Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
rm: growth package (#306)
teoa1c844f2a70f
diff --git a/js/app/bun.lock b/js/app/bun.lockindex 28c9d7c03c..6035c0e364 100644--- a/js/app/bun.lock+++ b/js/app/bun.lock@@ -280,9 +280,6 @@"typedoc": "^0.22.18",},},- "packages/growth": {- "name": "growth",- },"packages/lexical-core": {"name": "@macro-inc/lexical-core","version": "0.2.2",@@ -2329,8 +2326,6 @@"graphql-ws": ["[email protected]", "", { "peerDependencies": { "graphql": ">=0.11 <=16" } }, "sha512-Ju2RCU2dQMgSKtArPbEtsK5gNLnsQyTNIo/T7cZNp96niC1x0KdJNZV0TIoilceBPQwfb5itrGl8pkFeOUMl4A=="],- "growth": ["growth@workspace:packages/growth"],-"gtoken": ["[email protected]", "", { "dependencies": { "gaxios": "^6.0.0", "jws": "^4.0.0" } }, "sha512-pCcEwRi+TKpMlxAQObHDQ56KawURgyAf6jtIY046fJ5tIv3zDe/LEIubckAO8fj6JnAxLdmWkUfNyulQ2iKdEw=="],"hachure-fill": ["[email protected]", "", {}, "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg=="],diff --git a/js/app/packages/growth/ChatLightbox/ChatLightbox.tsx b/js/app/packages/growth/ChatLightbox/ChatLightbox.tsxdeleted file mode 100644index 5a1b0b20ce..0000000000--- a/js/app/packages/growth/ChatLightbox/ChatLightbox.tsx+++ /dev/null@@ -1,212 +0,0 @@-import { useLocation } from '@solidjs/router';-import { createEffect, createSignal, onCleanup, onMount, Show } from 'solid-js';--export const [showChatLightbox, setShowChatLightbox] = createSignal(false);--export function ChatLightbox() {- const [showTooltip, setShowTooltip] = createSignal(false);- const [chatInputTop, setChatInputTop] = createSignal<number>(0);- const [chatInputLeft, setChatInputLeft] = createSignal<number>(0);- const [chatInputWidth, setChatInputWidth] = createSignal<number>(0);- const [chatInputHeight, setChatInputHeight] = createSignal<number>(0);-- const [chatInputButtonTop, setChatInputButtonTop] = createSignal<number>(0);- const [chatInputButtonLeft, setChatInputButtonLeft] = createSignal<number>(0);- const [chatInputButtonWidth, setChatInputButtonWidth] =- createSignal<number>(0);- const [chatInputButtonHeight, setChatInputButtonHeight] =- createSignal<number>(0);-- const location = useLocation();-- const updateChatRect = () => {- const chatInput = document.getElementById('chat-input');- if (!chatInput) return;- const chatInputRect = chatInput.getBoundingClientRect();- setChatInputTop(chatInputRect.top);- setChatInputLeft(chatInputRect.left);- setChatInputWidth(chatInputRect.width);- setChatInputHeight(chatInputRect.height);- };-- const updateChatInputButtonRect = () => {- const chatInputButton = document.getElementById('chat-input-button');- if (!chatInputButton) return;- const chatInputButtonRect = chatInputButton.getBoundingClientRect();- setChatInputButtonTop(chatInputButtonRect.top);- setChatInputButtonLeft(chatInputButtonRect.left);- setChatInputButtonWidth(chatInputButtonRect.width);- setChatInputButtonHeight(chatInputButtonRect.height);- };-- // Update on location changes- createEffect(() => {- if (location.pathname === '/app/start/block') {- let interval: number | undefined;- let resizeObserver: ResizeObserver | undefined;-- const setupChatInput = () => {- const chatInput = document.getElementById('chat-input');- if (!chatInput) return false;-- const editable = chatInput.querySelector(- 'div[contenteditable="plaintext-only"]'- );- if (editable) {- (editable as HTMLElement).blur();- }-- window.addEventListener('resize', updateChatRect);- window.addEventListener('scroll', updateChatRect);- window.addEventListener('resize', updateChatInputButtonRect);- window.addEventListener('scroll', updateChatInputButtonRect);-- resizeObserver = new ResizeObserver(() => {- updateChatRect();- updateChatInputButtonRect();- });- resizeObserver.observe(chatInput);-- updateChatRect();- updateChatInputButtonRect();- return true;- };-- interval = window.setInterval(() => {- if (setupChatInput()) {- clearInterval(interval);- }- }, 50);-- onCleanup(() => {- if (interval) clearInterval(interval);- if (resizeObserver) resizeObserver.disconnect();- window.removeEventListener('resize', updateChatRect);- window.removeEventListener('scroll', updateChatRect);- window.removeEventListener('resize', updateChatInputButtonRect);- window.removeEventListener('scroll', updateChatInputButtonRect);- });- }- });-- const checkMobile = () => {- const isMobile = window.innerWidth < 640;- if (isMobile) {- setShowChatLightbox(false);- }- };-- onMount(() => {- checkMobile();- setTimeout(() => {- setShowTooltip(true);- }, 3000);- window.addEventListener('resize', checkMobile);- onCleanup(() => {- window.removeEventListener('resize', checkMobile);- });- });-- return (- <Show when={showChatLightbox()}>- <div- class="z-999 fixed inset-0 pointer-events-none hidden sm:block"- onClick={() => {- setShowTooltip(true);- }}- style={{- opacity: showChatLightbox() ? 1 : 0,- transition: 'opacity 0.3s ease-in-out',- }}- >- {/* Top section */}- <div- class="absolute top-0 left-0 w-full pointer-events-auto"- style={{ height: `${chatInputTop()}px` }}- >- <div class="w-full h-full bg-ink/20" />- </div>-- {/* Middle section with hole for chat input */}- <div- class="absolute w-full flex justify-between z-[1]"- style={{- top: `${chatInputTop()}px`,- height: `${chatInputHeight()}px`,- }}- >- {/* Left of chat input */}- <div- class="h-full bg-ink/20 pointer-events-auto overflow-hidden"- style={{ width: `${chatInputLeft()}px` }}- />-- <div- class="h-full grow-1 relative outline-5 outline-[#AAAAAA] shadow-xl rounded-xl"- style={{- 'box-shadow': '0px 0px 20px 0px rgba(0, 0, 0, 0.5)',- }}- >- {/* top section */}- <div- class="absolute top-0 left-0 w-full pointer-events-auto"- style={{- height: `${chatInputHeight() - chatInputButtonHeight() - 8}px`,- }}- />-- {/* left section */}- <div- class="absolute top-0 left-0 h-full pointer-events-auto"- style={{- width: `${chatInputWidth() - chatInputButtonWidth() - 8}px`,- }}- />- </div>-- {/* Right of chat input */}- <div- class="h-full bg-ink/20 pointer-events-auto"- style={{- width: `calc(100% - ${chatInputLeft()}px - ${chatInputWidth()}px)`,- }}- />- </div>-- {/* Create a blue pulsing effect on the chat input button */}- <div- class="absolute w-full pointer-events-none z-[2]"- style={{- top: `${chatInputButtonTop()}px`,- height: `${chatInputButtonHeight()}px`,- width: `${chatInputButtonWidth()}px`,- left: `${chatInputButtonLeft()}px`,- }}- >- <div- class="absolute top-1/2 -left-2 bg-accent text-panel rounded-lg px-2 py-1 text-xs -translate-x-full -translate-y-1/2 whitespace-nowrap"- style={{- opacity: showTooltip() ? 1 : 0,- transition: 'opacity 0.3s ease-in-out',- }}- >- Click here to get started- {/* create a triangle right arrow */}- <div class="absolute top-1/2 -right-1 -translate-y-1/2 w-2 h-2 bg-accent rotate-45" />- </div>- <div class="w-full h-full bg-accent/30 rounded-full animate-[pulse_2s_ease-in-out_infinite] shadow-[0_0_15px_rgba(59,130,246,0.5)]" />- <div class="absolute inset-0 bg-accent/20 rounded-full animate-[ping_2s_cubic-bezier(0,0,0.2,1)_infinite]" />- </div>-- {/* Bottom section */}- <div- class="absolute w-full bg-ink/20 pointer-events-auto"- style={{- top: `${chatInputTop() + chatInputHeight()}px`,- bottom: 0,- }}- />- </div>- </Show>- );-}diff --git a/js/app/packages/growth/ChatLightbox/ChatLightboxHook.tsx b/js/app/packages/growth/ChatLightbox/ChatLightboxHook.tsxdeleted file mode 100644index 62e7d99106..0000000000--- a/js/app/packages/growth/ChatLightbox/ChatLightboxHook.tsx+++ /dev/null@@ -1,46 +0,0 @@-//@ts-nocheck-import { addAttachmentToChat } from '@block-chat/signal/attachment';-import { chatBlockData } from '@block-chat/signal/chatBlockData';-import { chatInputValueSignal } from '@block-chat/signal/input';-import type { ChatAttachmentWithName } from '@service-cognition/generated/schemas/chatAttachmentWithName';-import { createCallback } from '@solid-primitives/rootless';-import { createEffect, createSignal } from 'solid-js';--const [fileAttached, setFileAttached] = createSignal(false);--export const ChatLightboxHook = () => {- const setPrompt = chatInputValueSignal.set;- const blockData = chatBlockData.get;- const addAttachment = createCallback(addAttachmentToChat);-- const init = async () => {- const prompt =- "I'm new to Macro. Can you explain what Macro is, what features it offers, and how it can help me with my work? Please provide an overview of its main capabilities and benefits.";- setPrompt(prompt);- const chatInput = document.getElementById(- 'chat-input-text-area'- ) as HTMLDivElement;- if (chatInput) {- chatInput.innerHTML = prompt;- }-- const attachment = blockData()?.availableAttachments.find(- // @ts-ignore- (f) => f.metadata?.document_name === 'Why use Macro?'- );- if (attachment) {- await addAttachment(attachment as ChatAttachmentWithName);- }- };-- createEffect(() => {- if (!blockData() || fileAttached()) return;- // Need to check if there is a file already attached to the chat- const availableAttachments = blockData()?.availableAttachments;- if (availableAttachments && availableAttachments.length > 0) {- init();- setFileAttached(true);- }- });- return '';-};diff --git a/js/app/packages/growth/Tooltip/Tooltip.tsx b/js/app/packages/growth/Tooltip/Tooltip.tsxdeleted file mode 100644index b23ecba2f5..0000000000--- a/js/app/packages/growth/Tooltip/Tooltip.tsx+++ /dev/null@@ -1,216 +0,0 @@-// import { createCallback } from '@solid-primitives/rootless';-// import { createMemo, createSignal, onCleanup, onMount, Show } from 'solid-js';-// import { useIsRightbarChat } from '../../app/component/rightbar/signal';-// import tooltipStore, { closeTooltip } from './TooltipStore';--interface TooltipProps {- text: string;- color: 'red' | 'code' | 'folder' | 'canvas' | 'note' | 'email';- position: 'top' | 'bottom' | 'left' | 'right';- secondaryPosition?: 'top' | 'bottom' | 'left' | 'right';- secondaryWidth?: number;- storageKey: string;- showHide?: boolean;-}--export default function Tooltip(_props: TooltipProps) {- // const [position, setPosition] = createSignal<TooltipProps['position']>(- // props.position- // );- // let tooltipRef!: HTMLDivElement;- // const isRightbarChat = useIsRightbarChat();-- // const {- // text,- // color,- // position: _position,- // secondaryPosition,- // secondaryWidth,- // storageKey,- // showHide,- // } = props;-- // const getXY = createCallback(() => {- // if (position() === 'top') {- // return {- // top: '4px',- // left: '50%',- // transform: 'translateX(-50%) translateY(-100%)',- // };- // }-- // if (position() === 'bottom') {- // return {- // bottom: '4px',- // left: '50%',- // transform: 'translateX(-50%) translateY(100%)',- // };- // }-- // if (position() === 'left') {- // return {- // top: '50%',- // left: '4px',- // transform: 'translateY(-50%) translateX(-100%)',- // };- // }-- // if (position() === 'right') {- // return {- // top: '50%',- // right: '4px',- // transform: 'translateY(-50%) translateX(100%)',- // };- // }- // });-- // const getDirection = createCallback(() => {- // if (position() === 'top') {- // return 'flex-col';- // }- // if (position() === 'bottom') {- // return 'flex-col-reverse';- // }- // if (position() === 'left') {- // return 'flex-row';- // }- // if (position() === 'right') {- // return 'flex-row-reverse';- // }- // });-- // const colorsDict = {- // red: {- // bg: 'bg-failure/50',- // dot: 'bg-failure',- // text: 'text-failure',- // },- // code: {- // bg: 'bg-code/60',- // dot: 'bg-code',- // text: 'text-code',- // },- // folder: {- // bg: 'bg-folder/60',- // dot: 'bg-folder',- // text: 'text-folder',- // },- // canvas: {- // bg: 'bg-canvas/60',- // dot: 'bg-canvas',- // text: 'text-canvas',- // },- // note: {- // bg: 'bg-note/60',- // dot: 'bg-note',- // text: 'text-note',- // },- // email: {- // bg: 'bg-email/60',- // dot: 'bg-email',- // text: 'text-email',- // },- // };-- // const lineTranslateDict = {- // top: 'translate-x-1/2',- // bottom: '-translate-x-1/2',- // left: '-translate-y-1/2',- // right: '-translate-y-1/2',- // };-- // const lineTranslate = createMemo(() => {- // return lineTranslateDict[position() as keyof typeof lineTranslateDict];- // });-- // const colors = createMemo(() => {- // return colorsDict[color as keyof typeof colorsDict];- // });-- // const lineStyles = createMemo(() => {- // return {- // width:- // position() === 'right' || position() === 'left' ? 'w-12' : 'w-[1px]',- // height:- // position() === 'right' || position() === 'left' ? 'h-[1px]' : 'h-12',- // backgroundColor: colors().bg,- // };- // });-- // onMount(() => {- // if (isRightbarChat) {- // return;- // }-- // const blockParent = tooltipRef.closest('[data-corvu-resizable-panel]');-- // if (!blockParent || !secondaryPosition || !secondaryWidth) {- // return;- // }-- // const resizeObserver = new ResizeObserver((entries) => {- // for (const entry of entries) {- // const { width } = entry.contentRect;-- // if (width <= secondaryWidth && position() !== secondaryPosition) {- // setPosition(secondaryPosition);- // } else if (width > secondaryWidth && position() !== props.position) {- // setPosition(props.position);- // }- // }- // });-- // // Start observing the resizable panel- // resizeObserver.observe(blockParent);-- // // Cleanup observer on component unmount- // onCleanup(() => {- // resizeObserver.disconnect();- // });- // });-- // if (isRightbarChat) {- // return null;- // }-- return null;-- // return (- // <div- // ref={tooltipRef}- // class={`absolute hidden ${getDirection()} justify-center items-center gap-2 sm:flex transition-opacity duration-200 ${!tooltipStore[storageKey as keyof typeof tooltipStore] ? 'opacity-100' : 'opacity-0'} pointer-events-none`}- // style={{- // ...getXY(),- // }}- // >- // <p class={`whitespace-nowrap text-xs font-medium ${colors().text}`}>- // {text}- // <Show when={showHide}>- // {' ['}- // <span- // class="select-none underline cursor-pointer pointer-events-auto"- // onClick={() =>- // closeTooltip(storageKey as keyof typeof tooltipStore)- // }- // >- // {'hide'}- // </span>- // {']'}- // </Show>- // </p>-- // <div class={`flex ${getDirection()} justify-center items-center`}>- // <div- // class={`${lineStyles().width} ${lineStyles().height} ${colors().bg} ${lineTranslate()}`}- // />- // <div- // class={`w-2 h-2 rounded-full ${colors().bg} flex items-center justify-center`}- // >- // <div- // class={`w-[6px] h-[6px] rounded-full ${colors().dot} animate-[ping_2s_ease-in-out_infinite]`}- // />- // </div>- // </div>- // </div>- // );-}diff --git a/js/app/packages/growth/Tooltip/TooltipStore.ts b/js/app/packages/growth/Tooltip/TooltipStore.tsdeleted file mode 100644index 1cdcf839a5..0000000000--- a/js/app/packages/growth/Tooltip/TooltipStore.ts+++ /dev/null@@ -1,22 +0,0 @@-import { makePersisted } from '@solid-primitives/storage';-import { createStore } from 'solid-js/store';--const [tooltipStore, setTooltipStore] = makePersisted(- createStore({- 'start-folder-tooltip': false,- 'start-document-tooltip': false,- 'start-code-tooltip': false,- 'start-canvas-tooltip': false,- 'start-email-tooltip': false,- 'chat-attach-tooltip': false,- 'close-split-tooltip': false,- 'start-message-tooltip': false,- }),- { name: 'tooltip-store' }-);--export const closeTooltip = (key: keyof typeof tooltipStore) => {- setTooltipStore(key, true);-};--export default tooltipStore;diff --git a/js/app/packages/growth/package.json b/js/app/packages/growth/package.jsondeleted file mode 100644index 33115f4ca2..0000000000--- a/js/app/packages/growth/package.json+++ /dev/null@@ -1,4 +0,0 @@-{- "name": "growth",- "private": true-}\ No newline at end of filediff --git a/js/app/packages/growth/tsconfig.json b/js/app/packages/growth/tsconfig.jsondeleted file mode 100644index b6af839f20..0000000000--- a/js/app/packages/growth/tsconfig.json+++ /dev/null@@ -1,9 +0,0 @@-{- "extends": "../../tsconfig.json",- "compilerOptions": {- "composite": true,- "jsx": "preserve",- "jsxImportSource": "solid-js",- "declaration": true- }-}diff --git a/js/app/tsconfig.json b/js/app/tsconfig.jsonindex 1ce4cb277f..f989b1a574 100644--- a/js/app/tsconfig.json+++ b/js/app/tsconfig.json@@ -82,9 +82,6 @@"@service-stripe/*": ["./packages/service-stripe/*"],- "@growth/*": [- "./packages/growth/*"- ],"@service-storage/*": ["./packages/service-storage/*"],