Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore: remove dead code (#5860)

teo40c815713b65
diff --git a/apps/web/knip.ts b/apps/web/knip.ts
index 8f038fc5ae..12df2c9d45 100644
--- a/apps/web/knip.ts
+++ b/apps/web/knip.ts
@@ -17,6 +17,12 @@ const config: KnipConfig = {
'**/generated/**',
'scripts/**',
'../../packages/loro-mirror/**',
+ '../../packages/sdk/**',
+ // Standalone browser harnesses are loaded from HTML and Playwright/Vite
+ // configs rather than imported by the application graph.
+ 'src/lib/graphql-cache/worker/browser-test/**',
+ // Compile-only API assertions are checked by tsc, not imported at runtime.
+ '**/*.typecheck.ts',
'**/vite.config.ts',
'**/vite-ci.config.ts',
'**/vite.base.ts',
@@ -51,9 +57,11 @@ const config: KnipConfig = {
'@vitest/ui',
'@datadog/datadog-ci',
'libheif-js',
+ '@tailwindcss/vite',
+ 'bebop',
],
- ignoreWorkspaces: ['../../packages/loro-mirror'],
+ ignoreWorkspaces: ['../../packages/loro-mirror', '../../packages/sdk'],
};
export default config;
diff --git a/apps/web/package.json b/apps/web/package.json
index 70e301d3fc..18c68e0c1c 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -71,17 +71,14 @@
"@lexical/utils": "0.45.0",
"@livekit/krisp-noise-filter": "^0.4.1",
"@livekit/track-processors": "^0.7.2",
- "@loro-mirror/core": "workspace:*",
"@lukemorales/query-key-factory": "^1.3.4",
"@macro-inc/collaboration": "workspace:*",
"@macro-inc/lexical-core": "workspace:*",
"@macro-inc/observability": "workspace:*",
"@normy/query-core": "^0.21.0",
- "@opentelemetry/api": "^1.9.1",
"@phosphor-icons/core": "^2.1.1",
"@pierre/diffs": "^1.3.5",
"@solid-primitives/context": "^0.3.2",
- "@solid-primitives/event-bus": "^1.1.2",
"@solid-primitives/keyed": "^1.5.3",
"@solid-primitives/lifecycle": "^0.1.2",
"@solid-primitives/memo": "^1.4.5",
@@ -131,7 +128,6 @@
"pdfjs-dist": "github:macro-inc/pdf.js#v2.16.52-web",
"posthog-js": "^1.387.0",
"quill": "^2.0.3",
- "shiki": "^4.4.3",
"short-uuid": "^5.2.0",
"signature_pad": "^5.0.10",
"solid-custom-scrollbars": "^0.1.7",
@@ -143,7 +139,6 @@
"tabbable": "^6.2.0",
"tailwind-merge": "^3.4.0",
"tailwindcss": "^4.2.4",
- "tauri-plugin-device-info-api": "^1.0.1",
"tauri-plugin-safe-area-insets": "^0.1.0",
"ts-pattern": "^5.9.0",
"unicode-emoji-json": "^0.8.0",
diff --git a/apps/web/src/components/app/app-sidebar/utils.ts b/apps/web/src/components/app/app-sidebar/utils.ts
deleted file mode 100644
index 515e40df67..0000000000
--- a/apps/web/src/components/app/app-sidebar/utils.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { getDisplayNameParts, tryMacroId } from '@core/user';
-
-export function useSenderName(senderId: string | null | undefined) {
- return () => {
- const { firstName, fullName } = getDisplayNameParts(
- tryMacroId(senderId ?? '')
- );
- if (firstName || fullName) {
- return firstName || fullName;
- }
- // Fallback: extract name from macro ID format (macro|[email protected])
- if (senderId?.startsWith('macro|')) {
- const email = senderId.slice(6);
- const namePart = email.split('@')[0];
-
- return namePart;
- }
- return null;
- };
-}
diff --git a/apps/web/src/components/icon/square-command-k.tsx b/apps/web/src/components/icon/square-command-k.tsx
deleted file mode 100644
index aa1b396ca3..0000000000
--- a/apps/web/src/components/icon/square-command-k.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-export const AnimatedSquareCommandKIcon = (props: {
- triggerAnimation?: boolean;
- class?: string;
-}) => {
- // Terminal-prompt icon (`>` chevron + input line).
- // On hover: colors invert (tile fills with ink, strokes flip to surface) and the
- // input line blinks like a terminal cursor.
- return (
- <svg
- width="100%"
- height="100%"
- viewBox="-1.5 -1.88 18 18"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- class={`animated-command-k-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}
- >
- {/*<title>Animated command-k icon</title>*/}
- <style>{`
- .animated-command-k-icon {
- .ck-bg {
- opacity: 0;
- transition: opacity 0.2s ease;
- }
- .ck-caret {
- stroke: currentColor;
- transition: stroke 0.2s ease;
- transform-origin: 0px 6.75px;
- }
- .ck-input {
- stroke: currentColor;
- transition: stroke 0.2s ease;
- transform-origin: 6px 13.49px;
- }
-
- &.animating {
- .ck-bg { opacity: 1; }
- .ck-caret {
- stroke: var(--color-surface);
- }
- .ck-input {
- stroke: var(--color-surface);
- transform: scaleX(0.8);
- animation: ck-cursor-blink 1s steps(1, end) infinite;
- animation-delay: 0.2s;
- }
- }
- }
-
- @keyframes ck-cursor-blink {
- 0%, 50% { opacity: 1; }
- 50.01%, 100% { opacity: 0; }
- }
- `}</style>
-
- {/* Inverted background tile */}
- <rect
- class="ck-bg"
- x="-1.5"
- y="-1.88"
- width="18"
- height="18"
- rx="2.5"
- fill="currentColor"
- />
-
- {/* Prompt chevron + input line */}
- <polyline
- class="ck-caret"
- points="0.75 0.75 6.75 6.75 0.75 12.75"
- stroke-width="1.125"
- stroke-linejoin="round"
- stroke-linecap="round"
- />
- <line
- class="ck-input"
- x1="6"
- y1="13.49"
- x2="15"
- y2="13.49"
- stroke-width="1.125"
- stroke-linejoin="round"
- stroke-linecap="round"
- />
- </svg>
- );
-};
diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingMediaColumn.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingMediaColumn.tsx
deleted file mode 100644
index 8ca0ec48c5..0000000000
--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingMediaColumn.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import type { CallRecord } from '@service-storage/generated/schemas/callRecord';
-import { cn } from '@ui';
-import type { Accessor, Setter } from 'solid-js';
-import { Show } from 'solid-js';
-import { CallRecordingParticipantsSection } from './CallRecordingParticipants';
-import { CallRecordingSummarySection } from './CallRecordingSummary';
-import { CallRecordingVideo } from './CallRecordingVideo';
-
-export type CallRecordingTimeUpdateSource = 'playback' | 'seeking' | 'seeked';
-
-/** Left column: recording video, fallbacks, and wide-mode participants slide. */
-export function CallRecordingMediaColumn(props: {
- record: Accessor<CallRecord>;
- hasTranscripts: Accessor<boolean>;
- isStacked: Accessor<boolean>;
- participantsOpen: Accessor<boolean>;
- suppressWideParticipantsMotion: Accessor<boolean>;
- participantsContentHeight: Accessor<number>;
- setParticipantsContentRef: Setter<HTMLDivElement | undefined>;
- onTimeUpdate: (
- seconds: number,
- source: CallRecordingTimeUpdateSource
- ) => void;
- setVideoRef: Setter<HTMLVideoElement | undefined>;
-}) {
- return (
- <div class="flex min-h-0 min-w-0 flex-col overflow-hidden @[860px]:min-h-0 @[860px]:min-w-0 @[860px]:overflow-hidden">
- <Show when={props.record().recordingUrl}>
- {(url) => (
- <div class="min-h-0 flex-1 overflow-hidden">
- <CallRecordingVideo
- url={url()}
- posterUrl={props.record().recordingPreviewUrl ?? undefined}
- onTimeUpdate={props.onTimeUpdate}
- setVideoRef={props.setVideoRef}
- />
- </div>
- )}
- </Show>
- <Show when={!props.record().recordingUrl}>
- <Show
- when={props.hasTranscripts()}
- fallback={
- <div class="flex min-h-0 flex-1 items-center justify-center px-4 text-center text-sm text-ink-faint">
- No recording or transcript available.
- </div>
- }
- >
- <div class="flex min-h-30 flex-1 items-center justify-center px-4 text-center text-sm text-ink-faint">
- No video recording for this call.
- </div>
- </Show>
- </Show>
-
- <div
- class={cn(
- 'overflow-hidden @[860px]:block',
- props.isStacked() ? 'hidden' : 'block',
- props.suppressWideParticipantsMotion()
- ? 'transition-none'
- : 'transition-[max-height] duration-300 ease-out'
- )}
- style={{
- 'max-height': props.participantsOpen()
- ? `${props.participantsContentHeight()}px`
- : '0px',
- }}
- >
- <div
- ref={props.setParticipantsContentRef}
- class={cn(
- props.suppressWideParticipantsMotion()
- ? 'transition-none'
- : 'transition-[transform,opacity] duration-300 ease-out will-change-transform',
- props.participantsOpen()
- ? 'translate-y-0 opacity-100'
- : 'translate-y-4 opacity-0 pointer-events-none'
- )}
- >
- <CallRecordingParticipantsSection record={props.record} />
- </div>
- </div>
-
- <CallRecordingSummarySection record={props.record} />
- </div>
- );
-}
diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingMetaStrip.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingMetaStrip.tsx
deleted file mode 100644
index f1771be1dd..0000000000
--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingMetaStrip.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import { CallAgainButton } from '@channel/Call/CallAgainButton';
-import type { CallRecord } from '@service-storage/generated/schemas/callRecord';
-import { format } from 'date-fns';
-import { Show } from 'solid-js';
-import { formatCallDuration } from '../../utils';
-import { CALL_META_STRIP_TOGGLE_IDLE } from './call-recording-utils';
-
-function formatCallDate(dateStr: string): string {
- return format(new Date(dateStr), 'MMM d, yyyy h:mm a');
-}
-
-export function CallRecordingMetaStrip(props: { record: CallRecord }) {
- return (
- <div class="flex shrink-0 items-center justify-between gap-3 border-b border-edge-muted/50 px-4 py-2">
- <div class="flex min-w-0 flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-ink-muted">
- <Show when={props.record.endedAt}>
- {(endedAt) => <span>{formatCallDate(endedAt())}</span>}
- </Show>
- <Show when={props.record.durationMs}>
- {(ms) => (
- <>
- <span>&middot;</span>
- <span>{formatCallDuration(ms())}</span>
- </>
- )}
- </Show>
- <Show when={props.record.isActive}>
- <span class="text-success font-medium">In progress</span>
- </Show>
- </div>
- <div class="flex items-center gap-1.5">
- <Show when={!props.record.isActive}>
- <CallAgainButton
- channelId={props.record.channelId}
- class={CALL_META_STRIP_TOGGLE_IDLE + ' shrink-0'}
- />
- </Show>
- </div>
- </div>
- );
-}
diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingSectionShell.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingSectionShell.tsx
deleted file mode 100644
index b56cd7c262..0000000000
--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingSectionShell.tsx
+++ /dev/null
@@ -1,155 +0,0 @@
-import Eye from '@phosphor/eye.svg';
-import EyeSlash from '@phosphor/eye-slash.svg';
-import UserCircle from '@phosphor/user-circle.svg';
-import UserCircleMinus from '@phosphor/user-circle-minus.svg';
-import { cn } from '@ui';
-import type { JSX } from 'solid-js';
-import {
- createEffect,
- createMemo,
- createSignal,
- onCleanup,
- Show,
-} from 'solid-js';
-
-export function CallRecordingSectionShell(props: {
- title: string;
- icon: JSX.Element;
- children: JSX.Element;
- class?: string;
- open?: boolean;
- accordion?: boolean;
- /** Used only for stacked accordion mode: cap open height as a % of the viewport height. */
- accordionOpenMaxVh?: number;
- onToggle?: () => void;
- toggleIconOpen?: JSX.Element;
- toggleIconClosed?: JSX.Element;
- toggleLabelOpen?: string;
- toggleLabelClosed?: string;
-}) {
- const isOpen = () => props.open ?? true;
- const [viewportResizeTick, setViewportResizeTick] = createSignal(0);
-
- const accordionOpenCapPx = createMemo(() => {
- viewportResizeTick();
- if (!props.accordion) return Number.POSITIVE_INFINITY;
- if (typeof window === 'undefined') return Number.POSITIVE_INFINITY;
- const vh = props.accordionOpenMaxVh ?? 45;
- return Math.max(0, (window.innerHeight * vh) / 100);
- });
-
- createEffect(() => {
- if (!props.accordion) return;
- const onResize = () => setViewportResizeTick((n) => n + 1);
- window.addEventListener('resize', onResize);
- onCleanup(() => window.removeEventListener('resize', onResize));
- });
-
- const toggleLabel = () =>
- isOpen()
- ? (props.toggleLabelOpen ?? `Hide ${props.title.toLowerCase()}`)
- : (props.toggleLabelClosed ?? `Show ${props.title.toLowerCase()}`);
- return (
- <div
- class={cn(
- 'min-h-0 overflow-hidden border-t border-edge-muted/50',
- props.class,
- props.accordion
- ? 'flex shrink-0 flex-col'
- : 'flex flex-col @[860px]:flex-1',
- !props.accordion && (isOpen() ? 'flex-1' : 'shrink-0')
- )}
- >
- <Show
- when={props.accordion && props.onToggle}
- fallback={
- <div class="isolate flex shrink-0 items-center gap-2 sticky top-0 bg-surface z-10 px-4 py-2 @[860px]:py-4 border-b border-edge-muted/50">
- {props.icon}
- <p class="font-semibold text-ink select-none text-sm shrink-0">
- {props.title}
- </p>
- <Show when={props.onToggle}>
- <button
- type="button"
- class="ml-auto shrink-0 rounded-xs border border-edge-muted/50 px-2 py-1 text-xs font-medium text-ink-muted hover:bg-hover hover:text-ink flex items-center gap-1.5 transition-colors"
- aria-expanded={props.open}
- aria-label={toggleLabel()}
- title={toggleLabel()}
- onClick={() => props.onToggle?.()}
- >
- <Show
- when={props.open}
- fallback={
- props.toggleIconClosed ?? (
- <UserCircleMinus class="size-4 shrink-0" />
- )
- }
- >
- {props.toggleIconOpen ?? (
- <UserCircle class="size-4 shrink-0" />
- )}
- </Show>
- </button>
- </Show>
- </div>
- }
- >
- <button
- type="button"
- class="isolate sticky top-0 z-10 flex w-full min-w-0 shrink-0 items-center gap-2 border-b border-edge-muted/50 bg-surface px-4 py-2 text-left @[860px]:py-4 hover:bg-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40 focus-visible:ring-offset-0"
- aria-expanded={props.open}
- aria-label={toggleLabel()}
- title={toggleLabel()}
- onClick={() => props.onToggle?.()}
- >
- {props.icon}
- <p class="min-w-0 flex-1 font-semibold text-ink select-none text-sm truncate">
- {props.title}
- </p>
- <span class="ml-auto flex shrink-0 items-center text-ink-muted">
- <Show
- when={isOpen()}
- fallback={<EyeSlash class="size-4 shrink-0" />}
- >
- <Eye class="size-4 shrink-0" />
- </Show>
- </span>
- </button>
- </Show>
- <div
- class={cn(
- 'min-h-0 overflow-hidden',
- props.accordion
- ? cn(
- 'transition-[max-height] duration-300 ease-in-out',
- isOpen() ? '' : 'pointer-events-none'
- )
- : cn(
- 'transition-[max-height,transform,opacity] duration-300 ease-out @[860px]:transition-none @[860px]:max-h-none @[860px]:opacity-100 @[860px]:translate-y-0',
- isOpen()
- ? 'flex min-h-0 flex-1 flex-col max-h-dvh translate-y-0 opacity-100 @[860px]:h-full @[860px]:max-h-none'
- : 'max-h-0 translate-y-2 opacity-0 pointer-events-none'
- )
- )}
- style={
- props.accordion
- ? {
- 'max-height': isOpen() ? `${accordionOpenCapPx()}px` : '0px',
- }
- : undefined
- }
- >
- <div
- class={cn(
- 'min-h-0 overflow-hidden',
- props.accordion
- ? 'flex h-full max-h-full flex-1 flex-col'
- : 'flex min-h-0 flex-1 flex-col @[860px]:h-full @[860px]:min-h-0'
- )}
- >
- {props.children}
- </div>
- </div>
- </div>
- );
-}
diff --git a/apps/web/src/features/block-call/component/CallRecording/CallRecordingTranscriptColumn.tsx b/apps/web/src/features/block-call/component/CallRecording/CallRecordingTranscriptColumn.tsx
deleted file mode 100644
index 887c8f2767..0000000000
--- a/apps/web/src/features/block-call/component/CallRecording/CallRecordingTranscriptColumn.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import Subtitles from '@phosphor/subtitles.svg';
-import UsersThree from '@phosphor/users-three.svg';
-import type { CallRecord } from '@service-storage/generated/schemas/callRecord';
-import { cn } from '@ui';
-import type { Accessor } from 'solid-js';
-import { Show } from 'solid-js';
-import { CallTranscript } from '../CallTranscript';
-import { CallRecordingParticipantsSection } from './CallRecordingParticipants';
-import { CallRecordingSectionShell } from './CallRecordingSectionShell';
-
-/** Right column: transcript shell + stacked participants accordion. */
-export function CallRecordingTranscriptColumn(props: {
- record: Accessor<CallRecord>;
- hasTranscripts: Accessor<boolean>;
- isStacked: Accessor<boolean>;
- transcriptOpen: Accessor<boolean>;
- participantsOpen: Accessor<boolean>;
- activeSequenceNum: Accessor<number | null>;
- timelineStartMs: Accessor<number | null>;
- videoSeekGeneration: Accessor<number>;
- onToggleTranscript: () => void;
- onToggleParticipants: () => void;
- onSeekToSeconds: (seconds: number) => void;
-}) {
- return (
- <div
- class={cn(
- 'relative min-h-0 min-w-0 overflow-hidden border-edge-muted/50',
- props.isStacked()
- ? 'flex min-h-0 min-w-0 flex-col'
- : 'flex min-h-0 min-w-0 flex-col border-t @[860px]:h-full @[860px]:min-h-0 @[860px]:border-t-0 @[860px]:border-l'
- )}
- >
- <Show
- when={props.hasTranscripts()}
- fallback={
- <div class="flex size-full min-h-0 min-w-0 flex-1 items-center justify-center px-4 py-10 text-center text-sm text-ink-muted">
- No transcripts for this call.
- </div>
- }
- >
- <div
- class={cn(
- 'min-h-0 min-w-0 flex-1',
- props.isStacked()
- ? 'flex flex-col'
- : 'flex min-h-0 flex-1 flex-col @[860px]:h-full @[860px]:min-h-0 @[860px]:min-w-[40cqw]'
- )}
- >
- <Show when={props.isStacked()}>
- <CallRecordingSectionShell
- title="Participants"
- icon={<UsersThree class="size-4 text-ink shrink-0" />}
- open={props.participantsOpen()}
- accordion
- accordionOpenMaxVh={38}
- onToggle={props.onToggleParticipants}
- >
- <CallRecordingParticipantsSection record={props.record} />
- </CallRecordingSectionShell>
- </Show>
-
- <CallRecordingSectionShell
- title="Transcript"
- icon={<Subtitles class="size-4 text-ink shrink-0" />}
- open={props.transcriptOpen()}
- accordion={props.isStacked()}
- accordionOpenMaxVh={52}
- onToggle={props.isStacked() ? props.onToggleTranscript : undefined}
- class={cn(!props.isStacked() && 'border-t-0')}
- >
- <CallTranscript
- transcript={props.record().transcript}
- channelId={props.record().channelId}
- timelineStartMs={props.timelineStartMs()}
- activeSequenceNum={props.activeSequenceNum()}
- videoSeekGeneration={props.videoSeekGeneration()}
- onSeekToSeconds={props.onSeekToSeconds}
- hideHeader
- />
- </CallRecordingSectionShell>
- </div>
- </Show>
- </div>
- );
-}
diff --git a/apps/web/src/features/block-canvas/operation/index.ts b/apps/web/src/features/block-canvas/operation/index.ts
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/apps/web/src/features/block-code/constant.ts b/apps/web/src/features/block-code/constant.ts
deleted file mode 100644
index 7fa6490e35..0000000000
--- a/apps/web/src/features/block-code/constant.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const RENAME_ENABLED = true;
-
-export const AUTO_SAVE_INTERVAL_MS = 1000 * 10;
diff --git a/apps/web/src/features/block-image/constants.ts b/apps/web/src/features/block-image/constants.ts
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/apps/web/src/features/block-image/signal/imageBlockData.ts b/apps/web/src/features/block-image/signal/imageBlockData.ts
deleted file mode 100644
index c04448d69d..0000000000
--- a/apps/web/src/features/block-image/signal/imageBlockData.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { blockDataSignalAs } from '@core/block';
-import type { ImageData } from '../definition';
-
-export const blockDataSignal = blockDataSignalAs<ImageData>('image');
diff --git a/apps/web/src/features/block-md/component/History.tsx b/apps/web/src/features/block-md/component/History.tsx
deleted file mode 100644
index f08746f914..0000000000
--- a/apps/web/src/features/block-md/component/History.tsx
+++ /dev/null
@@ -1,603 +0,0 @@
-import { SplitDrawer } from '@components/app/split-layout/components/SplitDrawer';
-import { useDrawerControl } from '@components/app/split-layout/components/SplitDrawerContext';
-import { useSplitLayout } from '@components/app/split-layout/layout';
-import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
-import {
- createLexicalWrapper,
- type LexicalWrapper,
- LexicalWrapperContext,
-} from '@core/component/LexicalMarkdown/context/LexicalWrapperContext';
-import {
- codePlugin,
- horizontalRulePlugin,
- mediaPlugin,
- tablePlugin,
-} from '@core/component/LexicalMarkdown/plugins';
-import { initializeEditorWithState } from '@core/component/LexicalMarkdown/utils';
-import { toast } from '@core/component/Toast/Toast';
-import { UserIcon } from '@core/component/UserIcon';
-import { registerHotkey } from '@core/hotkey/hotkeys';
-import { TOKENS } from '@core/hotkey/tokens';
-import { useBlockDocumentName } from '@core/util/currentBlockDocumentName';
-import {
- CommentNode,
- InlineSearchNode,
- peerIdPlugin,
-} from '@macro-inc/lexical-core';
-import ClockIcon from '@phosphor/clock-counter-clockwise.svg';
-import { storageServiceClient } from '@service-storage/client';
-import type { SyncServiceVersionID } from '@service-storage/generated/schemas/syncServiceVersionID';
-import { syncServiceClient } from '@service-sync/client';
-import { Button } from '@ui';
-import type { SerializedEditorState } from 'lexical';
-import { LoroDoc } from 'loro-crdt';
-import {
- createEffect,
- createMemo,
- createResource,
- createSignal,
- onMount,
- type ResourceReturn,
- Show,
- Suspense,
-} from 'solid-js';
-import { type VirtualizerHandle, VList } from 'virtua/solid';
-import {
- type GroupedHistory,
- type GroupingConfig,
- getDocumentHistory,
-} from '../history/time-travel';
-
-export const HISTORY_DRAWER_ID = 'history';
-
-async function forkDocumentAtVersion(
- documentId: string,
- documentName: string,
- version: SyncServiceVersionID
-) {
- const newName = `${documentName} (forked)`;
- const response = await storageServiceClient.copyDocument({
- documentId,
- documentName: newName,
- syncServiceVersion: version,
- });
-
- if (response.isErr()) return;
-
- const data = response.value;
-
- return data.documentId;
-}
-
-async function getLoroDocFromId(documentId: string) {
- const maybeSnapshot = await syncServiceClient.getSnapshot({
- documentId: documentId,
- });
-
- const doc = new LoroDoc();
-
- if (maybeSnapshot.isErr()) {
- console.error("Couldn't get snapshot", maybeSnapshot);
- return doc;
- }
-
- const snapshot = maybeSnapshot.value;
-
- doc.import(snapshot);
- return doc;
-}
-
-export function HistoryButton(props: { buttonSize?: 'sm' | 'base' }) {
- const drawerControl = useDrawerControl(HISTORY_DRAWER_ID);
- return (
- <Button
- label="History"
- variant={drawerControl.isOpen() ? 'active' : 'ghost'}
- size={props.buttonSize === 'base' ? 'icon-md' : 'icon-sm'}
- onClick={drawerControl.toggle}
- >
- <ClockIcon />
- </Button>
- );
-}
-
-export function HistoryDrawer(props: { documentId: string }) {
- const drawerControl = useDrawerControl(HISTORY_DRAWER_ID);
- return (
- <SplitDrawer id={HISTORY_DRAWER_ID} side="right" size={768} title="History">
- <Suspense fallback={'loading...'}>
- <History
- documentId={props.documentId}
- close={drawerControl.close}
- isOpen={drawerControl.isOpen()}
- />
- </Suspense>
- </SplitDrawer>
- );
-}
-
-export function HistoryModal(props: { documentId: string }) {
- const drawerControl = useDrawerControl(HISTORY_DRAWER_ID);
-
- return (
- <>
- <Button
- label="History"
- variant={drawerControl.isOpen() ? 'active' : 'ghost'}
- size="icon-sm"
- onClick={drawerControl.toggle}
- >
- <ClockIcon />
- </Button>
- <SplitDrawer
- id={HISTORY_DRAWER_ID}
- side="right"
- size={768}
- title="History"
- >
- <Suspense fallback={'loading...'}>
- <History
- documentId={props.documentId}
- close={drawerControl.close}
- isOpen={drawerControl.isOpen()}
- />
- </Suspense>
- </SplitDrawer>
- </>
- );
-}
-
-type HistoryProps = {
- documentId: string;
- close: () => void;
- isOpen: boolean;
-};
-
-type VersionId = {
- peerId: `${number}`;
- counter: number;
-};
-
-export function History(props: HistoryProps) {
- const [selectedVersion, setSelectedVersion] = createSignal<VersionId>();
- const context = useSplitPanelOrThrow();
- const { insertSplit } = useSplitLayout();
- const [loroDoc] = createResource(async () =>
- getLoroDocFromId(props.documentId)
- );
-
- const [isForking, setIsForking] = createSignal(false);
-
- const documentName = useBlockDocumentName();
-
- const [historyData] = createHistoryResource(props.documentId);
-
- const lexicalWrapper = createLexicalWrapper({
- type: 'markdown',
- namespace: 'md',
- isInteractable: () => false,
- });
-
- const sortedHistory = createMemo(() => {
- const data = historyData();
- if (!data || data.length === 0) return [];
-
- return data.sort(
- (a, b) => b.representative.timestamp - a.representative.timestamp
- );
- });
-
- createEffect(() => {
- if (historyData.loading || historyData.error) return;
- if (loroDoc.loading || loroDoc.error) return;
-
- let representative = historyData()?.at(0)?.representative;
- if (!representative) return;
-
- let versionId = {
- peerId: representative.change.peer,
- counter: representative.change.counter,
- };
- setSelectedVersion(versionId);
- selectVersion(versionId);
- });
-
- const selectVersion = (version: VersionId) => {
- const loroDoc_ = loroDoc();
- setSelectedVersion(version);
- if (!loroDoc_) {
- console.error('loroDoc_ is undefined');
- return;
- }
-
- const state = getStateAtVersion(loroDoc_, version);
-
- if (state === 'serialization-error') {
- toast.failure('Failed to parse state');
- return;
- }
-
- initializeEditorWithState(lexicalWrapper.editor, state);
- };
-
- const selected: () => [GroupedHistory, number] | undefined = () => {
- if (!selectedVersion()) return undefined;
-
- const found = sortedHistory()?.find(
- (v) =>
- v.representative.change.peer === selectedVersion()!.peerId &&
- v.representative.change.counter === selectedVersion()!.counter
- );
-
- if (!found) return undefined;
-
- return [found, sortedHistory().indexOf(found)!];
- };
-
- const handleFork = async () => {
- if (!selected()) return;
- const rep = selected()![0].representative;
- setIsForking(true);
- const id = await forkDocumentAtVersion(props.documentId, documentName(), {
- counter: rep.change.counter,
- peer: rep.change.peer,
- });
- if (!id) {
- toast.failure('Failed to copy version');
- setIsForking(false);
- return;
- }
- insertSplit({
- type: 'md',
- id,
- });
- setIsForking(false);
- };
-
- return (
- <div class="size-full p-2 flex flex-col gap-2 pb-12" tabindex={-1}>
- <Suspense fallback={'loading...'}>
- <Show when={selectedVersion()}>
- {(selectedVersion) => {
- return (
- <>
- <Show when={selected()}>
- {(selected) => {
- return (
- <div class="flex justify-between items-center w-full border border-edge">
- <VersionListItem
- item={selected()[0]}
- isSelected={true}
- index={selected()[1]}
- total={sortedHistory()!.length}
- />
- <div class="pr-4">
- <Button
- variant="active"
- disabled={isForking()}
- onClick={handleFork}
- >
- Copy Version
- </Button>
- </div>
- </div>
- );
- }}
- </Show>
- <div
- class="w-full h-[50%] overflow-y-scroll border border-edge"
- tabindex={-1}
- ref={(ref) => {
- ref.focus();
- }}
- >
- <DocumentPreview
- selectedVersion={selectedVersion()}
- lexicalWrapper={lexicalWrapper}
- isSelectedVersionEmpty={false}
- />
- </div>
- <div
- class="w-full h-[50%] overflow-y-auto border border-edge"
- tabindex={-1}
- >
- <VersionList
- versions={sortedHistory()!}
- selectedVersion={selectedVersion()}
- handleSelect={selectVersion}
- scopeId={context.splitHotkeyScope}
- isOpen={props.isOpen}
- />
- </div>
- </>
- );
- }}
- </Show>
- </Suspense>
- </div>
- );
-}
-
-const GROUPING_CONFIG: GroupingConfig = {
- pauseThreshold: 5000,
- minChanges: 1,
-};
-
-function isSerializedEditorState(
- state: unknown | undefined
-): state is SerializedEditorState {
- return (
- state !== undefined &&
- state !== null &&
- typeof state === 'object' &&
- 'root' in state
- );
-}
-
-type StateError = 'serialization-error';
-
-function getStateAtVersion(
- loroDoc: LoroDoc,
- version: VersionId
-): SerializedEditorState | StateError {
- loroDoc.checkout([{ peer: version.peerId, counter: version.counter }]);
-
- const loroState = loroDoc.toJSON();
-
- if (!isSerializedEditorState(loroState)) {
- return 'serialization-error';
- }
-
- return loroState;
-}
-
-function createHistoryResource(
- documentId: string
-): ResourceReturn<GroupedHistory[]> {
- return createResource(async () => {
- const data = await getDocumentHistory(documentId, {
- grouping: GROUPING_CONFIG,
- });
- return data as GroupedHistory[];
- });
-}
-
-function DocumentPreview(props: {
- selectedVersion: VersionId;
- lexicalWrapper: LexicalWrapper;
- isSelectedVersionEmpty: boolean;
-}) {
- let mountRef!: HTMLDivElement;
-
- onMount(() => {
- if (!mountRef) return;
- props.lexicalWrapper.editor.setRootElement(mountRef);
- props.lexicalWrapper.editor.setEditable(false);
- });
-
- props.lexicalWrapper.plugins
- .richText()
- .list()
- .markdownShortcuts()
- .use(horizontalRulePlugin())
- .use(mediaPlugin())
- .use(
- tablePlugin({
- hasCellMerge: true,
- hasCellBackgroundColor: true,
- hasTabHandler: false,
- hasHorizontalScroll: false,
- })
- )
- .use(
- codePlugin({
- setAccessories: (..._props: any) => {},
- accessories: {},
- })
- )
- .use(
- peerIdPlugin({
- peerId: () => undefined,
- nodes: [InlineSearchNode, CommentNode],
- })
- );
-
- return (
- <div class="size-full p-2">
- <LexicalWrapperContext.Provider value={props.lexicalWrapper}>
- <Show when={props.isSelectedVersionEmpty}>
- <div class="size-full flex items-center justify-center">
- <p class="text-ink-placeholder italic">
- This version of the document is empty
- </p>
- </div>
- </Show>
- <div class="size-full" ref={mountRef} contentEditable={false} />
- </LexicalWrapperContext.Provider>
- </div>
- );
-}
-
-function moveUp(
- versions: GroupedHistory[],
- current: VersionId
-): VersionId | null {
- const idx = findVersionIndex(versions, current);
- if (idx <= 0) return null;
- return toVersionId(versions[idx - 1]);
-}
-
-function moveDown(
- versions: GroupedHistory[],
- current: VersionId
-): VersionId | null {
- const idx = findVersionIndex(versions, current);
- if (idx >= versions.length - 1) return null;
- return toVersionId(versions[idx + 1]);
-}
-
-function findVersionIndex(
- versions: GroupedHistory[],
- version: VersionId
-): number {
- return versions.findIndex(
- (v) =>
- v.representative.change.peer === version.peerId &&
- v.representative.change.counter === version.counter
- );
-}
-
-function toVersionId(item: GroupedHistory): VersionId {
- return {
- peerId: item.representative.change.peer,
- counter: item.representative.change.counter,
- };
-}
-
-function VersionList(props: {
- versions: GroupedHistory[];
- selectedVersion: VersionId;
- handleSelect: (version: VersionId) => void;
- scopeId: string;
- isOpen: boolean;
-}) {
- const [virtualHandle, setVirtualHandle] = createSignal<VirtualizerHandle>();
-
- onMount(() => {
- registerHotkey({
- hotkey: 'arrowup',
- scopeId: props.scopeId,
- description: 'Next version',
- condition: () => props.isOpen,
- keyDownHandler: () => {
- const current = props.selectedVersion;
- const next = moveUp(props.versions, current);
- virtualHandle()?.scrollToIndex(
- findVersionIndex(props.versions, next ?? current),
- {
- align: 'nearest',
- }
- );
- if (next) {
- props.handleSelect(next);
- }
- return true;
- },
- hotkeyToken: TOKENS.channel.moveUp,
- displayPriority: 10,
- });
-
- registerHotkey({
- hotkey: 'arrowdown',
- scopeId: props.scopeId,
- description: 'Previous version',
- condition: () => props.isOpen,
- keyDownHandler: () => {
- const current = props.selectedVersion;
- const next = moveDown(props.versions, current);
- virtualHandle()?.scrollToIndex(
- findVersionIndex(props.versions, next ?? current),
- {
- align: 'nearest',
- }
- );
- if (next) {
- props.handleSelect(next);
- }
- return true;
- },
- hotkeyToken: TOKENS.channel.moveDown,
- displayPriority: 10,
- });
- });
-
- return (
- <VList data={props.versions} ref={setVirtualHandle}>
- {(item, index) => {
- const isSelected = () =>
- props.selectedVersion.peerId === item.representative.change.peer &&
- props.selectedVersion.counter === item.representative.change.counter;
-
- return (
- <VersionListItem
- item={item}
- isSelected={isSelected()}
- handleSelect={props.handleSelect}
- index={index()}
- total={props.versions.length}
- />
- );
- }}
- </VList>
- );
-}
-
-function IndexIndicator(props: {
- total: number;
- index: number;
- isSelected: boolean;
-}) {
- const normalizeToLongest = (num: number) => {
- const longestLength = String(props.total).length;
- return num.toString().padStart(longestLength, '0');
- };
-
- return (
- <p
- class="font-mono"
- classList={{
- 'text-accent': props.isSelected,
- 'text-ink-extra-muted': !props.isSelected,
- }}
- >
- {normalizeToLongest(props.total - props.index)}
- </p>
- );
-}
-
-function VersionListItem(props: {
- item: GroupedHistory;
- isSelected: boolean;
- handleSelect?: (version: VersionId) => void;
- index: number;
- total: number;
-}) {
- return (
- <button
- class="w-full p-2 sm:p-3 text-left flex items-center gap-2 sm:gap-3 min-h-15 sm:min-h-auto"
- classList={{
- 'bg-hover': props.isSelected && !!props.handleSelect,
- 'hover:bg-hover hover-transition-bg': !!props.handleSelect,
- }}
- onMouseDown={(e) => e.preventDefault()}
- onClick={() => {
- props.handleSelect?.({
- peerId: props.item.representative.change.peer,
- counter: props.item.representative.change.counter,
- });
- }}
- >
- <Show when={props.handleSelect}>
- <IndexIndicator
- total={props.total}
- index={props.index}
- isSelected={props.isSelected}
- />
- </Show>
- <UserIcon
- size="sm"
- isDeleted={false}
- id={props.item.representative.userId}
- />
- <div class="flex-1 min-w-0">
- <div class="text-ink text-xs truncate">
- {new Date(props.item.group.window.start * 1000).toLocaleString()} -{' '}
- {new Date(props.item.group.window.end * 1000).toLocaleTimeString()}
- </div>
- <div class="text-ink-extra-muted text-xs sm:text-xs">
- {props.item.group?.changes.length} changes
- </div>
- </div>
- </button>
- );
-}
diff --git a/apps/web/src/features/block-md/component/TaskCopyBranchButton.tsx b/apps/web/src/features/block-md/component/TaskCopyBranchButton.tsx
deleted file mode 100644
index 9cfa4b7641..0000000000
--- a/apps/web/src/features/block-md/component/TaskCopyBranchButton.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { useBlockId } from '@core/block';
-import { TOKENS } from '@core/hotkey/tokens';
-import { copyBranchNameToClipboard } from '@core/util/branchName';
-import GitBranch from '@phosphor/git-branch.svg';
-import { Button, cn } from '@ui';
-import { Show } from 'solid-js';
-
-export function TaskCopyBranchButton(props: {
- showLabel?: boolean;
- class?: string;
-}) {
- const blockId = useBlockId();
- const showLabel = () => props.showLabel ?? true;
-
- return (
- <Button
- variant="ghost"
- size="sm"
- depth={2}
- tooltip={showLabel() ? undefined : 'Copy branch name'}
- hotkey={TOKENS.entity.action.copyBranchName}
- class={cn(
- 'gap-1.5 rounded-full border border-edge-muted px-2',
- props.class
- )}
- onClick={() => void copyBranchNameToClipboard(blockId)}
- >
- <GitBranch class="size-3.5" />
- <Show when={showLabel()}>
- <span class="text-xs font-medium">Copy branch name</span>
- </Show>
- </Button>
- );
-}
diff --git a/apps/web/src/features/block-md/component/TemplateSelector.tsx b/apps/web/src/features/block-md/component/TemplateSelector.tsx
deleted file mode 100644
index 737533802d..0000000000
--- a/apps/web/src/features/block-md/component/TemplateSelector.tsx
+++ /dev/null
@@ -1,145 +0,0 @@
-import { TEMPLATES, type Template } from '@block-md/component/templates';
-import { createBlockSignal } from '@core/block';
-import { StaticMarkdown } from '@core/component/LexicalMarkdown/component/core/StaticMarkdown';
-import { setEditorStateFromMarkdown } from '@core/component/LexicalMarkdown/utils';
-import { useEmail } from '@core/context/user';
-import { createCallback } from '@solid-primitives/rootless';
-import { debounce } from '@solid-primitives/scheduled';
-import type { LexicalEditor } from 'lexical';
-import { createMemo, For, Show } from 'solid-js';
-import { Portal } from 'solid-js/web';
-import { TitlePlaceholderSignal } from './TitleEditor';
-
-const showTemplatePreviewSignal = createBlockSignal(false);
-const selectedTemplateSignal = createBlockSignal<Template | undefined>(
- undefined
-);
-
-const populateContent = (content: string) => {
- const userEmail = useEmail();
- const today = new Date();
- const formattedDate = today.toLocaleDateString('en-US', {
- year: 'numeric',
- month: 'long',
- day: 'numeric',
- });
- const formattedTime = today.toLocaleTimeString('en-US', {
- hour: '2-digit',
- minute: '2-digit',
- hour12: true,
- });
- let populatedContent = content;
- populatedContent = populatedContent.replaceAll('[DATE]', `${formattedDate}`);
- populatedContent = populatedContent.replaceAll('[TIME]', `${formattedTime}`);
- populatedContent = populatedContent.replaceAll(
- '[USER]',
- `${userEmail() ?? 'User'}`
- );
- return populatedContent;
-};
-
-function TemplateCard(props: {
- titleEditor: LexicalEditor | undefined;
- editor: LexicalEditor;
- template: Template;
-}) {
- const [_titlePlaceholder, setTitlePlaceholder] = TitlePlaceholderSignal;
- const setShowTemplatePreview = showTemplatePreviewSignal.set;
- const setSelectedTemplate = selectedTemplateSignal.set;
- const debouncedSetShowTemplatePreview = debounce(setShowTemplatePreview, 100);
-
- const createMarkdownFile = createCallback((template: Template) => {
- setEditorStateFromMarkdown(
- props.editor,
- populateContent(template.content),
- 'internal',
- false
- );
- const titleEditor = props.titleEditor;
- if (titleEditor) {
- setEditorStateFromMarkdown(
- titleEditor,
- populateContent(template.title),
- 'internal',
- false
- );
- }
- });
-
- return (
- <button
- onMouseDown={(e) => {
- e.preventDefault();
- e.stopPropagation();
- createMarkdownFile(props.template);
- setSelectedTemplate(undefined);
- setShowTemplatePreview(false);
- setTitlePlaceholder(undefined);
- }}
- onMouseEnter={() => {
- setSelectedTemplate(props.template);
- debouncedSetShowTemplatePreview(true);
- setTitlePlaceholder(populateContent(props.template.title));
- }}
- onMouseLeave={() => {
- setSelectedTemplate(undefined);
- setTitlePlaceholder(undefined);
- setShowTemplatePreview(false);
- }}
- class="flex flex-col justify-between p-4 rounded-lg border border-edge shadow hover:border-accent hover-transition-border transition"
- >
- <div>
- <div class="text-sm text-left font-medium text-ink">
- {props.template.name}
- </div>
- <div class="mt-1 text-left text-xs text-ink-placeholder">
- {props.template.subtext}
- </div>
- </div>
- </button>
- );
-}
-
-export function TemplateSelector(props: {
- titleEditor: LexicalEditor | undefined;
- editor: LexicalEditor;
- editorContainerRef: HTMLDivElement;
-}) {
- const previewMarkdown = createMemo(() => {
- const currentTemplate = selectedTemplateSignal();
- if (currentTemplate) {
- return populateContent(currentTemplate.content);
- }
- return '';
- });
-
- return (
- <>
- <Show when={showTemplatePreviewSignal() && selectedTemplateSignal()}>
- <Portal mount={props.editorContainerRef}>
- <div class="absolute inset-0 size-full text-ink-disabled bg-surface overflow-hidden">
- <StaticMarkdown
- markdown={`${previewMarkdown()}`}
- theme={{
- quote:
- 'border-l-2 border-edge pl-4 py-2 italic text-ink-disabled my-4',
- }}
- />
- </div>
- </Portal>
- </Show>
-
- <div class="grid grid-cols-1 @sm:grid-cols-2 @md:grid-cols-2 @lg:grid-cols-3 gap-4 p-4">
- <For each={TEMPLATES}>
- {(template) => (
- <TemplateCard
- titleEditor={props.titleEditor}
- editor={props.editor}
- template={template}
- />
- )}
- </For>
- </div>
- </>
- );
-}
diff --git a/apps/web/src/features/block-md/component/templates.ts b/apps/web/src/features/block-md/component/templates.ts
deleted file mode 100644
index 1a6df91ef7..0000000000
--- a/apps/web/src/features/block-md/component/templates.ts
+++ /dev/null
@@ -1,454 +0,0 @@
-// Organized imports alphabetically
-import Article from '@phosphor/article-medium.svg';
-import CheckList from '@phosphor/list-checks.svg';
-import Microscope from '@phosphor/microscope.svg';
-import NoteBook from '@phosphor/notebook.svg';
-import NotePad from '@phosphor/notepad.svg';
-import Chart from '@phosphor/projector-screen-chart.svg';
-import type { Component, JSX } from 'solid-js';
-
-export type Template = {
- id: string;
- name: string;
- icon: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;
- subtext: string;
- title: string;
- content: string;
-};
-
-export const TEMPLATES: Template[] = [
- {
- id: 'todo',
- name: 'To-Do List',
- icon: CheckList,
- subtext: 'Track and prioritize tasks to boost your productivity',
- title: 'To-Do List: [DATE]',
- content: `
-## 🔥 Important
-- [ ] **Task name**
- 🗓 Due: MM/DD/YYY
- 📌 Notes: Brief detail or link
-
-- [ ] **Another task**
- 🗓 Due:
- 📌 Notes:
-\n\n \n
----
-\n\n \n
-## ⚡ Today - [DATE]
-- [ ] **Task name**
- 🗓 Due:
- 📌 Notes:
-
-- [ ] **Another task**
- 🗓 Due:
- 📌 Notes:
-\n\n \n
----
-\n\n \n
-## 🗄 Upcoming
-- [ ] **Task name**
- 🗓 Due:
- 📌 Notes:
-
-- [ ] **Task name**
- 🗓 Due:
- 📌 Notes:
-`,
- },
- {
- id: 'blog_post',
- name: 'Blog Post',
- icon: Article,
- subtext: 'Craft compelling stories that captivate and inform your audience',
- title: 'Blog Post: [Title]',
- content: `
-**Date:** [DATE]
-**Author:** [USER]
-**Tags:** [tag1], [tag2], [tag3]
-\n\n \n
-## Introduction
-A compelling introduction to your topic that hooks the reader and gives a brief overview of what they'll learn.
-This article will help you understand [main benefit] by exploring [topic overview].
-\n\n \n
-## [Section 1 Heading]
-Main content for section 1. Include relevant information, examples, and insights.
-\n\n \n
-### [Subsection 1.1]
-More detailed exploration of a specific aspect of section 1.
-[Insert Image]
-\n\n \n
-## [Section 2 Heading]
-Main content for section 2. Continue providing value to the reader.
-> "A relevant quote that adds credibility or emphasis to your content." - Quote Author
-**Example:** [Describe a real-world example that illustrates your point]
-\n\n \n
-## [Section 3 Heading]
-Main content for section 3. Consider adding:
-- Bullet points for easier reading
-- Important takeaways
-- Tips and tricks
-- Common misconceptions
-- Step-by-step instructions
-\n\n \n
-## Conclusion
-Summarize the main points of your post and provide a call to action or final thoughts.
-What will you try first? Share your experience in the comments below!
-\n\n \n
----
-\n\n \n
-**Further Reading:**
-- Related Link 1
-\n\n \n
-**Share this post:**
-[Twitter] [Facebook] [LinkedIn] [Reddit]
-`,
- },
- {
- id: 'meeting_notes',
- name: 'Meeting Notes',
- icon: NotePad,
- subtext:
- 'Document discussions, decisions, and follow-up actions efficiently',
- title: 'Meeting Notes: [DATE]',
- content: `**Date:** [DATE]
-**Time:** [HH:MM] - [HH:MM] [Timezone]
-**Location:** [Physical Location/Virtual Platform]
-**Meeting Link:** [URL for recording/virtual meeting]
-**Attendees:**
-- [USER], [Role/Department]
-- @attendee2, [Role/Department]
-- @attendee3, [Role/Department]
-\n\n \n
-## Agenda
-1. [Agenda item 1] (XX min)
-2. [Agenda item 2] (XX min)
-3. [Agenda item 3] (XX min)
-\n\n \n
-## Discussion Points
-### [Topic 1]
-- Key point 1
-- Key point 2
-- Questions/concerns raised
-- Supporting data presented: [brief summary]
-\n\n \n
-### [Topic 2]
-- Key point 1
-- Key point 2
-- Questions/concerns raised
-\n\n \n
-## Decisions Made
-1. [Decision 1] - Rationale: [Brief explanation]
-2. [Decision 2] - Rationale: [Brief explanation]
-\n\n \n
-## Action Items
-- [ ] [Action item 1] - Assigned to: [Name] - Due: [MM/DD/YYYY]
-- [ ] [Action item 2] - Assigned to: [Name] - Due: [MM/DD/YYYY]
-- [ ] [Action item 3] - Assigned to: [Name] - Due: [MM/DD/YYYY]
-\n\n \n
-## Unresolved Issues
-1. [Issue 1] - Owner: [Name] - Follow-up plan: [Brief description]
-2. [Issue 2] - Owner: [Name] - Follow-up plan: [Brief description]
-\n\n \n
-## Resources Shared
-1. [Resource 1]: [URL or location]
-2. [Resource 2]: [URL or location]
-\n\n \n
----
-\n\n \n
-## Next Meeting
-**Date:** [MM/DD/YYYY]
-**Time:** [HH:MM] [Timezone]
-**Location:** [Physical Location/Virtual Platform]
-**Preliminary Agenda:**
-1. [Agenda item 1]
-2. [Agenda item 2]
-3. Follow up on action items from current meeting
-`,
- },
- {
- id: 'project_management',
- name: 'Project Management',
- icon: Chart,
- subtext: 'Organize your project with goals, timelines, and resources',
- title: 'Project Plan: [Project Name]',
- content: `
-## Project Overview
-**Start Date:** [DATE]
-**End Date:** [End Date]
-**Project Manager:** [USER]
-**Department:** [Department Name]
-\n\n \n
-### Project Description
-[Brief description of what the project aims to accomplish]
-\n\n \n
-### Project Goals
-1. [Goal 1]
-2. [Goal 2]
-3. [Goal 3]
-\n\n \n
-### Success Metrics
-- [Metric 1]: [Target]
-- [Metric 2]: [Target]
-- [Metric 3]: [Target]
-\n\n \n
-## Project Scope
-### In Scope
-- [In Scope Item 1]
-- [In Scope Item 2]
-- [In Scope Item 3]
-\n\n \n
-### Out of Scope
-- [Out of Scope Item 1]
-- [Out of Scope Item 2]
-- [Out of Scope Item 3]
-\n\n \n
-## Team & Stakeholders
-### Core Team
-- @member1, [Role] - Responsibilities: [Responsibilities]
-- @member2, [Role] - Responsibilities: [Responsibilities]
-- @member3, [Role] - Responsibilities: [Responsibilities]
-\n\n \n
-### Key Stakeholders
-- @stakeholder1, [Position] - Interest: [Interest in Project]
-- @stakeholder2, [Position] - Interest: [Interest in Project]
-- @stakeholder3, [Position] - Interest: [Interest in Project]
-\n\n \n
-## Timeline & Milestones
-### Phase 1: [Phase Name]
-**Duration:** [Duration]
-**Dates:** [Start Date] - [End Date]
-**Milestone:** [Milestone Description]
-**Key Tasks:**
-\t - [ ] [Task 1] - Assigned to: @assignee1 - Due: [Due Date]
-\t - [ ] [Task 2] - Assigned to: @assignee2 - Due: [Due Date]
-\t - [ ] [Task 3] - Assigned to: @assignee3 - Due: [Due Date]
-\n\n \n
-### Phase 2: [Phase Name]
-**Duration:** [Duration]
-**Dates:** [Start Date] - [End Date]
-**Milestone:** [Milestone Description]
-**Key Tasks:**
-\t - [ ] [Task 1] - Assigned to: @assignee1 - Due: [Due Date]
-\t - [ ] [Task 2] - Assigned to: @assignee2 - Due: [Due Date]
-\t - [ ] [Task 3] - Assigned to: @assignee3 - Due: [Due Date]
-\n\n \n
-### Phase 3: [Phase Name]
-**Duration:** [Duration]
-**Dates:** [Start Date] - [End Date]
-**Milestone:** [Milestone Description]
-**Key Tasks:**
-\t - [ ] [Task 1] - Assigned to: @assignee1 - Due: [Due Date]
-\t - [ ] [Task 2] - Assigned to: @assignee2 - Due: [Due Date]
-\t - [ ] [Task 3] - Assigned to: @assignee3 - Due: [Due Date]
-\n\n \n
-## Resources & Budget
-### Required Resources
-- **Equipment:** [Equipment Requirements]
-- **Software:** [Software Requirements]
-- **Other:** [Other Requirements]
-\n\n \n
-### Budget Breakdown
-| Category | Description | Estimated Cost |
-|----------|-------------|----------------|
-| Equipment | [Description] | $[Amount] |
-| Software | [Description] | $[Amount] |
-| Other | [Description] | $[Amount] |
-| **Total** | | **$[Total Amount]** |
-\n\n \n
-## Risk Management
-### Identified Risks
-| Risk | Likelihood (1-5) | Impact (1-5) | Score | Mitigation Strategy |
-|------|------------------|--------------|-------|---------------------|
-| [Risk Description] | [Rating] | [Rating] | [Score] | [Mitigation Plan] |
-| [Risk Description] | [Rating] | [Rating] | [Score] | [Mitigation Plan] |
-| [Risk Description] | [Rating] | [Rating] | [Score] | [Mitigation Plan] |
-\n\n \n
-## Dependencies
-- [Dependency 1]: [Impact Description]
-- [Dependency 2]: [Impact Description]
-- [Dependency 3]: [Impact Description]
-\n\n \n
-## Communication Plan
-### Regular Updates
-- **Team Meetings:** [Schedule]
-- **Status Reports:** [Schedule and Method]
-- **Stakeholder Updates:** [Schedule and Method]
-\n\n \n
-### Escalation Path
-1. [First Contact]
-2. [Second Contact]
-3. [Final Contact]
-\n\n \n
-## Approval
-**Approved By:** @approver
-**Date:** [Approval Date]
-\n\n \n
-## Revision History
-| Version | Date | Description of Changes | Changed By |
-|---------|------|------------------------|------------|
-| 1.0 | [DATE] | Initial plan | [USER] |
-| [Version Number] | [Date] | [Change Description] | [Editor Name] |
-`,
- },
- {
- id: 'research_paper',
- name: 'Research Paper',
- icon: Microscope,
- subtext: 'Structure your findings with academic precision and clarity',
- title: 'Research Paper: [Title]',
- content: `
-## Abstract
-This research explores [topic] by [methodology]. The study found [brief summary of key findings], suggesting [brief implications]. These results contribute to [field or domain] by [significance].
-\n\n \n
-## Summary
-A brief 2-3 sentence summary of the paper's main contribution and findings.
-\n\n \n
-## Key Points
-- Key point 1
-- Key point 2
-- Key point 3
-\n\n \n
-## Research Questions
-1. [Research question 1]
-2. [Research question 2]
-\n\n \n
-## Methodology
-- **Design:** [Experimental design, survey, case study, etc.]
-- **Participants:** [Number and characteristics of participants]
-- **Materials:** [Key instruments or materials used]
-- **Procedure:** [Brief description of the procedure]
-- **Data Analysis:** [Approaches used to analyze collected data]
-\n\n \n
-## Results
-- Finding 1
-- Finding 2
-- Finding 3
-\n\n \n
-### Data Visualization
-[Insert chart/graph/table description]
-\n\n \n
-## Discussion
-- Interpretation of finding 1
-- Interpretation of finding 2
-- Comparison with previous research
-\n\n \n
-## Limitations
-- Limitation 1
-- Limitation 2
-- Potential biases or confounding factors
-\n\n \n
-## Future Research
-- Suggestion 1
-- Suggestion 2
-- Potential applications
-\n\n \n
-## Conclusion
-- [Your thoughts on the paper's strengths]
-- [Questions that emerged while reading]
-- [How this connects to other research you've read]
-- [Potential applications of this research]
-\n\n \n
-## Important Quotes
-> "Direct quote from the paper that captures an essential point." (p. X)
-
-> "Another significant quote worth remembering." (p. Y)
-\n\n \n
-## Acknowledgements
-Opportunity to thank those who have helped and supported you personally and professionally during your thesis or dissertation process
-\n\n \n
-## References
-[Author Last Name], [First Initial]. ([Year]). [Title of paper]. [Journal Name], [Volume / Issue], [Page range]. [DOI or URL]
-\n\n \n
-## Appendix
-- [Data tables]
-- [Additional methodology details]
-- [Survey instruments]
-`,
- },
- {
- id: 'documentation',
- name: 'Documentation',
- icon: NoteBook,
- subtext: 'Create clear guides and references for technical implementations',
- title: '[Component/Feature/API] Documentation',
- content: `
-## Overview
-A brief description of what this project does and who it's for. Keep it simple and clear, ideally 2-3 sentences that explain the core purpose.
-\n\n \n
-## Features
-- **Feature 1**: Brief description of a key feature
-- **Feature 2**: Brief description of another feature
-- **Feature 3**: You get the idea...
-\n\n \n
-## Demo
-[Insert Demo Image / Video]
-\n\n \n
-## Installation
-\`\`\`bash
-# Clone the repository
-git clone https://github.com/username/project-name.git
-
-# Navigate to the project directory
-cd project-name
-
-# Install dependencies
-npm install
-
-# Start the development server
-npm start
-\`\`\`
-\n\n \n
-## Usage
-\`\`\`javascript
-// Include a code example showing how to use your project
-import { someFunction } from 'your-project';
-
-// Example usage
-const result = someFunction('example parameter');
-console.log(result);
-\`\`\`
-\n\n \n
-## API Reference
-| Endpoint | Method | Description |
-|----------|--------|-------------|
-| \`/api/items\` | GET | Retrieves all items |
-| \`/api/items/:id\` | GET | Retrieves a specific item by ID |
-| \`/api/items\` | POST | Creates a new item |
-| \`/api/items/:id\` | PUT | Updates an existing item |
-| \`/api/items/:id\` | DELETE | Deletes an item |
-\n\n \n
-## Tech Stack
-- [React](https://reactjs.org/) - Frontend framework
-- [Node.js](https://nodejs.org/) - Backend runtime
-- [Express](https://expressjs.com/) - Server framework
-- [MongoDB](https://mongodb.com/) - Database
-\n\n \n
-## Roadmap
-- [ ] Feature A - Coming Q4 2025
-- [ ] Feature B - Coming Q2 2026
-- [ ] Mobile application - Coming Q3 2026
-\n\n \n
-## Contributing
-Contributions are always welcome!
-1. Fork the project
-2. Create your feature branch (\`git checkout -b feature/amazing-feature\`)
-3. Commit your changes (\`git commit -m 'Add some amazing feature'\`)
-4. Push to the branch (\`git push origin feature/amazing-feature\`)
-5. Open a Pull Request
-Please read [CONTRIBUTING.md] for details on our code of conduct and the process for submitting pull requests.
-\n\n \n
-## License
-This project is licensed under the [MIT License] - see the file for details.
-\n\n \n
-## Acknowledgments
-- Hat tip to anyone whose code was used
-- Inspiration
-- etc.
-\n\n \n
-## Contact
-Your Name - [USER]
-Project Link: [GitHub Link]
-`,
- },
-];
diff --git a/apps/web/src/features/block-md/history/time-travel.ts b/apps/web/src/features/block-md/history/time-travel.ts
deleted file mode 100644
index 3ec462aa32..0000000000
--- a/apps/web/src/features/block-md/history/time-travel.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-import { syncServiceClient } from '@service-sync/client';
-import { type Change, LoroDoc } from 'loro-crdt';
-
-export type BaseHistory = {
- readonly userId: string;
- readonly timestamp: UnixTimestamp;
- readonly humanTimestamp: string;
- readonly change: Change;
-};
-
-type UnixTimestamp = number;
-type Milliseconds = number;
-
-type TimeWindow = {
- readonly start: UnixTimestamp;
- readonly end: UnixTimestamp;
-};
-
-type ChangeWindow = {
- readonly change: BaseHistory;
- readonly window: TimeWindow;
-};
-
-export type HistoryGroup = {
- readonly window: TimeWindow;
- readonly users: ReadonlySet<string>;
- readonly changes: readonly BaseHistory[];
-};
-
-export type GroupingConfig = {
- readonly pauseThreshold: Milliseconds;
- /** Minimum number of changes to form a group */
- readonly minChanges: number;
-};
-
-const DEFAULT_GROUPING_CONFIG: GroupingConfig = {
- pauseThreshold: 2000,
- minChanges: 1,
-};
-
-type DocumentHistoryOptions = {
- readonly grouping?: GroupingConfig;
-};
-
-export type GroupedHistory = {
- readonly representative: BaseHistory;
- readonly group: HistoryGroup;
-};
-
-function expandChangeToWindow(
- change: BaseHistory,
- pauseThresholdMs: number
-): ChangeWindow {
- const pauseThresholdSec = pauseThresholdMs / 1000;
- return {
- change,
- window: {
- start: change.timestamp,
- end: change.timestamp + pauseThresholdSec,
- },
- };
-}
-
-function windowsOverlap(a: TimeWindow, b: TimeWindow): boolean {
- return a.start <= b.end && b.start <= a.end;
-}
-
-function mergeWindows(a: TimeWindow, b: TimeWindow): TimeWindow {
- return {
- start: Math.min(a.start, b.start),
- end: Math.max(a.end, b.end),
- };
-}
-
-function changeInWindow(change: BaseHistory, window: TimeWindow): boolean {
- return change.timestamp >= window.start && change.timestamp <= window.end;
-}
-
-/**
- * Finds editing sessions by clustering changes that happen close together in time.
- *
- * Two changes belong to the same session if they're within `pauseThreshold` of each other.
- * Uses interval merging: treat each change as a time window, merge overlapping windows.
- */
-function groupHistory(
- history: readonly BaseHistory[],
- config: GroupingConfig = DEFAULT_GROUPING_CONFIG
-): HistoryGroup[] {
- if (history.length === 0) return [];
- const sorted = [...history].sort((a, b) => a.timestamp - b.timestamp);
- const windows = sorted.map((c) =>
- expandChangeToWindow(c, config.pauseThreshold)
- );
- const mergedWindows = mergeOverlappingWindows(windows.map((w) => w.window));
- const groups = mergedWindows.map((window) => createGroup(sorted, window));
- return groups.filter((g) => g.changes.length >= config.minChanges);
-}
-
-function mergeOverlappingWindows(windows: TimeWindow[]): TimeWindow[] {
- if (windows.length === 0) return [];
-
- const merged: TimeWindow[] = [];
- let current = windows[0];
-
- for (let i = 1; i < windows.length; i++) {
- if (windowsOverlap(current, windows[i])) {
- current = mergeWindows(current, windows[i]);
- } else {
- merged.push(current);
- current = windows[i];
- }
- }
- merged.push(current);
-
- return merged;
-}
-
-function createGroup(
- changes: readonly BaseHistory[],
- window: TimeWindow
-): HistoryGroup {
- const groupChanges = changes.filter((c) => changeInWindow(c, window));
- const users = new Set(groupChanges.map((c) => c.userId));
-
- return {
- window,
- users,
- changes: groupChanges,
- };
-}
-
-async function fetchRawHistory(documentId: string): Promise<BaseHistory[]> {
- const maybeSnapshot = await syncServiceClient.getSnapshot({ documentId });
- if (maybeSnapshot.isErr()) {
- console.error('Failed to get snapshot', maybeSnapshot);
- return [];
- }
-
- const doc = new LoroDoc();
- doc.import(maybeSnapshot.value);
-
- const maybeMetadata = await syncServiceClient.getDocumentMetadata({
- documentId,
- });
-
- if (maybeMetadata.isErr()) {
- console.error('Failed to get document metadata', maybeMetadata);
- return [];
- }
-
- const metadata = maybeMetadata.value;
- const peerToUserId = new Map(
- metadata.peers.map((p) => [String(p.peer_id), p.user_id])
- );
-
- const changes = doc.getAllChanges();
- const history: BaseHistory[] = [];
-
- for (const [peerId, peerChanges] of changes) {
- const userId = peerToUserId.get(peerId);
- if (!userId) continue;
-
- for (const change of peerChanges) {
- history.push({
- userId,
- timestamp: change.timestamp,
- humanTimestamp: new Date(change.timestamp * 1000).toLocaleString(),
- change,
- });
- }
- }
-
- return history.sort((a, b) => a.timestamp - b.timestamp);
-}
-
-function applyGrouping(
- history: readonly BaseHistory[],
- config?: GroupingConfig
-): GroupedHistory[] {
- const groups = groupHistory(history, config);
-
- return groups.map((group) => ({
- representative: group.changes[0],
- group,
- }));
-}
-
-export async function getDocumentHistory(
- documentId: string,
- options?: DocumentHistoryOptions
-): Promise<GroupedHistory[]> {
- const history = await fetchRawHistory(documentId);
- if (history.length === 0) return [];
-
- const grouped = applyGrouping(history, options?.grouping);
- return grouped;
-}
diff --git a/apps/web/src/features/block-md/signal/frontMatter.ts b/apps/web/src/features/block-md/signal/frontMatter.ts
deleted file mode 100644
index 26b5afb6fb..0000000000
--- a/apps/web/src/features/block-md/signal/frontMatter.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-import { makePersisted } from '@solid-primitives/storage';
-import { createStore } from 'solid-js/store';
-
-// blockId -> showFrontMatter
-type FrontMatterPreference = Record<string, boolean>;
-
-const [frontMatterPreference_, setFrontMatterPreference] = makePersisted(
- createStore<FrontMatterPreference>({}),
- {
- name: 'mdFrontMatterPreference',
- storage: localStorage,
- }
-);
-
-export const frontMatterPreference = frontMatterPreference_;
-
-export const getFrontMatterPreference = (documentId: string): boolean => {
- // Default to true if not set
- if (frontMatterPreference_[documentId] === undefined) {
- return true;
- }
- return frontMatterPreference_[documentId];
-};
-
-export const setFrontMatterPreferenceForDoc = (
- documentId: string,
- value: boolean
-) => {
- setFrontMatterPreference(documentId, value);
-};
diff --git a/apps/web/src/features/block-md/signal/pendingLocationParamsSignal.ts b/apps/web/src/features/block-md/signal/pendingLocationParamsSignal.ts
deleted file mode 100644
index 4c31b2f784..0000000000
--- a/apps/web/src/features/block-md/signal/pendingLocationParamsSignal.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-import { createBlockSignal } from '@core/block';
-
-export const pendingLocationParamsSignal =
- createBlockSignal<Record<string, string | undefined>>();
diff --git a/apps/web/src/features/block-pdf/component/CustomCursor.tsx b/apps/web/src/features/block-pdf/component/CustomCursor.tsx
deleted file mode 100644
index cdb2b1eaa8..0000000000
--- a/apps/web/src/features/block-pdf/component/CustomCursor.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import { placeableModeSignal } from '@block-pdf/signal/placeables';
-import { createEffect, createSignal, onCleanup, Show } from 'solid-js';
-import { PayloadMode, type PayloadType } from '../type/placeables';
-
-const modeToCursor: Record<PayloadType, string> = {
- [PayloadMode.TextBox]: 'Text Box',
- [PayloadMode.FreeTextAnnotation]: 'Text Annotation',
- [PayloadMode.Shape]: 'Shape',
- [PayloadMode.ShapeAnnotation]: 'Shape Annotation',
- [PayloadMode.Image]: 'Image',
- [PayloadMode.Bookmark]: 'Bookmark',
- [PayloadMode.FreeComment]: 'Comment',
- [PayloadMode.Thread]: 'Comment',
- [PayloadMode.PageNumber]: 'Page Numbers',
- [PayloadMode.Signature]: 'Signature',
- [PayloadMode.Watermark]: 'Watermark',
- [PayloadMode.HeaderFooter]: 'Header or Footer',
- [PayloadMode.Redact]: 'Redact',
- [PayloadMode.NoMode]: '',
-};
-
-export function CustomCursor(props: { containerRef?: HTMLDivElement }) {
- const containerRef = () => props.containerRef;
- const [pos, setPos] = createSignal({ x: 0, y: 0 });
- const [mode] = placeableModeSignal;
-
- const mouseMoveHandler = ({ x, y }: MouseEvent) => setPos({ x, y });
-
- createEffect(() => {
- const container = containerRef();
- if (!container) return;
- container.addEventListener('mousemove', mouseMoveHandler);
-
- onCleanup(() =>
- container.removeEventListener('mousemove', mouseMoveHandler)
- );
- });
-
- return (
- <Show when={containerRef() && mode() !== PayloadMode.NoMode}>
- <div
- class="dot absolute z-custom-cursor-tooltip"
- style={{
- left: `${pos().x + 10}px`,
- top: `${pos().y + 50}px`,
- }}
- >
- {modeToCursor[mode()]}
- </div>
- </Show>
- );
-}
diff --git a/apps/web/src/features/block-pdf/model/Thread.ts b/apps/web/src/features/block-pdf/model/Thread.ts
deleted file mode 100644
index d962de0dad..0000000000
--- a/apps/web/src/features/block-pdf/model/Thread.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { z } from 'zod';
-
-// TODO: deprecate this fully
-export class Thread {
- public headID: string;
- public page: number;
- public comments: any[];
- public isResolved: boolean;
-
- constructor(
- headID: string,
- page: number,
- comments?: any[],
- isResolved?: boolean
- ) {
- this.headID = headID;
- this.page = page;
- this.comments = comments ?? [];
- this.isResolved = isResolved ?? false;
- }
-
- public static toObject(this_: Thread): IThread {
- return {
- headID: this_.headID,
- page: this_.page,
- comments: this_.comments,
- isResolved: this_.isResolved,
- };
- }
-}
-
-export const ThreadSchema = z.object({
- headID: z.string(),
- page: z.number(),
- comments: z.array(z.any()),
- isResolved: z.boolean(),
-});
-
-export type IThread = z.infer<typeof ThreadSchema>;
diff --git a/apps/web/src/features/block-pdf/signal/window.ts b/apps/web/src/features/block-pdf/signal/window.ts
deleted file mode 100644
index c0960e96a8..0000000000
--- a/apps/web/src/features/block-pdf/signal/window.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { createBlockSignal } from '@core/block';
-import { frameThrottle } from '@core/util/frameThrottle';
-import { createEffect } from 'solid-js';
-
-export const windowSizeSignal = createBlockSignal({
- width: 0,
- height: 0,
-});
-
-let watcherRegistrations = 0;
-
-export function useUpdateWindowSize() {
- const setWindowSize = windowSizeSignal.set;
- const windowSize = windowSizeSignal.get;
- createEffect(() => {
- if (watcherRegistrations) {
- console.error(
- 'Multiple window size watchers registered. Additional watchers on the DOM are redundant. Please check for multiple usages of useUpdateWindowSize()'
- );
- }
-
- function resizeHandler() {
- setWindowSize({
- width: window.innerWidth,
- height: window.innerHeight,
- });
- }
-
- const debouncedResizeHandler = frameThrottle(resizeHandler);
-
- // Do initial measurement if hook is added post DOMContentLoaded
- if (windowSize().width === 0 && document.readyState === 'complete') {
- debouncedResizeHandler();
- }
-
- window.addEventListener('resize', debouncedResizeHandler);
- window.addEventListener('DOMContentLoaded', debouncedResizeHandler);
- watcherRegistrations += 1;
- return () => {
- watcherRegistrations -= 1;
- window.removeEventListener('DOMContentLoaded', debouncedResizeHandler);
- window.removeEventListener('resize', debouncedResizeHandler);
- };
- }, [windowSize().width, setWindowSize]);
-}
diff --git a/apps/web/src/features/block-pdf/util/DateUtils.ts b/apps/web/src/features/block-pdf/util/DateUtils.ts
deleted file mode 100644
index 9ef1367b97..0000000000
--- a/apps/web/src/features/block-pdf/util/DateUtils.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-export function reformatPdfjsDate(
- modificationDate: string | null,
- creationDate: string | null
-) {
- let editDate: Date = new Date();
- if (modificationDate != null) editDate = new Date(modificationDate);
- else if (creationDate != null) editDate = new Date(creationDate);
- if (isNaN(editDate.getFullYear())) {
- let tempDate = modificationDate ?? creationDate;
- const split = tempDate?.match(/.{1,2}/g);
- // Imported Pdfjs annotation date may come in the format "D:YYYYMMDDHHMMSS-GMT" but needs to be "YYYY-MM-DDTHH:MM:SS-GMT"
- if (split != null && split[0] === 'D:') {
- split[8] = '-' + split[8].charAt(1);
- split[9] = split[9].charAt(0);
- tempDate =
- split[1] +
- split[2] +
- '-' +
- split[3] +
- '-' +
- split[4] +
- 'T' +
- split[5] +
- ':' +
- split[6] +
- ':' +
- split[7] +
- split[8] +
- split[9] +
- ':' +
- split[10];
- editDate = new Date(tempDate);
- }
- }
- return editDate;
-}
-
-export function getCleanHumanReadableCurrentDateTime() {
- const now = new Date();
- const datePart = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(
- 2,
- '0'
- )}-${String(now.getDate()).padStart(2, '0')}`;
- const timePart = `${String(now.getHours()).padStart(2, '0')}${String(
- now.getMinutes()
- ).padStart(2, '0')}${String(now.getSeconds()).padStart(2, '0')}`;
- return `${datePart}-${timePart}`;
-}
diff --git a/apps/web/src/features/block-pr/constants.ts b/apps/web/src/features/block-pr/constants.ts
deleted file mode 100644
index bb598907cf..0000000000
--- a/apps/web/src/features/block-pr/constants.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export const URL_PARAMS = {
- /**
- * Document id of the task this PR was opened from. When present, PR data
- * loads from the task's stored GitHub data (team-visible, populated by the
- * GitHub App installation) instead of requiring a personal GitHub link.
- */
- task: 'task',
-} as const;
diff --git a/apps/web/src/features/channel/Call/CallAgainButton.tsx b/apps/web/src/features/channel/Call/CallAgainButton.tsx
deleted file mode 100644
index 570c35feb3..0000000000
--- a/apps/web/src/features/channel/Call/CallAgainButton.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import PhoneCallIcon from '@icon/wide-call.svg';
-import { useCall } from './use-call';
-
-export function CallAgainButton(props: { channelId: string; class?: string }) {
- const call = useCall(() => props.channelId);
- return (
- <button
- type="button"
- class={props.class}
- disabled={call.isJoining()}
- title="Call again"
- onClick={(e) => {
- e.stopPropagation();
- void call.joinCall();
- }}
- >
- <PhoneCallIcon class="size-4 shrink-0" />
- Call again
- </button>
- );
-}
diff --git a/apps/web/src/features/channel/Call/index.ts b/apps/web/src/features/channel/Call/index.ts
deleted file mode 100644
index 51ceebec08..0000000000
--- a/apps/web/src/features/channel/Call/index.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-export { CallAudioSink } from './CallAudioSink';
-export type { CallState } from './CallContext';
-export {
- CallProvider,
- useCallContext,
- useCallContextOptional,
-} from './CallContext';
-export type {
- CallControlsProps,
- CallControlsVariant,
-} from './CallControls/CallControls';
-export { CallControls } from './CallControls/CallControls';
-export { CallEventSync } from './CallEventSync';
-export { CallOverlay } from './CallOverlay';
-export {
- CallStartedNotifier,
- MAX_RING_DURATION_MS,
- stopCallRinger,
-} from './CallStartedNotifier';
-export { ChannelCallAutoJoin } from './ChannelCallAutoJoin';
-export { ChannelCallButton } from './ChannelCallButton';
-export { ChannelCallTab } from './ChannelCallTab';
-export type {
- CallAnsweredEvent,
- CallEndedEvent,
- CallEvent,
- CallEventType,
- CallShareWithTeamToggledEvent,
- CallStartedEvent,
-} from './call-events';
-export {
- createCallEventsEffect,
- isCallEventType,
- parseCallEvent,
-} from './call-events';
-export { getCallJoinTab, getCallLeaveTab } from './call-tabs';
-export type {
- InCallPanelControls,
- InCallPanelMember,
- InCallPanelProps,
- InCallParticipantsListPopoverProps,
- InCallVisibleAvatarSlot,
- UseInCallPanelOptions,
- UseInCallPanelResult,
-} from './InCallPanel';
-export {
- buildOrderedInCallMembers,
- buildVisibleAvatarSlots,
- IN_CALL_PANEL_VISIBLE_AVATAR_COUNT,
- InCallPanel,
- InCallParticipantsListPopover,
- splitInCallMembersForAvatars,
- useInCallPanel,
-} from './InCallPanel';
-export { joinChannelCall } from './join-channel-call';
-export { NativeCallProvider } from './native-call-state';
-export { openChannelCallTab } from './open-channel-call-tab';
-export { useCall } from './use-call';
-export {
- CallKitSync,
- isNativeIosCallKitEnabled,
- useCallKitSetup,
-} from './use-callkit';
diff --git a/apps/web/src/features/channel/Channel/ChannelTabPlaceholder.tsx b/apps/web/src/features/channel/Channel/ChannelTabPlaceholder.tsx
deleted file mode 100644
index c219410818..0000000000
--- a/apps/web/src/features/channel/Channel/ChannelTabPlaceholder.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-export function ChannelTabPlaceholder(props: { label: string }) {
- return (
- <div class="flex min-h-0 flex-1 justify-center px-3 pb-3 pt-2">
- <div class="flex min-h-0 w-full max-w-channel-message flex-1 items-center justify-center rounded-md border border-dashed border-edge-muted bg-surface-1 px-4 py-8 text-sm text-ink-muted">
- {props.label} view is not implemented yet.
- </div>
- </div>
- );
-}
diff --git a/apps/web/src/features/channel/Input/tests/select-trailing-paragraph.ts b/apps/web/src/features/channel/Input/tests/select-trailing-paragraph.test.ts
similarity index 98%
rename from apps/web/src/features/channel/Input/tests/select-trailing-paragraph.ts
rename to apps/web/src/features/channel/Input/tests/select-trailing-paragraph.test.ts
index 5c262b2685..f2a3204fef 100644
--- a/apps/web/src/features/channel/Input/tests/select-trailing-paragraph.ts
+++ b/apps/web/src/features/channel/Input/tests/select-trailing-paragraph.test.ts
@@ -46,7 +46,7 @@ function expectCaretInBlock(editor: LexicalEditor, blockIndex: number) {
});
}
-describe('$selectContentEnd', () => {
+describe('$selectTrailingParagraph', () => {
test('appends an empty paragraph below a trailing quote and selects it', () => {
const editor = createTestEditor();
diff --git a/apps/web/src/features/channel/Input/utils/index.ts b/apps/web/src/features/channel/Input/utils/index.ts
deleted file mode 100644
index 2e395b1c71..0000000000
--- a/apps/web/src/features/channel/Input/utils/index.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export {
- buildUploadedAttachment,
- fileExtension,
- getAttachmentKindFromFile,
- iconTypeFromFilename,
- type UploadDocumentSuccessResult,
- type UploadFailedResult,
- type UploadResult,
- type UploadStaticSuccessResult,
- type UploadSuccess,
-} from './file-helpers';
-export { applyInlineFormat, applyNodeFormat } from './formatting';
diff --git a/apps/web/src/features/channel/Thread/utils/index.ts b/apps/web/src/features/channel/Thread/utils/index.ts
deleted file mode 100644
index 6ab7406694..0000000000
--- a/apps/web/src/features/channel/Thread/utils/index.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-export {
- type ActionableMessage,
- buildMessageLink,
- canDeleteMessage,
- canEditMessage,
- canReplyToMessage,
- DEFAULT_REACTION_EMOJI,
- hasReactionFromUser,
- isBotMessage,
- isOwnMessage,
-} from './message-actions';
-
-export {
- getInnerRailBottom,
- innerRailTop,
- innerRailX,
- replyInputOffsetX,
- threadConnectorStyle,
- threadOffsetX,
-} from './thread-rail-geometry';
-export {
- DEFAULT_VISIBLE_REPLY_COUNT,
- getCollapsedRepliesCount,
- getThreadLatestReplyAt,
- getThreadReplyCountLabel,
- getUniqueReplyUserIds,
-} from './thread-reply-indicator-helpers';
diff --git a/apps/web/src/features/companies/index.ts b/apps/web/src/features/companies/index.ts
deleted file mode 100644
index f8cd2c2687..0000000000
--- a/apps/web/src/features/companies/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { Company } from './Company/Company';
diff --git a/apps/web/src/features/contacts/index.ts b/apps/web/src/features/contacts/index.ts
deleted file mode 100644
index e86774569d..0000000000
--- a/apps/web/src/features/contacts/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { Contact } from './Contact/Contact';
diff --git a/apps/web/src/features/dynamic-ui/index.ts b/apps/web/src/features/dynamic-ui/index.ts
deleted file mode 100644
index 5eacea045a..0000000000
--- a/apps/web/src/features/dynamic-ui/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './schema';
-export { Widget } from './widget';
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view-mobile-create-button.tsx b/apps/web/src/features/next-soup/soup-view/soup-view-mobile-create-button.tsx
deleted file mode 100644
index 466d12b521..0000000000
--- a/apps/web/src/features/next-soup/soup-view/soup-view-mobile-create-button.tsx
+++ /dev/null
@@ -1,125 +0,0 @@
-import type { ListView } from '@app/constants/list-views';
-import {
- runCreateAction,
- setCreateMenuOpen,
-} from '@app/features/command/Launcher';
-import { openCreateCompanyModal } from '@app/features/companies/CreateCompanyModal';
-import { useAnalytics } from '@app/lib/analytics/analytics-context';
-import { openNewChannelModal } from '@channel/CreateChannelModal';
-import { hapticImpact } from '@core/mobile/haptics';
-import { ICON_ANIMATION_DURATION_MS } from '@icon/animation';
-import { AnimatedChannelIcon } from '@icon/wide-channel';
-import { AnimatedCompanyIcon } from '@icon/wide-company';
-import { AnimatedEmailIcon } from '@icon/wide-email';
-import { AnimatedPlusIcon } from '@icon/wide-plus';
-import { AnimatedStarIcon } from '@icon/wide-star';
-import { AnimatedTaskIcon } from '@icon/wide-task';
-import { cn, Layer } from '@ui';
-import {
- type Accessor,
- type Component,
- createMemo,
- createSignal,
- type JSX,
-} from 'solid-js';
-import { Dynamic } from 'solid-js/web';
-import {
- MOBILE_FLOATING_BUTTON_OFFSCREEN_RIGHT,
- MOBILE_FLOATING_BUTTON_TRANSITION,
- MOBILE_FLOATING_BUTTON_VISIBLE,
-} from './soup-view-mobile-floating-motion';
-
-type IconComponent = Component<
- JSX.SvgSVGAttributes<SVGSVGElement> | { triggerAnimation?: boolean }
->;
-
-const VIEW_CREATE_ICONS: Partial<Record<ListView, IconComponent>> = {
- agents: AnimatedStarIcon,
- mail: AnimatedEmailIcon,
- documents: AnimatedPlusIcon,
- tasks: AnimatedTaskIcon,
- channels: AnimatedChannelIcon,
- companies: AnimatedCompanyIcon,
- inbox: AnimatedPlusIcon,
-};
-
-export function SoupViewMobileCreateButton(props: {
- activeView: () => ListView | undefined;
- visible?: Accessor<boolean>;
-}) {
- const analytics = useAnalytics();
- const [animating, setAnimating] = createSignal(false);
-
- // Entity creation analytics fire at the data-layer chokepoints (create.ts
- // etc.) once the entity actually exists; the dock only attributes `source`.
- const VIEW_CREATE_ACTIONS: Partial<Record<ListView, () => void>> = {
- agents: () => {
- runCreateAction('chat', { source: 'mobile_dock' });
- },
- mail: () => {
- runCreateAction('email', { source: 'mobile_dock' });
- },
- documents: () => {
- analytics.track('create_menu_open', { from: 'mobile_dock' });
- setCreateMenuOpen(true);
- },
- tasks: () => {
- runCreateAction('task', { source: 'mobile_dock' });
- },
- channels: () => {
- openNewChannelModal();
- },
- companies: () => {
- openCreateCompanyModal();
- },
- };
-
- const createAction = createMemo(() => {
- const view = props.activeView();
- if (!view || view === 'search') return undefined;
- return (
- VIEW_CREATE_ACTIONS[view] ??
- (() => {
- analytics.track('create_menu_open', { from: 'mobile_dock' });
- setCreateMenuOpen(true);
- })
- );
- });
-
- const createIcon = createMemo<IconComponent>(() => {
- const view = props.activeView();
- return (view && VIEW_CREATE_ICONS[view]) ?? AnimatedPlusIcon;
- });
-
- const isVisible = () => (props.visible?.() ?? true) && !!createAction();
-
- return (
- <Layer depth={3}>
- <button
- type="button"
- class={cn(
- 'absolute bottom-4 right-4 z-10 h-11 pl-3.5 pr-4.5 rounded-full',
- 'island flex items-center justify-center gap-2',
- MOBILE_FLOATING_BUTTON_TRANSITION,
- isVisible()
- ? MOBILE_FLOATING_BUTTON_VISIBLE
- : MOBILE_FLOATING_BUTTON_OFFSCREEN_RIGHT
- )}
- disabled={!isVisible()}
- aria-hidden={!isVisible()}
- onClick={() => {
- hapticImpact('light');
- setAnimating(true);
- setTimeout(() => setAnimating(false), ICON_ANIMATION_DURATION_MS);
- // Defer to next frame to avoid focus race with Dialog
- requestAnimationFrame(() => createAction()?.());
- }}
- >
- <div class="size-5 [&_svg]:size-5">
- <Dynamic component={createIcon()} triggerAnimation={animating()} />
- </div>
- <div>Create</div>
- </button>
- </Layer>
- );
-}
diff --git a/apps/web/src/features/next-soup/soup-view/soup-view-mobile-floating-motion.ts b/apps/web/src/features/next-soup/soup-view/soup-view-mobile-floating-motion.ts
deleted file mode 100644
index 8708093197..0000000000
--- a/apps/web/src/features/next-soup/soup-view/soup-view-mobile-floating-motion.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export const MOBILE_FLOATING_BUTTON_TRANSITION =
- 'origin-center transition-all duration-300 ease-out';
-
-export const MOBILE_FLOATING_BUTTON_VISIBLE =
- 'opacity-100 translate-x-0 scale-100';
-
-export const MOBILE_FLOATING_BUTTON_OFFSCREEN_RIGHT =
- 'pointer-events-none translate-x-[calc(100%+var(--floating-button-offscreen-gap,2rem))]';
diff --git a/apps/web/src/features/onboarding/OnboardingLesson.tsx b/apps/web/src/features/onboarding/OnboardingLesson.tsx
deleted file mode 100644
index 8bbf8ea1e8..0000000000
--- a/apps/web/src/features/onboarding/OnboardingLesson.tsx
+++ /dev/null
@@ -1,285 +0,0 @@
-import MacroLogo from '@core/component/MacroLogo';
-import ArrowLeftIcon from '@phosphor/arrow-left.svg';
-import { Button, cn } from '@ui';
-import { type Accessor, type Component, type JSX, Show } from 'solid-js';
-import { Dynamic } from 'solid-js/web';
-import { ContinueButton } from './components-lib';
-import { OnboardingProgress } from './OnboardingProgress';
-import { useOnboarding } from './onboarding-context';
-import type { LessonContentProps, LessonState } from './types';
-
-interface LessonProps {
- lesson: LessonState;
-}
-
-interface LessonStyleProps extends LessonProps {
- bodyStyle: Accessor<JSX.CSSProperties>;
-}
-
-interface LessonActionsProps extends LessonProps {
- continueLabel: Accessor<string | undefined>;
-}
-
-export function OnboardingLessonContent(props: {
- lesson: LessonState;
- component: Component<LessonContentProps>;
-}) {
- const onboarding = useOnboarding();
-
- return (
- <Dynamic
- component={props.component}
- onComplete={onboarding.handleLessonComplete}
- onUnready={onboarding.handleLessonUnready}
- advance={onboarding.advanceLesson}
- skipLesson={onboarding.state.skipLesson}
- goToLesson={onboarding.state.goToLessonById}
- isActive={true}
- scopeId={onboarding.scopeId}
- />
- );
-}
-
-export function OnboardingLessonActions(props: LessonActionsProps) {
- const onboarding = useOnboarding();
-
- return (
- <Show when={!props.lesson.definition.hideContinue}>
- <div class="flex flex-col gap-2">
- <ContinueButton
- ref={onboarding.setContinueButtonRef}
- onClick={onboarding.handleContinue}
- label={props.continueLabel()}
- disabled={!onboarding.readyToContinue()}
- centered={props.lesson.definition.centeredButton}
- />
- <Show when={props.lesson.definition.secondaryAction}>
- {(Action) => (
- <OnboardingLessonContent
- lesson={props.lesson}
- component={Action()}
- />
- )}
- </Show>
- <button
- type="button"
- onClick={onboarding.handleSkipLesson}
- class={cn(
- 'w-full px-3 py-2.5 text-lg font-bold rounded-xs flex items-center gap-2 border border-edge-muted bg-transparent text-ink/60 hover:bg-hover',
- props.lesson.definition.centeredButton
- ? 'justify-center'
- : 'justify-between'
- )}
- >
- Skip lesson
- </button>
- </div>
- </Show>
- );
-}
-
-export function OnboardingLessonTitle(props: LessonProps) {
- return <>{props.lesson.definition.title}</>;
-}
-
-export function OnboardingLessonSubtitle(
- props: LessonProps & { class: string }
-) {
- return (
- <Show when={props.lesson.definition.subtitle}>
- <p class={props.class}>{props.lesson.definition.subtitle}</p>
- </Show>
- );
-}
-
-export function OnboardingDesktopHeader(
- props: LessonProps & { headerStyle: Accessor<JSX.CSSProperties> }
-) {
- const onboarding = useOnboarding();
- const previousLesson = () => onboarding.getPreviousLesson();
-
- return (
- <div class="p-4">
- <div style={props.headerStyle()}>
- <div class="bg-ink text-surface text-xs font-mono size-4 flex items-center justify-center font-bold rounded-xs">
- {props.lesson.index + 1}
- </div>
- <Show when={previousLesson()}>
- {(prevLesson) => (
- <Button
- variant="ghost"
- size="sm"
- onClick={() => onboarding.handleBack(prevLesson())}
- class="mt-6 gap-1.5 rounded-xs"
- >
- <ArrowLeftIcon class="size-4" />
- Back
- </Button>
- )}
- </Show>
- <h2
- class={cn(
- 'text-3xl font-semibold text-ink-muted',
- previousLesson() ? 'mt-4' : 'mt-12'
- )}
- >
- <OnboardingLessonTitle lesson={props.lesson} />
- </h2>
- </div>
- </div>
- );
-}
-
-export function OnboardingLessonBody(props: LessonStyleProps) {
- return (
- <div style={props.bodyStyle()}>
- <OnboardingLessonSubtitle
- lesson={props.lesson}
- class="text-sm text-ink/60 mb-4"
- />
- <OnboardingLessonContent
- lesson={props.lesson}
- component={props.lesson.definition.content}
- />
- </div>
- );
-}
-
-export function OnboardingLessonFooter() {
- const onboarding = useOnboarding();
-
- return (
- <div class="flex flex-col gap-3 px-4 py-3">
- <div class="flex items-center justify-between gap-2">
- <OnboardingProgress
- lessons={[...onboarding.state.lessons()]}
- currentIndex={onboarding.state.currentIndex()}
- />
- <span class="text-xs text-ink-extra-muted/50 font-mono">
- {onboarding.state.currentIndex() + 1} /{' '}
- {onboarding.state.lessons().length}
- </span>
- </div>
- </div>
- );
-}
-
-export function OnboardingDemoFallback() {
- return (
- <div class="flex items-center justify-center h-full">
- <div class="w-full m-12 opacity-10 max-w-80">
- <MacroLogo class="fill-ink" />
- </div>
- </div>
- );
-}
-
-export function OnboardingDemoPanel(props: LessonStyleProps) {
- return (
- <div class="flex-1 min-w-0 flex items-center justify-center bg-panel overflow-hidden">
- <div style={props.bodyStyle()} class="size-full">
- <Show
- when={props.lesson.definition.demo}
- fallback={<OnboardingDemoFallback />}
- >
- {(Demo) => (
- <OnboardingLessonContent lesson={props.lesson} component={Demo()} />
- )}
- </Show>
- </div>
- </div>
- );
-}
-
-export function OnboardingDesktopSidebar(
- props: LessonStyleProps & {
- headerStyle: Accessor<JSX.CSSProperties>;
- continueLabel: Accessor<string | undefined>;
- }
-) {
- return (
- <div class="w-1/3 h-full min-w-0 flex flex-col">
- <OnboardingDesktopHeader
- lesson={props.lesson}
- headerStyle={props.headerStyle}
- />
-
- <div class="flex-1 overflow-y-auto px-4 flex flex-col">
- <OnboardingLessonBody
- lesson={props.lesson}
- bodyStyle={props.bodyStyle}
- />
- <div class="mt-8 pt-4">
- <OnboardingLessonActions
- lesson={props.lesson}
- continueLabel={props.continueLabel}
- />
- </div>
- </div>
-
- <OnboardingLessonFooter />
- </div>
- );
-}
-
-export function OnboardingMobileLesson(
- props: LessonStyleProps & { continueLabel: Accessor<string | undefined> }
-) {
- return (
- <div class="size-full flex flex-col items-center overflow-y-auto p-6">
- <div
- style={props.bodyStyle()}
- class="flex flex-col items-start text-left gap-6 w-full max-w-md mt-4"
- >
- <h2 class="text-3xl font-semibold text-ink">
- <OnboardingLessonTitle lesson={props.lesson} />
- </h2>
- <OnboardingLessonSubtitle
- lesson={props.lesson}
- class="text-base text-ink/60"
- />
- <div class="onboarding-stagger">
- <OnboardingLessonContent
- lesson={props.lesson}
- component={props.lesson.definition.content}
- />
- </div>
- <Show when={props.lesson.definition.demo}>
- {(Demo) => (
- <div class="w-full">
- <OnboardingLessonContent
- lesson={props.lesson}
- component={Demo()}
- />
- </div>
- )}
- </Show>
- <div class="w-full mt-2">
- <OnboardingLessonActions
- lesson={props.lesson}
- continueLabel={props.continueLabel}
- />
- </div>
- </div>
- </div>
- );
-}
-
-export function OnboardingDesktopLesson(
- props: LessonStyleProps & {
- headerStyle: Accessor<JSX.CSSProperties>;
- continueLabel: Accessor<string | undefined>;
- }
-) {
- return (
- <>
- <OnboardingDesktopSidebar
- lesson={props.lesson}
- bodyStyle={props.bodyStyle}
- headerStyle={props.headerStyle}
- continueLabel={props.continueLabel}
- />
- <OnboardingDemoPanel lesson={props.lesson} bodyStyle={props.bodyStyle} />
- </>
- );
-}
diff --git a/apps/web/src/features/onboarding/OnboardingModalLayout.tsx b/apps/web/src/features/onboarding/OnboardingModalLayout.tsx
deleted file mode 100644
index ed4c1d95b5..0000000000
--- a/apps/web/src/features/onboarding/OnboardingModalLayout.tsx
+++ /dev/null
@@ -1,127 +0,0 @@
-import MacroLogo from '@core/component/MacroLogo';
-import { Button, Hotkey } from '@ui';
-import { type Component, type JSX, Show } from 'solid-js';
-import { Dynamic } from 'solid-js/web';
-import { OnboardingProgress } from './OnboardingProgress';
-import { useOnboarding } from './onboarding-context';
-import type { LessonContentProps, LessonState } from './types';
-
-interface OnboardingModalLayoutProps {
- lesson: LessonState;
- bodyStyle: () => JSX.CSSProperties;
-}
-
-function LessonContent(props: {
- lesson: LessonState;
- component: Component<LessonContentProps>;
-}) {
- const onboarding = useOnboarding();
-
- return (
- <Dynamic
- component={props.component}
- onComplete={onboarding.handleLessonComplete}
- onUnready={onboarding.handleLessonUnready}
- advance={onboarding.advanceLesson}
- skipLesson={onboarding.state.skipLesson}
- goToLesson={onboarding.state.goToLessonById}
- isActive={true}
- scopeId={onboarding.scopeId}
- />
- );
-}
-
-function ModalFooter(props: { lesson: LessonState }) {
- const onboarding = useOnboarding();
-
- return (
- <footer class="shrink-0 px-4 pt-3 pb-0 bg-surface flex items-center justify-between gap-4">
- <div class="flex items-center gap-3 min-w-0">
- <OnboardingProgress
- lessons={[...onboarding.state.lessons()]}
- currentIndex={onboarding.state.currentIndex()}
- />
- <span class="text-xs text-ink-extra-muted/50 font-mono shrink-0">
- {onboarding.state.currentIndex() + 1} /{' '}
- {onboarding.state.lessons().length}
- </span>
- </div>
-
- <Show when={!props.lesson.definition.hideContinue}>
- <div class="flex items-center justify-end gap-2 shrink-0">
- <Button
- variant="base"
- // size="lg"
- onClick={onboarding.handleSkipLesson}
- >
- Skip lesson
- </Button>
- <Button
- ref={onboarding.setContinueButtonRef}
- variant="cta"
- // size="lg"
- onClick={onboarding.handleContinue}
- disabled={!onboarding.readyToContinue()}
- >
- {onboarding.continueLabel() ?? 'Continue'}
- <Hotkey shortcut="cmd+enter" theme="current" />
- </Button>
- </div>
- </Show>
- </footer>
- );
-}
-
-function DemoFallback() {
- return (
- <div class="flex items-center justify-center h-full">
- <div class="w-full m-12 opacity-10 max-w-80">
- <MacroLogo class="fill-ink" />
- </div>
- </div>
- );
-}
-
-export function OnboardingModalLayout(props: OnboardingModalLayoutProps) {
- return (
- <div class="size-full flex flex-col bg-surface text-ink">
- <div class="flex-1 min-h-0 flex gap-12">
- <aside class="w-105 shrink-0 flex flex-col">
- <div class="flex-1 overflow-y-auto px-4 py-4">
- <div style={props.bodyStyle()}>
- <h3 class="text-3xl font-semibold text-ink">
- {props.lesson.definition.title}
- </h3>
- <Show when={props.lesson.definition.subtitle}>
- <p class="text-sm text-ink/60 mt-2 mb-4">
- {props.lesson.definition.subtitle}
- </p>
- </Show>
-
- <LessonContent
- lesson={props.lesson}
- component={props.lesson.definition.content}
- />
- </div>
- </div>
- </aside>
-
- <main class="flex-1 min-w-0 flex flex-col bg-panel">
- <div class="flex-1 min-h-0 overflow-hidden">
- <div style={props.bodyStyle()} class="size-full">
- <Show
- when={props.lesson.definition.demo}
- fallback={<DemoFallback />}
- >
- {(Demo) => (
- <LessonContent lesson={props.lesson} component={Demo()} />
- )}
- </Show>
- </div>
- </div>
- </main>
- </div>
- <ModalFooter lesson={props.lesson} />
- </div>
- );
-}
diff --git a/apps/web/src/features/paywall/PaywallTeamMemberView.tsx b/apps/web/src/features/paywall/PaywallTeamMemberView.tsx
deleted file mode 100644
index 168395ceef..0000000000
--- a/apps/web/src/features/paywall/PaywallTeamMemberView.tsx
+++ /dev/null
@@ -1,22 +0,0 @@
-import UsersThreeIcon from '@phosphor/users-three.svg';
-
-const PaywallTeamMemberView = () => (
- <div class="relative space-y-2 w-full">
- <div class="p-4 sm:p-5 border border-edge flex flex-col gap-3 text-left rounded-sm">
- <div class="flex justify-between items-start">
- <div class="flex items-center gap-2 font-semibold text-ink text-base sm:text-lg">
- <UsersThreeIcon class="size-5 shrink-0 text-accent" />
- Team subscription
- </div>
- </div>
- <div class="text-sm text-ink/60 flex flex-col gap-1">
- <span>
- Your subscription is managed by your team owner. Contact them to make
- changes.
- </span>
- </div>
- </div>
- </div>
-);
-
-export default PaywallTeamMemberView;
diff --git a/apps/web/src/features/paywall/PaywallTeamOwnerView.tsx b/apps/web/src/features/paywall/PaywallTeamOwnerView.tsx
deleted file mode 100644
index aa34401010..0000000000
--- a/apps/web/src/features/paywall/PaywallTeamOwnerView.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import { PLANS } from '@app/features/paywall/plans';
-import { useTeamQuery } from '@queries/team';
-import type { Team } from '@service-auth/generated/schemas/team';
-import { stripeServiceClient } from '@service-stripe/client';
-import { Button } from '@ui';
-import { createMemo } from 'solid-js';
-import SubscriptionTier from './SubscriptionTier';
-
-interface PaywallTeamOwnerViewProps {
- team: Team;
-}
-
-const PREMIUM_PRICE = PLANS.find((p) => p.tier === 'premium')!.price;
-
-const PaywallTeamOwnerView = (props: PaywallTeamOwnerViewProps) => {
- const teamQuery = useTeamQuery(() => props.team.id);
- const memberCount = createMemo(() => teamQuery.data?.members.length ?? 0);
- const totalPrice = createMemo(() => memberCount() * PREMIUM_PRICE);
-
- const handleManage = async () => {
- try {
- const url = await stripeServiceClient.createPortalSession();
- window.location.href = url;
- } catch (error) {
- console.error(error);
- }
- };
-
- return (
- <div class="relative space-y-2 w-full">
- <div class="p-4 sm:p-5 bg-active flex flex-col gap-3 text-left rounded-sm">
- <div class="flex justify-between items-start">
- <div class="font-semibold text-ink text-base sm:text-lg">
- {props.team.name}
- </div>
- <SubscriptionTier class="w-7 shrink-0" tier="premium" />
- </div>
- <div class="flex items-baseline gap-0.5">
- <span class="text-3xl font-bold text-ink">${totalPrice()}</span>
- <span class="text-base text-ink/40">/mo</span>
- </div>
- <div class="text-sm text-ink/60 flex flex-col gap-1">
- <span>Plan: Premium</span>
- <span>Seats: {memberCount()}</span>
- <span>Price per seat: ${PREMIUM_PRICE}/mo</span>
- </div>
- </div>
- <div class="w-full">
- <Button
- onClick={handleManage}
- variant="base"
- size="lg"
- depth={3}
- class="w-full"
- >
- Manage Subscription
- </Button>
- </div>
- </div>
- );
-};
-
-export default PaywallTeamOwnerView;
diff --git a/apps/web/src/features/paywall/PlanGrid.tsx b/apps/web/src/features/paywall/PlanGrid.tsx
deleted file mode 100644
index 6b582ce257..0000000000
--- a/apps/web/src/features/paywall/PlanGrid.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-import { For, type JSX, Show } from 'solid-js';
-import { PLAN_FEATURES, PLANS, type Plan, type PlanTier } from './plans';
-
-interface PlanGridProps {
- /** The currently highlighted tier — shows accent styling. */
- highlightedTier?: () => PlanTier | undefined;
- /** Render a footer (e.g. button) below the feature rows for each plan column. */
- footer?: (plan: Plan) => JSX.Element;
-}
-
-export function PlanGrid(props: PlanGridProps) {
- const isHighlighted = (plan: Plan) =>
- plan.highlighted || props.highlightedTier?.() === plan.tier;
-
- return (
- <div class="w-full overflow-x-auto">
- <table class="w-full min-w-small text-sm border-separate border-spacing-0 table-fixed">
- <thead>
- <tr>
- <th class="p-4 w-40" aria-hidden="true" />
- <For each={PLANS}>
- {(plan) => (
- <th
- scope="col"
- class="p-4 text-left align-top"
- classList={{
- 'bg-accent/5 border-t border-x border-accent':
- isHighlighted(plan),
- }}
- >
- <div class="flex flex-col gap-2">
- <span class="text-xl font-semibold text-ink">
- {plan.name}
- </span>
- <span class="flex items-baseline gap-0.5">
- <span class="text-3xl font-bold text-ink">
- ${plan.price}
- </span>
- <span class="text-base text-ink/40">/mo</span>
- </span>
- </div>
- </th>
- )}
- </For>
- </tr>
- </thead>
- <tbody>
- <For each={PLAN_FEATURES}>
- {(feature) => (
- <tr>
- <th
- scope="row"
- class="px-4 py-3 text-left font-normal text-ink/60 border-t border-edge-muted"
- >
- {feature.label}
- </th>
- <For each={PLANS}>
- {(plan) => (
- <td
- class="px-4 py-3 text-ink"
- classList={{
- 'bg-accent/5 border-x border-accent':
- isHighlighted(plan),
- 'border-t border-edge-muted': !isHighlighted(plan),
- }}
- >
- {feature.values[plan.tier]}
- </td>
- )}
- </For>
- </tr>
- )}
- </For>
- </tbody>
- <Show when={props.footer}>
- {(footerRender) => (
- <tfoot>
- <tr>
- <td class="p-4 border-t border-edge-muted" />
- <For each={PLANS}>
- {(plan) => (
- <td
- class="p-4 align-bottom"
- classList={{
- 'bg-accent/5 border-x border-b border-accent':
- isHighlighted(plan),
- 'border-t border-edge-muted': !isHighlighted(plan),
- }}
- >
- {footerRender()(plan)}
- </td>
- )}
- </For>
- </tr>
- </tfoot>
- )}
- </Show>
- </table>
- </div>
- );
-}
diff --git a/apps/web/src/features/paywall/SubscriptionTier.tsx b/apps/web/src/features/paywall/SubscriptionTier.tsx
deleted file mode 100644
index 9a2345687a..0000000000
--- a/apps/web/src/features/paywall/SubscriptionTier.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import type { PaidPlanTier } from './plans';
-
-interface SubscriptionTierProps {
- tier?: PaidPlanTier;
- class?: string;
-}
-
-const SubscriptionTier = (props: SubscriptionTierProps) => {
- const active1 = () => props.tier === 'premium';
- const active2 = () => props.tier === 'premium';
- const active3 = () => !!props.tier;
-
- return (
- <svg
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 24 16"
- class={props.class}
- display="block"
- >
- <path
- d="m15.578 0.043946-2.2441 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.041 0.98242 7.0859 6.6973 2.2402-0.87891v-6.6758c0-0.2568-0.10497-0.50153-0.29297-0.67773z"
- fill="var(--b4)"
- />
- <path
- d="m6.25 0.041992-2.2422 0.88086v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.0391 0.98242 7.084 6.6973 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773l-1.043-0.98438-7.082-6.6973z"
- fill="var(--b4)"
- />
- <path
- d="m2.252 5.083-2.2422 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l2.793 2.6406 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773z"
- fill="var(--b4)"
- />
-
- <path
- d="m15.578 0.043946-2.2441 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.041 0.98242 7.0859 6.6973 2.2402-0.87891v-6.6758c0-0.2568-0.10497-0.50153-0.29297-0.67773z"
- style={{
- transform: `translateY(${active1() ? 0 : 16}px)`,
- transition: 'transform 0.3s ease 0.2s',
- fill: 'var(--a0)',
- }}
- />
- <path
- d="m6.25 0.041992-2.2422 0.88086v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l1.0391 0.98242 7.084 6.6973 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773l-1.043-0.98438-7.082-6.6973z"
- style={{
- transform: `translateY(${active2() ? 0 : 16}px)`,
- transition: 'transform 0.3s ease 0.1s',
- fill: 'var(--a0)',
- }}
- />
- <path
- d="m2.252 5.083-2.2422 0.87891v6.6758c0 0.2568 0.10697 0.50329 0.29297 0.67969l2.793 2.6406 2.2441-0.87891v-6.6758c0-0.2568-0.10302-0.50153-0.29102-0.67773z"
- style={{
- transform: `translateY(${active3() ? 0 : 16}px)`,
- transition: 'transform 0.3s ease 0s',
- fill: 'var(--a0)',
- }}
- />
-
- {/*<path fill="var(--b0)" d="m5.3398 9.2617v5.8164l-2.2441 0.87891-2.793-2.6387c-0.186-0.1764-0.29296-0.42289-0.29297-0.67969v3.3613h23.99l-0.0059-0.91992-2.2402 0.87891-7.0859-6.6973v5.8184l-2.2441 0.87891z"/>*/}
- </svg>
- );
-};
-
-export default SubscriptionTier;
diff --git a/apps/web/src/features/settings/SettingsButton.tsx b/apps/web/src/features/settings/SettingsButton.tsx
deleted file mode 100644
index d195fa5b0a..0000000000
--- a/apps/web/src/features/settings/SettingsButton.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { useSplitLayout } from '@components/app/split-layout/layout';
-import { useSettingsState } from '@core/constant/SettingsState';
-import { TOKENS } from '@core/hotkey/tokens';
-import IconGear from '@icon/macro-gear.svg';
-import { Button, cn } from '@ui';
-import { Show } from 'solid-js';
-
-export function SettingsButton() {
- const { settingsOpen, toggleSettings } = useSettingsState();
- const { getSplitCount } = useSplitLayout();
-
- // Hide settings button when there are multiple splits
- const isSingleSplit = () => getSplitCount() <= 1;
-
- return (
- <Show when={isSingleSplit()}>
- <Button
- class="px-0"
- label={settingsOpen() ? 'Close Settings' : 'Open Settings'}
- hotkey={TOKENS.global.toggleSettings}
- onClick={() => toggleSettings()}
- >
- <IconGear
- class={cn(
- 'size-4.5 box-content rounded-full hover:bg-transparent p-1',
- settingsOpen() &&
- 'bg-accent/20 text-accent hover:text-ink hover:bg-hover',
- !settingsOpen() && 'hover:text-accent hover:bg-accent/20'
- )}
- />
- </Button>
- </Show>
- );
-}
diff --git a/apps/web/src/features/theme/components/ThemeCrud.tsx b/apps/web/src/features/theme/components/ThemeCrud.tsx
deleted file mode 100644
index e68168fb43..0000000000
--- a/apps/web/src/features/theme/components/ThemeCrud.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-import IconDotsThreeVertical from '@phosphor/dots-three-vertical.svg';
-import IconClipboard from '@phosphor-icons/core/regular/clipboard.svg?component-solid';
-import { Button, Dropdown } from '@ui';
-import { createMemo, Show } from 'solid-js';
-import {
- setDarkModeTheme,
- setLightModeTheme,
- userThemes,
-} from '../signals/themeSignals';
-import { deleteTheme, exportTheme } from '../utils/themeUtils';
-
-interface ThemeCrudProps {
- themeId: string;
-}
-
-export function ThemeCrud(props: ThemeCrudProps) {
- const isUserTheme = createMemo(() =>
- userThemes().some((t) => t.id === props.themeId)
- );
-
- const stop = (e: Event) => e.stopPropagation();
-
- return (
- <div
- class="flex shrink-0 items-center gap-0.5"
- onClick={stop}
- onPointerDown={stop}
- onKeyDown={stop}
- >
- <Button
- label="Copy To Clipboard"
- onPointerDown={() => exportTheme(props.themeId)}
- variant="ghost"
- size="icon-sm"
- >
- <IconClipboard />
- </Button>
-
- <Dropdown placement="bottom-end">
- <Dropdown.Trigger label="Theme options" variant="ghost" size="icon-sm">
- <IconDotsThreeVertical />
- </Dropdown.Trigger>
- <Dropdown.Content class="shadow-menu">
- <Dropdown.Group>
- <Dropdown.Item
- class="touch:min-h-10"
- onSelect={() => setDarkModeTheme(props.themeId)}
- >
- Set default dark theme
- </Dropdown.Item>
- <Dropdown.Item
- class="touch:min-h-10"
- onSelect={() => setLightModeTheme(props.themeId)}
- >
- Set default light theme
- </Dropdown.Item>
- </Dropdown.Group>
- {/* Separate group renders a divider (gap-px) above the destructive
- action; only user themes can be deleted. */}
- <Show when={isUserTheme()}>
- <Dropdown.Group>
- <Dropdown.Item
- class="text-failure touch:min-h-10"
- onSelect={() => deleteTheme(props.themeId)}
- >
- Delete
- </Dropdown.Item>
- </Dropdown.Group>
- </Show>
- </Dropdown.Content>
- </Dropdown>
- </div>
- );
-}
-
-export default ThemeCrud;
diff --git a/apps/web/src/features/theme/components/ThemeEditorAdvanced.tsx b/apps/web/src/features/theme/components/ThemeEditorAdvanced.tsx
deleted file mode 100644
index 2fa75640c2..0000000000
--- a/apps/web/src/features/theme/components/ThemeEditorAdvanced.tsx
+++ /dev/null
@@ -1,214 +0,0 @@
-import {
- batch,
- createEffect,
- createSignal,
- For,
- type Setter,
- untrack,
-} from 'solid-js';
-import { themeReactive } from '../signals/themeReactive';
-import type { ThemeReactiveColor } from '../types/themeTypes';
-import { convertOklchTo, getOklch, validateColor } from '../utils/colorUtil';
-import { ColorPickerPopover } from './ColorPickerPopover';
-
-const displayType = () => 'hex';
-
-function setColor(
- colorValue: ThemeReactiveColor,
- colorString: string,
- inputElement: HTMLInputElement,
- setIsSetByInput: Setter<boolean>
-) {
- if (
- !colorString ||
- colorString.trim() === '' ||
- colorString.length < 6 ||
- !validateColor(colorString)
- ) {
- inputElement.classList.add('invalid');
- return;
- }
- try {
- let oklch = getOklch(colorString);
- batch(() => {
- setIsSetByInput(true);
- colorValue.l[1](oklch.l ? oklch.l : 0);
- colorValue.c[1](oklch.c ? oklch.c : 0);
- colorValue.h[1](oklch.h ? oklch.h : 0);
- });
- inputElement.classList.remove('invalid');
- } catch (error) {
- console.error(`Error processing color "${colorString}":`, error);
- }
-}
-
-export function ThemeEditorAdvanced() {
- return (
- <>
- <style>{`
- .theme-editor-advanced-input::selection {
- background-color: var(--a0);
- color: var(--b0);
- }
-
- .theme-editor-advanced-input.invalid {
- color: var(--a0) !important;
- }
- `}</style>
-
- <div
- style={{
- 'font-size': 'var(--text-xs)',
- 'font-weight': 300,
- display: 'block',
- }}
- >
- <div
- style="
- background-color: oklch(from var(--c0) l c h / 0.06);
- box-sizing: border-box;
- overflow-x: hidden;
- display: grid;
- gap: 1px;
- "
- >
- <For each={Object.entries(themeReactive)}>
- {([colorKey, colorValue]) => {
- // a1 thru a4 are not currently being used, so we will hide them
- if (['a1', 'a2', 'a3', 'a4'].includes(colorKey)) return null;
- const [isSetByInput, setIsSetByInput] = createSignal(false);
- const [inputValue, setInputValue] = createSignal('');
-
- createEffect(() => {
- const newValue = convertOklchTo(
- colorValue.l[0](),
- colorValue.c[0](),
- colorValue.h[0](),
- displayType()
- );
- if (untrack(isSetByInput)) {
- setIsSetByInput(false); /* console.log('blocked!!!'); */
- } else {
- setInputValue(newValue);
- }
- });
-
- return (
- <div
- style="
- font-family: var(--font-mono);
- background-color: var(--b0);
- "
- >
- <div
- style="
- grid-template-columns: 104px calc(7ch + 40px) 1fr calc(4ch + 40px);
- background-color: oklch(from var(--c0) l c h / 0.06);
- align-items: center;
- display: grid;
- height: 61px;
- gap: 1px 0px;
- "
- >
- <div
- style="
- background-color: var(--b0);
- box-sizing: border-box;
- align-items: center;
- padding: 0 20px;
- display: grid;
- height: 100%;
- width: 100%;
- "
- >
- <ColorPickerPopover
- l={() => colorValue.l[0]()}
- c={() => colorValue.c[0]()}
- h={() => colorValue.h[0]()}
- onL={(n) => colorValue.l[1](n)}
- onC={(n) => colorValue.c[1](n)}
- onH={(n) => colorValue.h[1](n)}
- title={colorValue.description}
- subtitle={`--${colorKey}`}
- ariaLabel={`Edit ${colorValue.description} (--${colorKey})`}
- />
- </div>
-
- <div
- style="
- background-color: var(--b0);
- box-sizing: border-box;
- align-items: center;
- white-space: nowrap;
- padding: 0 20px;
- display: grid;
- height: 100%;
- width: 100%;
- "
- >
- <input
- onInput={(e) => {
- setColor(
- colorValue,
- e.target.value,
- e.target,
- setIsSetByInput
- );
- }}
- style="
- color: var(--color-ink-extra-muted);
- font-family: var(--font-mono);
- font-size: var(--text-xs);
- background: transparent;
- font-weight: 300;
- outline: none;
- border: none;
- width: 100%;
- "
- class="theme-editor-advanced-input"
- value={inputValue()}
- type="text"
- />
- </div>
-
- <div
- style="
- color: var(--color-ink-extra-muted);
- background-color: var(--b0);
- box-sizing: border-box;
- align-items: center;
- white-space: nowrap;
- text-overflow: ellipsis;
- padding: 0 20px;
- overflow: hidden;
- display: grid;
- height: 100%;
- width: 100%;
- "
- >
- {colorValue.description}
- </div>
- <div
- style="
- background-color: var(--b0);
- box-sizing: border-box;
- white-space: nowrap;
- align-items: center;
- padding: 0 20px;
- display: grid;
- height: 100%;
- width: 100%;
- "
- >
- --{colorKey}
- </div>
- </div>
- </div>
- );
- }}
- </For>
- </div>
- </div>
- </>
- );
-}
diff --git a/apps/web/src/features/theme/components/ThemeEditorBasic.tsx b/apps/web/src/features/theme/components/ThemeEditorBasic.tsx
deleted file mode 100644
index a6457cf0ab..0000000000
--- a/apps/web/src/features/theme/components/ThemeEditorBasic.tsx
+++ /dev/null
@@ -1,485 +0,0 @@
-import { batch, createEffect, createSignal, type JSX, untrack } from 'solid-js';
-import { themeReactive } from '../signals/themeReactive';
-import { setThemeDepth, themeDepth } from '../signals/themeSignals';
-import { convertOklchTo, getOklch, validateColor } from '../utils/colorUtil';
-import { ColorPickerPopover } from './ColorPickerPopover';
-
-function setLightness(lightness: number) {
- batch(() => {
- themeReactive.a0.l[1](lightness);
- themeReactive.a1.l[1](lightness);
- themeReactive.a2.l[1](lightness);
- themeReactive.a3.l[1](lightness);
- themeReactive.a4.l[1](lightness);
- });
-}
-
-function setChroma(chroma: number, saturation: number) {
- batch(() => {
- themeReactive.a0.c[1](chroma);
- themeReactive.a1.c[1](chroma);
- themeReactive.a2.c[1](chroma);
- themeReactive.a3.c[1](chroma);
- themeReactive.a4.c[1](chroma);
- setSaturation(saturation);
- });
-}
-
-function setHue(hue: number) {
- batch(() => {
- themeReactive.a0.h[1](hue);
- themeReactive.a1.h[1](hue + 40);
- themeReactive.a2.h[1](hue + 80);
- themeReactive.a3.h[1](hue + 120);
- themeReactive.a4.h[1](hue + 160);
-
- themeReactive.b0.h[1](hue);
- themeReactive.b1.h[1](hue);
- themeReactive.b2.h[1](hue);
- themeReactive.b3.h[1](hue);
- themeReactive.b4.h[1](hue);
-
- themeReactive.c0.h[1](hue);
- themeReactive.c1.h[1](hue);
- themeReactive.c2.h[1](hue);
- themeReactive.c3.h[1](hue);
- themeReactive.c4.h[1](hue);
- });
-}
-
-function setSaturation(saturation: number) {
- const s = saturation * themeReactive.a0.c[0]() * 0.37 * 0.6;
-
- batch(() => {
- themeReactive.b0.c[1](s);
- themeReactive.b1.c[1](s);
- themeReactive.b2.c[1](s);
- themeReactive.b3.c[1](s);
- themeReactive.b4.c[1](s);
-
- themeReactive.c0.c[1](s);
- themeReactive.c1.c[1](s);
- themeReactive.c2.c[1](s);
- themeReactive.c3.c[1](s);
- themeReactive.c4.c[1](s);
- });
-}
-
-let q = 8;
-function sigmoid(x: number, b: number): number {
- return (
- -(
- (1 / (1 + Math.exp(b * (x - 0.5))) - 0.5) *
- (0.5 / (1 / (1 + Math.exp(q / 2)) - 0.5))
- ) + 0.5
- );
-}
-
-function getContrastFromY(y: number): number {
- return (
- (-2 *
- Math.log(
- 1 / (-(y - 0.5) / (0.5 / (1 / (1 + Math.exp(q / 2)) - 0.5)) + 0.5) - 1
- ) -
- (-2 *
- Math.log(
- 1 / (-(y - 0.5) / (0.5 / (1 / (1 + Math.exp(q / 2)) - 0.5)) + 0.5) - 1
- ) <
- 0
- ? -1
- : 1)) /
- (q - 1) /
- 2 +
- 0.4
- );
-}
-
-function setContrast(contrast: number) {
- const c = (contrast - 0.4) * 2;
- const p = c < 0 ? -1 : 1;
- const b = c * (q - 1) + p;
-
- batch(() => {
- themeReactive.b0.l[1](sigmoid(0.0, b));
- themeReactive.b1.l[1](sigmoid(0.08, b));
- themeReactive.b2.l[1](sigmoid(0.18, b));
- themeReactive.b3.l[1](sigmoid(0.22, b));
- themeReactive.b4.l[1](sigmoid(0.28, b));
-
- themeReactive.c4.l[1](sigmoid(0.68, b));
- themeReactive.c3.l[1](sigmoid(0.76, b));
- themeReactive.c2.l[1](sigmoid(0.84, b));
- themeReactive.c1.l[1](sigmoid(0.92, b));
- themeReactive.c0.l[1](sigmoid(1.0, b));
- });
-}
-
-export function randomizeTheme() {
- batch(() => {
- const randLightness = Math.random();
- const randHue = Math.random();
- setLightness(randLightness * 0.7 + 0.3);
- setHue(randHue * 360);
-
- const randSaturation = Math.random() * 0.5;
- const randContrast = 1 - randLightness;
- const randChroma = (Math.random() * 0.5 + 0.5) * 0.37;
- const randDepth = Math.random() * 0.2 + 0.1;
-
- setContrast(randContrast);
- setChroma(randChroma, randSaturation);
- setSaturation(randSaturation);
- setThemeDepth(randDepth);
- });
-}
-
-/** Numeric value box shown to the right of each slider, on a display scale
- * (default 0-100). Pass displayMin/displayMax for a centered scale (e.g.
- * -100..100 for Contrast). Keeps its own text state while typing. */
-function NumberInput(props: {
- get: () => number;
- set: (n: number) => void;
- min: number;
- max: number;
- displayMin?: number;
- displayMax?: number;
-}) {
- const dMin = () => props.displayMin ?? 0;
- const dMax = () => props.displayMax ?? 100;
- const toDisplay = (v: number) =>
- dMin() + ((v - props.min) / (props.max - props.min)) * (dMax() - dMin());
- const fromDisplay = (d: number) =>
- props.min + ((d - dMin()) / (dMax() - dMin())) * (props.max - props.min);
-
- const [text, setText] = createSignal('');
- const [isSetByInput, setIsSetByInput] = createSignal(false);
-
- createEffect(() => {
- const value = props.get();
- if (untrack(isSetByInput)) {
- setIsSetByInput(false);
- } else {
- setText(Math.round(toDisplay(value)).toString());
- }
- });
-
- return (
- <div
- style="
- background-color: oklch(from var(--c0) l c h / 0.05);
- box-sizing: border-box;
- align-items: center;
- border-radius: 6px;
- padding: 3px 6px;
- display: flex;
- gap: 1px;
- flex: none;
- width: 6ch;
- "
- >
- <input
- class="theme-editor-basic-num"
- type="number"
- value={text()}
- min={dMin()}
- max={dMax()}
- step={1}
- onInput={(e) => {
- const raw = e.currentTarget.value;
- setIsSetByInput(true);
- setText(raw);
- const d = parseFloat(raw);
- if (!Number.isNaN(d)) {
- props.set(fromDisplay(Math.max(dMin(), Math.min(dMax(), d))));
- }
- }}
- onBlur={() => setText(Math.round(toDisplay(props.get())).toString())}
- style="
- font-family: var(--font-mono);
- background: transparent;
- box-sizing: border-box;
- text-align: right;
- color: var(--c0);
- font-size: 12px;
- min-width: 0;
- outline: none;
- border: none;
- padding: 0;
- flex: 1;
- "
- />
- <span style="color: var(--c2); font-size: 12px; flex: none;">%</span>
- </div>
- );
-}
-
-/** Accent control: a clickable circle swatch (opens the color picker) beside a
- * validated, editable hex field. Both read/write the same accent color. */
-function AccentControl(props: {
- l: () => number;
- c: () => number;
- h: () => number;
- onL: (n: number) => void;
- onC: (n: number) => void;
- onH: (n: number) => void;
-}) {
- const [hexText, setHexText] = createSignal('');
- const [invalid, setInvalid] = createSignal(false);
- const [bySelf, setBySelf] = createSignal(false);
-
- createEffect(() => {
- const next = convertOklchTo(props.l(), props.c(), props.h(), 'hex');
- if (untrack(bySelf)) {
- setBySelf(false);
- } else {
- setHexText(next);
- }
- });
-
- const apply = (value: string) => {
- setBySelf(true);
- setHexText(value);
- if (!value || value.trim().length < 6 || !validateColor(value)) {
- setInvalid(true);
- return;
- }
- try {
- const next = getOklch(value);
- batch(() => {
- props.onL(next.l || 0);
- props.onC(next.c || 0);
- props.onH(next.h || 0);
- });
- setInvalid(false);
- } catch {
- setInvalid(true);
- }
- };
-
- return (
- <>
- <ColorPickerPopover
- l={props.l}
- c={props.c}
- h={props.h}
- onL={props.onL}
- onC={props.onC}
- onH={props.onH}
- ariaLabel="Edit accent color"
- trigger={
- <div
- class="size-6 rounded-full border border-ink/[0.15]"
- style={{
- 'background-color': `oklch(${props.l()} ${props.c()} ${props.h()}deg)`,
- }}
- />
- }
- />
- <input
- type="text"
- value={hexText()}
- onInput={(e) => apply(e.currentTarget.value)}
- spellcheck={false}
- aria-label="Accent hex color"
- class="w-[11ch] rounded-md bg-ink/5 px-2 py-1 text-right font-mono text-xs uppercase text-ink outline-none focus:bg-ink/8"
- classList={{ 'text-failure': invalid() }}
- />
- </>
- );
-}
-
-/** A stacked row: label on the left, control(s) right-aligned. The control
- * cluster is capped (~half the row on wide layouts) so sliders don't run all
- * the way back to the label. */
-function Control(props: { label: string; children: JSX.Element }) {
- return (
- <div class="flex min-h-10 items-center gap-3">
- <div class="w-[8ch] shrink-0 text-ink-muted">{props.label}</div>
- <div class="flex-1" />
- <div class="flex w-1/2 min-w-0 max-w-72 items-center justify-end gap-2.5">
- {props.children}
- </div>
- </div>
- );
-}
-
-/** A simple, borderless slider: a rounded neutral track, an accent fill up to
- * the value, and a round thumb. `fraction` (0..1) positions the thumb/fill;
- * `value` drives the underlying range input on its own min/max scale. */
-function BasicSlider(props: {
- fraction: number;
- onInput: (e: Event) => void;
- min: number;
- max: number;
- step?: number;
- value?: string;
-}) {
- const f = () => {
- const v = props.fraction;
- return Number.isFinite(v) ? Math.max(0, Math.min(1, v)) : 0;
- };
- return (
- <div style="position:relative;height:16px;flex:1;min-width:0;">
- {/* track */}
- <div style="position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);height:4px;border-radius:999px;background:oklch(from var(--c0) l c h / 0.1);" />
- {/* filled portion — muted ink */}
- <div
- style={{
- position: 'absolute',
- left: '0',
- top: '50%',
- transform: 'translateY(-50%)',
- height: '4px',
- 'border-radius': '999px',
- background: 'oklch(from var(--c0) l c h / 0.25)',
- width: `${f() * 100}%`,
- }}
- />
- {/* thumb — ink */}
- <div
- style={{
- position: 'absolute',
- top: '50%',
- left: `${f() * 100}%`,
- transform: 'translate(-50%, -50%)',
- width: '16px',
- height: '16px',
- 'border-radius': '50%',
- 'background-color': 'var(--c0)',
- 'box-shadow': '0 1px 2px oklch(0 0 0 / 0.25)',
- }}
- />
- <input
- class="theme-editor-basic-slider"
- type="range"
- min={props.min}
- max={props.max}
- step={props.step ?? 0.001}
- value={props.value}
- onInput={props.onInput}
- style="appearance:none;-webkit-appearance:none;position:absolute;inset:0;width:100%;height:100%;margin:0;background:#0000;outline:none;cursor:pointer;"
- />
- </div>
- );
-}
-
-export function ThemeEditorBasic() {
- const a0 = themeReactive.a0;
-
- // Saturation is stored as a fraction of the accent's chroma; recover it so
- // accent-chroma edits keep the same tint ratio.
- const satFraction = () => {
- const denom = a0.c[0]() * 0.37 * 0.6;
- return denom ? themeReactive.b0.c[0]() / denom : 0;
- };
-
- const clamp = (n: number, min: number, max: number) =>
- Math.max(min, Math.min(max, n));
-
- const handleSaturationChange = (e: Event) =>
- setSaturation(
- clamp(parseFloat((e.target as HTMLInputElement).value), 0, 1)
- );
- const handleContrastChange = (e: Event) =>
- setContrast(
- clamp(parseFloat((e.target as HTMLInputElement).value), 0, 0.8)
- );
- const handleDepthChange = (e: Event) =>
- setThemeDepth(
- clamp(parseFloat((e.target as HTMLInputElement).value), 0, 0.4)
- );
-
- return (
- <>
- <style>{`
- .theme-editor-basic-slider::-webkit-slider-thumb {
- opacity: 0;
- }
- .theme-editor-basic-slider::-moz-range-thumb {
- opacity: 0;
- }
- .theme-editor-basic-num::-webkit-inner-spin-button,
- .theme-editor-basic-num::-webkit-outer-spin-button {
- -webkit-appearance: none;
- margin: 0;
- }
- .theme-editor-basic-num {
- -moz-appearance: textfield;
- }
- `}</style>
-
- <div
- style="
- font-family: var(--font-sans);
- padding: 10px 16px 12px 16px;
- background-color: var(--b0);
- box-sizing: border-box;
- height: min-content;
- font-weight: 500;
- font-size: 12px;
- "
- >
- <div class="flex flex-col divide-y divide-ink/[0.05]">
- <Control label="Accent">
- <AccentControl
- l={() => a0.l[0]()}
- c={() => a0.c[0]()}
- h={() => a0.h[0]()}
- onL={(n) => setLightness(n)}
- onC={(n) => setChroma(n, satFraction())}
- onH={(n) => setHue(n)}
- />
- </Control>
-
- <Control label="Tint">
- <BasicSlider
- fraction={satFraction()}
- value={satFraction().toString()}
- onInput={handleSaturationChange}
- min={0}
- max={1}
- />
- <NumberInput
- get={satFraction}
- set={setSaturation}
- min={0}
- max={1}
- />
- </Control>
-
- <Control label="Lightness">
- <BasicSlider
- fraction={getContrastFromY(themeReactive.b0.l[0]()) / 0.8}
- value={getContrastFromY(themeReactive.b0.l[0]()).toString()}
- onInput={handleContrastChange}
- min={0}
- max={0.8}
- />
- <NumberInput
- get={() => getContrastFromY(themeReactive.b0.l[0]())}
- set={setContrast}
- min={0}
- max={0.8}
- />
- </Control>
-
- <Control label="Contrast">
- <BasicSlider
- fraction={themeDepth() / 0.4}
- value={themeDepth().toString()}
- onInput={handleDepthChange}
- min={0}
- max={0.4}
- />
- <NumberInput
- get={themeDepth}
- set={setThemeDepth}
- min={0}
- max={0.4}
- />
- </Control>
- </div>
- </div>
- </>
- );
-}
diff --git a/apps/web/src/features/theme/components/ThemeList.tsx b/apps/web/src/features/theme/components/ThemeList.tsx
deleted file mode 100644
index 03500acf4e..0000000000
--- a/apps/web/src/features/theme/components/ThemeList.tsx
+++ /dev/null
@@ -1,74 +0,0 @@
-import { useAnalytics } from '@app/lib/analytics/analytics-context';
-import { cn } from '@ui';
-import { createMemo, For } from 'solid-js';
-import {
- currentThemeId,
- isThemeSaved,
- showDarkThemes,
- showLightThemes,
- themes,
-} from '../signals/themeSignals';
-import { applyTheme } from '../utils/themeUtils';
-import { ThemeChips } from './ThemeChips';
-import { ThemeCrud } from './ThemeCrud';
-
-function ThemeList() {
- const analytics = useAnalytics();
-
- const visibleThemes = createMemo(() =>
- themes().filter((theme) =>
- theme.mode === 'dark' ? showDarkThemes() : showLightThemes()
- )
- );
-
- return (
- <div class="@container p-2">
- <div class="grid grid-cols-1 gap-2 @md:grid-cols-2 @2xl:grid-cols-3">
- <For each={visibleThemes()}>
- {(theme) => {
- const selected = () =>
- theme.id === currentThemeId() && isThemeSaved();
- const select = () => {
- analytics.track('theme_changed', { themeId: theme.id });
- applyTheme(theme.id);
- };
- return (
- // role="button" (not <button>) because the card contains ThemeCrud's
- // own buttons, and nesting native buttons is invalid HTML.
- <div
- role="button"
- tabIndex={0}
- class={cn(
- 'flex min-w-0 cursor-pointer items-center gap-2 rounded-lg border bg-surface p-2 transition-colors duration-[var(--transition)]',
- selected()
- ? 'border-accent'
- : 'border-edge-muted hover:bg-hover'
- )}
- onClick={select}
- onKeyDown={(e) => {
- if (e.key === 'Enter' || e.key === ' ') {
- e.preventDefault();
- select();
- }
- }}
- >
- <ThemeChips theme={theme} />
- <span
- class={cn(
- 'min-w-0 flex-1 truncate text-sm',
- selected() ? 'text-accent' : 'text-ink'
- )}
- >
- {theme.name}
- </span>
- <ThemeCrud themeId={theme.id} />
- </div>
- );
- }}
- </For>
- </div>
- </div>
- );
-}
-
-export default ThemeList;
diff --git a/apps/web/src/features/theme/components/ThemeTools.tsx b/apps/web/src/features/theme/components/ThemeTools.tsx
deleted file mode 100644
index 66be528f15..0000000000
--- a/apps/web/src/features/theme/components/ThemeTools.tsx
+++ /dev/null
@@ -1,123 +0,0 @@
-import { isMobile } from '@core/mobile/isMobile';
-import IconSave from '@phosphor-icons/core/regular/floppy-disk-back.svg?component-solid';
-import IconShuffle from '@phosphor-icons/core/regular/shuffle.svg?component-solid';
-import { Button, cn } from '@ui';
-import { createMemo, Show } from 'solid-js';
-import { currentThemeId, isThemeSaved, themes } from '../signals/themeSignals';
-import { saveTheme, updateTheme } from '../utils/themeUtils';
-
-function ThemeTools(props: {
- class?: string;
- editingThemeId?: string;
- onRandomize?: () => void;
-}) {
- let themeName!: HTMLDivElement;
-
- const defaultThemeName = 'New Theme';
-
- const editingTheme = () =>
- props.editingThemeId
- ? themes().find((theme) => theme.id === props.editingThemeId)
- : undefined;
-
- const currentThemeName = createMemo(() => {
- // While editing a custom theme, keep its name (even with unsaved edits).
- const editing = editingTheme();
- if (editing) return editing.name;
- const theme = themes().find((theme) => theme.id === currentThemeId());
- if (isThemeSaved()) {
- return theme?.name;
- } else {
- return defaultThemeName;
- }
- });
-
- // Editing an existing custom theme writes back to it; otherwise save a new one.
- const commit = (rawName: string) => {
- const name = rawName.trim() || editingTheme()?.name || defaultThemeName;
- if (props.editingThemeId) {
- updateTheme(props.editingThemeId, name);
- } else {
- saveTheme(name);
- }
- };
-
- return (
- <div
- class={cn(
- 'flex items-center overflow-hidden w-full min-w-0',
- props.class
- )}
- style={{
- gap: '4.5px' /* (41 - 32) / 2 */,
- 'font-family': 'var(--font-sans)',
- 'scrollbar-width': 'none',
- 'font-size': '14px',
- height: '39.5px',
- }}
- >
- <div
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- e.preventDefault();
- const name = themeName.innerText.trim();
- if (name) {
- commit(name);
- themeName.blur();
- } else {
- themeName.innerText = currentThemeName() ?? defaultThemeName;
- }
- }
- }}
- onBlur={() => {
- if (!themeName.innerText.trim()) {
- themeName.innerText = currentThemeName() ?? defaultThemeName;
- }
- }}
- class={cn(
- 'rounded-lg py-1.5 px-2 border text-xs outline-none',
- 'bg-transparent text-ink-muted border-ink/[0.06]',
- 'hover:bg-surface hover:text-ink',
- 'focus:bg-surface focus:text-ink focus:border-accent',
- 'min-w-0 overflow-hidden text-ellipsis'
- )}
- style={{
- 'white-space': 'nowrap',
- // Narrower on mobile so it fits on the same line as the Basic/Advanced tabs.
- flex: isMobile() ? '0 1 7.5rem' : '0 1 13rem',
- 'min-width': '0',
- }}
- contentEditable={true}
- ref={themeName}
- >
- {currentThemeName()}
- </div>
-
- <Show when={props.onRandomize}>
- <Button
- onPointerDown={() => props.onRandomize?.()}
- label="Randomize theme"
- variant="ghost"
- size="icon-sm"
- >
- <IconShuffle />
- </Button>
- </Show>
-
- <Show when={!isThemeSaved()}>
- <Button
- onPointerDown={() => {
- commit(themeName.innerText);
- }}
- label={props.editingThemeId ? 'Save changes' : 'Save theme'}
- variant="ghost"
- size="icon-sm"
- >
- <IconSave />
- </Button>
- </Show>
- </div>
- );
-}
-
-export default ThemeTools;
diff --git a/apps/web/src/lib/animate/easings/back.ts b/apps/web/src/lib/animate/easings/back.ts
deleted file mode 100644
index 1e3b17a5cc..0000000000
--- a/apps/web/src/lib/animate/easings/back.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-import type { EasingFn, BackOptions } from '../types/types';
-
-export function backIn(opts: BackOptions = {}): EasingFn {
- const { overshoot = 1.70158 } = opts;
- return (t) => (overshoot + 1) * t * t * t - overshoot * t * t;
-}
-
-export function backOut(opts: BackOptions = {}): EasingFn {
- const { overshoot = 1.70158 } = opts;
- return (t) => 1 + (overshoot + 1) * Math.pow(t - 1, 3) + overshoot * Math.pow(t - 1, 2);
-}
-
-export function backInOut(opts: BackOptions = {}): EasingFn {
- const { overshoot = 1.70158 } = opts;
- const c2 = overshoot * 1.525;
- return (t) => t < 0.5
- ? (Math.pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2
- : (Math.pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2;
-}
diff --git a/apps/web/src/lib/animate/easings/bounce.ts b/apps/web/src/lib/animate/easings/bounce.ts
deleted file mode 100644
index 6e1cce0e97..0000000000
--- a/apps/web/src/lib/animate/easings/bounce.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import type { EasingFn } from '../types/types';
-
-export const bounceIn: EasingFn = (t) => 1 - bounceOut(1 - t);
-
-export const bounceOut: EasingFn = (t) => {
- if (t < 1 / 2.75) return 7.5625 * t * t;
- if (t < 2 / 2.75) {
- const t2 = t - 1.5 / 2.75;
- return 7.5625 * t2 * t2 + 0.75;
- }
- if (t < 2.5 / 2.75) {
- const t2 = t - 2.25 / 2.75;
- return 7.5625 * t2 * t2 + 0.9375;
- }
- const t2 = t - 2.625 / 2.75;
- return 7.5625 * t2 * t2 + 0.984375;
-};
-
-export const bounceInOut: EasingFn = (t) => t < 0.5
- ? (1 - bounceOut(1 - 2 * t)) / 2
- : (1 + bounceOut(2 * t - 1)) / 2;
diff --git a/apps/web/src/lib/animate/easings/cubic.ts b/apps/web/src/lib/animate/easings/cubic.ts
deleted file mode 100644
index 06d403d8f7..0000000000
--- a/apps/web/src/lib/animate/easings/cubic.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { EasingFn } from '../types/types';
-
-export const cubicIn: EasingFn = (t) => t * t * t;
-
-export const cubicOut: EasingFn = (t) => 1 - Math.pow(1 - t, 3);
-
-export const cubicInOut: EasingFn = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
diff --git a/apps/web/src/lib/animate/easings/elastic.ts b/apps/web/src/lib/animate/easings/elastic.ts
deleted file mode 100644
index ca97c21957..0000000000
--- a/apps/web/src/lib/animate/easings/elastic.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { EasingFn, ElasticOptions } from '../types/types';
-
-export function elasticIn(opts: ElasticOptions = {}): EasingFn {
- const { amplitude: _amp = 1, period = 0.3 } = opts;
- const amplitude = Math.max(1, _amp);
- return (t) => {
- if (t === 0 || t === 1) return t;
- return -(amplitude * Math.pow(2, 10 * (t - 1)) * Math.sin(((t - 1 - (period / (2 * Math.PI)) * Math.asin(1 / amplitude)) * (2 * Math.PI)) / period));
- };
-}
-
-export function elasticOut(opts: ElasticOptions = {}): EasingFn {
- const { amplitude: _amp = 1, period = 0.3 } = opts;
- const amplitude = Math.max(1, _amp);
- return (t) => {
- if (t === 0 || t === 1) return t;
- return amplitude * Math.pow(2, -10 * t) * Math.sin(((t - (period / (2 * Math.PI)) * Math.asin(1 / amplitude)) * (2 * Math.PI)) / period) + 1;
- };
-}
-
-export function elasticInOut(opts: ElasticOptions = {}): EasingFn {
- const { amplitude: _amp = 1, period = 0.45 } = opts;
- const amplitude = Math.max(1, _amp);
- return (t) => {
- if (t === 0 || t === 1) return t;
- if (t < 0.5) return -(amplitude * Math.pow(2, 20 * t - 10) * Math.sin(((20 * t - 10 - (period / (2 * Math.PI)) * Math.asin(1 / amplitude)) * (2 * Math.PI)) / period)) / 2;
- return (amplitude * Math.pow(2, -20 * t + 10) * Math.sin(((20 * t - 10 - (period / (2 * Math.PI)) * Math.asin(1 / amplitude)) * (2 * Math.PI)) / period)) / 2 + 1;
- };
-}
diff --git a/apps/web/src/lib/animate/easings/linear.ts b/apps/web/src/lib/animate/easings/linear.ts
deleted file mode 100644
index 4e063b2954..0000000000
--- a/apps/web/src/lib/animate/easings/linear.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import type { EasingFn } from '../types/types';
-
-export const linear: EasingFn = (t) => t;
diff --git a/apps/web/src/lib/animate/easings/quad.ts b/apps/web/src/lib/animate/easings/quad.ts
deleted file mode 100644
index f030f9005e..0000000000
--- a/apps/web/src/lib/animate/easings/quad.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { EasingFn } from '../types/types';
-
-export const quadIn: EasingFn = (t) => t * t;
-
-export const quadOut: EasingFn = (t) => 1 - (1 - t) * (1 - t);
-
-export const quadInOut: EasingFn = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
diff --git a/apps/web/src/lib/animate/easings/sine.ts b/apps/web/src/lib/animate/easings/sine.ts
deleted file mode 100644
index b22f4d554c..0000000000
--- a/apps/web/src/lib/animate/easings/sine.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import type { EasingFn } from '../types/types';
-
-export const sineIn: EasingFn = (t) => 1 - Math.cos((t * Math.PI) / 2);
-
-export const sineOut: EasingFn = (t) => Math.sin((t * Math.PI) / 2);
-
-export const sineInOut: EasingFn = (t) => -(Math.cos(Math.PI * t) - 1) / 2;
diff --git a/apps/web/src/lib/animate/index.ts b/apps/web/src/lib/animate/index.ts
deleted file mode 100644
index be022518cd..0000000000
--- a/apps/web/src/lib/animate/index.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export type {
- ProgressKeyframeProperty,
- PropertyKeyframeEntry,
- AnimationController,
- ProgressKeyframes,
- ProgressKeyframe,
- PropertySegment,
- ElasticOptions,
- PropertyTrack,
- BackOptions,
- PlayOptions,
- EasingFn,
- Timeline,
-} from './types/types';
-
-export { elasticIn, elasticOut, elasticInOut} from './easings/elastic';
-export { bounceIn, bounceOut, bounceInOut } from './easings/bounce';
-export { progressKeyframes } from './keyframes/progressKeyframes';
-export { cubicIn, cubicOut, cubicInOut } from './easings/cubic';
-export { targetKeyframes } from './keyframes/targetKeyframes';
-export { backIn, backOut, backInOut } from './easings/back';
-export { sineIn, sineOut, sineInOut } from './easings/sine';
-export { quadIn, quadOut, quadInOut} from './easings/quad';
-export { createTimeline } from './utils/timeline';
-export { controller } from './utils/controller';
-export { linear } from './easings/linear';
diff --git a/apps/web/src/lib/animate/keyframes/progressKeyframes.ts b/apps/web/src/lib/animate/keyframes/progressKeyframes.ts
deleted file mode 100644
index c48be56823..0000000000
--- a/apps/web/src/lib/animate/keyframes/progressKeyframes.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import type { PropertyTrack, PropertySegment, ProgressKeyframes, ProgressKeyframe, Timeline } from '../types/types';
-import { createTimeline } from '../utils/timeline';
-import { linear } from '../easings/linear';
-
-/*
- Progress-first keyframe format.
-
- Example:
-
- progressKeyframes({
- 0: [{ target: setScale, value: 1.0, easing: backOut }, { target: setX, value: 0, easing: elasticOut }],
- 0.25: [{ target: setScale, value: 0.6, easing: cubicOut }],
- 0.5: [{ target: setScale, value: 0.6, easing: backOut }, { target: setX, value: 100, easing: bounceOut }],
- 0.75: [{ target: setScale, value: 1.2, easing: cubicInOut }],
- 1: [{ target: setScale, value: 1.0 }, { target: setX, value: 0 }],
- })
-
- Compiles to PropertyTrack[]:
-
- [
- {
- target: setScale,
- segments: [
- { fromProgress: 0, toProgress: 0.25, fromValue: 1.0, toValue: 0.6, easing: backOut },
- { fromProgress: 0.25, toProgress: 0.5, fromValue: 0.6, toValue: 0.6, easing: cubicOut },
- { fromProgress: 0.5, toProgress: 0.75, fromValue: 0.6, toValue: 1.2, easing: backOut },
- { fromProgress: 0.75, toProgress: 1.0, fromValue: 1.2, toValue: 1.0, easing: cubicInOut },
- ]
- },
- {
- target: setX,
- segments: [
- { fromProgress: 0, toProgress: 0.5, fromValue: 0, toValue: 100, easing: elasticOut },
- { fromProgress: 0.5, toProgress: 1.0, fromValue: 100, toValue: 0, easing: bounceOut },
- ]
- },
- ]
-*/
-
-export function progressKeyframes(timeline: ProgressKeyframes): Timeline {
- const keyframesByProperty = new Map<(value: number) => void, ProgressKeyframe[]>();
-
- for (const [progressStr, frame] of Object.entries(timeline)) {
- const progress = Number(progressStr);
- for (const { target, value, easing } of frame) {
- let list = keyframesByProperty.get(target);
- if (!list) {
- list = [];
- keyframesByProperty.set(target, list);
- }
- list.push({ progress, value, easing });
- }
- }
-
- const tracks: PropertyTrack[] = [];
-
- for (const [target, keyframes] of keyframesByProperty) {
- keyframes.sort((a, b) => a.progress - b.progress);
-
- const first = keyframes[0];
- const last = keyframes[keyframes.length - 1];
- if (first.progress > 0) { keyframes.unshift({ progress: 0, value: first.value, easing: first.easing }); }
- if (last.progress < 1) { keyframes.push({ progress: 1, value: last.value }); }
-
- const segments: PropertySegment[] = [];
- for (let i = 0; i < keyframes.length - 1; i++) {
- const from = keyframes[i];
- const to = keyframes[i + 1];
- const range = to.progress - from.progress;
- segments.push({
- rangeInverse: range > 0 ? 1 / range : 0,
- valueDelta: to.value - from.value,
- easing: from.easing ?? linear,
- fromProgress: from.progress,
- toProgress: to.progress,
- fromValue: from.value,
- toValue: to.value,
- });
- }
-
- if (segments.length > 0) { tracks.push({ target, segments }); }
- }
-
- if (tracks.length === 0) { throw new Error('progressKeyframes: no valid keyframes provided'); }
- return createTimeline(tracks);
-}
diff --git a/apps/web/src/lib/animate/keyframes/targetKeyframes.ts b/apps/web/src/lib/animate/keyframes/targetKeyframes.ts
deleted file mode 100644
index fabccbee01..0000000000
--- a/apps/web/src/lib/animate/keyframes/targetKeyframes.ts
+++ /dev/null
@@ -1,90 +0,0 @@
-import type { PropertySegment, PropertyKeyframeEntry, Timeline } from '../types/types';
-import { createTimeline } from '../utils/timeline';
-import { linear } from '../easings/linear';
-
-/*
- Property-first keyframe format.
-
- Example:
-
- propertyKeyframes([
- { target: setScale, offset: [0, 0.25, 0.5, 0.75, 1.0], value: [1.0, 0.6, 0.6, 1.2, 1.0], easing: [backOut, cubicOut, backOut, cubicInOut] },
- { target: setX, offset: [0, 0.5, 1.0], value: [0, 100, 0], easing: [elasticOut, bounceOut] },
- ])
-
- Compiles to PropertyTrack[]:
-
- [
- {
- target: setScale,
- segments: [
- { fromProgress: 0, toProgress: 0.25, fromValue: 1.0, toValue: 0.6, easing: backOut },
- { fromProgress: 0.25, toProgress: 0.5, fromValue: 0.6, toValue: 0.6, easing: cubicOut },
- { fromProgress: 0.5, toProgress: 0.75, fromValue: 0.6, toValue: 1.2, easing: backOut },
- { fromProgress: 0.75, toProgress: 1.0, fromValue: 1.2, toValue: 1.0, easing: cubicInOut },
- ]
- },
- {
- target: setX,
- segments: [
- { fromProgress: 0, toProgress: 0.5, fromValue: 0, toValue: 100, easing: elasticOut },
- { fromProgress: 0.5, toProgress: 1.0, fromValue: 100, toValue: 0, easing: bounceOut },
- ]
- },
- ]
-*/
-
-export function targetKeyframes(entries: PropertyKeyframeEntry[]): Timeline {
- if (entries.length === 0) { throw new Error('propertyKeyframes: entries array cannot be empty'); }
-
- const tracks = [];
-
- for (const entry of entries) {
- const { target, offset, value, easing } = entry;
-
- if (offset.length === 0) { continue; }
-
- const easings = easing ? easing.slice() : undefined;
- const times = offset.slice();
- const vals = value.slice();
-
-
- const firstValue = vals[0];
- const lastValue = vals[vals.length - 1];
- const firstEasing = easings?.[0];
- const lastEasing = easings?.[easings.length - 1];
-
- if (times[0] > 0) {
- times.unshift(0);
- vals.unshift(firstValue);
- easings?.unshift(firstEasing);
- }
- if (times[times.length - 1] < 1) {
- times.push(1);
- vals.push(lastValue);
- easings?.push(lastEasing);
- }
-
- const segments: PropertySegment[] = [];
- for (let i = 0; i < times.length - 1; i++) {
- const fromProgress = times[i];
- const toProgress = times[i + 1];
- const fromValue = vals[i] ?? lastValue;
- const toValue = vals[i + 1] ?? lastValue;
- const r = toProgress - fromProgress;
- segments.push({
- easing: easings?.[i] ?? lastEasing ?? linear,
- rangeInverse: r > 0 ? 1 / r : 0,
- valueDelta: toValue - fromValue,
- fromProgress,
- toProgress,
- fromValue,
- toValue,
- });
- }
-
- tracks.push({ target, segments });
- }
-
- return createTimeline(tracks);
-}
diff --git a/apps/web/src/lib/animate/types/types.ts b/apps/web/src/lib/animate/types/types.ts
deleted file mode 100644
index 294d0db12b..0000000000
--- a/apps/web/src/lib/animate/types/types.ts
+++ /dev/null
@@ -1,76 +0,0 @@
-export type AnimationController = {
- onProgress(callback: (p: number) => void): AnimationController;
- onLoop(callback: (count: number) => void): AnimationController;
- onComplete(callback: () => void): AnimationController;
- onResume(callback: () => void): AnimationController;
- onPause(callback: () => void): AnimationController;
- duration(seconds: number): AnimationController;
- setSpeed(s: number): AnimationController;
- seek(p: number): AnimationController;
- pause(): AnimationController;
- loop(): AnimationController;
- play(): AnimationController;
- readonly isPlaying: boolean;
- readonly progress: number;
- readonly speed: number;
- destroy(): void;
-};
-
-export type EasingFn = (t: number) => number;
-
-export type ProgressKeyframes = {
- [at: number]: ProgressKeyframeProperty[];
-};
-
-export type ProgressKeyframeProperty = {
- target: (val: number) => void;
- easing?: EasingFn;
- value: number;
-};
-
-export type PropertyKeyframeEntry = {
- easing?: (EasingFn | undefined)[];
- target: (val: number) => void;
- offset: number[];
- value: number[];
-};
-
-export type ProgressKeyframe = {
- easing?: EasingFn;
- progress: number;
- value: number;
-};
-
-export type PropertyTrack = {
- target: (val: number) => void;
- segments: PropertySegment[];
-};
-
-export type PropertySegment = {
- rangeInverse: number;
- fromProgress: number;
- toProgress: number;
- valueDelta: number;
- fromValue: number;
- easing: EasingFn;
- toValue: number;
-};
-
-export type ElasticOptions = {
- amplitude?: number;
- period?: number;
-};
-
-export type PlayOptions = {
- duration: number;
- speed?: number;
- loop?: boolean;
-};
-
-export type BackOptions = {
- overshoot?: number;
-};
-
-export type Timeline = {
- render(p: number): void;
-};
diff --git a/apps/web/src/lib/animate/utils/controller.ts b/apps/web/src/lib/animate/utils/controller.ts
deleted file mode 100644
index 6912cf8c64..0000000000
--- a/apps/web/src/lib/animate/utils/controller.ts
+++ /dev/null
@@ -1,169 +0,0 @@
-import type { AnimationController, Timeline } from '../types/types';
-
-export function controller(input: Timeline | Timeline[]): AnimationController {
- const timelines = Array.isArray(input) ? input : [input];
- let _onProgress: ((p: number) => void) | null = null;
- let _onLoop: ((count: number) => void) | null = null;
- let _onComplete: (() => void) | null = null;
- let _onResume: (() => void) | null = null;
- let _onPause: (() => void) | null = null;
- let lastTimestamp: number | null = null;
- let rafId: number | null = null;
- let _isPlaying = false;
- let _loopCount = 0;
- let _duration = 1;
- let _progress = 0;
- let _loop = false;
- let _speed = 1;
-
- function onLoop(callback: (count: number) => void): AnimationController {
- _onLoop = callback;
- return ctrl;
- }
-
- function onProgress(callback: (p: number) => void): AnimationController {
- _onProgress = callback;
- return ctrl;
- }
-
- function onComplete(callback: () => void): AnimationController {
- _onComplete = callback;
- return ctrl;
- }
-
- function tick(timestamp: number) {
- if (!_isPlaying) {
- lastTimestamp = null;
- return;
- }
-
- if (lastTimestamp === null) {
- lastTimestamp = timestamp;
- rafId = requestAnimationFrame(tick);
- return;
- }
-
- const deltaMs = timestamp - lastTimestamp;
- lastTimestamp = timestamp;
- const deltaProgress = (deltaMs / 1000 / _duration) * _speed;
- let newProgress = _progress + deltaProgress;
-
- if (_loop) {
- if (newProgress > 1) {
- newProgress = newProgress % 1;
- _loopCount++;
- _onLoop?.(_loopCount);
- }
- if (newProgress < 0) {
- newProgress = 1 + (newProgress % 1);
- _loopCount++;
- _onLoop?.(_loopCount);
- }
- }
- else {
- if (newProgress >= 1) {
- renderAll(1);
- _isPlaying = false;
- lastTimestamp = null;
- _onComplete?.();
- return;
- }
- if (newProgress <= 0) {
- renderAll(0);
- _isPlaying = false;
- lastTimestamp = null;
- _onComplete?.();
- return;
- }
- }
-
- renderAll(newProgress);
- rafId = requestAnimationFrame(tick);
- }
-
- function onResume(callback: () => void): AnimationController {
- _onResume = callback;
- return ctrl;
- }
-
- function onPause(callback: () => void): AnimationController {
- _onPause = callback;
- return ctrl;
- }
-
- function renderAll(p: number) {
- _progress = p;
- for (const timeline of timelines) { timeline.render(p); }
- _onProgress?.(p);
- }
-
- function duration(seconds: number): AnimationController {
- _duration = seconds;
- return ctrl;
- }
-
- function setSpeed(s: number): AnimationController {
- _speed = s;
- return ctrl;
- }
-
- function seek(p: number): AnimationController {
- renderAll(p < 0 ? 0 : p > 1 ? 1 : p);
- return ctrl;
- }
-
- function pause(): AnimationController {
- _isPlaying = false;
- lastTimestamp = null;
- if (rafId !== null) {
- cancelAnimationFrame(rafId);
- rafId = null;
- }
- _onPause?.();
- return ctrl;
- }
-
- function play(): AnimationController {
- if (_isPlaying) return ctrl;
- _isPlaying = true;
- rafId = requestAnimationFrame(tick);
- _onResume?.();
- return ctrl;
- }
-
- function loop(): AnimationController {
- _loop = true;
- return ctrl;
- }
-
- function destroy(): void {
- pause();
- _onProgress = null;
- _onComplete = null;
- _onResume = null;
- _onPause = null;
- _onLoop = null;
- }
-
- renderAll(0);
-
- const ctrl: AnimationController = {
- get isPlaying() { return _isPlaying; },
- get progress() { return _progress; },
- get speed() { return _speed; },
- onProgress,
- onComplete,
- setSpeed,
- duration,
- onResume,
- destroy,
- onPause,
- onLoop,
- pause,
- loop,
- play,
- seek,
- };
-
- return ctrl;
-}
diff --git a/apps/web/src/lib/animate/utils/timeline.ts b/apps/web/src/lib/animate/utils/timeline.ts
deleted file mode 100644
index 0527ade561..0000000000
--- a/apps/web/src/lib/animate/utils/timeline.ts
+++ /dev/null
@@ -1,146 +0,0 @@
-import type { PropertyTrack, Timeline, EasingFn } from '../types/types';
-
-/*
- Given the example PropertyTrack[] produced by `progressKeyframes`:
-
- [
- {
- target: setScale,
- segments: [
- { fromProgress: 0, toProgress: 0.25, fromValue: 1.0, toValue: 0.6, valueDelta: -0.4, rangeInverse: 4, easing: backOut },
- { fromProgress: 0.25, toProgress: 0.5, fromValue: 0.6, toValue: 0.6, valueDelta: 0.0, rangeInverse: 4, easing: cubicOut },
- { fromProgress: 0.5, toProgress: 0.75, fromValue: 0.6, toValue: 1.2, valueDelta: 0.6, rangeInverse: 4, easing: backOut },
- { fromProgress: 0.75, toProgress: 1.0, fromValue: 1.2, toValue: 1.0, valueDelta: -0.2, rangeInverse: 4, easing: cubicInOut },
- ],
- },
- {
- target: setX,
- segments: [
- { fromProgress: 0, toProgress: 0.5, fromValue: 0, toValue: 100, valueDelta: 100, rangeInverse: 2, easing: elasticOut },
- { fromProgress: 0.5, toProgress: 1.0, fromValue: 100, toValue: 0, valueDelta: -100, rangeInverse: 2, easing: bounceOut },
- ],
- },
- ]
-
- ...createTimeline compiles into a struct-of-arrays layout, indexed by track:
-
- trackCount = 2
-
- setters = [ setScale, setX ]
- segmentLengths = [ 4, 2 ]
- lastIndices = [ 3, 1 ]
- cachedIndices = Uint32Array [ 0, 0 ] // mutated per render
-
- fromProgressArrays = [ Float32Array [0, 0.25, 0.5, 0.75], Float32Array [0, 0.5 ] ]
- toProgressArrays = [ Float32Array [0.25, 0.5, 0.75, 1.0 ], Float32Array [0.5, 1.0 ] ]
- fromValueArrays = [ Float32Array [1.0, 0.6, 0.6, 1.2 ], Float32Array [0, 100 ] ]
- valueDeltaArrays = [ Float32Array [-0.4, 0.0, 0.6, -0.2 ], Float32Array [100, -100 ] ]
- rangeInverseArrays = [ Float32Array [4, 4, 4, 4 ], Float32Array [2, 2 ] ]
- easingArrays = [ [backOut, cubicOut, backOut, cubicInOut], [elasticOut, bounceOut] ]
-
- Why: hot-path render() reads parallel typed arrays by index, avoiding object
- property lookups and pointer chasing. Segments per track are tiny (here 4 and 2),
- so the linear-scan branch (len <= 4) skips the binary search, and cachedIndices
- short-circuits the lookup entirely while progress stays inside the same segment.
-
- Example: render(0.6) on the setScale track
- cachedIndices[0] = 0 (stale) -> fromP=0, toP=0.25, not in cached
- linear scan from j=3 down: fromProgressArr[2]=0.5 <= 0.6 -> idx = 2
- cachedIndices[0] = 2
- localProgress = (0.6 - 0.5) * 4 = 0.4
- mappedProgress = backOut(0.4) ~ 0.9
- setScale(0.6 + 0.6 * 0.9) ~ setScale(1.14)
-*/
-
-export function createTimeline(tracks: PropertyTrack[]): Timeline {
- const trackCount = tracks.length;
-
- const rangeInverseArrays: Float32Array[] = new Array(trackCount);
- const fromProgressArrays: Float32Array[] = new Array(trackCount);
- const setters: ((v: number) => void)[] = new Array(trackCount);
- const toProgressArrays: Float32Array[] = new Array(trackCount);
- const valueDeltaArrays: Float32Array[] = new Array(trackCount);
- const fromValueArrays: Float32Array[] = new Array(trackCount);
- const easingArrays: EasingFn[][] = new Array(trackCount);
- const segmentLengths: number[] = new Array(trackCount);
- const lastIndices: number[] = new Array(trackCount);
- const cachedIndices = new Uint32Array(trackCount);
-
- for (let i = 0; i < trackCount; i++) {
- const { target, segments } = tracks[i];
- const len = segments.length;
- const fromProgress = new Float32Array(len);
- const toProgress = new Float32Array(len);
- const fromValue = new Float32Array(len);
- const rangeInverse = new Float32Array(len);
- const valueDelta = new Float32Array(len);
- const easings: EasingFn[] = new Array(len);
-
- for (let j = 0; j < len; j++) {
- const seg = segments[j];
- fromProgress[j] = seg.fromProgress;
- toProgress[j] = seg.toProgress;
- fromValue[j] = seg.fromValue;
- rangeInverse[j] = seg.rangeInverse;
- valueDelta[j] = seg.valueDelta;
- easings[j] = seg.easing;
- }
-
- fromProgressArrays[i] = fromProgress;
- toProgressArrays[i] = toProgress;
- rangeInverseArrays[i] = rangeInverse;
- valueDeltaArrays[i] = valueDelta;
- fromValueArrays[i] = fromValue;
- easingArrays[i] = easings;
- lastIndices[i] = len - 1;
- segmentLengths[i] = len;
- setters[i] = target;
- }
-
- function render(progress: number) {
- const p = progress < 0 ? 0 : progress > 1 ? 1 : progress;
-
- for (let i = 0; i < trackCount; i++) {
- const fromProgressArr = fromProgressArrays[i];
- const toProgressArr = toProgressArrays[i];
- const lastIdx = lastIndices[i];
-
- let idx = cachedIndices[i];
- let fromP = fromProgressArr[idx];
- let toP = toProgressArr[idx];
- const inCached = p >= fromP && (p < toP || (p === 1 && idx === lastIdx));
-
- if (!inCached) {
- const len = segmentLengths[i];
- if (len <= 4) {
- idx = 0;
- for (let j = lastIdx; j >= 0; j--) {
- if (fromProgressArr[j] <= p) {
- idx = j;
- break;
- }
- }
- }
- else {
- let hi = lastIdx;
- let lo = 0;
- while (lo < hi) {
- const mid = (lo + hi + 1) >>> 1;
- if (fromProgressArr[mid] <= p) lo = mid;
- else hi = mid - 1;
- }
- idx = lo;
- }
- cachedIndices[i] = idx;
- fromP = fromProgressArr[idx];
- }
-
- const localProgress = (p - fromP) * rangeInverseArrays[i][idx];
- const mappedProgress = easingArrays[i][idx](localProgress);
-
- setters[i](fromValueArrays[i][idx] + valueDeltaArrays[i][idx] * mappedProgress);
- }
- }
-
- return { render };
-}
diff --git a/apps/web/src/lib/core/component/Editable.tsx b/apps/web/src/lib/core/component/Editable.tsx
deleted file mode 100644
index 069e4fc67b..0000000000
--- a/apps/web/src/lib/core/component/Editable.tsx
+++ /dev/null
@@ -1,201 +0,0 @@
-import { cn } from '@ui';
-import {
- type ComponentProps,
- createContext,
- createSignal,
- type JSX,
- onMount,
- Show,
- splitProps,
- useContext,
-} from 'solid-js';
-import { type FileListSize, TEXT_SIZE_CLASSES } from './FileList/constants';
-
-export const EditingContext = createContext<
- ReturnType<typeof createSignal<boolean>>
->(createSignal(false));
-interface EditableLabelState {
- handleSubmitEdit?: (v: string) => void | Promise<void>;
- handleCancelEdit?: (e: Event) => void;
- inputClass?: string;
- labelText?: string;
- dynamicSizing?: boolean;
- placeholder?: string;
- allowEmpty?: boolean;
- size?: FileListSize;
-}
-
-type EditableLabelProps = ComponentProps<'input'> & EditableLabelState;
-
-function _EditableLabel(props: EditableLabelProps) {
- const [editableLabelProps, inputProps] = splitProps(props, [
- 'handleSubmitEdit',
- 'handleCancelEdit',
- 'inputClass',
- 'labelText',
- 'dynamicSizing',
- 'placeholder',
- 'allowEmpty',
- ]);
- let inputRef: undefined | HTMLInputElement;
- let spanRef: undefined | HTMLSpanElement;
- let isSubmitting = false;
-
- const updateInputWidth = () => {
- if (editableLabelProps.dynamicSizing && spanRef && inputRef) {
- spanRef.textContent = inputRef.value.replace(/ /g, '\u00A0');
- inputRef.style.width = `${spanRef!.offsetWidth + 4}px`;
- }
- };
-
- onMount(() => {
- setTimeout(() => {
- inputRef!.focus();
- inputRef!.select();
- updateInputWidth();
- }, 100);
- });
-
- const [_, setIsEditing] = useContext(EditingContext);
-
- const handleKeyPress = async (e: KeyboardEvent) => {
- if (e.key === 'Escape') {
- e.preventDefault();
- e.stopPropagation();
- isSubmitting = true;
- editableLabelProps.handleCancelEdit?.(e);
- setIsEditing(false);
- inputRef!.blur();
-
- setTimeout(() => {
- isSubmitting = false;
- }, 100);
- } else if (e.key === 'Enter') {
- e.preventDefault();
- e.stopPropagation();
-
- const trimmedValue = inputRef!.value.trim();
-
- if (trimmedValue.length === 0 && !editableLabelProps.allowEmpty) {
- isSubmitting = true;
- editableLabelProps.handleCancelEdit?.(e);
- setIsEditing(false);
- inputRef!.blur();
- setTimeout(() => {
- isSubmitting = false;
- }, 100);
- return;
- }
-
- if (editableLabelProps.labelText === inputRef!.value) {
- isSubmitting = true;
- editableLabelProps.handleCancelEdit?.(e);
- setIsEditing(false);
- inputRef!.blur();
- setTimeout(() => {
- isSubmitting = false;
- }, 100);
- return;
- }
-
- isSubmitting = true;
- await editableLabelProps.handleSubmitEdit?.(inputRef!.value);
- setIsEditing(false);
- inputRef!.blur();
-
- setTimeout(() => {
- isSubmitting = false;
- }, 100);
- }
- };
-
- const handleBlur = async (e: Event) => {
- if (isSubmitting) {
- return;
- }
-
- const trimmedValue = inputRef!.value.trim();
-
- if (editableLabelProps.labelText === inputRef!.value) {
- editableLabelProps.handleCancelEdit?.(e);
- setIsEditing(false);
- return;
- }
-
- if (trimmedValue.length === 0 && !editableLabelProps.allowEmpty) {
- editableLabelProps.handleCancelEdit?.(e);
- setIsEditing(false);
- return;
- }
-
- await editableLabelProps.handleSubmitEdit?.(inputRef!.value);
- setIsEditing(false);
- };
-
- const handleClick = (e: MouseEvent) => {
- e.preventDefault();
- e.stopPropagation();
- };
-
- const handleFocus = (e: FocusEvent) => {
- (e.target as HTMLInputElement).select();
- };
-
- const handleInput = (_e: InputEvent) => {
- updateInputWidth();
- };
-
- return (
- <>
- <input
- ref={inputRef}
- class={
- editableLabelProps.inputClass ??
- `w-full text-ink ${TEXT_SIZE_CLASSES[props.size ?? 'sm']} font-medium font-sans overflow-hidden border-0 select-all`
- }
- value={editableLabelProps.labelText}
- onBlur={handleBlur}
- onInput={handleInput}
- onFocus={handleFocus}
- onClick={handleClick}
- size={editableLabelProps.labelText?.length}
- onKeyDown={handleKeyPress}
- {...inputProps}
- placeholder={editableLabelProps.placeholder}
- autocomplete="off"
- spellcheck={false}
- />
-
- <Show when={editableLabelProps.dynamicSizing}>
- <span
- ref={spanRef}
- class={cn(
- 'text-ink text-sm font-medium font-sans',
- 'overflow-hidden border-0 min-w-12 max-w-42',
- 'absolute whitespace-pre invisible'
- )}
- style="top: 0; left: 0;"
- ></span>
- </Show>
- </>
- );
-}
-
-type EditableComponentProps = {
- editingComponent: JSX.Element;
- isEditing?: boolean;
-} & (
- | { component: JSX.Element; children?: never }
- | { component?: never; children: JSX.Element }
-);
-
-function _EditableProvider(props: EditableComponentProps) {
- const [isEditing, setIsEditing] = createSignal(props.isEditing ?? false);
- return (
- <EditingContext.Provider value={[isEditing, setIsEditing]}>
- <Show when={!isEditing()} fallback={props.editingComponent}>
- {props.children ?? props.component}
- </Show>
- </EditingContext.Provider>
- );
-}
diff --git a/apps/web/src/lib/core/component/Message.tsx b/apps/web/src/lib/core/component/Message.tsx
deleted file mode 100644
index 7c0d787b96..0000000000
--- a/apps/web/src/lib/core/component/Message.tsx
+++ /dev/null
@@ -1,461 +0,0 @@
-import { observedSize } from '@core/directive/observedSize';
-import { isTouchDevice } from '@core/mobile/isTouchDevice';
-import { type DateValue, formatDate } from '@core/util/date';
-import IconPlus from '@phosphor/plus.svg';
-import { Button, cn } from '@ui';
-import {
- type Accessor,
- type Component,
- createContext,
- createMemo,
- createSignal,
- type JSX,
- type Setter,
- Show,
- splitProps,
- useContext,
-} from 'solid-js';
-import {
- CustomEntityIcon,
- EntityIcon,
- type EntityWithValidIcon,
-} from './EntityIcon';
-import { UserIcon } from './UserIcon';
-
-false && observedSize;
-
-type MessageRootProps = {
- id?: string;
- focused: boolean;
- unfocusable?: boolean;
- senderId?: string;
- senderPhotoUrl?: string;
- customIcon?: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;
- customIconTargetType?: EntityWithValidIcon;
- isFirstMessage: boolean;
- isLastMessage: boolean;
- isConsecutive?: boolean;
- timestamp?: DateValue;
- hoverActions?: () => JSX.Element;
- shouldHover?: boolean;
- threadDepth?: number;
- hasThreadChildren?: boolean;
- isFirstInThread?: boolean;
- isLastInThread?: boolean;
- isDeleted?: boolean;
- isNewMessage?: boolean;
- isParentNewMessage?: boolean;
- shouldShowThreadAppendInput?: boolean;
- setThreadAppendMountTarget?: (el: HTMLElement) => void;
- onThreadAppend?: () => void;
- hideConnectors?: boolean;
- /**
- * When true, disables the default `bg-hover` background applied on hover.
- * Useful when a consumer applies its own hover/background styling to the
- * message wrapper and the core hover background would conflict.
- */
- disableHoverBackground?: boolean;
- children: JSX.Element;
- setMessageBodyRef?: Setter<HTMLDivElement | undefined>;
- isTarget?: boolean;
- /** When true, shows the rail and connector to the reply input below the last message */
- hasReplyInputBelow?: boolean;
-};
-
-type MessageContextValue = {
- focused: Accessor<boolean>;
- isFirstMessage: Accessor<boolean>;
- isLastMessage: Accessor<boolean>;
- isConsecutive: Accessor<boolean | undefined>;
- hoverActions: Accessor<JSX.Element | undefined>;
- threadDepth: Accessor<number | undefined>;
- isFirstInThread: Accessor<boolean | undefined>;
- isLastInThread: Accessor<boolean | undefined>;
- isDeleted: Accessor<boolean | undefined>;
- hover: Accessor<boolean>;
- setHover: Setter<boolean>;
-};
-
-const MessageContext = createContext<MessageContextValue>();
-function useMessageContext(): MessageContextValue {
- const ctx = useContext(MessageContext);
- if (!ctx) throw new Error('Message.* must be used within <Message>');
- return ctx;
-}
-
-/* TopBar */
-
-type MessageTopBarSimpleProps = {
- name: string;
- timestamp?: DateValue | null;
- tagLabel?: string;
- tagIcon?: Component<JSX.SvgSVGAttributes<SVGSVGElement>> | undefined;
-};
-
-type MessageTopBarChildrenProps = {
- children: JSX.Element;
-};
-
-type MessageTopBarProps = MessageTopBarSimpleProps | MessageTopBarChildrenProps;
-
-function isTopBarChildrenProps(
- props: MessageTopBarProps
-): props is MessageTopBarChildrenProps {
- return 'children' in props;
-}
-
-const TopBar: Component<MessageTopBarProps> = (props) => {
- const context = useMessageContext();
-
- if (isTopBarChildrenProps(props)) {
- return props.children;
- }
-
- const [local] = splitProps(props as MessageTopBarSimpleProps, [
- 'name',
- 'timestamp',
- 'tagLabel',
- 'tagIcon',
- ]);
- return (
- <Show when={!context.isConsecutive()}>
- <div class="font-mono flex flex-row items-center justify-between">
- {/* Name */}
- <div class="ph-no-capture shrink min-w-0 text-sm truncate text-ink-muted">
- {local.name}
- </div>
- {/* Tag */}
- <Show when={local.tagLabel}>
- <div class="inline-flex items-center ml-2 px-0.5 text-xs bg-edge text-ink border border-edge max-w-60 min-w-0">
- <div class="shrink-0 px-0.5">
- <Show when={local.tagIcon}>
- <CustomEntityIcon icon={local.tagIcon!} size="xs" />
- </Show>
- </div>
- <span class="truncate">{local.tagLabel}</span>
- </div>
- </Show>
- {/* Date - hidden when hovering since it shows above hover actions */}
- <Show when={local.timestamp && !context.hover()}>
- <div class="text-xs mobile:text-sm text-ink-muted min-w-0 shrink-2 truncate">
- {local.timestamp && formatDate(local.timestamp)}
- </div>
- </Show>
- </div>
- </Show>
- );
-};
-
-/* Body */
-
-type MessageBodyProps = {
- children: JSX.Element;
- isDeleted?: boolean;
-};
-
-const Body: Component<MessageBodyProps> = (props) => {
- return (
- <Show
- when={!props.isDeleted}
- fallback={
- <div class="text-xs text-ink-muted font-mono">Message Deleted</div>
- }
- >
- <div class="ph-no-capture text-sm text-ink pr-4">{props.children}</div>
- </Show>
- );
-};
-
-type NestedConnectorLinesProps = {
- threadDepth?: number;
- isParentNewMessage?: boolean;
-};
-
-const NestedConnectorLines: Component<NestedConnectorLinesProps> = (props) => {
- const NestedLines: JSX.Element[] = [];
- for (let i = 0; i < (props.threadDepth ?? 0); i++) {
- NestedLines.push(
- <div
- class="absolute h-full border-l-1"
- classList={{
- 'border-accent': props.isParentNewMessage,
- 'border-rail': !props.isParentNewMessage,
- }}
- style={{
- left: `calc(${i} * var(--thread-shift) + var(--left-of-connector))`,
- }}
- />
- );
- }
-
- return (
- <div class="absolute left-0 top-0 size-full z-user-highlight pointer-events-none">
- {NestedLines}
- </div>
- );
-};
-
-/* Root */
-
-const Root: Component<MessageRootProps> = (props) => {
- const [hover, setHover] = createSignal(false);
- const [replySize, setReplySize] = createSignal<DOMRect>();
- const ctx: MessageContextValue = {
- focused: () => props.focused,
- isFirstMessage: () => props.isFirstMessage,
- isLastMessage: () => props.isLastMessage,
- isConsecutive: () => props.isConsecutive,
- hoverActions: () => props.hoverActions?.(),
- threadDepth: () => props.threadDepth,
- isFirstInThread: () => props.isFirstInThread,
- isLastInThread: () => props.isLastInThread,
- isDeleted: () => props.isDeleted,
- hover,
- setHover,
- };
-
- const replyHeight = createMemo(() => {
- return replySize()?.height ?? 0;
- });
-
- return (
- <MessageContext.Provider value={ctx}>
- <div
- class="relative flex flex-row items-stretch w-full"
- classList={{
- 'bg-accent': props.isTarget,
- 'bg-active': props.focused,
- 'bg-hover': hover() && !props.disableHoverBackground,
- }}
- onMouseEnter={() => setHover(true)}
- onMouseLeave={() => setHover(false)}
- >
- <Show when={!props.hideConnectors}>
- <NestedConnectorLines
- threadDepth={props.threadDepth}
- isParentNewMessage={props.isParentNewMessage}
- />
- </Show>
- <div
- class="flex flex-row flex-1 min-w-0"
- style={{
- 'margin-bottom': props.isLastInThread //|| props.showReply?.()
- ? `${replyHeight()}px`
- : '0px',
- }}
- >
- {/* Message Wrapper w/ Main Connector Line */}
- <div
- class="w-full"
- style={{
- 'padding-left': `calc(${props.threadDepth ?? 0} * var(--thread-shift))`,
- }}
- onMouseEnter={() => setHover(true)}
- onMouseLeave={() => setHover(false)}
- tabIndex={props.isDeleted || props.unfocusable ? -1 : 0}
- ref={props.setMessageBodyRef}
- data-message-body-id={props.id}
- >
- <div
- class={cn(
- 'relative flex flex-col pl-[calc(var(--user-icon-width)/2+var(--message-padding-x))] ml-(--left-of-connector)',
- !props.hideConnectors &&
- (!props.isLastMessage || props.hasReplyInputBelow) &&
- 'border-l-1',
- props.isNewMessage ? 'border-accent' : 'border-rail',
- !(
- props.isConsecutive ||
- props.isFirstMessage ||
- props.isFirstInThread
- ) && 'pt-2',
- props.isLastMessage && !props.hasReplyInputBelow && 'pb-4',
- props.hasThreadChildren && 'pb-4'
- )}
- >
- {/* User Icon */}
- <div class="absolute left-0 -translate-x-1/2">
- <Show when={!props.isConsecutive}>
- <div class="relative">
- <Show when={props.isFirstInThread}>
- {/* Slanted Line Connector */}
- <div
- class={cn(
- 'absolute text-rail -z-1',
- props.isNewMessage && 'text-accent'
- )}
- style={{
- left: `calc((var(--thread-shift) - var(--left-of-connector) + var(--left-of-user-icon) + 1px) * -1)`,
- bottom:
- 'calc(var(--user-icon-width) / 2 - 0.0375 * var(--user-icon-width))',
- width: `calc(var(--thread-shift) - var(--left-of-connector) + var(--left-of-user-icon) + 3px)`,
- }}
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- fill="none"
- viewBox="0 0 24 18"
- width="100%"
- >
- <path
- stroke="currentColor"
- vector-effect="non-scaling-stroke"
- d="M23 17 4 6.0303C2.5 5.1643.5 4 .5.5"
- />
- </svg>
- </div>
- </Show>
- <Show
- when={props.customIcon || props.customIconTargetType}
- fallback={
- <div
- class="flex justify-center items-center"
- style={{
- width: `var(--user-icon-width)`,
- height: `var(--user-icon-width)`,
- }}
- >
- <UserIcon
- id={props.senderId ?? ''}
- photoUrl={props.senderPhotoUrl}
- isDeleted={false}
- size="fill"
- suppressClick={true}
- />
- </div>
- }
- >
- <div
- class="flex justify-center items-center"
- style={{
- width: `var(--user-icon-width)`,
- height: `var(--user-icon-width)`,
- }}
- >
- <EntityIcon
- targetType={props.customIconTargetType}
- size="fill"
- />
- </div>
- </Show>
- </div>
- </Show>
- </div>
- {/* Message Body */}
- {props.children}
- </div>
- </div>
- </div>
- <Show
- when={
- props.hoverActions &&
- !isTouchDevice() &&
- (hover() || !!props.shouldHover)
- }
- >
- <div
- class="absolute right-0 -top-4 flex flex-col items-end z-tool-tip"
- classList={{
- block: props.focused || !!props.shouldHover,
- hidden: !(props.focused || !!props.shouldHover),
- }}
- onMouseEnter={() => setHover(true)}
- onMouseLeave={() => setHover(false)}
- data-message-id={props.id}
- >
- <Show when={props.timestamp}>
- {(timestamp) => (
- <div class="absolute top-0 -translate-y-full bg-surface pl-2 pt-2 text-xs text-ink-muted font-mono mb-0.5 select-text cursor-default">
- {formatDate(timestamp(), {
- showTime: true,
- })}
- </div>
- )}
- </Show>
- <div class="border border-edge bg-surface">
- {props.hoverActions?.()}
- </div>
- </div>
- </Show>
- <Show when={props.isLastInThread}>
- <div
- class="absolute bottom-0 w-full"
- use:observedSize={{
- setSize: setReplySize,
- }}
- >
- <Show
- when={props.shouldShowThreadAppendInput}
- fallback={
- <div
- class="w-min -translate-x-1/2 icon-plus"
- style={{
- 'margin-left': `calc(var(--thread-shift) + var(--left-of-connector))`,
- }}
- onMouseEnter={() => setHover(false)}
- >
- <Button
- onClick={props.onThreadAppend}
- tabIndex={0}
- class="text-ink-muted flex flex-row justify-center items-center relative p-0 hover:bg-transparent active:border-transparent active:bg-transparent active:text-inherit hover:opacity-100"
- >
- <div class="border border-edge-muted bg-surface hover:bg-hover hover-transition-bg flex flex-row justify-center items-center mx-2 mb-2 size-(--user-icon-width) touch:min-h-(--user-icon-width) touch:min-w-(--user-icon-width)">
- <IconPlus class="size-1/2" />
- </div>
- </Button>
- </div>
- }
- >
- <div
- class="relative"
- classList={{
- 'pb-3': props.isLastInThread && props.isLastMessage,
- }}
- style={{
- 'margin-left': `calc(var(--left-of-connector) + var(--thread-shift) + var(--user-icon-width) / 2)`,
- }}
- onMouseEnter={() => setHover(false)}
- ref={(el) => props.setThreadAppendMountTarget?.(el)}
- >
- <div
- class="absolute border-l-1 border-rail"
- style={{
- left: `calc((var(--user-icon-width) / 2) * -1)`,
- height:
- 'calc(50% - (var(--user-icon-width) / 2 + 1px) / 24 * 18 + 1px)',
- }}
- />
-
- <div
- class="absolute text-rail -z-1"
- style={{
- left: `calc((var(--user-icon-width) / 2) * -1)`,
- bottom: '50%',
- width: `calc(var(--user-icon-width) / 2 + 1px)`,
- }}
- >
- <svg
- xmlns="http://www.w3.org/2000/svg"
- fill="none"
- viewBox="0 0 24 18"
- width="100%"
- >
- <path
- stroke="currentColor"
- vector-effect="non-scaling-stroke"
- d="M23 17 4 6.0303C2.5 5.1643.5 4 .5.5"
- />
- </svg>
- </div>
- </div>
- </Show>
- </div>
- </Show>
- </div>
- </MessageContext.Provider>
- );
-};
-
-export const Message = Object.assign(Root, {
- TopBar,
- Body,
-});
diff --git a/apps/web/src/lib/core/component/TailSpinner.tsx b/apps/web/src/lib/core/component/TailSpinner.tsx
deleted file mode 100644
index ae0ccd00c2..0000000000
--- a/apps/web/src/lib/core/component/TailSpinner.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright 2022 Leonard Kioi
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// https://github.com/lenniezelk/solid-spinner
-
-import type { Component, JSX } from 'solid-js';
-
-interface SpinnerProps extends JSX.SvgSVGAttributes<SVGSVGElement> {
- width?: string | number;
- height?: string | number;
- class?: string;
- style?: JSX.CSSProperties;
-}
-
-export const TailSpinner: Component<SpinnerProps> = (
- props: SpinnerProps
-): JSX.Element => {
- return (
- <svg
- viewBox="0 0 38 38"
- xmlns="http://www.w3.org/2000/svg"
- data-test-name="tail-spin"
- role="img"
- {...props}
- width={props.width || 38}
- height={props.height || 38}
- class={props.class || ''}
- >
- <defs>
- <linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
- <stop stop-color="currentColor" stop-opacity="0" offset="0%" />
- <stop
- stop-color="currentColor"
- stop-opacity=".631"
- offset="63.146%"
- />
- <stop stop-color="currentColor" offset="100%" />
- </linearGradient>
- </defs>
- <g fill="none" fill-rule="evenodd">
- <g transform="translate(1 1)">
- <path
- d="M36 18c0-9.94-8.06-18-18-18"
- id="Oval-2"
- stroke="url(#a)"
- stroke-width="2"
- >
- <animateTransform
- attributeName="transform"
- type="rotate"
- from="0 18 18"
- to="360 18 18"
- dur="0.9s"
- repeatCount="indefinite"
- />
- </path>
- <circle fill="currentColor" cx="36" cy="18" r="1">
- <animateTransform
- attributeName="transform"
- type="rotate"
- from="0 18 18"
- to="360 18 18"
- dur="0.9s"
- repeatCount="indefinite"
- />
- </circle>
- </g>
- </g>
- </svg>
- );
-};
diff --git a/apps/web/src/lib/core/index.ts b/apps/web/src/lib/core/index.ts
deleted file mode 100644
index ff8b4c5632..0000000000
--- a/apps/web/src/lib/core/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export default {};
diff --git a/apps/web/src/lib/core/internal/main.tsx b/apps/web/src/lib/core/internal/main.tsx
deleted file mode 100644
index e092d8b66c..0000000000
--- a/apps/web/src/lib/core/internal/main.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-/* @refresh reload */
-import { render } from 'solid-js/web';
-
-import './index.css';
-import App from './App';
-
-const root = document.getElementById('root');
-
-if (import.meta.env.DEV && root instanceof HTMLElement) {
- render(() => <App />, root);
-}
diff --git a/apps/web/src/lib/core/util/frameThrottle.ts b/apps/web/src/lib/core/util/frameThrottle.ts
deleted file mode 100644
index 61abe97c49..0000000000
--- a/apps/web/src/lib/core/util/frameThrottle.ts
+++ /dev/null
@@ -1,30 +0,0 @@
-export const frameThrottle = <T extends (...args: any) => any>(
- callback: T
-): ((...args: Parameters<T>) => void) & { cancel(): void } => {
- let requestId: number | undefined;
-
- let lastArgs: any[];
-
- const later = (context: any) => () => {
- requestId = undefined;
- callback.apply(context, lastArgs);
- };
-
- const throttled = function (
- this: ThisParameterType<T>,
- ...args: Parameters<T>
- ) {
- lastArgs = args;
- if (requestId == null) {
- requestId = requestAnimationFrame(later(this));
- }
- };
-
- throttled.cancel = () => {
- if (!requestId) return;
- cancelAnimationFrame(requestId);
- requestId = undefined;
- };
-
- return throttled;
-};
diff --git a/apps/web/src/lib/core/util/isElementVisibleInViewport.ts b/apps/web/src/lib/core/util/isElementVisibleInViewport.ts
deleted file mode 100644
index 5e5ab79838..0000000000
--- a/apps/web/src/lib/core/util/isElementVisibleInViewport.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-function matchScroll(str: string) {
- return str.match(/auto|scroll/);
-}
-
-const getScrollElementParent = (el: HTMLElement | null) => {
- if (!el) {
- return null;
- }
-
- const style = getComputedStyle(el);
-
- const hasScrollableOverflow =
- matchScroll(style.overflow) ||
- matchScroll(style.overflowY) ||
- matchScroll(style.overflowX);
-
- if (hasScrollableOverflow && el.clientHeight !== el.scrollHeight) {
- return el;
- }
-
- return getScrollElementParent(el.parentElement);
-};
-
-export function isElementVisibleInViewport(
- el: HTMLElement,
- options: {
- padding?: {
- top?: number;
- right?: number;
- bottom?: number;
- left?: number;
- };
- } = {}
-): boolean {
- const top = options.padding?.top ?? 0;
- const right = options.padding?.right ?? 0;
- const bottom = options.padding?.bottom ?? 0;
- const left = options.padding?.left ?? 0;
-
- const rect = el.getBoundingClientRect();
-
- const visibleWidth =
- Math.min(rect.right, window.innerWidth - right) - Math.max(rect.left, left);
-
- const visibleHeight =
- Math.min(rect.bottom, window.innerHeight - bottom) -
- Math.max(rect.top, top);
-
- return visibleWidth >= 0 && visibleHeight >= 0;
-}
-export function isElementVisibleInScrollElViewport(
- el: HTMLElement,
- options: {
- padding?: {
- top?: number;
- right?: number;
- bottom?: number;
- left?: number;
- };
- } = {}
-) {
- const top = options.padding?.top ?? 0;
- const right = options.padding?.right ?? 0;
- const bottom = options.padding?.bottom ?? 0;
- const left = options.padding?.left ?? 0;
-
- const rect = el.getBoundingClientRect();
- const scrollEl = getScrollElementParent(el);
- if (scrollEl === el) {
- return {
- visibleHeight: 0,
- visibleWidth: 0,
- isHeightClipped: false,
- isWidthClipped: false,
- height: rect.height,
- width: rect.width,
- scrollElRect: null,
- isVisible: true,
- };
- }
-
- if (!scrollEl) {
- return {
- visibleHeight: 0,
- visibleWidth: 0,
- isHeightClipped: false,
- isWidthClipped: false,
- height: rect.height,
- width: rect.width,
- scrollElRect: null,
- isVisible: true,
- };
- }
-
- const scrollElRect = scrollEl?.getBoundingClientRect();
-
- const visibleWidth =
- Math.min(rect.right - scrollElRect.left, scrollElRect.width - right) -
- Math.max(rect.left - scrollElRect.left, left);
-
- const visibleHeight =
- Math.min(rect.bottom - scrollElRect.top, scrollElRect.height - bottom) -
- Math.max(rect.top - scrollElRect.top, top);
-
- return {
- isHeightClipped: visibleHeight < rect.height,
- isWidthClipped: visibleWidth < rect.height,
- visibleHeight,
- visibleWidth,
- height: rect.height,
- width: rect.width,
- scrollElRect,
- isVisible: visibleWidth >= 0 && visibleHeight >= 0,
- };
-}
diff --git a/apps/web/src/lib/core/util/zod.ts b/apps/web/src/lib/core/util/zod.ts
deleted file mode 100644
index d5fd32ef16..0000000000
--- a/apps/web/src/lib/core/util/zod.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { z } from 'zod';
-
-const datelike = z.union([z.number(), z.string(), z.date()]);
-/** Safely coerces a date-like value to a Date object. */
-const _toZodDate = datelike.pipe(z.coerce.date());
-
-/** Safely coerces a number-like value to a number. */
-const _toZodNumber = z.number().or(z.string()).pipe(z.coerce.number());
-
-/** Safely coerces a number-like set to Set<number>. */
-export const toZodNumberSet = z
- .union([z.set(z.number()), z.array(z.number())])
- .transform((data) => (data instanceof Set ? data : new Set(data)));
diff --git a/apps/web/src/lib/queries/ai/createAIObject.ts b/apps/web/src/lib/queries/ai/createAIObject.ts
deleted file mode 100644
index 87b1ed029d..0000000000
--- a/apps/web/src/lib/queries/ai/createAIObject.ts
+++ /dev/null
@@ -1,322 +0,0 @@
-import { dcsCompletion } from '@service-cognition/client';
-import {
- type SolidMutationOptions,
- type UseMutationResult,
- useMutation,
-} from '@tanstack/solid-query';
-import type OpenAI from 'openai';
-import { z } from 'zod';
-
-type ChatMessage = OpenAI.ChatCompletionMessageParam;
-type ChatModel = OpenAI.ChatModel | (string & {});
-type JsonObject = Record<string, unknown>;
-
-export type AIObjectSchemaViolation = {
- path: string;
- message: string;
-};
-
-export class AIObjectSchemaError extends Error {
- constructor(public readonly violations: readonly AIObjectSchemaViolation[]) {
- super(
- [
- 'Zod schema is not compatible with OpenAI strict structured outputs.',
- ...violations.map((violation) => `- ${violation.message}`),
- ].join('\n')
- );
- this.name = 'AIObjectSchemaError';
- }
-}
-
-export class AIObjectParseError extends Error {
- constructor(
- public readonly content: string,
- public readonly parseError: unknown
- ) {
- super('AI object completion returned invalid JSON');
- this.name = 'AIObjectParseError';
- }
-}
-
-export class AIObjectValidationError<T> extends Error {
- constructor(public readonly zodError: z.ZodError<T>) {
- super(zodError.message);
- this.name = 'AIObjectValidationError';
- }
-}
-
-export type CreateAIObjectOptions<
- Schema extends z.ZodType,
- Variables = string,
- OnMutateResult = unknown,
-> = Omit<
- SolidMutationOptions<z.infer<Schema>, Error, Variables, OnMutateResult>,
- 'mutationFn'
-> & {
- /**
- * Zod v4 schema used for OpenAI structured outputs and final validation.
- *
- * OpenAI `strict: true` requires every object property to be required. Use
- * `.nullable()` for values the model may omit semantically; `.optional()` is
- * rejected before sending the request.
- */
- schema: Schema;
- /** Name sent to OpenAI for the json_schema response format. */
- schemaName?: string;
- /** Model for the DCS `/chat/completions` proxy. */
- model?: ChatModel;
- /** Optional system message prepended to generated messages. */
- system?: string;
- /** Static prompt or prompt factory. Defaults to the submitted variables. */
- prompt?: string | ((variables: Variables) => string);
- /** Static messages or message factory. Overrides `system` and `prompt`. */
- messages?: ChatMessage[] | ((variables: Variables) => ChatMessage[]);
- temperature?: number;
- maxTokens?: number;
-};
-
-export type CreateAIObjectResult<
- Schema extends z.ZodType,
- Variables = string,
- OnMutateResult = unknown,
-> = UseMutationResult<z.infer<Schema>, Error, Variables, OnMutateResult>;
-
-function defaultSchemaName(schema: z.ZodType): string {
- return (
- schema.description
- ?.toLowerCase()
- .replace(/[^a-z0-9]+/g, '_')
- .replace(/^_+|_+$/g, '') || 'ai_object'
- );
-}
-
-function isJsonObject(value: unknown): value is JsonObject {
- return typeof value === 'object' && value !== null && !Array.isArray(value);
-}
-
-function formatJsonPath(path: readonly string[]): string {
- if (path.length === 0) {
- return '$';
- }
-
- return `$${path.map((part) => `.${part}`).join('')}`;
-}
-
-function collectStrictSchemaViolations(
- schema: unknown,
- path: readonly string[] = []
-): AIObjectSchemaViolation[] {
- if (!isJsonObject(schema)) {
- return [];
- }
-
- const violations: AIObjectSchemaViolation[] = [];
- const properties = schema.properties;
- const type = schema.type;
- const isObjectSchema =
- type === 'object' || (Array.isArray(type) && type.includes('object'));
-
- if (isObjectSchema) {
- if (schema.additionalProperties !== false) {
- violations.push({
- path: formatJsonPath(path),
- message: `${formatJsonPath(path)} must set additionalProperties: false.`,
- });
- }
-
- if (isJsonObject(properties)) {
- const required = schema.required;
- const requiredProperties = new Set(
- Array.isArray(required)
- ? required.filter(
- (property): property is string => typeof property === 'string'
- )
- : []
- );
-
- for (const property of Object.keys(properties)) {
- if (!requiredProperties.has(property)) {
- violations.push({
- path: formatJsonPath([...path, property]),
- message: `${formatJsonPath([
- ...path,
- property,
- ])} is optional. OpenAI strict structured outputs require every object property to be required; use .nullable() instead of .optional().`,
- });
- }
- }
- }
- }
-
- if (isJsonObject(properties)) {
- for (const [property, propertySchema] of Object.entries(properties)) {
- violations.push(
- ...collectStrictSchemaViolations(propertySchema, [...path, property])
- );
- }
- }
-
- const items = schema.items;
- if (isJsonObject(items)) {
- violations.push(...collectStrictSchemaViolations(items, [...path, '[]']));
- } else if (Array.isArray(items)) {
- for (const [index, item] of items.entries()) {
- violations.push(
- ...collectStrictSchemaViolations(item, [...path, `[${index}]`])
- );
- }
- }
-
- for (const key of ['anyOf', 'oneOf', 'allOf'] as const) {
- const schemas = schema[key];
- if (!Array.isArray(schemas)) {
- continue;
- }
-
- for (const childSchema of schemas) {
- violations.push(...collectStrictSchemaViolations(childSchema, path));
- }
- }
-
- for (const key of ['$defs', 'definitions'] as const) {
- const definitions = schema[key];
- if (!isJsonObject(definitions)) {
- continue;
- }
-
- for (const [name, definition] of Object.entries(definitions)) {
- violations.push(
- ...collectStrictSchemaViolations(definition, [...path, key, name])
- );
- }
- }
-
- return violations;
-}
-
-function toJsonSchema(schema: z.ZodType) {
- const jsonSchema = z.toJSONSchema(schema, {
- target: 'draft-07',
- unrepresentable: 'throw',
- cycles: 'throw',
- reused: 'inline',
- });
-
- const violations = collectStrictSchemaViolations(jsonSchema);
- if (violations.length > 0) {
- throw new AIObjectSchemaError(violations);
- }
-
- return jsonSchema;
-}
-
-function stringifyVariables(variables: unknown): string {
- return typeof variables === 'string' ? variables : JSON.stringify(variables);
-}
-
-function buildMessages<Schema extends z.ZodType, Variables, OnMutateResult>(
- options: CreateAIObjectOptions<Schema, Variables, OnMutateResult>,
- variables: Variables
-): ChatMessage[] {
- if (typeof options.messages === 'function') {
- return options.messages(variables);
- }
-
- if (options.messages) {
- return options.messages;
- }
-
- const prompt =
- typeof options.prompt === 'function'
- ? options.prompt(variables)
- : (options.prompt ?? stringifyVariables(variables));
-
- const messages: ChatMessage[] = [];
- if (options.system) {
- messages.push({ role: 'system', content: options.system });
- }
- messages.push({ role: 'user', content: prompt });
- return messages;
-}
-
-async function generateAIObject<
- Schema extends z.ZodType,
- Variables,
- OnMutateResult,
->(
- options: CreateAIObjectOptions<Schema, Variables, OnMutateResult>,
- variables: Variables
-): Promise<z.infer<Schema>> {
- const response = await dcsCompletion({
- model: options.model ?? 'gpt-4o-mini',
- messages: buildMessages(options, variables),
- ...(options.temperature === undefined
- ? {}
- : { temperature: options.temperature }),
- ...(options.maxTokens === undefined
- ? {}
- : { max_tokens: options.maxTokens }),
- response_format: {
- type: 'json_schema',
- json_schema: {
- name: options.schemaName ?? defaultSchemaName(options.schema),
- strict: true,
- schema: toJsonSchema(options.schema),
- },
- },
- });
-
- if (response.isErr()) {
- throw new Error(response.error.map((error) => error.message).join(', '));
- }
-
- const content = response.value.choices[0]?.message?.content;
- if (!content) {
- throw new Error('AI object completion returned no content');
- }
-
- let parsedJson: unknown;
- try {
- parsedJson = JSON.parse(content);
- } catch (error) {
- throw new AIObjectParseError(content, error);
- }
-
- const parsedObject = options.schema.safeParse(parsedJson);
- if (!parsedObject.success) {
- throw new AIObjectValidationError(parsedObject.error);
- }
-
- return parsedObject.data;
-}
-
-/**
- * TanStack mutation for DCS structured object generation.
- *
- * This behaves like `useMutation`: pass standard mutation options (`onSuccess`,
- * `onError`, `onSettled`, `retry`, etc.) and call `mutate` or `mutateAsync`.
- *
- * @example
- * ```tsx
- * const mutation = createAIObject({
- * schema: z.object({ title: z.string() }),
- * prompt: (text: string) => `Generate a title for: ${text}`,
- * onSuccess: (object) => console.log(object.title),
- * });
- *
- * mutation.mutate('Quarterly planning notes');
- * mutation.data?.title;
- * ```
- */
-export function createAIObject<
- Schema extends z.ZodType,
- Variables = string,
- OnMutateResult = unknown,
->(
- options: CreateAIObjectOptions<Schema, Variables, OnMutateResult>
-): CreateAIObjectResult<Schema, Variables, OnMutateResult> {
- return useMutation<z.infer<Schema>, Error, Variables, OnMutateResult>(() => ({
- ...options,
- mutationFn: async (variables) => await generateAIObject(options, variables),
- }));
-}
diff --git a/apps/web/src/lib/queries/team/index.ts b/apps/web/src/lib/queries/team/index.ts
deleted file mode 100644
index cde91bf9c3..0000000000
--- a/apps/web/src/lib/queries/team/index.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export {} from './invitations';
-export {} from './invites';
-
-export {
- invalidateUserTeams,
- useTeamQuery,
- useUserTeamsQuery,
-} from './teams';
diff --git a/bun.lock b/bun.lock
index f42abea8a3..43353dc0c0 100644
--- a/bun.lock
+++ b/bun.lock
@@ -46,17 +46,14 @@
"@lexical/utils": "0.45.0",
"@livekit/krisp-noise-filter": "^0.4.1",
"@livekit/track-processors": "^0.7.2",
- "@loro-mirror/core": "workspace:*",
"@lukemorales/query-key-factory": "^1.3.4",
"@macro-inc/collaboration": "workspace:*",
"@macro-inc/lexical-core": "workspace:*",
"@macro-inc/observability": "workspace:*",
"@normy/query-core": "^0.21.0",
- "@opentelemetry/api": "^1.9.1",
"@phosphor-icons/core": "^2.1.1",
"@pierre/diffs": "^1.3.5",
"@solid-primitives/context": "^0.3.2",
- "@solid-primitives/event-bus": "^1.1.2",
"@solid-primitives/keyed": "^1.5.3",
"@solid-primitives/lifecycle": "^0.1.2",
"@solid-primitives/memo": "^1.4.5",
@@ -106,7 +103,6 @@
"pdfjs-dist": "github:macro-inc/pdf.js#v2.16.52-web",
"posthog-js": "^1.387.0",
"quill": "^2.0.3",
- "shiki": "^4.4.3",
"short-uuid": "^5.2.0",
"signature_pad": "^5.0.10",
"solid-custom-scrollbars": "^0.1.7",
@@ -118,7 +114,6 @@
"tabbable": "^6.2.0",
"tailwind-merge": "^3.4.0",
"tailwindcss": "^4.2.4",
- "tauri-plugin-device-info-api": "^1.0.1",
"tauri-plugin-safe-area-insets": "^0.1.0",
"ts-pattern": "^5.9.0",
"unicode-emoji-json": "^0.8.0",
@@ -2986,7 +2981,7 @@
"shell-quote": ["[email protected]", "", {}, "sha512-Iov+JwFv/2HcTpcwNMKd8+IWNb8tboQJNQTkAY/LLVK7gGH9jy+LGkVqPxfekHl+yMmiqXszdGWXgkfml7hjqA=="],
- "shiki": ["[email protected]", "", { "dependencies": { "@shikijs/core": "4.4.3", "@shikijs/engine-javascript": "4.4.3", "@shikijs/engine-oniguruma": "4.4.3", "@shikijs/langs": "4.4.3", "@shikijs/themes": "4.4.3", "@shikijs/types": "4.4.3", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-Mb/GvXPHBAXdgGIcnfU5L3ldpn1XcxrGkPHwqgRx17/I2XRfqlFKk2vGkHWINn1kdXvzJZeuO3is6I9KLPFm0g=="],
+ "shiki": ["[email protected]", "", { "dependencies": { "jsonc-parser": "^3.0.0", "vscode-oniguruma": "^1.6.1", "vscode-textmate": "5.2.0" } }, "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng=="],
"short-uuid": ["[email protected]", "", { "dependencies": { "any-base": "^1.1.0", "uuid": "^9.0.1" } }, "sha512-296/Nzi4DmANh93iYBwT4NoYRJuHnKEzefrkSagQbTH/A6NTaB68hSPDjm5IlbI5dx9FXdmtqPcj6N5H+CPm6w=="],
@@ -3142,8 +3137,6 @@
"tapable": ["[email protected]", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="],
- "tauri-plugin-device-info-api": ["[email protected]", "", { "dependencies": { "@tauri-apps/api": "^2.0.0" } }, "sha512-d2QoatWeQ6X09fdEDdWSKzBVSZv9x8LpksJP/gfv4WeRmZwJRsLLMf1++qOw7PdOmQlNoKHFcKXPZlr2n4irdg=="],
-
"tauri-plugin-safe-area-insets": ["[email protected]", "", { "dependencies": { "@tauri-apps/api": ">=2.0.0-beta.6" } }, "sha512-NhtxSQdU7+laTJiO4WZFlTB1CBzRlNE5EuHflGAGXS55fiwOkkaWztfNishFQO+eZtb9i5jLHX3Yho48lnqcRQ=="],
"teeny-request": ["[email protected]", "", { "dependencies": { "http-proxy-agent": "^5.0.0", "https-proxy-agent": "^5.0.0", "node-fetch": "^2.6.9", "stream-events": "^1.0.5", "uuid": "^9.0.0" } }, "sha512-resvxdc6Mgb7YEThw6G6bExlXKkv6+YbuzGg9xuXxSgxJF7Ozs+o8Y9+2R3sArdWdW8nOokoQb1yrpFB0pQK2g=="],
@@ -3506,6 +3499,10 @@
"@orval/query/chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
+ "@pierre/diffs/shiki": ["[email protected]", "", { "dependencies": { "@shikijs/core": "4.4.3", "@shikijs/engine-javascript": "4.4.3", "@shikijs/engine-oniguruma": "4.4.3", "@shikijs/langs": "4.4.3", "@shikijs/themes": "4.4.3", "@shikijs/types": "4.4.3", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-Mb/GvXPHBAXdgGIcnfU5L3ldpn1XcxrGkPHwqgRx17/I2XRfqlFKk2vGkHWINn1kdXvzJZeuO3is6I9KLPFm0g=="],
+
+ "@pierre/theming/shiki": ["[email protected]", "", { "dependencies": { "@shikijs/core": "4.4.3", "@shikijs/engine-javascript": "4.4.3", "@shikijs/engine-oniguruma": "4.4.3", "@shikijs/langs": "4.4.3", "@shikijs/themes": "4.4.3", "@shikijs/types": "4.4.3", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.5" } }, "sha512-Mb/GvXPHBAXdgGIcnfU5L3ldpn1XcxrGkPHwqgRx17/I2XRfqlFKk2vGkHWINn1kdXvzJZeuO3is6I9KLPFm0g=="],
+
"@poppinss/dumper/supports-color": ["[email protected]", "", {}, "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g=="],
"@smithy/property-provider/@smithy/types": ["@smithy/[email protected]", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-QwYgloJ0sVNBeBuBs65cIkTbfzV/Q6ZNPCJ99EICFEdJYG50nGIY/uYXp+TbsdJReIuPr0a0kXmCvren3MbRRw=="],
@@ -3762,8 +3759,6 @@
"tsx/esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="],
- "typedoc/shiki": ["[email protected]", "", { "dependencies": { "jsonc-parser": "^3.0.0", "vscode-oniguruma": "^1.6.1", "vscode-textmate": "5.2.0" } }, "sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng=="],
-
"typedoc-plugin-coverage/typedoc": ["[email protected]", "", { "dependencies": { "@gerrit0/mini-shiki": "^3.23.0", "lunr": "^2.3.9", "markdown-it": "^14.3.0", "minimatch": "^10.2.5", "yaml": "^2.9.0" }, "peerDependencies": { "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x || 6.0.x" }, "bin": { "typedoc": "bin/typedoc" } }, "sha512-uSKqkh8Cr48vllnEy+jdaAgOeR6Y+QCBW7usgUsKj7gJEfR7stw9U/fE49LBnj2tPRKPY0c0EBJSWe9Appmplg=="],
"typedoc-plugin-markdown/typedoc": ["[email protected]", "", { "dependencies": { "@gerrit0/mini-shiki": "^3.23.0", "lunr": "^2.3.9", "markdown-it": "^14.3.0", "minimatch": "^10.2.5", "yaml": "^2.9.0" }, "peerDependencies": { "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x || 6.0.x" }, "bin": { "typedoc": "bin/typedoc" } }, "sha512-uSKqkh8Cr48vllnEy+jdaAgOeR6Y+QCBW7usgUsKj7gJEfR7stw9U/fE49LBnj2tPRKPY0c0EBJSWe9Appmplg=="],
diff --git a/nix-support/node_modules-hashes.json b/nix-support/node_modules-hashes.json
index 27772b187a..99f8cc129f 100644
--- a/nix-support/node_modules-hashes.json
+++ b/nix-support/node_modules-hashes.json
@@ -1,6 +1,6 @@
{
"nodeModules": {
- "aarch64-darwin": "sha256-ms6ZphoQP1awt+QzGmjUXNUFoWzYQCqB1Iytden6X0o=",
- "x86_64-linux": "sha256-//19aldyGPEDNVGH5ZAmnuWC7R4znCni5A1wYqMdiT8="
+ "aarch64-darwin": "sha256-iPpZ7oaorFe423fnfFl7t0WhJYlAXU9w7tU2D/kAUPk=",
+ "x86_64-linux": "sha256-sHJyjMTBdvttX2Yu5BaxbPjyNaB5/+uhOdQZ21uNTbM="
}
}