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.

fix(ui): cleanup (#2868)

Fake-User097a4771501a
diff --git a/js/app/packages/app/asset/blank.docx b/js/app/packages/app/asset/blank.docx
deleted file mode 100644
index 5075228e3f..0000000000
Binary files a/js/app/packages/app/asset/blank.docx and /dev/null differ
diff --git a/js/app/packages/app/asset/macro.svg b/js/app/packages/app/asset/macro.svg
deleted file mode 100644
index 1e872d4f35..0000000000
--- a/js/app/packages/app/asset/macro.svg
+++ /dev/null
@@ -1,22 +0,0 @@
-<svg width="319" height="50" viewBox="0 0 319 50" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M119.799 48.2568V10.9961H129.736L140.59 32.1646L151.39 10.9961H161.002V48.2568H152.956V25.1982L143.506 43.667H137.35L127.846 25.1982V48.2568H119.799ZM165.753 48.2568L179.955 10.9961H189.243L203.5 48.2568H194.428L191.835 41.0747H177.201L174.555 48.2568H165.753ZM179.955 33.4604H189.082L184.491 20.9326L179.955 33.4604ZM204.686 29.6265C204.686 18.7725 213.056 10.4561 223.91 10.4561C231.524 10.4561 237.95 14.6685 241.028 21.1484L233.415 24.7124C231.74 20.8784 228.284 18.4482 223.91 18.4482C217.646 18.4482 213.11 23.2002 213.11 29.6265C213.11 36.0527 217.646 40.8047 223.91 40.8047C228.284 40.8047 231.74 38.3745 233.415 34.5405L241.028 38.1045C237.95 44.585 231.524 48.7969 223.91 48.7969C213.056 48.7969 204.686 40.4805 204.686 29.6265ZM246.967 48.2568V10.9961H262.736C269.81 10.9961 275.156 16.5044 275.156 23.6865C275.156 28.8164 272.564 32.8667 268.676 34.8647L276.128 48.2568H266.786L260.251 36.3228H255.445V48.2568H246.967ZM255.445 28.4927H261.602C264.68 28.4927 266.732 26.6025 266.732 23.6865C266.732 20.7163 264.68 18.8262 261.602 18.8262H255.445V28.4927ZM280.016 29.6265C280.016 18.7725 288.439 10.4561 299.348 10.4561C310.256 10.4561 318.68 18.7725 318.68 29.6265C318.68 40.4805 310.256 48.7969 299.348 48.7969C288.439 48.7969 280.016 40.4805 280.016 29.6265ZM310.202 29.6265C310.202 23.1465 305.558 18.4482 299.348 18.4482C293.083 18.4482 288.439 23.1465 288.439 29.6265C288.439 36.1064 293.083 40.8047 299.348 40.8047C305.558 40.8047 310.202 36.1064 310.202 29.6265Z" fill="#333C66"/>
-<path d="M32.6802 15.4471L33.0693 15.1332L32.6802 15.4471L38.7366 22.9541L31.9102 37.3366L17.2419 49.5H7.40761C4.95706 49.5 2.72439 48.0924 1.66783 45.8813C0.611289 43.6702 0.91874 41.0488 2.45823 39.1422L21.5927 15.4448C22.9455 13.7694 24.9836 12.7958 27.137 12.7963C29.2904 12.7967 31.328 13.7712 32.6802 15.4471Z" fill="url(#paint0_linear_470_2)" stroke="black"/>
-<path d="M98.71 37.8042C100.449 39.9568 100.796 42.9167 99.6036 45.4136C98.4108 47.9104 95.8898 49.5 93.1227 49.5H61.4199L47.7939 36.6286L39.9283 22.9325L54.7372 4.59657C56.8295 2.0059 59.981 0.500146 63.311 0.5C66.6411 0.499854 69.7927 2.00538 71.8852 4.59587L98.71 37.8042Z" fill="url(#paint1_linear_470_2)" stroke="black"/>
-<path d="M65.3027 49.5001H15.289C18.1859 48.4594 20.7815 46.6381 22.7617 44.1864L39.3242 23.6806L54.0416 41.9054C56.9828 45.5475 60.9218 48.1676 65.3027 49.5001Z" fill="url(#paint2_linear_470_2)" stroke="black"/>
-<defs>
-<linearGradient id="paint0_linear_470_2" x1="0.704605" y1="45.8885" x2="36.6763" y2="19.8173" gradientUnits="userSpaceOnUse">
-<stop stop-color="#568FFF"/>
-<stop offset="1" stop-color="#4918BD"/>
-</linearGradient>
-<linearGradient id="paint1_linear_470_2" x1="96.1086" y1="25" x2="42.8807" y2="25" gradientUnits="userSpaceOnUse">
-<stop stop-color="#1AB0E2"/>
-<stop offset="0.557813" stop-color="#43D2ED"/>
-<stop offset="1" stop-color="#5FE9F5"/>
-</linearGradient>
-<linearGradient id="paint2_linear_470_2" x1="9.34229" y1="36.4424" x2="73.1171" y2="36.4424" gradientUnits="userSpaceOnUse">
-<stop stop-color="#1AD1E2"/>
-<stop offset="0.382163" stop-color="#27B5EC"/>
-<stop offset="0.999227" stop-color="#4080FF"/>
-</linearGradient>
-</defs>
-</svg>
diff --git a/js/app/packages/app/component/BetaTooltip.tsx b/js/app/packages/app/component/BetaTooltip.tsx
deleted file mode 100644
index 446cb7ad6a..0000000000
--- a/js/app/packages/app/component/BetaTooltip.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import { BetaBadge } from '@core/component/BetaBadge';
-
-export const BetaTooltip = (props: { text: string }) => {
- return (
- <div class="border rounded border-edge p-2.5 w-44 text-xs items-center text-left bg-panel shadow-lg z-9999">
- <div class="absolute top-[-12px] left-[-12px] bg-panel">
- <BetaBadge />
- </div>
- <div class="py-1">{props.text}</div>
- </div>
- );
-};
diff --git a/js/app/packages/app/component/CustomCursorTest.tsx b/js/app/packages/app/component/CustomCursorTest.tsx
deleted file mode 100644
index 1404db680d..0000000000
--- a/js/app/packages/app/component/CustomCursorTest.tsx
+++ /dev/null
@@ -1,293 +0,0 @@
-import { createSignal, For, onMount } from 'solid-js';
-import { cn } from '@ui/utils/classname';
-
-const ShadowDOMTest = () => {
- let shadowHost: HTMLDivElement | undefined;
-
- onMount(() => {
- if (!shadowHost) return;
-
- const shadowRoot = shadowHost.attachShadow({ mode: 'open' });
-
- shadowRoot.innerHTML = `
- <style>
- :host {
- display: block;
- padding-top: 4rem;
- }
- p {
- margin: 1em 0;
- }
- a {
- color: var(--color-accent, #3b82f6);
- text-decoration: underline;
- }
- code {
- font-family: monospace;
- background: rgba(0, 0, 0, 0.05);
- padding: 0.125em 0.25em;
- border-radius: 0.25em;
- }
- button {
- color: var(--color-accent, #3b82f6);
- padding: 0.5rem;
- border: 1px solid var(--color-accent, #3b82f6);
- background: transparent;
- margin: 0 0.25rem;
- }
- button.cursor-pointer {
- cursor: var(--cursor-pointer);
- }
- </style>
- <div class="" style="padding: 0px;">
- <p>
- By creating a
- <a href="/en-US/docs/Web/API/BroadcastChannel" class="text-accent underline">
- <code>BroadcastChannel</code>
- </a>
- object, you can receive any messages that are posted to it. You don't have to
- <a href="/en-US/docs/Web/API/BroadcastChannel" class="text-accent underline">
- <span><code>LINK</code></span>
- </a>
- maintain a reference to the frames or workers you wish to communicate with: they can "subscribe" to a particular channel by constructing their own
- <a href="/en-US/docs/Web/API/BroadcastChannel" class="text-accent underline">
- <code>BroadcastChannel</code>
- </a>
- with the same name, and have bi-directional communication between all of them.
- </p>
- <p>
- The API doesn't associate any semantics to messages,
- <button class="text-accent p-2 border-accent border">clicky button</button>
- bar
- <button class="text-accent p-2 border-accent border">
- <span>clicky button 2</span>
- </button>
- foo
- <button class="text-accent p-2 border-accent border cursor-pointer">
- <span>clicky button 3</span>
- </button>
- so it is up to the code to know what kind of messages to expect and what to do with them.
- </p>
- </div>
- `;
- });
-
- return <div ref={shadowHost} />;
-};
-
-const CustomCursorTest = () => {
- const [useClass, setUseClass] = createSignal(true);
- const [useStyle, setUseStyle] = createSignal(false);
-
- const cursorTypes = [
- // general cursors
- { name: 'auto', cursor: 'auto', tw: 'cursor-auto' },
- { name: 'default', cursor: 'default', tw: 'cursor-default' },
- { name: 'none', cursor: 'none', tw: 'cursor-none' },
-
- // link and status cursors
- { name: 'context-menu', cursor: 'context-menu', tw: 'cursor-context-menu' },
- { name: 'help', cursor: 'help', tw: 'cursor-help' },
- { name: 'pointer', cursor: 'pointer', tw: 'cursor-pointer' },
- { name: 'progress', cursor: 'progress', tw: 'cursor-progress' },
- { name: 'wait', cursor: 'wait', tw: 'cursor-wait' },
-
- // selection cursors
- { name: 'cell', cursor: 'cell', tw: 'cursor-cell' },
- { name: 'crosshair', cursor: 'crosshair', tw: 'cursor-crosshair' },
- { name: 'text', cursor: 'text', tw: 'cursor-text' },
- {
- name: 'vertical-text',
- cursor: 'vertical-text',
- tw: 'cursor-vertical-text',
- },
-
- // drag-and-drop cursors
- { name: 'alias', cursor: 'alias', tw: 'cursor-alias' },
- { name: 'copy', cursor: 'copy', tw: 'cursor-copy' },
- { name: 'move', cursor: 'move', tw: 'cursor-move' },
- { name: 'no-drop', cursor: 'no-drop', tw: 'cursor-no-drop' },
- { name: 'not-allowed', cursor: 'not-allowed', tw: 'cursor-not-allowed' },
- { name: 'grab', cursor: 'grab', tw: 'cursor-grab' },
- { name: 'grabbing', cursor: 'grabbing', tw: 'cursor-grabbing' },
-
- // resizing and scrolling cursors
- { name: 'all-scroll', cursor: 'all-scroll', tw: 'cursor-all-scroll' },
- { name: 'col-resize', cursor: 'col-resize', tw: 'cursor-col-resize' },
- { name: 'row-resize', cursor: 'row-resize', tw: 'cursor-row-resize' },
- { name: 'n-resize', cursor: 'n-resize', tw: 'cursor-n-resize' },
- { name: 's-resize', cursor: 's-resize', tw: 'cursor-s-resize' },
- { name: 'e-resize', cursor: 'e-resize', tw: 'cursor-e-resize' },
- { name: 'w-resize', cursor: 'w-resize', tw: 'cursor-w-resize' },
- { name: 'ns-resize', cursor: 'ns-resize', tw: 'cursor-ns-resize' },
- { name: 'ew-resize', cursor: 'ew-resize', tw: 'cursor-ew-resize' },
- { name: 'ne-resize', cursor: 'ne-resize', tw: 'cursor-ne-resize' },
- { name: 'nw-resize', cursor: 'nw-resize', tw: 'cursor-nw-resize' },
- { name: 'se-resize', cursor: 'se-resize', tw: 'cursor-se-resize' },
- { name: 'sw-resize', cursor: 'sw-resize', tw: 'cursor-sw-resize' },
- { name: 'nesw-resize', cursor: 'nesw-resize', tw: 'cursor-nesw-resize' },
-
- // zooming cursors
- { name: 'zoom-in', cursor: 'zoom-in', tw: 'cursor-zoom-in' },
- { name: 'zoom-out', cursor: 'zoom-out', tw: 'cursor-zoom-out' },
- ];
-
- return (
- <div
- class="p-8"
- ref={(el) => {
- onMount(() => {
- el.parentElement!.style.overflow = 'auto';
- });
- }}
- >
- <style>
- {`
- :where(*, ::before, ::after) {
- user-select: unset;
- }
-
- :where(input, textarea, select, p *, p span, .pdfViewer *, .markdown-content *, [contenteditable], .md *) {
- user-select: unset;
- }
- `}
- </style>
- <h1 class="text-2xl font-bold mb-6">Custom Cursor Types Test</h1>
-
- <div class="mb-6 flex gap-2 flex-wrap">
- <button
- class={cn(
- 'px-4 py-2 rounded border transition-colors',
- useClass() && !useStyle()
- ? 'bg-(--color-accent) text-page border-(--color-accent)'
- : 'bg-transparent border-(--color-edge) text-(--color-text) hover:bg-(--color-surface-hover)'
- )}
- onClick={() => {
- setUseClass(true);
- setUseStyle(false);
- }}
- >
- Class Only
- </button>
- <button
- class={cn(
- 'px-4 py-2 rounded border transition-colors',
- !useClass() && useStyle()
- ? 'bg-(--color-accent) text-page border-(--color-accent)'
- : 'bg-transparent border-(--color-edge) text-(--color-text) hover:bg-(--color-surface-hover)'
- )}
- onClick={() => {
- setUseClass(false);
- setUseStyle(true);
- }}
- >
- Style Only
- <div>*by using css variable `--cursor-*`</div>
- </button>
- <button
- class={cn(
- 'px-4 py-2 rounded border transition-colors',
- useClass() && useStyle()
- ? 'bg-(--color-accent) text-page border-(--color-accent)'
- : 'bg-transparent border-(--color-edge) text-(--color-text) hover:bg-(--color-surface-hover)'
- )}
- onClick={() => {
- setUseClass(true);
- setUseStyle(true);
- }}
- >
- Both (Class + Style)
- </button>
- </div>
- <div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4">
- <For each={cursorTypes}>
- {({ name, cursor, tw }) => (
- <div
- class="flex items-center justify-center border border-(--color-edge) p-2 rounded hover:bg-(--color-surface-hover) transition-colors"
- classList={{ [`${tw}`]: !!tw && useClass() }}
- style={{
- cursor: useStyle() ? `var(--cursor-${cursor})` : undefined,
- }}
- >
- <div class="py-2">{name}</div>
- </div>
- )}
- </For>
- </div>
- <div class="pt-16">
- <div
- class="flex items-center text-accent p-2 border-accent border my-4"
- style={{ cursor: 'pointer' }}
- >
- <div>div wrapper with inline style cursor pointer and hr child</div>
- <hr style="border:none;transition:border-color var(--transition);border-top:10px dashed var(--b4);box-sizing:border-box;width:100%;" />
- </div>
- {/* SCUFFED: how do we want to handle this color? */}
- <div
- class="border border-[oklch(0.554_0.046_257.417)] p-2"
- contenteditable
- >
- contenteditable
- <ul class="p-2">
- <li class="list-disc mb-6">some text</li>
- <li class="list-disc">some text 2</li>
- </ul>
- </div>
- <p>
- By creating a{' '}
- <a
- href="/en-US/docs/Web/API/BroadcastChannel"
- class="text-accent underline"
- >
- <code>BroadcastChannel</code>
- </a>{' '}
- object, you can receive any messages that are posted to it. You don't
- have to
- <a
- href="/en-US/docs/Web/API/BroadcastChannel"
- class="text-accent underline"
- >
- <span>
- <code>LINK</code>
- </span>
- </a>{' '}
- maintain a reference to the frames or workers you wish to communicate
- with: they can "subscribe" to a particular channel by constructing
- their own{' '}
- <a
- href="/en-US/docs/Web/API/BroadcastChannel"
- class="text-accent underline"
- >
- <code>BroadcastChannel</code>
- </a>{' '}
- with the same name, and have bi-directional communication between all
- of them.
- </p>
- <div>
- <div />
- The API doesn't associate any semantics to messages,
- <span>
- <button class="text-accent p-2 border-accent border">
- clicky button
- </button>
- bar
- <button class="text-accent p-2 border-accent border">
- <span>clicky button 2</span>
- </button>
- foo
- <button class="text-accent p-2 border-accent border cursor-pointer">
- <span>clicky button 3</span>
- </button>
- so it is up to the code to know what kind of messages to expect and
- what to do with them.
- </span>
- </div>
- </div>
-
- <h2 class="pt-16 text-2xl font-bold">Shadow DOM Demo</h2>
- <ShadowDOMTest />
- </div>
- );
-};
-
-export default CustomCursorTest;
diff --git a/js/app/packages/app/component/FileDropZoneModal.tsx b/js/app/packages/app/component/FileDropZoneModal.tsx
deleted file mode 100644
index 6eb78a779b..0000000000
--- a/js/app/packages/app/component/FileDropZoneModal.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { FileDropZone } from '@core/component/FileDropZone';
-import { Overlay } from '@core/component/Modal';
-import {
- blockAcceptedFileExtensions,
- blockAcceptedMimeTypes,
-} from '@core/constant/allBlocks';
-import { uploadFiles } from '@core/util/upload';
-import Dialog from '@corvu/dialog';
-import { useUserId } from '@core/context/user';
-import { Show } from 'solid-js';
-
-export const FILE_DROP_ZONE_DIALOG_CONTEXT_NAME = 'file-drop-zone-modal';
-
-export function FileDropZoneModal() {
- const userId = useUserId();
-
- const dialogContext = Dialog.useContext(FILE_DROP_ZONE_DIALOG_CONTEXT_NAME);
-
- return (
- <Show when={userId()}>
- <Dialog.Portal contextId={FILE_DROP_ZONE_DIALOG_CONTEXT_NAME}>
- <Overlay contextId={FILE_DROP_ZONE_DIALOG_CONTEXT_NAME} />
- <Dialog.Content
- class="bg-dialog rounded-xl p-1 w-[250px] h-[257px] md:w-[433px] fixed left-1/2 top-1/2 z-modal -translate-x-1/2 -translate-y-1/2"
- contextId={FILE_DROP_ZONE_DIALOG_CONTEXT_NAME}
- >
- <FileDropZone
- class="w-full h-full rounded-lg overflow-hidden border border-edge border-dashed inline-flex flex-col justify-center items-center gap-[14px]"
- acceptedMimeTypes={blockAcceptedMimeTypes}
- acceptedExtensions={blockAcceptedFileExtensions}
- onFilesDrop={async (files) => {
- await uploadFiles(files, 'dss');
- dialogContext.setOpen(false);
- }}
- >
- <div class="w-[222px] text-center text-ink-muted text-sm font-sans font-normal leading-[20px] wrap-break-word select-none cursor-default">
- Drag and drop or{' '}
- <span class="text-accent-ink underline">click</span> to import.
- </div>
- </FileDropZone>
- </Dialog.Content>
- </Dialog.Portal>
- </Show>
- );
-}
diff --git a/js/app/packages/app/component/HotkeyExample.tsx b/js/app/packages/app/component/HotkeyExample.tsx
deleted file mode 100644
index 8cfb9d3414..0000000000
--- a/js/app/packages/app/component/HotkeyExample.tsx
+++ /dev/null
@@ -1,67 +0,0 @@
-import { Hotkey } from '@core/component/Hotkey';
-import { executedTokens } from '@core/hotkey/state';
-import type { HotkeyToken } from '@core/hotkey/tokens';
-import { getHotkeyCommandByToken } from '@core/hotkey/utils';
-import ArrowRight from '@icon/regular/arrow-right.svg';
-import { createMemo, For, Show } from 'solid-js';
-
-export interface HotkeyExampleProps {
- hotkeyTokenSequence: HotkeyToken[];
- subtitle?: string;
-}
-
-export function HotkeyExample(props: HotkeyExampleProps) {
- const commandSequence = props.hotkeyTokenSequence.map((token) => ({
- command: getHotkeyCommandByToken(token),
- executed: createMemo(() => executedTokens().includes(token)),
- }));
-
- const lowerCaseFirstChar = (str: string) =>
- str.charAt(0).toLowerCase() + str.slice(1);
-
- const lastCommandDescription_ = commandSequence.at(-1)?.command?.description;
- const lastCommandDescription = createMemo(() =>
- lowerCaseFirstChar(
- typeof lastCommandDescription_ === 'function'
- ? lastCommandDescription_()
- : (lastCommandDescription_ ?? '')
- )
- );
-
- return (
- <div class="h-min hotkey-list col-span-full grid grid-cols-subgrid">
- <div class="hotkey-item col-span-full grid grid-cols-subgrid">
- <div class="hotkeys col-span-1 flex items-center gap-2">
- <For each={commandSequence}>
- {(item, index) => (
- <>
- <Show when={item.command}>
- {(command) => (
- <Hotkey
- token={command().hotkeyToken}
- showPlus
- class="font-mono text-base h-9 min-w-9 px-3 flex items-center justify-center gap-2 border transition-all duration-300"
- classList={{
- 'border-accent/75 bg-accent/75 text-panel':
- item.executed(),
- 'bg-input border-edge-muted text-accent/75':
- !item.executed(),
- }}
- />
- )}
- </Show>
- <Show when={index() < commandSequence.length - 1}>
- <ArrowRight class="size-6 text-ink-muted shrink-0" />
- </Show>
- </>
- )}
- </For>
- </div>
- <div class="label col-start-2 flex flex-col justify-center">
- <h2 class="text-base">{lastCommandDescription()}</h2>
- {/* <p class="text-sm text-ink-muted">{props.subtitle}</p> */}
- </div>
- </div>
- </div>
- );
-}
diff --git a/js/app/packages/app/component/split-layout/componentRegistry.tsx b/js/app/packages/app/component/split-layout/componentRegistry.tsx
index 60728a6840..2cc1ca248b 100644
--- a/js/app/packages/app/component/split-layout/componentRegistry.tsx
+++ b/js/app/packages/app/component/split-layout/componentRegistry.tsx
@@ -339,10 +339,6 @@ if (LOCAL_ONLY) {
() => import('@core/component/FormControls/debug/NewFormPrimitivesDemo')
)
);
- registerComponent(
- 'custom-cursor',
- lazy(() => import('@app/component/CustomCursorTest'))
- );
registerComponent(
'resize',
lazy(() => import('@core/internal/ResizeDemo'))