├── .nvmrc ├── .prettierignore ├── packages ├── highlight │ ├── assets │ │ ├── arc-dark.png │ │ ├── dracula.png │ │ ├── light.png │ │ ├── one-dark.png │ │ ├── coldark-cold.png │ │ ├── coldark-dark.png │ │ ├── duotone-dark.png │ │ ├── duotone-sea.png │ │ ├── holi-dark.png │ │ ├── night-owl.png │ │ ├── synthwave84.png │ │ ├── vscode-dark.png │ │ ├── material-light.png │ │ ├── material-ocean.png │ │ ├── material-palenight.png │ │ ├── material-volcano.png │ │ └── aura-dark.png │ ├── .eslintignore │ ├── src │ │ ├── public-api.ts │ │ └── lib │ │ │ ├── themes │ │ │ ├── light │ │ │ │ ├── index.ts │ │ │ │ └── light.ts │ │ │ ├── oneDark │ │ │ │ ├── index.ts │ │ │ │ └── oneDark.ts │ │ │ ├── holi │ │ │ │ └── index.ts │ │ │ ├── panda │ │ │ │ └── index.ts │ │ │ ├── duotoneDark │ │ │ │ └── index.ts │ │ │ ├── shadeOfPurple │ │ │ │ └── index.ts │ │ │ ├── auraDark │ │ │ │ └── index.ts │ │ │ ├── moonlight │ │ │ │ └── index.ts │ │ │ ├── xCodeDark │ │ │ │ └── index.ts │ │ │ ├── vitesseDark │ │ │ │ └── index.ts │ │ │ ├── dracula │ │ │ │ └── index.ts │ │ │ ├── fleetDark │ │ │ │ └── index.ts │ │ │ ├── arcDark │ │ │ │ └── index.ts │ │ │ ├── duotoneSea │ │ │ │ └── index.ts │ │ │ ├── poimandres │ │ │ │ └── index.ts │ │ │ ├── xCodeLight │ │ │ │ └── index.ts │ │ │ ├── coldarkDark │ │ │ │ └── index.ts │ │ │ ├── materialPalenight │ │ │ │ └── index.ts │ │ │ ├── coldarkCold │ │ │ │ └── index.ts │ │ │ ├── vsCodeDark │ │ │ │ └── index.ts │ │ │ ├── materialLight │ │ │ │ └── index.ts │ │ │ ├── nightOwl │ │ │ │ └── index.ts │ │ │ ├── githubDark │ │ │ │ └── index.ts │ │ │ ├── synthwave84 │ │ │ │ └── index.ts │ │ │ ├── materialOcean │ │ │ │ └── index.ts │ │ │ ├── githubLight │ │ │ │ └── index.ts │ │ │ ├── githubDarkDimmed │ │ │ │ └── index.ts │ │ │ └── materialVolcano │ │ │ │ └── index.ts │ │ │ ├── core │ │ │ └── index.ts │ │ │ └── plugins │ │ │ ├── cursor-style.ts │ │ │ ├── line-numbers-style.ts │ │ │ └── selection-style.ts │ ├── .gitignore │ ├── .lintstagedrc │ ├── tsconfig.esm.json │ ├── tsconfig.dts.json │ ├── tsconfig.json │ └── dev │ │ ├── Editor │ │ ├── themes.ts │ │ └── Editor.css.ts │ │ ├── tsconfig.json │ │ ├── global.css.ts │ │ ├── themeStore.ts │ │ ├── index.html │ │ └── vite.config.ts ├── prisma-models │ ├── .gitignore │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ ├── scripts │ │ └── build.ts │ └── package.json ├── ui │ ├── .eslintignore │ ├── src │ │ ├── lib │ │ │ ├── tokens │ │ │ │ ├── index.ts │ │ │ │ └── createCodeImageTheme.ts │ │ │ ├── primitives │ │ │ │ ├── Badge │ │ │ │ │ └── index.ts │ │ │ │ ├── Group │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── Group.css.ts │ │ │ │ │ └── Group.tsx │ │ │ │ ├── Toggle │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Toggle.tsx │ │ │ │ ├── Label │ │ │ │ │ ├── index.ts │ │ │ │ │ └── FieldLabel.css.ts │ │ │ │ ├── IconButton │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── IconButton.tsx │ │ │ │ ├── PortalHost │ │ │ │ │ ├── index.ts │ │ │ │ │ └── PortalHost.css.ts │ │ │ │ ├── RadioBlock │ │ │ │ │ ├── index.ts │ │ │ │ │ └── RadioBlock.tsx │ │ │ │ ├── Transition │ │ │ │ │ └── index.ts │ │ │ │ ├── SegmentedField │ │ │ │ │ └── index.ts │ │ │ │ ├── Box │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── Stack.css.ts │ │ │ │ │ └── Box.css.ts │ │ │ │ ├── Icon │ │ │ │ │ └── index.ts │ │ │ │ ├── Snackbar │ │ │ │ │ └── index.ts │ │ │ │ ├── Link │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── Link.css.ts │ │ │ │ │ └── Link.tsx │ │ │ │ ├── Button │ │ │ │ │ └── index.ts │ │ │ │ ├── TextField │ │ │ │ │ └── index.ts │ │ │ │ ├── RangeField │ │ │ │ │ └── index.ts │ │ │ │ ├── Field │ │ │ │ │ ├── index.ts │ │ │ │ │ └── FlexField.tsx │ │ │ │ ├── Loader │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── LoadingOverlay.css.ts │ │ │ │ │ ├── Loader.css.ts │ │ │ │ │ ├── LoadingCircle.css.ts │ │ │ │ │ └── LoadingOverlay.tsx │ │ │ │ ├── Text │ │ │ │ │ ├── index.ts │ │ │ │ │ └── Text.css.ts │ │ │ │ └── Dropdown │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── DropdownPortal.tsx │ │ │ │ │ └── DropdownItem.tsx │ │ │ ├── utils │ │ │ │ ├── index.ts │ │ │ │ └── mapToProperty.ts │ │ │ ├── hooks │ │ │ │ ├── pagination │ │ │ │ │ ├── index.ts │ │ │ │ │ └── getLastPage.ts │ │ │ │ ├── arrayFromRange.ts │ │ │ │ └── index.ts │ │ │ └── theme │ │ │ │ ├── variables.css.ts │ │ │ │ ├── index.ts │ │ │ │ ├── spacing.ts │ │ │ │ └── base.css.ts │ │ ├── vite-env.d.ts │ │ └── index.tsx │ ├── .gitignore │ ├── .lintstagedrc │ ├── tsconfig.dts.json │ ├── dev │ │ ├── global.css.ts │ │ ├── tsconfig.json │ │ ├── vite.config.ts │ │ └── index.html │ ├── tsconfig.json │ └── tsconfig.source.json ├── config │ ├── .eslintignore │ ├── .gitignore │ ├── src │ │ ├── lib │ │ │ ├── base │ │ │ │ └── locales.ts │ │ │ ├── types │ │ │ │ ├── terminal-def.ts │ │ │ │ └── configuration.ts │ │ │ ├── icons │ │ │ │ └── txt.svg │ │ │ └── core │ │ │ │ └── createConfiguration.ts │ │ ├── .lintstagedrc │ │ └── public-api.ts │ ├── .lintstagedrc │ ├── tsconfig.esm.json │ ├── tsconfig.dts.json │ ├── tsconfig.json │ └── README.md ├── locale │ ├── .eslintignore │ ├── .gitignore │ ├── .lintstagedrc │ ├── src │ │ ├── public-api.ts │ │ └── lib │ │ │ └── path.ts │ ├── README.md │ ├── tsconfig.esm.json │ ├── tsconfig.json │ ├── tsconfig.dts.json │ └── vite.config.ts ├── atomic-state │ ├── .eslintignore │ ├── .gitignore │ ├── src │ │ ├── experimental │ │ │ └── index.ts │ │ ├── createDerivedObservable.ts │ │ ├── getStoreInternals.ts │ │ ├── index.tsx │ │ └── createTrackObserver.ts │ ├── rollup.config.js │ ├── vitest.config.ts │ ├── .lintstagedrc │ ├── tsconfig.esm.json │ ├── tsconfig.json │ ├── tsconfig.dts.json │ ├── README.md │ └── CHANGELOG.md ├── dom-export │ ├── .eslintignore │ ├── .lintstagedrc │ ├── src │ │ ├── public-api.ts │ │ └── lib │ │ │ ├── cloneSafe.ts │ │ │ └── applyStyleFromOptions.ts │ ├── tsconfig.esm.json │ ├── vitest.config.ts │ ├── tsconfig.json │ ├── tsconfig.dts.json │ ├── README.md │ ├── test │ │ └── embedWebFontsTestPage.html │ └── vite.config.ts └── vanilla-extract │ ├── .eslintignore │ ├── .gitignore │ ├── src │ ├── index.ts │ └── esbuild │ │ └── vanillaCssTsFilesLoader.ts │ ├── .lintstagedrc │ └── tsconfig.json ├── .github ├── FUNDING.yml ├── actions │ └── setup-job │ │ └── action.yml ├── ISSUE_TEMPLATE │ ├── 3-dev-infra-request.yml │ └── 2-feature-request.yml ├── CODEOWNERS ├── stale.yml └── workflows │ └── release.yml ├── apps ├── api │ ├── .eslintignore │ ├── src │ │ ├── modules │ │ │ ├── preset │ │ │ │ ├── repository │ │ │ │ │ ├── index.ts │ │ │ │ │ └── preset.repository.ts │ │ │ │ ├── domain │ │ │ │ │ └── index.ts │ │ │ │ ├── schema │ │ │ │ │ ├── preset-update-dto.schema.ts │ │ │ │ │ └── preset-create-dto.schema.ts │ │ │ │ ├── handlers │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── delete.ts │ │ │ │ │ └── findAll.ts │ │ │ │ ├── exceptions │ │ │ │ │ ├── NotFoundPresetException.ts │ │ │ │ │ └── ExceedPresetLimitException.ts │ │ │ │ └── mapper │ │ │ │ │ └── index.ts │ │ │ └── project │ │ │ │ ├── repository │ │ │ │ └── index.ts │ │ │ │ ├── domain │ │ │ │ ├── index.ts │ │ │ │ ├── projectGetByIdResponse.ts │ │ │ │ └── projectCreateRequest.ts │ │ │ │ └── schema │ │ │ │ ├── project-delete.schema.ts │ │ │ │ └── index.ts │ │ ├── plugins │ │ │ ├── healthcheck.ts │ │ │ ├── sensible.ts │ │ │ ├── handler.ts │ │ │ ├── cors.ts │ │ │ └── prisma.ts │ │ ├── common │ │ │ ├── exceptions │ │ │ │ ├── NotFoundEntityException.ts │ │ │ │ ├── UnprocessableEntityException.ts │ │ │ │ └── HandlerError.ts │ │ │ ├── typebox │ │ │ │ ├── enum.ts │ │ │ │ └── nullable.ts │ │ │ ├── domainFunctions │ │ │ │ └── registry.ts │ │ │ └── types │ │ │ │ └── extract-api-types.ts │ │ ├── routes │ │ │ └── v1 │ │ │ │ └── project │ │ │ │ └── getAllByUserId.ts │ │ └── schemas │ │ │ └── index.ts │ ├── .taprc │ ├── nixpacks.toml │ ├── prisma │ │ └── migrations │ │ │ ├── 20230821142152_update_default_frame_radius │ │ │ └── migration.sql │ │ │ ├── 20231231115803_add_terminal_border_type_property │ │ │ └── migration.sql │ │ │ ├── migration_lock.toml │ │ │ ├── 20240107110836_add_line_number_start │ │ │ └── migration.sql │ │ │ ├── 20230302183231_editor_add_ligatures_option │ │ │ └── migration.sql │ │ │ ├── 20220819164911_delete_cascade_user │ │ │ └── migration.sql │ │ │ ├── 20230302182841_project_unique_owner_constraint_336_feature │ │ │ └── migration.sql │ │ │ ├── 20220813131834_add_user_email │ │ │ └── migration.sql │ │ │ └── 20230304194315_preset │ │ │ └── migration.sql │ ├── .lintstagedrc │ ├── tsconfig.schema.json │ ├── test │ │ ├── helpers │ │ │ └── auth0Mock.ts │ │ ├── __internal__ │ │ │ └── presetUtils.ts │ │ ├── tsconfig.json │ │ ├── setup-unit.ts │ │ ├── modules │ │ │ └── preset │ │ │ │ └── data-utils.ts │ │ └── common │ │ │ └── domainFunctions │ │ │ └── builder.test.ts │ ├── tsup.config.ts │ ├── tsconfig.dts.json │ ├── api-types │ │ └── index.d.ts │ ├── tsconfig.json │ ├── README.md │ └── docker-compose.dev.yml ├── codeimage │ ├── .eslintignore │ ├── src │ │ ├── core │ │ │ ├── modules │ │ │ │ └── dnd │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ ├── constants │ │ │ │ ├── identity.ts │ │ │ │ ├── noop.ts │ │ │ │ ├── non-nullable.ts │ │ │ │ └── umami.ts │ │ │ ├── helpers │ │ │ │ └── string.ts │ │ │ ├── hooks │ │ │ │ └── isMobile.tsx │ │ │ ├── directives │ │ │ │ └── clickOutside.ts │ │ │ └── operators │ │ │ │ ├── create-resize-observer.ts │ │ │ │ └── create-mutation-observer.ts │ │ ├── hooks │ │ │ ├── use-indexed-db.tsx │ │ │ └── use-hotkey.ts │ │ ├── assets │ │ │ ├── apple-icon-180.png │ │ │ ├── codeimage-card.png │ │ │ ├── styles │ │ │ │ ├── app.scss │ │ │ │ ├── _reset.scss │ │ │ │ └── _inter.scss │ │ │ └── logo-white.svg │ │ ├── components │ │ │ ├── LoadingOverlay │ │ │ │ └── Skeleton.tsx │ │ │ ├── FeatureBadge │ │ │ │ ├── browserSvgs │ │ │ │ │ ├── edge.png │ │ │ │ │ ├── opera.png │ │ │ │ │ ├── chrome.png │ │ │ │ │ └── firefox.png │ │ │ │ ├── compatibility │ │ │ │ │ └── api.ts │ │ │ │ └── FeatureBadge.css.ts │ │ │ ├── PropertyEditor │ │ │ │ ├── PanelDivider.tsx │ │ │ │ ├── SidebarPopoverHost.tsx │ │ │ │ ├── SidebarPopoverHost.css.ts │ │ │ │ ├── controls │ │ │ │ │ └── TerminalControlField │ │ │ │ │ │ ├── TerminalControlFieldSkeleton.tsx │ │ │ │ │ │ ├── TerminalControlFieldSkeleton.css.ts │ │ │ │ │ │ └── TerminalControlField.css.ts │ │ │ │ ├── PanelHeader.tsx │ │ │ │ ├── EditorForm.tsx │ │ │ │ ├── SuspenseEditorItem.tsx │ │ │ │ ├── SidebarPopover │ │ │ │ │ └── SidebarPopover.css.ts │ │ │ │ └── EditorSidebar.tsx │ │ │ ├── Toolbar │ │ │ │ ├── ExportContent.css.ts │ │ │ │ └── SettingsDialog.css.ts │ │ │ ├── Terminal │ │ │ │ ├── GlassReflection │ │ │ │ │ └── TerminalGlassReflection.tsx │ │ │ │ ├── MacOsTerminal │ │ │ │ │ ├── MacOsTerminalGrayTheme.tsx │ │ │ │ │ └── MacOsTerminalOutlineTheme.tsx │ │ │ │ └── Tabs │ │ │ │ │ ├── TabIcon │ │ │ │ │ └── TabIcon.css.ts │ │ │ │ │ └── TabAddButton │ │ │ │ │ └── TabAddButton.tsx │ │ │ ├── Scaffold │ │ │ │ ├── Scaffold.css.ts │ │ │ │ ├── Canvas │ │ │ │ │ └── Canvas.tsx │ │ │ │ └── Sidebar │ │ │ │ │ └── Sidebar.tsx │ │ │ ├── Icons │ │ │ │ ├── PlusIcon.tsx │ │ │ │ ├── Download.tsx │ │ │ │ ├── Pencil.tsx │ │ │ │ ├── CloudIcon.tsx │ │ │ │ ├── CheckCircle.tsx │ │ │ │ ├── ShareIcon.tsx │ │ │ │ ├── EmptyCircle.tsx │ │ │ │ ├── CloseIcon.tsx │ │ │ │ ├── Collection.tsx │ │ │ │ ├── Clipboard.tsx │ │ │ │ ├── ColorSwatch.tsx │ │ │ │ ├── Code.tsx │ │ │ │ └── Folder.tsx │ │ │ ├── Changelog │ │ │ │ └── Changelog.css.ts │ │ │ ├── UserBadge │ │ │ │ └── UserBadge.css.ts │ │ │ └── ThemeSwitcher │ │ │ │ ├── ThemeBoxSkeleton.tsx │ │ │ │ └── ThemeBoxSkeleton.css.ts │ │ ├── data-access │ │ │ └── api.ts │ │ ├── ui │ │ │ ├── ExperimentalFeatureTooltip │ │ │ │ └── ExperimentalFeatureTooltip.css.ts │ │ │ ├── snackbarHostAppStyle.css.ts │ │ │ ├── GitHubLoginButton │ │ │ │ └── GitHubLoginButton.css.ts │ │ │ ├── ExperimentalChip │ │ │ │ ├── ExperimentalChip.tsx │ │ │ │ └── ExperimentalChip.css.ts │ │ │ └── Skeleton │ │ │ │ └── SkeletonDivider.tsx │ │ ├── state │ │ │ ├── index.ts │ │ │ ├── presets │ │ │ │ └── types.ts │ │ │ ├── frame │ │ │ │ └── model.ts │ │ │ └── plugins │ │ │ │ └── unique-id.ts │ │ ├── mocks │ │ │ └── browser.ts │ │ ├── umami.d.ts │ │ ├── pages │ │ │ ├── Editor │ │ │ │ └── Editor.tsx │ │ │ └── Dashboard │ │ │ │ └── components │ │ │ │ ├── ProjectToolbar │ │ │ │ └── ProjectToolbar.css.ts │ │ │ │ └── ProjectItemSkeleton │ │ │ │ ├── ProjectItemSkeleton.tsx │ │ │ │ └── ProjectItemSkeleton.css.ts │ │ ├── client.d.ts │ │ └── i18n │ │ │ ├── bottombar.ts │ │ │ └── notFound.ts │ ├── public │ │ ├── assets │ │ │ ├── favicon.ico │ │ │ └── fonts │ │ │ │ ├── agave │ │ │ │ └── Agave-Regular.ttf │ │ │ │ ├── geist_mono │ │ │ │ └── GeistMono[wght].ttf │ │ │ │ ├── IBM_Plex_Mono │ │ │ │ ├── IBMPlexMono-Bold.ttf │ │ │ │ ├── IBMPlexMono-Thin.ttf │ │ │ │ ├── IBMPlexMono-Italic.ttf │ │ │ │ ├── IBMPlexMono-Light.ttf │ │ │ │ ├── IBMPlexMono-Medium.ttf │ │ │ │ ├── IBMPlexMono-Regular.ttf │ │ │ │ ├── IBMPlexMono-SemiBold.ttf │ │ │ │ ├── IBMPlexMono-BoldItalic.ttf │ │ │ │ ├── IBMPlexMono-ExtraLight.ttf │ │ │ │ ├── IBMPlexMono-LightItalic.ttf │ │ │ │ ├── IBMPlexMono-MediumItalic.ttf │ │ │ │ ├── IBMPlexMono-ThinItalic.ttf │ │ │ │ ├── IBMPlexMono-SemiBoldItalic.ttf │ │ │ │ └── IBMPlexMono-ExtraLightItalic.ttf │ │ │ │ └── monaspace │ │ │ │ ├── MonaspaceArgonVarVF[wght,wdth,slnt].ttf │ │ │ │ ├── MonaspaceNeonVarVF[wght,wdth,slnt].ttf │ │ │ │ ├── MonaspaceRadonVarVF[wght,wdth,slnt].ttf │ │ │ │ ├── MonaspaceXenonVarVF[wght,wdth,slnt].ttf │ │ │ │ └── MonaspaceKryptonVarVF[wght,wdth,slnt].ttf │ │ ├── pwa │ │ │ ├── apple-icon-180.png │ │ │ ├── manifest-icon-192.maskable.png │ │ │ └── manifest-icon-512.maskable.png │ │ └── sitemap.xml │ ├── changelog │ │ ├── data │ │ │ ├── 1-5-0 │ │ │ │ ├── font-picker.mp4 │ │ │ │ ├── window-style.mp4 │ │ │ │ ├── xcode-theme.mp4 │ │ │ │ └── constant.ts │ │ │ ├── 1-6-0 │ │ │ │ ├── new-border-option.mp4 │ │ │ │ └── starting-line-number.mp4 │ │ │ ├── 1-7-0 │ │ │ │ └── shareable_presets.png │ │ │ └── 1-9-0 │ │ │ │ └── export-active-tab.png │ │ ├── 1-4-3_11-08-2023.mdx │ │ ├── 1-7-0_06-29-2024.mdx │ │ └── 1-9-0_02-02-2025.mdx │ ├── .lintstagedrc │ ├── vercel.json │ └── tsconfig.json └── website │ ├── public │ ├── img.png │ ├── favicon.ico │ ├── favicon-192x192.png │ ├── favicon-512x512.png │ ├── apple-touch-icon.png │ ├── example-codeimage.png │ ├── fonts │ │ ├── Mona-Sans.woff2 │ │ ├── Mona-Sans-Bold.woff2 │ │ ├── Mona-Sans-Medium.woff2 │ │ ├── Mona-Sans-Regular.woff2 │ │ └── Mona-Sans-SemiBold.woff2 │ ├── projects-showcase.png │ ├── projects-showcase.webp │ ├── landing │ │ ├── codeimage_preview.png │ │ ├── codeimage_preview_lite.png │ │ ├── codeimage_preview_mobile.webp │ │ ├── codeimage_preview_desktop.webp │ │ └── codeimage_preview_mobile_ultra.webp │ ├── brand │ │ └── codeimage_logo_final.png │ ├── manifest.webmanifest │ └── sitemap.xml │ ├── src │ ├── entry-client.tsx │ ├── components │ │ ├── CodeImageLogo │ │ │ ├── codeimage-logo-blue-low-v1.png │ │ │ ├── codeimage-logo-blue-xxxs.webp │ │ │ └── CodeImageLogo.tsx │ │ ├── Landing │ │ │ └── EditorSteps │ │ │ │ ├── EditorScene │ │ │ │ ├── ScrollDownMouse │ │ │ │ │ └── ScrollDownMouse.tsx │ │ │ │ ├── GlassReflection │ │ │ │ │ └── TerminalGlassReflection.tsx │ │ │ │ ├── CircularProgress │ │ │ │ │ ├── CircularProgress.tsx │ │ │ │ │ └── CircularProgress.css.ts │ │ │ │ └── SnippetControls │ │ │ │ │ └── SnippetControls.css.ts │ │ │ │ └── CodeEditor │ │ │ │ ├── lang-javascript-plugin.ts │ │ │ │ ├── CodeEditorPreviewBlock.tsx │ │ │ │ ├── CodeEditor.css.ts │ │ │ │ └── editor-core.ts │ │ └── Umami │ │ │ └── UmamiScript.tsx │ ├── entry-server.tsx │ ├── core │ │ ├── constants.ts │ │ ├── object.ts │ │ └── hydration │ │ │ └── schedule.ts │ └── theme │ │ └── supportLch.ts │ ├── .lighthouserc.json │ ├── .gitignore │ ├── tsconfig.json │ └── add-css-stylesheet.ts ├── .lintstagedrc ├── vercel.json ├── banner.png ├── assets ├── banner.png ├── showcase_1.png ├── codeimage_card.png ├── codesandbox_fork.png └── dependency_graph.png ├── codeimage-logo-black.png ├── codeimage-logo-white.png ├── .husky └── commit-msg ├── pnpm-workspace.yaml ├── .vscode ├── codeimage.code-workspace └── settings.json ├── .idea ├── .gitignore ├── watcherTasks.xml ├── codeStyles │ └── codeStyleConfig.xml ├── vcs.xml ├── jsLibraryMappings.xml ├── jsLinters │ └── eslint.xml ├── inspectionProfiles │ └── Project_Default.xml ├── modules.xml ├── prettier.xml └── codegram.iml ├── .npmrc ├── .gitignore ├── .editorconfig ├── .prettierrc ├── scripts └── env-utils.ts ├── .changeset ├── config.json └── README.md ├── commitlint.config.js ├── patches └── csstype@3.1.1.patch └── tsconfig.json /.nvmrc: -------------------------------------------------------------------------------- 1 | v16.13.2 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist 2 | -------------------------------------------------------------------------------- /packages/highlight/assets/arc-dark.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/dracula.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/light.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/one-dark.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/coldark-cold.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/coldark-dark.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/duotone-dark.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/duotone-sea.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/holi-dark.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/night-owl.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/synthwave84.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/vscode-dark.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: riccardoperra 2 | -------------------------------------------------------------------------------- /apps/api/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/highlight/assets/material-light.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/material-ocean.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/material-palenight.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/assets/material-volcano.png: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/prisma-models/.gitignore: -------------------------------------------------------------------------------- 1 | generated 2 | -------------------------------------------------------------------------------- /packages/ui/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.md": "prettier --write" 3 | } 4 | -------------------------------------------------------------------------------- /apps/codeimage/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/config/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/highlight/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/locale/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/atomic-state/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/dom-export/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/highlight/src/public-api.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/core'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/tokens/index.ts: -------------------------------------------------------------------------------- 1 | export * from './tokens'; 2 | -------------------------------------------------------------------------------- /packages/vanilla-extract/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/ui/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /packages/highlight/src/lib/themes/light/index.ts: -------------------------------------------------------------------------------- 1 | export * from './light'; 2 | -------------------------------------------------------------------------------- /packages/prisma-models/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from '../generated/client'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Badge/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Badge'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Group/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Group'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Toggle/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Toggle'; 2 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "github": { 3 | "enabled": false 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/banner.png -------------------------------------------------------------------------------- /packages/highlight/src/lib/themes/oneDark/index.ts: -------------------------------------------------------------------------------- 1 | export * from './oneDark'; 2 | -------------------------------------------------------------------------------- /packages/locale/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist-ssr 4 | *.local 5 | -------------------------------------------------------------------------------- /packages/ui/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Label/index.ts: -------------------------------------------------------------------------------- 1 | export * from './FieldLabel'; 2 | -------------------------------------------------------------------------------- /packages/config/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/IconButton/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './IconButton'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/PortalHost/index.ts: -------------------------------------------------------------------------------- 1 | export * from './PortalHost'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/RadioBlock/index.ts: -------------------------------------------------------------------------------- 1 | export * from './RadioBlock'; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Transition/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Transition'; 2 | -------------------------------------------------------------------------------- /apps/api/src/modules/preset/repository/index.ts: -------------------------------------------------------------------------------- 1 | export * from './preset.repository.js'; 2 | -------------------------------------------------------------------------------- /apps/api/src/modules/project/repository/index.ts: -------------------------------------------------------------------------------- 1 | export * from './project.repository.js'; 2 | -------------------------------------------------------------------------------- /assets/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/assets/banner.png -------------------------------------------------------------------------------- /packages/atomic-state/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local -------------------------------------------------------------------------------- /packages/highlight/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/SegmentedField/index.ts: -------------------------------------------------------------------------------- 1 | export * from './SegmentedField'; 2 | -------------------------------------------------------------------------------- /packages/atomic-state/src/experimental/index.ts: -------------------------------------------------------------------------------- 1 | export {effect, type Effect} from './effects'; 2 | -------------------------------------------------------------------------------- /packages/vanilla-extract/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local -------------------------------------------------------------------------------- /assets/showcase_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/assets/showcase_1.png -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Box/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Box'; 2 | export * from './Stack'; 3 | -------------------------------------------------------------------------------- /packages/ui/src/lib/utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './factory'; 2 | export * from './mapToProperty'; 3 | -------------------------------------------------------------------------------- /apps/api/.taprc: -------------------------------------------------------------------------------- 1 | test-env: [ 2 | TS_NODE_FILES=true, 3 | TS_NODE_PROJECT=./test/tsconfig.json 4 | ] 5 | -------------------------------------------------------------------------------- /apps/codeimage/src/core/modules/dnd/index.ts: -------------------------------------------------------------------------------- 1 | export {type DragEventParam, type DndRect} from './types'; 2 | -------------------------------------------------------------------------------- /codeimage-logo-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/codeimage-logo-black.png -------------------------------------------------------------------------------- /codeimage-logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/codeimage-logo-white.png -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit "$1" 5 | -------------------------------------------------------------------------------- /apps/website/public/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/img.png -------------------------------------------------------------------------------- /assets/codeimage_card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/assets/codeimage_card.png -------------------------------------------------------------------------------- /assets/codesandbox_fork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/assets/codesandbox_fork.png -------------------------------------------------------------------------------- /assets/dependency_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/assets/dependency_graph.png -------------------------------------------------------------------------------- /packages/config/src/lib/base/locales.ts: -------------------------------------------------------------------------------- 1 | export const SUPPORTED_LOCALES = ['it', 'en', 'de', 'es'] as const; 2 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Icon/index.ts: -------------------------------------------------------------------------------- 1 | export * from './SvgIcon'; 2 | export * from './RemoteSvgIcon'; 3 | -------------------------------------------------------------------------------- /apps/codeimage/src/core/constants/identity.ts: -------------------------------------------------------------------------------- 1 | export function identity(item: T): T { 2 | return item; 3 | } 4 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Snackbar/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Snackbar'; 2 | export * from './SnackbarHost'; 3 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - 'apps/**' 3 | - 'packages/**' 4 | - 'tools/**' 5 | - '!**/test/**' 6 | -------------------------------------------------------------------------------- /.vscode/codeimage.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": ".." 5 | } 6 | ], 7 | "settings": {} 8 | } -------------------------------------------------------------------------------- /apps/website/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/favicon.ico -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Link/index.ts: -------------------------------------------------------------------------------- 1 | export * as linkStyles from './Link.css'; 2 | export {Link} from './Link'; 3 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Button/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Button'; 2 | export * as buttonStyles from './Button.css'; 3 | -------------------------------------------------------------------------------- /apps/website/public/favicon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/favicon-192x192.png -------------------------------------------------------------------------------- /apps/website/public/favicon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/favicon-512x512.png -------------------------------------------------------------------------------- /packages/highlight/assets/aura-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/packages/highlight/assets/aura-dark.png -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/TextField/index.ts: -------------------------------------------------------------------------------- 1 | export * from './TextField'; 2 | export * as textFieldStyles from './TextField.css'; 3 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | save-exact=true 2 | save-prefix= 3 | strict-peer-dependencies=false 4 | 5 | shell-emulator=true 6 | enable-pre-post-scripts=false 7 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/favicon.ico -------------------------------------------------------------------------------- /apps/codeimage/src/hooks/use-indexed-db.tsx: -------------------------------------------------------------------------------- 1 | import * as idb from 'idb-keyval'; 2 | 3 | export function useIdb() { 4 | return idb; 5 | } 6 | -------------------------------------------------------------------------------- /apps/website/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/apple-touch-icon.png -------------------------------------------------------------------------------- /apps/website/public/example-codeimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/example-codeimage.png -------------------------------------------------------------------------------- /apps/website/public/fonts/Mona-Sans.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/fonts/Mona-Sans.woff2 -------------------------------------------------------------------------------- /apps/website/public/projects-showcase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/projects-showcase.png -------------------------------------------------------------------------------- /apps/website/public/projects-showcase.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/projects-showcase.webp -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/RangeField/index.ts: -------------------------------------------------------------------------------- 1 | export * as rangeFieldStyles from './RangeField.css'; 2 | export * from './RangeField'; 3 | -------------------------------------------------------------------------------- /apps/codeimage/public/pwa/apple-icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/pwa/apple-icon-180.png -------------------------------------------------------------------------------- /apps/codeimage/src/assets/apple-icon-180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/src/assets/apple-icon-180.png -------------------------------------------------------------------------------- /apps/codeimage/src/assets/codeimage-card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/src/assets/codeimage-card.png -------------------------------------------------------------------------------- /apps/codeimage/src/core/constants/noop.ts: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line @typescript-eslint/no-empty-function 2 | export function noop(): void {} 3 | -------------------------------------------------------------------------------- /apps/website/src/entry-client.tsx: -------------------------------------------------------------------------------- 1 | import {mount, StartClient} from 'solid-start/entry-client'; 2 | 3 | mount(() => , document); 4 | -------------------------------------------------------------------------------- /packages/atomic-state/rollup.config.js: -------------------------------------------------------------------------------- 1 | // rollup.config.js 2 | import withSolid from 'rollup-preset-solid'; 3 | 4 | export default withSolid(); 5 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Field/index.ts: -------------------------------------------------------------------------------- 1 | export {FlexField} from './FlexField'; 2 | export * as flexFieldStyles from './FlexField.css'; 3 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/LoadingOverlay/Skeleton.tsx: -------------------------------------------------------------------------------- 1 | export const Skeleton = () => { 2 | return
; 3 | }; 4 | -------------------------------------------------------------------------------- /apps/website/public/fonts/Mona-Sans-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/fonts/Mona-Sans-Bold.woff2 -------------------------------------------------------------------------------- /packages/atomic-state/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: {}, 5 | }); 6 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Loader/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Loading'; 2 | export * from './LoadingCircle'; 3 | export * from './LoadingOverlay'; 4 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Text/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Text'; 2 | export * from './useText'; 3 | export * as textStyles from './Text.css'; 4 | -------------------------------------------------------------------------------- /apps/api/nixpacks.toml: -------------------------------------------------------------------------------- 1 | # nixpacks.toml 2 | providers = ["node"] 3 | 4 | [phases.setup] 5 | nixPkgs = ["nodejs"] 6 | 7 | [phases.build] 8 | cmds = ["ls"] 9 | -------------------------------------------------------------------------------- /apps/api/prisma/migrations/20230821142152_update_default_frame_radius/migration.sql: -------------------------------------------------------------------------------- 1 | UPDATE "SnippetFrame" 2 | SET radius = 8 3 | where radius is not null; 4 | -------------------------------------------------------------------------------- /apps/codeimage/src/data-access/api.ts: -------------------------------------------------------------------------------- 1 | import * as projectApi from './project'; 2 | 3 | export const API = { 4 | project: projectApi, 5 | } as const; 6 | -------------------------------------------------------------------------------- /apps/website/public/fonts/Mona-Sans-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/fonts/Mona-Sans-Medium.woff2 -------------------------------------------------------------------------------- /apps/website/public/fonts/Mona-Sans-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/fonts/Mona-Sans-Regular.woff2 -------------------------------------------------------------------------------- /apps/website/public/landing/codeimage_preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/landing/codeimage_preview.png -------------------------------------------------------------------------------- /packages/highlight/src/lib/core/index.ts: -------------------------------------------------------------------------------- 1 | export * from './custom-theme'; 2 | export * from './build-theme'; 3 | export * from './define-editor-theme'; 4 | -------------------------------------------------------------------------------- /apps/api/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{ts,tsx,js,jsx}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /apps/codeimage/changelog/data/1-5-0/font-picker.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/changelog/data/1-5-0/font-picker.mp4 -------------------------------------------------------------------------------- /apps/codeimage/changelog/data/1-5-0/window-style.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/changelog/data/1-5-0/window-style.mp4 -------------------------------------------------------------------------------- /apps/codeimage/changelog/data/1-5-0/xcode-theme.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/changelog/data/1-5-0/xcode-theme.mp4 -------------------------------------------------------------------------------- /apps/codeimage/src/core/helpers/string.ts: -------------------------------------------------------------------------------- 1 | export const toTitleCase = (str: string) => { 2 | return str.replace(/(^|\s)\S/g, t => t.toUpperCase()); 3 | }; 4 | -------------------------------------------------------------------------------- /apps/website/public/brand/codeimage_logo_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/brand/codeimage_logo_final.png -------------------------------------------------------------------------------- /apps/website/public/fonts/Mona-Sans-SemiBold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/fonts/Mona-Sans-SemiBold.woff2 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .vercel 4 | **/*.env 5 | .env 6 | .env.* 7 | ./**/*.env 8 | ./**/*.env.* 9 | .idea 10 | .pnpm-store/ 11 | .DS_STORE 12 | -------------------------------------------------------------------------------- /apps/codeimage/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{ts,tsx,js,jsx}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /apps/website/public/landing/codeimage_preview_lite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/landing/codeimage_preview_lite.png -------------------------------------------------------------------------------- /.idea/watcherTasks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /apps/codeimage/changelog/data/1-6-0/new-border-option.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/changelog/data/1-6-0/new-border-option.mp4 -------------------------------------------------------------------------------- /apps/codeimage/changelog/data/1-7-0/shareable_presets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/changelog/data/1-7-0/shareable_presets.png -------------------------------------------------------------------------------- /apps/codeimage/changelog/data/1-9-0/export-active-tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/changelog/data/1-9-0/export-active-tab.png -------------------------------------------------------------------------------- /apps/codeimage/public/pwa/manifest-icon-192.maskable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/pwa/manifest-icon-192.maskable.png -------------------------------------------------------------------------------- /apps/codeimage/public/pwa/manifest-icon-512.maskable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/pwa/manifest-icon-512.maskable.png -------------------------------------------------------------------------------- /apps/website/public/landing/codeimage_preview_mobile.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/landing/codeimage_preview_mobile.webp -------------------------------------------------------------------------------- /packages/locale/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{ts,tsx,js,jsx,json}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/ui/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "**.{ts,tsx,js,jsx,json}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /apps/api/prisma/migrations/20231231115803_add_terminal_border_type_property/migration.sql: -------------------------------------------------------------------------------- 1 | -- AlterTable 2 | ALTER TABLE "SnippetTerminal" ADD COLUMN "borderType" TEXT; 3 | -------------------------------------------------------------------------------- /apps/api/tsconfig.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "dist", 5 | "emitDeclarationOnly": true, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/agave/Agave-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/agave/Agave-Regular.ttf -------------------------------------------------------------------------------- /apps/website/public/landing/codeimage_preview_desktop.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/landing/codeimage_preview_desktop.webp -------------------------------------------------------------------------------- /packages/config/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "**/*.{ts,tsx,js,jsx,json}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/config/src/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{ts,tsx,js,jsx,json}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/highlight/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{ts,tsx,js,jsx,json}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/vanilla-extract/src/index.ts: -------------------------------------------------------------------------------- 1 | export {vanillaExtractPlugin} from './vite-plugin'; 2 | 3 | export {vanillaCssTsFilesLoader} from './esbuild/vanillaCssTsFilesLoader'; 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.formatOnSave": true, 3 | "editor.bracketPairColorization.enabled": false, 4 | "typescript.tsdk": "node_modules/typescript/lib" 5 | } -------------------------------------------------------------------------------- /apps/api/prisma/migrations/migration_lock.toml: -------------------------------------------------------------------------------- 1 | # Please do not edit this file manually 2 | # It should be added in your version-control system (i.e. Git) 3 | provider = "postgresql" -------------------------------------------------------------------------------- /apps/codeimage/changelog/data/1-6-0/starting-line-number.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/changelog/data/1-6-0/starting-line-number.mp4 -------------------------------------------------------------------------------- /packages/atomic-state/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{ts,tsx,js,jsx,json}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/dom-export/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "**/*.{ts,tsx,js,jsx,json}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /packages/locale/src/public-api.ts: -------------------------------------------------------------------------------- 1 | export {I18nContext, createI18nContext} from '@solid-primitives/i18n'; 2 | 3 | export * from './lib/path'; 4 | export * from './lib/use-i18n'; 5 | -------------------------------------------------------------------------------- /packages/vanilla-extract/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{ts,tsx,js,jsx,json}": [ 3 | "pnpm lint", 4 | "pnpm pre-commit-prettier", 5 | "pnpm pre-commit-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /apps/api/src/modules/project/domain/index.ts: -------------------------------------------------------------------------------- 1 | export * from './projectCreateRequest.js'; 2 | export * from './projectUpdateRequest.js'; 3 | export * from './projectGetByIdResponse.js'; 4 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/FeatureBadge/browserSvgs/edge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/src/components/FeatureBadge/browserSvgs/edge.png -------------------------------------------------------------------------------- /apps/codeimage/src/components/FeatureBadge/browserSvgs/opera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/src/components/FeatureBadge/browserSvgs/opera.png -------------------------------------------------------------------------------- /apps/website/public/landing/codeimage_preview_mobile_ultra.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/public/landing/codeimage_preview_mobile_ultra.webp -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | indent_style = space 9 | indent_size = 2 -------------------------------------------------------------------------------- /apps/api/prisma/migrations/20240107110836_add_line_number_start/migration.sql: -------------------------------------------------------------------------------- 1 | -- AlterTable 2 | ALTER TABLE "SnippetEditorTab" ADD COLUMN "lineNumberStart" INTEGER NOT NULL DEFAULT 1; 3 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/geist_mono/GeistMono[wght].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/geist_mono/GeistMono[wght].ttf -------------------------------------------------------------------------------- /apps/codeimage/src/components/FeatureBadge/browserSvgs/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/src/components/FeatureBadge/browserSvgs/chrome.png -------------------------------------------------------------------------------- /apps/codeimage/src/components/FeatureBadge/browserSvgs/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/src/components/FeatureBadge/browserSvgs/firefox.png -------------------------------------------------------------------------------- /packages/config/tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": false, 5 | "outDir": "./dist/esm" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/dom-export/src/public-api.ts: -------------------------------------------------------------------------------- 1 | export * from './lib'; 2 | export {cloneNodeSafe} from './lib/cloneSafe'; 3 | 4 | export {type Options as HtmlExportOptions} from './lib/options'; 5 | -------------------------------------------------------------------------------- /packages/locale/README.md: -------------------------------------------------------------------------------- 1 | ### @codeimage/Locale 2 | 3 | This is just a wrapper of [`solid-i18n`](https://github.com/davedbase/solid-primitives/tree/main/packages/i18n) with strict typings 4 | -------------------------------------------------------------------------------- /packages/locale/tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": false, 5 | "outDir": "./dist/esm" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Bold.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Thin.ttf -------------------------------------------------------------------------------- /packages/atomic-state/tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": false, 5 | "outDir": "./dist/esm" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/dom-export/tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": false, 5 | "outDir": "./dist/esm" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /packages/highlight/tsconfig.esm.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": false, 5 | "outDir": "./dist/esm" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Italic.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Light.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Medium.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-Regular.ttf -------------------------------------------------------------------------------- /apps/codeimage/src/ui/ExperimentalFeatureTooltip/ExperimentalFeatureTooltip.css.ts: -------------------------------------------------------------------------------- 1 | import {style} from '@vanilla-extract/css'; 2 | 3 | export const tooltip = style({ 4 | maxWidth: '350px', 5 | }); 6 | -------------------------------------------------------------------------------- /apps/website/src/components/CodeImageLogo/codeimage-logo-blue-low-v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/src/components/CodeImageLogo/codeimage-logo-blue-low-v1.png -------------------------------------------------------------------------------- /apps/website/src/components/CodeImageLogo/codeimage-logo-blue-xxxs.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/website/src/components/CodeImageLogo/codeimage-logo-blue-xxxs.webp -------------------------------------------------------------------------------- /packages/dom-export/vitest.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'happy-dom', 6 | // ... 7 | }, 8 | }); 9 | -------------------------------------------------------------------------------- /packages/ui/src/lib/hooks/pagination/index.ts: -------------------------------------------------------------------------------- 1 | export {arrayFomRange} from '../arrayFromRange'; 2 | export {getLastPage} from './getLastPage'; 3 | export {createPagedData} from './createPagedData'; 4 | -------------------------------------------------------------------------------- /apps/api/prisma/migrations/20230302183231_editor_add_ligatures_option/migration.sql: -------------------------------------------------------------------------------- 1 | -- AlterTable 2 | ALTER TABLE "SnippetEditorOptions" ADD COLUMN "enableLigatures" BOOLEAN NOT NULL DEFAULT true; 3 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-SemiBold.ttf -------------------------------------------------------------------------------- /apps/codeimage/src/ui/snackbarHostAppStyle.css.ts: -------------------------------------------------------------------------------- 1 | import {style} from '@vanilla-extract/css'; 2 | 3 | export const snackbarHostAppStyleCss = style({ 4 | inset: 'calc(20px + 60px) !important', 5 | }); 6 | -------------------------------------------------------------------------------- /apps/codeimage/vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "rewrites": [ 3 | { 4 | "source": "/(.*)", 5 | "destination": "/" 6 | } 7 | ], 8 | "github": { 9 | "enabled": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /apps/codeimage/changelog/data/1-5-0/constant.ts: -------------------------------------------------------------------------------- 1 | export const localFontAccessApiBrowserCompatibilityLink = 2 | 'https://developer.mozilla.org/en-US/docs/Web/API/Local_Font_Access_API#browser_compatibility'; 3 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-BoldItalic.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-ExtraLight.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-LightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-LightItalic.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-MediumItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-MediumItalic.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-ThinItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-ThinItalic.ttf -------------------------------------------------------------------------------- /apps/codeimage/src/core/constants/non-nullable.ts: -------------------------------------------------------------------------------- 1 | export function nonNullable( 2 | value: T | undefined | null, 3 | ): value is NonNullable { 4 | return value !== null && value !== undefined; 5 | } 6 | -------------------------------------------------------------------------------- /packages/ui/src/lib/hooks/arrayFromRange.ts: -------------------------------------------------------------------------------- 1 | export const arrayFomRange = (start: number, end: number) => { 2 | const length = end - start + 1; 3 | return Array.from({length}, (_, i) => start + i); 4 | }; 5 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-SemiBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-SemiBoldItalic.ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-ExtraLightItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/IBM_Plex_Mono/IBMPlexMono-ExtraLightItalic.ttf -------------------------------------------------------------------------------- /packages/config/tsconfig.dts.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "declarationMap": false, 6 | "outDir": "./dist" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/monaspace/MonaspaceArgonVarVF[wght,wdth,slnt].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/monaspace/MonaspaceArgonVarVF[wght,wdth,slnt].ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/monaspace/MonaspaceNeonVarVF[wght,wdth,slnt].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/monaspace/MonaspaceNeonVarVF[wght,wdth,slnt].ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/monaspace/MonaspaceRadonVarVF[wght,wdth,slnt].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/monaspace/MonaspaceRadonVarVF[wght,wdth,slnt].ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/monaspace/MonaspaceXenonVarVF[wght,wdth,slnt].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/monaspace/MonaspaceXenonVarVF[wght,wdth,slnt].ttf -------------------------------------------------------------------------------- /apps/codeimage/public/assets/fonts/monaspace/MonaspaceKryptonVarVF[wght,wdth,slnt].ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riccardoperra/codeimage/HEAD/apps/codeimage/public/assets/fonts/monaspace/MonaspaceKryptonVarVF[wght,wdth,slnt].ttf -------------------------------------------------------------------------------- /apps/api/src/plugins/healthcheck.ts: -------------------------------------------------------------------------------- 1 | import fastifyHealthcheck from 'fastify-healthcheck'; 2 | import fp from 'fastify-plugin'; 3 | 4 | export default fp(async fastify => { 5 | return fastify.register(fastifyHealthcheck); 6 | }); 7 | -------------------------------------------------------------------------------- /.idea/jsLibraryMappings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /apps/website/public/manifest.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "icons": [ 3 | { "src": "/favicon-192x192.png", "type": "image/png", "sizes": "192x192" }, 4 | { "src": "/favicon-512x512.png", "type": "image/png", "sizes": "512x512" } 5 | ] 6 | } -------------------------------------------------------------------------------- /packages/atomic-state/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "preserve", 5 | "jsxImportSource": "solid-js" 6 | }, 7 | "include": [ 8 | "./src" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/vanilla-extract/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./dist", 5 | "preserveSymlinks": true 6 | }, 7 | "include": [ 8 | "./src" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /apps/website/src/components/Landing/EditorSteps/EditorScene/ScrollDownMouse/ScrollDownMouse.tsx: -------------------------------------------------------------------------------- 1 | import * as styles from './ScrollDownMouse.css'; 2 | 3 | export function ScrollDownMouse() { 4 | return
; 5 | } 6 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Dropdown/index.ts: -------------------------------------------------------------------------------- 1 | export * as dropdownStyles from './Dropdown.css'; 2 | export * from './DropdownItem'; 3 | export * from './DropdownMenu'; 4 | // export * from './DropdownPanel'; 5 | export * from './DropdownPortal'; 6 | -------------------------------------------------------------------------------- /.idea/jsLinters/eslint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "tabWidth": 2, 3 | "quoteProps": "as-needed", 4 | "printWidth": 80, 5 | "singleQuote": true, 6 | "arrowParens": "avoid", 7 | "trailingComma": "all", 8 | "bracketSpacing": false, 9 | "endOfLine": "auto" 10 | } 11 | -------------------------------------------------------------------------------- /packages/config/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "preserve", 5 | "jsxImportSource": "solid-js", 6 | }, 7 | "include": [ 8 | "./src" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/locale/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "preserve", 5 | "jsxImportSource": "solid-js", 6 | }, 7 | "include": [ 8 | "./src" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/ui/src/lib/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export {useFloating} from './useFloating'; 2 | export type {UseFloatingOptions} from './useFloating'; 3 | export {createPagedData, getLastPage} from './pagination'; 4 | export {arrayFomRange} from './arrayFromRange'; 5 | -------------------------------------------------------------------------------- /apps/website/src/entry-server.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | createHandler, 3 | renderAsync, 4 | StartServer, 5 | } from 'solid-start/entry-server'; 6 | 7 | export default createHandler( 8 | renderAsync(event => ), 9 | ); 10 | -------------------------------------------------------------------------------- /packages/dom-export/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "preserve", 5 | "jsxImportSource": "solid-js", 6 | }, 7 | "include": [ 8 | "./src" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/locale/tsconfig.dts.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "declarationMap": false, 6 | "emitDeclarationOnly": true, 7 | "outDir": "./dist" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/PropertyEditor/PanelDivider.tsx: -------------------------------------------------------------------------------- 1 | import {VoidComponent} from 'solid-js'; 2 | import * as styles from './EditorSidebar.css'; 3 | 4 | export const PanelDivider: VoidComponent = () => { 5 | return
; 6 | }; 7 | -------------------------------------------------------------------------------- /apps/website/src/components/Landing/EditorSteps/CodeEditor/lang-javascript-plugin.ts: -------------------------------------------------------------------------------- 1 | import { 2 | javascriptLanguage, 3 | jsxLanguage as $jsxLanguage, 4 | } from '@codemirror/lang-javascript'; 5 | 6 | export const jsxLanguage = [javascriptLanguage, $jsxLanguage]; 7 | -------------------------------------------------------------------------------- /packages/dom-export/tsconfig.dts.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "declarationMap": false, 6 | "emitDeclarationOnly": true, 7 | "outDir": "./dist" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/highlight/tsconfig.dts.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "declarationMap": false, 6 | "emitDeclarationOnly": true, 7 | "outDir": "./dist" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/ui/tsconfig.dts.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "declarationMap": false, 6 | "emitDeclarationOnly": true, 7 | "outDir": "./dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /scripts/env-utils.ts: -------------------------------------------------------------------------------- 1 | export function makeEnvFile( 2 | obj: Record, 3 | ): string { 4 | return Object.entries(obj).reduce( 5 | (acc, [key, value]) => (key ? acc + `${key}=${String(value)}\n` : acc), 6 | '', 7 | ); 8 | } 9 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/Toolbar/ExportContent.css.ts: -------------------------------------------------------------------------------- 1 | import {style} from '@vanilla-extract/css'; 2 | 3 | export const exportContent = style({ 4 | width: '240px', 5 | }); 6 | 7 | export const exportContentPopover = style({ 8 | maxWidth: 'unset', 9 | }); 10 | -------------------------------------------------------------------------------- /packages/highlight/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "preserve", 5 | "jsxImportSource": "solid-js", 6 | "types": ["@types/node"] 7 | }, 8 | "include": [ 9 | "./src", 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/PortalHost/PortalHost.css.ts: -------------------------------------------------------------------------------- 1 | import {style} from '@vanilla-extract/css'; 2 | import {themeVars} from '../../theme'; 3 | 4 | export const host = style({ 5 | width: '0px', 6 | height: '0px', 7 | zIndex: themeVars.zIndex['40'], 8 | }); 9 | -------------------------------------------------------------------------------- /apps/codeimage/src/state/index.ts: -------------------------------------------------------------------------------- 1 | import {Container} from 'statebuilder'; 2 | import {createRoot} from 'solid-js'; 3 | 4 | const container = createRoot(() => Container.create()); 5 | 6 | export const provideAppState: typeof container.get = state => 7 | container.get(state); 8 | -------------------------------------------------------------------------------- /packages/atomic-state/tsconfig.dts.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "declarationMap": false, 6 | "emitDeclarationOnly": true, 7 | "outDir": "./dist/types" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/ui/src/lib/theme/variables.css.ts: -------------------------------------------------------------------------------- 1 | import {createVar} from '@vanilla-extract/css'; 2 | 3 | export const colorVar = createVar(); 4 | export const fontSize = createVar(); 5 | export const backgroundColorVar = createVar(); 6 | export const dynamicFullHeight = createVar(); 7 | -------------------------------------------------------------------------------- /apps/api/src/modules/preset/domain/index.ts: -------------------------------------------------------------------------------- 1 | import {Preset} from '@codeimage/prisma-models'; 2 | 3 | export type PresetCreateRequest = Pick< 4 | Preset, 5 | 'name' | 'data' | 'ownerId' | 'version' 6 | >; 7 | 8 | export type PresetUpdateRequest = Pick; 9 | -------------------------------------------------------------------------------- /apps/codeimage/src/mocks/browser.ts: -------------------------------------------------------------------------------- 1 | import {setupWorker} from 'msw'; 2 | import {db} from './db'; 3 | import {persistMswjs} from './persist'; 4 | import projectHandlers from './projectMockHandlers'; 5 | 6 | export const worker = setupWorker(...projectHandlers); 7 | persistMswjs(db); 8 | -------------------------------------------------------------------------------- /packages/ui/src/index.tsx: -------------------------------------------------------------------------------- 1 | export * from './lib/theme'; 2 | export * from './lib/primitives'; 3 | export * from './lib/hooks'; 4 | export * from './lib/tokens'; 5 | 6 | export { 7 | createFloatingPortalNode, 8 | FloatingPortal, 9 | } from './lib/floating/floating-portal'; 10 | -------------------------------------------------------------------------------- /apps/api/test/helpers/auth0Mock.ts: -------------------------------------------------------------------------------- 1 | import {User} from '@codeimage/prisma-models'; 2 | import {TestContext} from 'vitest'; 3 | import {mockAuthProvider} from '../../src/plugins/auth0.js'; 4 | 5 | export const auth0Mock = (t: TestContext & T) => 6 | mockAuthProvider(t.user); 7 | -------------------------------------------------------------------------------- /apps/api/tsup.config.ts: -------------------------------------------------------------------------------- 1 | import {defineConfig} from 'tsup'; 2 | 3 | export default defineConfig({ 4 | entry: ['./src/**/*.ts'], 5 | bundle: false, 6 | platform: 'node', 7 | target: 'node18', 8 | format: ['esm'], 9 | sourcemap: true, 10 | clean: true, 11 | dts: false, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/highlight/dev/Editor/themes.ts: -------------------------------------------------------------------------------- 1 | import {CustomTheme} from '../../src/lib/core'; 2 | import * as themes from '../../src/lib/themes'; 3 | 4 | export const AVAILABLE_THEMES: CustomTheme[] = Object.values(themes).sort( 5 | (a, b) => a.properties.label.localeCompare(b.properties.label), 6 | ); 7 | -------------------------------------------------------------------------------- /packages/ui/src/lib/theme/index.ts: -------------------------------------------------------------------------------- 1 | export * from './colors'; 2 | export * from './spacing'; 3 | export * from './theme.css'; 4 | export * from './global2.css'; 5 | export * from './sprinkles.css'; 6 | export * from './variables.css'; 7 | export * from './base.css'; 8 | export * from './with-theme-mode'; 9 | -------------------------------------------------------------------------------- /.github/actions/setup-job/action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup CI Step' 2 | description: 'Checkout PR and use same node version for jobs' 3 | 4 | runs: 5 | using: 'composite' 6 | 7 | steps: 8 | - name: Use Node.js 22 9 | uses: actions/setup-node@v4 10 | with: 11 | node-version: 22 12 | -------------------------------------------------------------------------------- /apps/api/src/modules/preset/schema/preset-update-dto.schema.ts: -------------------------------------------------------------------------------- 1 | import {Static, Type as t} from '@sinclair/typebox'; 2 | 3 | export const PresetUpdateDtoSchema = t.Object({ 4 | name: t.String(), 5 | data: t.Object({}), 6 | }); 7 | 8 | export type PresetUpdateDto = Static; 9 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /apps/api/test/__internal__/presetUtils.ts: -------------------------------------------------------------------------------- 1 | import {Value} from '@sinclair/typebox/value'; 2 | import {PresetDataSchema} from '../../src/modules/preset/schema/preset-dto.schema.js'; 3 | 4 | export const testPresetUtils = { 5 | buildPresetData() { 6 | return Value.Create(PresetDataSchema); 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /apps/api/test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noEmit": true, 5 | "moduleResolution": "Node16", 6 | "module": "ES2022", 7 | "target": "ES2022" 8 | }, 9 | "include": [ 10 | "../src/**/*.ts", 11 | "**/*.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/PropertyEditor/SidebarPopoverHost.tsx: -------------------------------------------------------------------------------- 1 | import * as styles from './SidebarPopoverHost.css'; 2 | 3 | export const SIDEBAR_POPOVER_HOST_ID = 'sidebar-popover-host'; 4 | 5 | export function SidebarPopoverHost() { 6 | return
; 7 | } 8 | -------------------------------------------------------------------------------- /apps/website/.lighthouserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "ci": { 3 | "collect": { 4 | "url": [ 5 | "http://localhost/" 6 | ], 7 | "staticDistDir": "dist/public", 8 | "numberOfRuns": 3 9 | }, 10 | "upload": { 11 | "target": "temporary-public-storage" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /apps/codeimage/src/core/hooks/isMobile.tsx: -------------------------------------------------------------------------------- 1 | type AppMode = 'full' | 'mobile'; 2 | 3 | export function useModality(): AppMode { 4 | // const phone = useMediaQuery(`screen and (max-width: 768px)`); 5 | const phone = window.matchMedia('screen and (max-width: 768px)').matches; 6 | return phone ? 'mobile' : 'full'; 7 | } 8 | -------------------------------------------------------------------------------- /apps/website/src/core/constants.ts: -------------------------------------------------------------------------------- 1 | export const mainWebsiteLink = 'https://app.codeimage.dev'; 2 | export const betterCommentsForGitHubLink = 3 | 'https://better-comments-for-github.netlify.app'; 4 | export const ogImageUrl = 5 | 'https://github.com/riccardoperra/codeimage/blob/main/assets/codeimage_card.png?raw=true'; 6 | -------------------------------------------------------------------------------- /packages/ui/src/lib/utils/mapToProperty.ts: -------------------------------------------------------------------------------- 1 | import type {Properties} from 'csstype'; 2 | 3 | export const mapToProperty = 4 | >(property: Property) => 5 | (value: string | number) => { 6 | const styleRule = {[property]: value}; 7 | return styleRule; 8 | }; 9 | -------------------------------------------------------------------------------- /apps/codeimage/changelog/1-4-3_11-08-2023.mdx: -------------------------------------------------------------------------------- 1 | # v1.4.3 2 | 3 | This new version introduce the [JetBrains Fleet](https://www.jetbrains.com/fleet/) Dark Theme in the CodeImage editor! 4 | 5 | ![Snippet using jetbrains fleet theme](https://github.com/riccardoperra/codeimage/assets/37072694/0f346e31-92ec-4176-991d-d6aa2ae9e225) 6 | -------------------------------------------------------------------------------- /apps/api/prisma/migrations/20220819164911_delete_cascade_user/migration.sql: -------------------------------------------------------------------------------- 1 | -- DropForeignKey 2 | ALTER TABLE "Project" DROP CONSTRAINT "Project_userId_fkey"; 3 | 4 | -- AddForeignKey 5 | ALTER TABLE "Project" ADD CONSTRAINT "Project_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; 6 | -------------------------------------------------------------------------------- /apps/api/tsconfig.dts.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": true, 5 | "emitDeclarationOnly": true, 6 | "declarationMap": false, 7 | "outDir": "./dist", 8 | "moduleResolution": "NodeNext", 9 | "module": "NodeNext", 10 | "target": "ES2022" 11 | } 12 | } -------------------------------------------------------------------------------- /apps/codeimage/src/core/modules/dnd/types.ts: -------------------------------------------------------------------------------- 1 | import {DragEventHandler} from '@thisbeyond/solid-dnd/dist/types/drag-drop-context'; 2 | 3 | export interface DndRect { 4 | left?: number; 5 | top?: number; 6 | right?: number; 7 | bottom?: number; 8 | } 9 | 10 | export type DragEventParam = Parameters[0]; 11 | -------------------------------------------------------------------------------- /apps/codeimage/src/umami.d.ts: -------------------------------------------------------------------------------- 1 | declare const umami: Umami; 2 | 3 | // https://umami.is/docs/tracker-functions 4 | interface Umami { 5 | track(view_properties?: {website: string; [key: string]: string}): void; 6 | track( 7 | event_name: string, 8 | event_data?: {[key: string]: string | number}, 9 | ): void; 10 | } 11 | -------------------------------------------------------------------------------- /apps/website/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | dist 3 | .solid 4 | .output 5 | .vercel 6 | .netlify 7 | netlify 8 | 9 | # dependencies 10 | /node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | *.launch 17 | .settings/ 18 | 19 | # Temp 20 | gitignore 21 | 22 | # System Files 23 | .DS_Store 24 | Thumbs.db 25 | -------------------------------------------------------------------------------- /apps/website/src/theme/supportLch.ts: -------------------------------------------------------------------------------- 1 | import {StyleRule} from '@vanilla-extract/css'; 2 | 3 | type CSSProps = Omit; 4 | 5 | export function lchSupportStyle(props: CSSProps): StyleRule { 6 | return { 7 | '@supports': { 8 | '(color: lch(0% 0 0))': props, 9 | }, 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /packages/prisma-models/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "outDir": "dist", 5 | "target": "ESNext", 6 | "module": "CommonJS", 7 | "moduleResolution": "node", 8 | "declaration": true, 9 | "sourceMap": false 10 | }, 11 | "include": [ 12 | "src/**/*" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /packages/ui/dev/global.css.ts: -------------------------------------------------------------------------------- 1 | import {globalStyle} from '@vanilla-extract/css'; 2 | import {themeVars} from '../src/lib/theme/global2.css'; 3 | 4 | globalStyle('html, body', { 5 | fontFamily: 'Albert Sans, sans-serif', 6 | backgroundColor: themeVars.dynamicColors.panel.background, 7 | color: themeVars.dynamicColors.baseText, 8 | }); 9 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/FeatureBadge/compatibility/api.ts: -------------------------------------------------------------------------------- 1 | import {Identifier} from './types'; 2 | 3 | export function getWindowMdnCompatibilityApi() { 4 | return fetch( 5 | 'https://raw.githubusercontent.com/mdn/browser-compat-data/main/api/Window.json', 6 | ).then(res => res.json() as Promise<{api: {Window: Identifier['Window']}}>); 7 | } 8 | -------------------------------------------------------------------------------- /packages/config/src/lib/types/terminal-def.ts: -------------------------------------------------------------------------------- 1 | export interface TerminalDefinition { 2 | name: T; 3 | component: TComponent; 4 | } 5 | 6 | export type TerminalDefinitionMap = { 7 | keys: readonly [...T]; 8 | entries: Record>; 9 | }; 10 | -------------------------------------------------------------------------------- /apps/api/api-types/index.d.ts: -------------------------------------------------------------------------------- 1 | export type { 2 | CreateProjectApi, 3 | DeleteProjectApi, 4 | UpdateProjectApi, 5 | UpdateProjectNameApi, 6 | GetProjectByIdApi, 7 | CloneProjectApi, 8 | CreatePresetApi, 9 | DeletePresetApi, 10 | GetPresetByIdApi, 11 | UpdatePresetApi, 12 | GetAllPresetApi, 13 | } from '../dist/schemas/index.js'; 14 | -------------------------------------------------------------------------------- /apps/codeimage/src/state/presets/types.ts: -------------------------------------------------------------------------------- 1 | import {GetPresetByIdApi} from '@codeimage/api/api-types'; 2 | 3 | export type ApiPreset = GetPresetByIdApi['response']; 4 | export type PresetData = ApiPreset['data']; 5 | 6 | export type Preset = Omit & { 7 | data: PresetData; 8 | }; 9 | 10 | export type PresetsArray = Array; 11 | -------------------------------------------------------------------------------- /apps/api/prisma/migrations/20230302182841_project_unique_owner_constraint_336_feature/migration.sql: -------------------------------------------------------------------------------- 1 | -- AddForeignKey 2 | ALTER TABLE "Project" ADD CONSTRAINT "Project_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; 3 | 4 | -- RenameIndex 5 | ALTER INDEX "Project_id_ownerId_idx" RENAME TO "Project_id_ownerId_key"; 6 | -------------------------------------------------------------------------------- /apps/api/test/setup-unit.ts: -------------------------------------------------------------------------------- 1 | import * as dotEnv from 'dotenv'; 2 | import path from 'node:path'; 3 | import {fileURLToPath} from 'node:url'; 4 | 5 | export function setup() { 6 | const __filename = fileURLToPath(import.meta.url); 7 | const __dirname = path.dirname(__filename); 8 | 9 | dotEnv.config({path: `${__dirname}/../.env.test`}).parsed; 10 | } 11 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/Terminal/GlassReflection/TerminalGlassReflection.tsx: -------------------------------------------------------------------------------- 1 | import {Box} from '@codeimage/ui'; 2 | import * as styles from './TerminalGlassReflection.css'; 3 | 4 | export const TerminalGlassReflection = () => { 5 | return ( 6 | 7 | 8 | 9 | ); 10 | }; 11 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@1.6.4/schema.json", 3 | "changelog": ["@changesets/changelog-github", { "repo": "riccardoperra/codeimage" }], 4 | "commit": true, 5 | "linked": [], 6 | "access": "restricted", 7 | "baseBranch": "main", 8 | "updateInternalDependencies": "patch", 9 | "ignore": [] 10 | } 11 | -------------------------------------------------------------------------------- /apps/website/src/components/Landing/EditorSteps/CodeEditor/CodeEditorPreviewBlock.tsx: -------------------------------------------------------------------------------- 1 | import * as styles from './CodeEditor.css'; 2 | 3 | interface CodeEditorPreviewBlockProps { 4 | code: string; 5 | } 6 | 7 | export function CodeEditorPreviewBlock(props: CodeEditorPreviewBlockProps) { 8 | return
;
 9 | }
10 | 


--------------------------------------------------------------------------------
/packages/highlight/src/lib/plugins/cursor-style.ts:
--------------------------------------------------------------------------------
 1 | import {EditorView} from '@codemirror/view';
 2 | 
 3 | export interface StyledCursorOptions {
 4 |   color: string;
 5 | }
 6 | 
 7 | export function styledCursor(options: StyledCursorOptions) {
 8 |   return EditorView.theme({
 9 |     '.cm-cursor, .cm-dropCursor': {borderLeftColor: options.color},
10 |   });
11 | }
12 | 


--------------------------------------------------------------------------------
/apps/api/src/modules/preset/handlers/index.ts:
--------------------------------------------------------------------------------
 1 | import {FastifyInstance} from 'fastify';
 2 | import {PresetMapper} from '../mapper/index.js';
 3 | import type {PresetRepository} from '../repository/index.js';
 4 | 
 5 | export type PresetHandlerDependencies = {
 6 |   repository: PresetRepository;
 7 |   mapper: PresetMapper;
 8 |   config: FastifyInstance['config'];
 9 | };
10 | 


--------------------------------------------------------------------------------
/packages/atomic-state/README.md:
--------------------------------------------------------------------------------
1 | # @codeimage/atomic-state
2 | 
3 | ![Latest release Version](https://img.shields.io/badge/dynamic/json?style=for-the-badge&color=success&label=Version&query=version&url=https%3A%2F%2Fraw.githubusercontent.com%2Friccardoperra%2Fcodeimage%2Fmain%2Fpackages%2Fatomic-state%2Fpackage.json)
4 | 
5 | State utils and helpers for @codeimage/app client
6 | 


--------------------------------------------------------------------------------
/packages/highlight/dev/tsconfig.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "extends": "../tsconfig.json",
 3 |   "compilerOptions": {
 4 |     "noUnusedLocals": true,
 5 |     "sourceMap": true,
 6 |     "jsx": "preserve",
 7 |     "resolveJsonModule": true,
 8 |     "jsxImportSource": "solid-js",
 9 |     "preserveSymlinks": true,
10 |     "types": [
11 |       "@types/node"
12 |     ]
13 |   }
14 | }
15 | 


--------------------------------------------------------------------------------
/apps/api/src/modules/preset/schema/preset-create-dto.schema.ts:
--------------------------------------------------------------------------------
 1 | import {Static, Type as t} from '@sinclair/typebox';
 2 | import {PresetDataSchema} from './preset-dto.schema.js';
 3 | 
 4 | export const PresetCreateDtoSchema = t.Object({
 5 |   name: t.String(),
 6 |   data: PresetDataSchema,
 7 | });
 8 | 
 9 | export type PresetCreateDto = Static;
10 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/ui/GitHubLoginButton/GitHubLoginButton.css.ts:
--------------------------------------------------------------------------------
 1 | import {style} from '@vanilla-extract/css';
 2 | 
 3 | export const button = style({
 4 |   backgroundColor: 'rgb(47, 51, 55)',
 5 |   color: 'rgb(255, 255, 255)',
 6 |   border: '1px solid rgb(47, 51, 55)',
 7 |   cursor: 'pointer',
 8 | 
 9 |   ':hover': {
10 |     background: 'rgb(29,33,35)',
11 |   },
12 | });
13 | 


--------------------------------------------------------------------------------
/packages/prisma-models/scripts/build.ts:
--------------------------------------------------------------------------------
 1 | import { execSync } from 'node:child_process';
 2 | import * as fs from 'node:fs';
 3 | 
 4 | const generatedTypes = fs.existsSync('./generated');
 5 | if (!generatedTypes) {
 6 |     console.warn("Prisma types has not been generated. Skipping build");
 7 |     process.exit(0);
 8 | }
 9 | 
10 | execSync(`pnpm run build:ts`, { stdio: 'inherit' })


--------------------------------------------------------------------------------
/apps/api/src/common/exceptions/NotFoundEntityException.ts:
--------------------------------------------------------------------------------
1 | import {HandlerError} from './HandlerError.js';
2 | 
3 | export abstract class NotFoundEntityException<
4 |   Args extends Record | void = void,
5 | > extends HandlerError {
6 |   // eslint-disable-next-line @typescript-eslint/no-unused-vars
7 |   abstract createMessage(args: Args): string;
8 | }
9 | 


--------------------------------------------------------------------------------
/apps/api/src/plugins/sensible.ts:
--------------------------------------------------------------------------------
 1 | import sensible, {SensibleOptions} from '@fastify/sensible';
 2 | import fp from 'fastify-plugin';
 3 | 
 4 | /**
 5 |  * This plugins adds some utilities to handle http errors
 6 |  *
 7 |  * @see https://github.com/fastify/fastify-sensible
 8 |  */
 9 | export default fp(async fastify => {
10 |   fastify.register(sensible);
11 | });
12 | 


--------------------------------------------------------------------------------
/packages/config/README.md:
--------------------------------------------------------------------------------
1 | # @codeimage/config
2 | 
3 | ![Latest release Version](https://img.shields.io/badge/dynamic/json?style=for-the-badge&color=success&label=Version&query=version&url=https%3A%2F%2Fraw.githubusercontent.com%2Friccardoperra%2Fcodeimage%2Fmain%2Fpackages%2Fconfig%2Fpackage.json)
4 | 
5 | Base configuration and interfaces for [`@codeimage/app`](../../apps/codeimage);
6 | 


--------------------------------------------------------------------------------
/apps/website/src/components/Landing/EditorSteps/EditorScene/GlassReflection/TerminalGlassReflection.tsx:
--------------------------------------------------------------------------------
 1 | import {Box} from '@codeimage/ui';
 2 | import * as styles from './TerminalGlassReflection.css';
 3 | 
 4 | export const TerminalGlassReflection = () => {
 5 |   return (
 6 |     
 7 |       
 8 |     
 9 |   );
10 | };
11 | 


--------------------------------------------------------------------------------
/packages/highlight/src/lib/plugins/line-numbers-style.ts:
--------------------------------------------------------------------------------
 1 | import {EditorView} from '@codemirror/view';
 2 | 
 3 | export interface StyledLineNumbersOptions {
 4 |   color: string;
 5 | }
 6 | 
 7 | export function styledLineNumbers(options: StyledLineNumbersOptions) {
 8 |   return EditorView.theme({
 9 |     '.cm-lineNumbers .cm-gutterElement': {color: options.color},
10 |   });
11 | }
12 | 


--------------------------------------------------------------------------------
/packages/ui/src/lib/primitives/Loader/LoadingOverlay.css.ts:
--------------------------------------------------------------------------------
 1 | import {style} from '@vanilla-extract/css';
 2 | 
 3 | export const overlay = style({
 4 |   position: 'fixed',
 5 |   width: '100%',
 6 |   left: 0,
 7 |   top: 0,
 8 |   height: '100%',
 9 |   backgroundColor: `rgba(0, 0, 0, .25)`,
10 |   display: 'flex',
11 |   alignItems: 'center',
12 |   justifyContent: 'center',
13 | });
14 | 


--------------------------------------------------------------------------------
/apps/api/src/plugins/handler.ts:
--------------------------------------------------------------------------------
 1 | import fp from 'fastify-plugin';
 2 | import {HandlerRegistry} from '../common/domainFunctions/registry.js';
 3 | 
 4 | export default fp(async fastify => {
 5 |   fastify.decorate('handlerRegistry', new HandlerRegistry());
 6 | });
 7 | 
 8 | declare module 'fastify' {
 9 |   interface FastifyInstance {
10 |     handlerRegistry: HandlerRegistry;
11 |   }
12 | }
13 | 


--------------------------------------------------------------------------------
/packages/config/src/lib/icons/txt.svg:
--------------------------------------------------------------------------------
 1 | 
 2 |   
 8 |   
11 | 
12 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/components/Scaffold/Scaffold.css.ts:
--------------------------------------------------------------------------------
 1 | import {createTheme, style} from '@vanilla-extract/css';
 2 | 
 3 | export const [scaffoldTheme, scaffoldVars] = createTheme({
 4 |   toolbarHeight: '52px',
 5 |   panelWidth: '280px',
 6 |   virtualHeightFallback: '1vh',
 7 | });
 8 | 
 9 | export const scaffold = style([
10 |   scaffoldTheme,
11 |   {
12 |     height: '100%',
13 |   },
14 | ]);
15 | 


--------------------------------------------------------------------------------
/packages/ui/src/lib/primitives/Field/FlexField.tsx:
--------------------------------------------------------------------------------
 1 | import {PropsWithChildren} from 'solid-js';
 2 | import {styled} from '../../utils';
 3 | import {FlexFieldVariants, wrapper} from './FlexField.css';
 4 | 
 5 | export function FlexField(props: PropsWithChildren) {
 6 |   return (
 7 |     
 8 |   );
 9 | }
10 | 


--------------------------------------------------------------------------------
/.idea/prettier.xml:
--------------------------------------------------------------------------------
1 | 
2 | 
3 |   
4 |     
9 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/components/Terminal/MacOsTerminal/MacOsTerminalGrayTheme.tsx:
--------------------------------------------------------------------------------
 1 | import {ParentComponent} from 'solid-js';
 2 | import {BaseTerminalProps} from '../TerminalHost';
 3 | import {MacOsTerminal} from './MacOsTerminal';
 4 | 
 5 | export const MacOsTerminalGrayTheme: ParentComponent<
 6 |   BaseTerminalProps
 7 | > = props => {
 8 |   return ;
 9 | };
10 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/components/Terminal/Tabs/TabIcon/TabIcon.css.ts:
--------------------------------------------------------------------------------
 1 | import {themeVars} from '@codeimage/ui';
 2 | import {style} from '@vanilla-extract/css';
 3 | 
 4 | export const tabIcon = style([
 5 |   {
 6 |     display: 'inline-flex',
 7 |     marginRight: themeVars.spacing['2'],
 8 |     selectors: {
 9 |       '[data-lite] &': {
10 |         fontSize: '11px',
11 |       },
12 |     },
13 |   },
14 | ]);
15 | 


--------------------------------------------------------------------------------
/packages/ui/tsconfig.json:
--------------------------------------------------------------------------------
 1 | {
 2 |   "extends": "../../tsconfig.json",
 3 |   "compilerOptions": {
 4 |     "noUnusedLocals": true,
 5 |     "sourceMap": true,
 6 |     "jsx": "preserve",
 7 |     "resolveJsonModule": true,
 8 |     "jsxImportSource": "solid-js",
 9 |     "preserveSymlinks": true,
10 |     "types": [
11 |       "@types/node"
12 |     ]
13 |   },
14 |   "include": [
15 |     "./src",
16 |   ]
17 | }
18 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/components/PropertyEditor/SidebarPopoverHost.css.ts:
--------------------------------------------------------------------------------
 1 | import {style} from '@vanilla-extract/css';
 2 | import {scaffoldVars} from '../Scaffold/Scaffold.css';
 3 | 
 4 | export const wrapper = style({
 5 |   marginLeft: `calc(${scaffoldVars.panelWidth} + 10px)`,
 6 |   position: 'absolute',
 7 |   maxWidth: scaffoldVars.panelWidth,
 8 |   height: '0px',
 9 |   width: '0px',
10 |   zIndex: 5,
11 | });
12 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/components/Terminal/MacOsTerminal/MacOsTerminalOutlineTheme.tsx:
--------------------------------------------------------------------------------
 1 | import {ParentComponent} from 'solid-js';
 2 | import {BaseTerminalProps} from '../TerminalHost';
 3 | import {MacOsTerminal} from './MacOsTerminal';
 4 | 
 5 | export const MacOsTerminalOutlineTheme: ParentComponent<
 6 |   BaseTerminalProps
 7 | > = props => {
 8 |   return ;
 9 | };
10 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/ui/ExperimentalChip/ExperimentalChip.tsx:
--------------------------------------------------------------------------------
 1 | import {ExperimentalIcon} from '@ui/ExperimentalFeatureTooltip/ExperimentalFeatureTooltip';
 2 | import * as styles from './ExperimentalChip.css';
 3 | 
 4 | export function ExperimentalChip() {
 5 |   return (
 6 |     
 7 |       
 8 |       Experimental
 9 |     
10 |   );
11 | }
12 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/components/Icons/PlusIcon.tsx:
--------------------------------------------------------------------------------
 1 | import {SvgIcon, SvgIconProps} from '@codeimage/ui';
 2 | 
 3 | export function PlusIcon(props: SvgIconProps) {
 4 |   return (
 5 |     
 6 |       
 7 |     
 8 |   );
 9 | }
10 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/assets/styles/app.scss:
--------------------------------------------------------------------------------
 1 | @import "reset";
 2 | @import "inter";
 3 | 
 4 | html, body {
 5 |   overflow: hidden;
 6 | }
 7 | 
 8 | * {
 9 |   box-sizing: border-box;
10 | }
11 | 
12 | body {
13 |   margin: 0;
14 |   -webkit-font-smoothing: antialiased;
15 |   -moz-osx-font-smoothing: grayscale;
16 |   height: 100%;
17 |   touch-action: none;
18 |   position: relative;
19 |   overscroll-behavior-y: none;
20 | }
21 | 


--------------------------------------------------------------------------------
/packages/ui/src/lib/primitives/Loader/Loader.css.ts:
--------------------------------------------------------------------------------
 1 | import {themeVars} from '../../theme';
 2 | import {style} from '@vanilla-extract/css';
 3 | 
 4 | export const loader = style({
 5 |   selectors: {
 6 |     ['[data-theme-mode=dark] &']: {
 7 |       stroke: themeVars.backgroundColor.white,
 8 |     },
 9 |     ['[data-theme-mode=light] &']: {
10 |       stroke: themeVars.backgroundColor.black,
11 |     },
12 |   },
13 | });
14 | 


--------------------------------------------------------------------------------
/apps/api/src/common/typebox/enum.ts:
--------------------------------------------------------------------------------
 1 | import {TString, Type} from '@sinclair/typebox';
 2 | 
 3 | export const enumLiteral = (values: T[]): TString => {
 4 |   const literals = values.map(value => Type.Literal(value));
 5 |   // TODO: validation should work but type must work as a string...
 6 |   return Type.Intersect([
 7 |     Type.Union(literals),
 8 |     Type.String(),
 9 |   ]) as unknown as TString;
10 | };
11 | 


--------------------------------------------------------------------------------
/packages/highlight/dev/Editor/Editor.css.ts:
--------------------------------------------------------------------------------
 1 | import {backgroundColorVar, colorVar, themeVars} from '@codeimage/ui';
 2 | import {style} from '@vanilla-extract/css';
 3 | 
 4 | export const editor = style({
 5 |   boxShadow: themeVars.boxShadow.lg,
 6 |   backgroundColor: backgroundColorVar,
 7 |   color: colorVar,
 8 |   padding: themeVars.spacing['4'],
 9 |   borderRadius: themeVars.borderRadius.lg,
10 |   overflowY: 'auto',
11 | });
12 | 


--------------------------------------------------------------------------------
/packages/locale/src/lib/path.ts:
--------------------------------------------------------------------------------
 1 | type Path = Target extends string
 2 |   ? Prefix
 3 |   : Path<
 4 |       Target[keyof Target],
 5 |       `${Prefix extends '' ? '' : `${Prefix}.`}${Extract}`
 6 |     >;
 7 | 
 8 | export type ExtractLocaleKeys = T extends Record
 9 |   ? U
10 |   : never;
11 | 
12 | export type LocaleKeys = Path>;
13 | 


--------------------------------------------------------------------------------
/apps/api/src/modules/project/schema/project-delete.schema.ts:
--------------------------------------------------------------------------------
 1 | import {Static, Type} from '@sinclair/typebox';
 2 | import {BaseProjectResponseSchema} from './project.schema.js';
 3 | 
 4 | export const ProjectDeleteResponseSchema = Type.Intersect(
 5 |   [BaseProjectResponseSchema],
 6 |   {
 7 |     title: 'ProjectDeleteResponse',
 8 |   },
 9 | );
10 | 
11 | export type ProjectDeleteResponse = Static;
12 | 


--------------------------------------------------------------------------------
/apps/codeimage/src/components/PropertyEditor/controls/TerminalControlField/TerminalControlFieldSkeleton.tsx:
--------------------------------------------------------------------------------
 1 | import {SkeletonLine} from '@ui/Skeleton/Skeleton';
 2 | import * as styles from './TerminalControlFieldSkeleton.css';
 3 | 
 4 | export function TerminalControlSkeleton() {
 5 |   return (
 6 |     
7 | 8 |
9 | ); 10 | } 11 | -------------------------------------------------------------------------------- /packages/atomic-state/src/createDerivedObservable.ts: -------------------------------------------------------------------------------- 1 | import {from, Observable} from 'rxjs'; 2 | import {createMemo, observable} from 'solid-js'; 3 | 4 | export function createDerivedObservable(selector: () => T) { 5 | const memoized = createMemo(selector); 6 | const observable$ = observable(memoized); 7 | const rxjsState$ = from(observable$ as unknown as Observable); 8 | return [rxjsState$, memoized] as const; 9 | } 10 | -------------------------------------------------------------------------------- /packages/ui/dev/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "noUnusedLocals": true, 5 | "sourceMap": true, 6 | "jsx": "preserve", 7 | "resolveJsonModule": true, 8 | "jsxImportSource": "solid-js", 9 | "preserveSymlinks": true, 10 | "types": [ 11 | "@types/node" 12 | ] 13 | }, 14 | "include": [ 15 | "./**/*", 16 | "../src/**/*" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /apps/api/test/modules/preset/data-utils.ts: -------------------------------------------------------------------------------- 1 | import {Preset} from '@codeimage/prisma-models'; 2 | 3 | export class PresetTestDataUtils { 4 | static buildPreset(id: string, name: string, ownerId: string, data: {} = {}) { 5 | return { 6 | id, 7 | name, 8 | createdAt: new Date(), 9 | updatedAt: new Date(), 10 | version: BigInt(1), 11 | data, 12 | ownerId, 13 | } as Preset; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/Scaffold/Canvas/Canvas.tsx: -------------------------------------------------------------------------------- 1 | import {FlowProps} from 'solid-js'; 2 | import * as styles from './Canvas.css'; 3 | 4 | // eslint-disable-next-line @typescript-eslint/ban-types 5 | type CanvasProps = {}; 6 | 7 | export function Canvas(props: FlowProps) { 8 | return ( 9 |
10 |
{props.children}
11 |
12 | ); 13 | } 14 | -------------------------------------------------------------------------------- /packages/highlight/dev/global.css.ts: -------------------------------------------------------------------------------- 1 | import {backgroundColorVar, themeVars} from '@codeimage/ui'; 2 | import {globalStyle} from '@vanilla-extract/css'; 3 | 4 | globalStyle('html, body', { 5 | fontFamily: 'Albert Sans, sans-serif', 6 | backgroundColor: backgroundColorVar, 7 | backdropFilter: 'brightness(0.8)', 8 | overflow: 'hidden', 9 | width: '100%', 10 | height: '100%', 11 | color: themeVars.dynamicColors.baseText, 12 | }); 13 | -------------------------------------------------------------------------------- /packages/highlight/src/lib/themes/holi/index.ts: -------------------------------------------------------------------------------- 1 | import {createTheme} from '../../core'; 2 | import {holi} from './holi'; 3 | 4 | export const holiTheme = createTheme({ 5 | id: 'holiTheme', 6 | editorTheme: holi, 7 | properties: { 8 | darkMode: true, 9 | label: 'Holi Dark', 10 | previewBackground: '#122f6d', 11 | terminal: { 12 | main: '#030314', 13 | text: '#FFF', 14 | }, 15 | }, 16 | } as const); 17 | -------------------------------------------------------------------------------- /packages/ui/dev/vite.config.ts: -------------------------------------------------------------------------------- 1 | import {vanillaExtractPlugin} from '@codeimage/vanilla-extract'; 2 | import {defineConfig} from 'vite'; 3 | import solidPlugin from 'vite-plugin-solid'; 4 | import {withStaticVercelPreview} from '../../../scripts/vercel-output-build'; 5 | 6 | export const viteConfig = defineConfig({ 7 | plugins: [solidPlugin(), vanillaExtractPlugin(), withStaticVercelPreview()], 8 | }); 9 | 10 | export default viteConfig; 11 | -------------------------------------------------------------------------------- /apps/api/src/plugins/cors.ts: -------------------------------------------------------------------------------- 1 | import fastifyCors from '@fastify/cors'; 2 | import fp from 'fastify-plugin'; 3 | 4 | export default fp(async fastify => { 5 | const config = fastify.config.ALLOWED_ORIGINS; 6 | 7 | if (!config) { 8 | return; 9 | } 10 | 11 | const origins = config.split(',').map(str => str.trim()); 12 | const origin = origins.includes('*') ? '*' : origins; 13 | 14 | fastify.register(fastifyCors, {origin}); 15 | }); 16 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/PropertyEditor/controls/TerminalControlField/TerminalControlFieldSkeleton.css.ts: -------------------------------------------------------------------------------- 1 | import {themeVars} from '@codeimage/ui'; 2 | import {style} from '@vanilla-extract/css'; 3 | 4 | export const wrapper = style({ 5 | height: '50px', 6 | display: 'flex', 7 | paddingLeft: themeVars.spacing['2'], 8 | paddingRight: themeVars.spacing['2'], 9 | borderRadius: themeVars.borderRadius.md, 10 | alignItems: 'center', 11 | }); 12 | -------------------------------------------------------------------------------- /packages/ui/src/lib/theme/spacing.ts: -------------------------------------------------------------------------------- 1 | export const spacing = { 2 | auto: 'auto', 3 | px: '1px', 4 | 0: '0', 5 | 1: '0.25rem', 6 | 2: '0.5rem', 7 | 3: '0.75rem', 8 | 4: '1rem', 9 | 5: '1.25rem', 10 | 6: '1.5rem', 11 | 8: '2rem', 12 | 10: '2.5rem', 13 | 12: '3rem', 14 | 16: '4rem', 15 | 20: '5rem', 16 | 24: '6rem', 17 | 32: '8rem', 18 | 40: '10rem', 19 | 48: '12rem', 20 | 56: '14rem', 21 | 64: '16rem', 22 | } as const; 23 | -------------------------------------------------------------------------------- /apps/api/src/modules/preset/exceptions/NotFoundPresetException.ts: -------------------------------------------------------------------------------- 1 | import {NotFoundEntityException} from '../../../common/exceptions/NotFoundEntityException.js'; 2 | 3 | type Params = { 4 | id: string; 5 | ownerId: string; 6 | }; 7 | 8 | export class NotFoundPresetException extends NotFoundEntityException { 9 | createMessage({id, ownerId}: Params): string { 10 | return `Preset with id ${id} for user ${ownerId} not found`; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/highlight/src/lib/themes/panda/index.ts: -------------------------------------------------------------------------------- 1 | import {createTheme} from '../../core'; 2 | import {panda, palette} from './panda'; 3 | 4 | export const pandaTheme = createTheme({ 5 | id: 'panda', 6 | editorTheme: panda, 7 | properties: { 8 | darkMode: true, 9 | label: 'Panda', 10 | previewBackground: `#1a1a1a`, 11 | terminal: { 12 | main: palette.background, 13 | text: palette.text, 14 | }, 15 | }, 16 | } as const); 17 | -------------------------------------------------------------------------------- /apps/website/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "esModuleInterop": true, 5 | "target": "ESNext", 6 | "module": "ESNext", 7 | "moduleResolution": "node", 8 | "jsxImportSource": "solid-js", 9 | "jsx": "preserve", 10 | "resolveJsonModule": true, 11 | "types": ["vite/client"], 12 | "baseUrl": "./", 13 | "paths": { 14 | "~/*": ["./src/*"] 15 | } 16 | }, 17 | } 18 | -------------------------------------------------------------------------------- /apps/codeimage/src/pages/Editor/Editor.tsx: -------------------------------------------------------------------------------- 1 | import {EditorSyncProvider} from '@codeimage/store/editor/createEditorSync'; 2 | import {useParams} from '@solidjs/router'; 3 | import {lazy} from 'solid-js'; 4 | 5 | const App = lazy(() => import('./App')); 6 | 7 | export default function Editor() { 8 | const params = useParams(); 9 | return ( 10 | 11 | 12 | 13 | ); 14 | } 15 | -------------------------------------------------------------------------------- /apps/codeimage/src/state/frame/model.ts: -------------------------------------------------------------------------------- 1 | export interface FrameState { 2 | background: string | null; 3 | padding: number; 4 | radius: number; 5 | visible: boolean; 6 | opacity: number; 7 | autoWidth: boolean; 8 | scale: number; 9 | width: number; 10 | height: number; 11 | aspectRatio: string | null; 12 | } 13 | 14 | export type PersistedFrameState = Pick< 15 | FrameState, 16 | 'background' | 'padding' | 'radius' | 'visible' | 'opacity' 17 | >; 18 | -------------------------------------------------------------------------------- /apps/website/src/components/Umami/UmamiScript.tsx: -------------------------------------------------------------------------------- 1 | import {NoHydration} from 'solid-js/web'; 2 | 3 | export function UmamiScript() { 4 | const websiteId = import.meta.env.VITE_UMAMI_WEBSITE_ID; 5 | const scriptSrc = import.meta.env.VITE_UMAMI_SCRIPT_SRC; 6 | 7 | if (!websiteId || !scriptSrc) return null; 8 | 9 | return ( 10 | 11 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/Icons/ColorSwatch.tsx: -------------------------------------------------------------------------------- 1 | import {SvgIcon, SvgIconProps} from '@codeimage/ui'; 2 | 3 | export const ColorSwatchIcon = (props: SvgIconProps) => { 4 | return ( 5 | 11 | 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /packages/dom-export/src/lib/applyStyleFromOptions.ts: -------------------------------------------------------------------------------- 1 | import {Options} from './options'; 2 | 3 | export function applyStyleFromOptions( 4 | node: T, 5 | options: Options, 6 | ): T { 7 | const {style} = node; 8 | 9 | if (options.backgroundColor) { 10 | style.backgroundColor = options.backgroundColor; 11 | } 12 | 13 | if (options.width) { 14 | style.width = `${options.width}px`; 15 | } 16 | 17 | if (options.height) { 18 | style.height = `${options.height}px`; 19 | } 20 | 21 | const manual = options.style; 22 | if (manual != null) { 23 | Object.keys(manual).forEach((key: any) => { 24 | style[key] = manual[key] as string; 25 | }); 26 | } 27 | 28 | return node; 29 | } 30 | -------------------------------------------------------------------------------- /packages/highlight/src/lib/themes/githubLight/index.ts: -------------------------------------------------------------------------------- 1 | import {createTheme} from '../../core'; 2 | import libColors from '@primer/primitives/dist/ts/colors/light'; 3 | import {githubLight} from './githubLight'; 4 | 5 | export const githubLightTheme = createTheme({ 6 | id: 'githubLight', 7 | editorTheme: githubLight, 8 | properties: { 9 | darkMode: false, 10 | label: 'GitHub Light', 11 | previewBackground: 12 | 'linear-gradient(-45deg, rgba(73,84,222,1) 0%,rgba(73,221,216,1) 100%)', 13 | terminal: { 14 | main: libColors.codemirror.bg, 15 | text: libColors.codemirror.text, 16 | tabs: { 17 | inactiveTabBackground: libColors.scale.gray[1], 18 | }, 19 | }, 20 | }, 21 | } as const); 22 | -------------------------------------------------------------------------------- /apps/api/docker-compose.dev.yml: -------------------------------------------------------------------------------- 1 | # docker-compose -f docker-compose.dev.yml -p codeimage up -d 2 | 3 | version: '3.8' 4 | 5 | services: 6 | db: 7 | image: postgres:13-alpine 8 | restart: unless-stopped 9 | volumes: 10 | - postgres_data:/var/lib/postgresql/data/ 11 | ports: 12 | - '5432:5432' 13 | environment: 14 | - POSTGRES_USER=postgres 15 | - POSTGRES_PASSWORD=postgres 16 | - POSTGRES_DB=codeimage 17 | test_db: 18 | image: postgres:13-alpine 19 | restart: always 20 | ports: 21 | - '5433:5432' 22 | environment: 23 | POSTGRES_USER: postgres 24 | POSTGRES_PASSWORD: postgres 25 | POSTGRES_DB: codeimage_test 26 | 27 | volumes: 28 | postgres_data: null 29 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Loader/LoadingOverlay.tsx: -------------------------------------------------------------------------------- 1 | import {JSXElement, Show} from 'solid-js'; 2 | import {omitProps} from 'solid-use/props'; 3 | import {styled} from '../../utils'; 4 | import {LoaderProps, Loading} from './Loading'; 5 | import {overlay} from './LoadingOverlay.css'; 6 | 7 | interface LoadingOverlayProps extends LoaderProps { 8 | overlay: boolean; 9 | } 10 | 11 | export function LoadingOverlay(props: LoadingOverlayProps): JSXElement { 12 | const loadingProps = omitProps(props, ['overlay']); 13 | return ( 14 | }> 15 | 16 | 17 | 18 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /apps/api/src/routes/v1/project/getAllByUserId.ts: -------------------------------------------------------------------------------- 1 | import {FastifyPluginAsync} from 'fastify'; 2 | import {ProjectGetByIdResponse} from '../../../modules/project/schema/index.js'; 3 | 4 | const getAllByUserIdRoute: FastifyPluginAsync = async fastify => { 5 | fastify.get( 6 | '/', 7 | { 8 | preValidation: (req, reply) => fastify.authorize(req, reply), 9 | schema: { 10 | tags: ['Project'], 11 | summary: 'Get all CodeImage projects by the current user', 12 | }, 13 | }, 14 | async (request): Promise => { 15 | const {appUser} = request; 16 | return fastify.projectService.findAllByUserId(appUser.id); 17 | }, 18 | ); 19 | }; 20 | 21 | export default getAllByUserIdRoute; 22 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/IconButton/IconButton.tsx: -------------------------------------------------------------------------------- 1 | import {ElementType} from '@solid-aria/types'; 2 | import clsx from 'clsx'; 3 | import {ParentProps} from 'solid-js'; 4 | import {omitProps} from 'solid-use/props'; 5 | import {Button, ButtonProps} from '../Button/Button'; 6 | import * as styles from './IconButton.css'; 7 | 8 | export function IconButton( 9 | props: ParentProps>, 10 | ) { 11 | const classes = () => 12 | clsx(styles.iconButton({size: props.size}), props.class); 13 | 14 | return ( 15 | // @ts-expect-error not valid type with TS>5.0 16 | 19 | ); 20 | } 21 | -------------------------------------------------------------------------------- /apps/codeimage/src/assets/logo-white.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/highlight/dev/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Solid App 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 120 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 120 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: wontfix 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /apps/api/src/common/types/extract-api-types.ts: -------------------------------------------------------------------------------- 1 | import {Static, TSchema} from '@sinclair/typebox'; 2 | import {FastifySchema} from 'fastify'; 3 | 4 | type StaticSchemaOrType = T extends TSchema ? Static : T; 5 | 6 | interface GetApiRequest { 7 | body?: StaticSchemaOrType; 8 | querystring?: StaticSchemaOrType; 9 | params?: StaticSchemaOrType; 10 | headers?: StaticSchemaOrType; 11 | } 12 | 13 | type GetApiResponse = T['response'] extends { 14 | 200: infer U; 15 | } 16 | ? StaticSchemaOrType 17 | : never; 18 | 19 | export interface GetApiTypes { 20 | request: GetApiRequest; 21 | response: GetApiResponse; 22 | } 23 | -------------------------------------------------------------------------------- /apps/api/src/modules/project/schema/index.ts: -------------------------------------------------------------------------------- 1 | export { 2 | ProjectCreateRequestSchema, 3 | type ProjectCreateRequest, 4 | type ProjectCreateResponse, 5 | ProjectCreateResponseSchema, 6 | } from './project-create.schema.js'; 7 | 8 | export { 9 | type ProjectUpdateRequest, 10 | type ProjectUpdateResponse, 11 | ProjectUpdateRequestSchema, 12 | ProjectUpdateResponseSchema, 13 | } from './project-update.schema.js'; 14 | 15 | export { 16 | ProjectDeleteResponseSchema, 17 | type ProjectDeleteResponse, 18 | } from './project-delete.schema.js'; 19 | 20 | export { 21 | ProjectGetByIdResponseSchema, 22 | PartialProjectGetByIdResponseSchema, 23 | type ProjectGetByIdResponse, 24 | type ProjectCompleteResponse, 25 | } from './project-get-by-id.schema.js'; 26 | -------------------------------------------------------------------------------- /packages/prisma-models/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@codeimage/prisma-models", 3 | "version": "0.0.1", 4 | "description": "", 5 | "types": "./dist/index.d.ts", 6 | "exports": { 7 | ".": { 8 | "node": "./dist/index.js", 9 | "import": "./dist/index.js", 10 | "types": "./dist/index.d.ts" 11 | } 12 | }, 13 | "typesVersions": { 14 | "*": { 15 | "./": [ 16 | "./dist/index.d.ts" 17 | ] 18 | } 19 | }, 20 | "scripts": { 21 | "test": "echo \"Error: no test specified\" && exit 1", 22 | "build": "tsx ./scripts/build.ts", 23 | "build:ts": "tsc" 24 | }, 25 | "keywords": [], 26 | "author": "Riccardo Perra", 27 | "license": "MIT", 28 | "devDependencies": { 29 | "typescript": "~5.3.2" 30 | } 31 | } -------------------------------------------------------------------------------- /apps/api/src/modules/project/domain/projectCreateRequest.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Project, 3 | SnippetEditorOptions, 4 | SnippetEditorTab, 5 | SnippetFrame, 6 | SnippetTerminal, 7 | } from '@codeimage/prisma-models'; 8 | 9 | type IdAndProjectId = 'id' | 'projectId'; 10 | 11 | export interface ProjectCreateRequest { 12 | name: Project['name']; 13 | editorOptions: Omit; 14 | terminal: Omit; 15 | frame: Omit; 16 | editors: Omit[]; 17 | } 18 | 19 | export type ProjectCreateResponse = Project & { 20 | editorOptions: SnippetEditorOptions; 21 | terminal: SnippetTerminal; 22 | frame: SnippetFrame; 23 | editorTabs: SnippetEditorTab[]; 24 | }; 25 | -------------------------------------------------------------------------------- /apps/codeimage/src/pages/Dashboard/components/ProjectItemSkeleton/ProjectItemSkeleton.css.ts: -------------------------------------------------------------------------------- 1 | import {backgroundColorVar, themeVars, withThemeMode} from '@codeimage/ui'; 2 | import {darkGrayScale} from '@codeimage/ui/themes/darkTheme'; 3 | import {style} from '@vanilla-extract/css'; 4 | import {item} from '../ProjectItem/ProjectItem.css'; 5 | 6 | export const itemSkeleton = style([ 7 | item, 8 | { 9 | selectors: { 10 | ...withThemeMode({ 11 | light: { 12 | vars: { 13 | [backgroundColorVar]: themeVars.backgroundColor.gray['100'], 14 | }, 15 | }, 16 | dark: { 17 | vars: { 18 | [backgroundColorVar]: darkGrayScale.gray2, 19 | }, 20 | }, 21 | }), 22 | }, 23 | }, 24 | ]); 25 | -------------------------------------------------------------------------------- /packages/highlight/dev/vite.config.ts: -------------------------------------------------------------------------------- 1 | import {vanillaExtractPlugin} from '@codeimage/vanilla-extract'; 2 | import {defineConfig, Plugin} from 'vite'; 3 | import solidPlugin from 'vite-plugin-solid'; 4 | import {withStaticVercelPreview} from '../../../scripts/vercel-output-build'; 5 | 6 | export const viteConfig = defineConfig({ 7 | plugins: [ 8 | vanillaExtractPlugin() as unknown as Plugin, 9 | solidPlugin(), 10 | withStaticVercelPreview() as unknown as Plugin, 11 | ], 12 | optimizeDeps: { 13 | // Add both @codemirror/state and @codemirror/view to included deps to optimize 14 | include: [ 15 | '@codemirror/state', 16 | '@codemirror/view', 17 | '@codemirror/lang-javascript', 18 | ], 19 | }, 20 | }); 21 | 22 | export default viteConfig; 23 | -------------------------------------------------------------------------------- /packages/highlight/src/lib/themes/githubDarkDimmed/index.ts: -------------------------------------------------------------------------------- 1 | import libColors from '@primer/primitives/dist/ts/colors/dark_dimmed'; 2 | import {createTheme} from '../../core'; 3 | import {githubDarkDimmed} from './githubDarkDimmed'; 4 | 5 | export const githubDarkDimmedTheme = createTheme({ 6 | id: 'githubDarkDimmed', 7 | editorTheme: githubDarkDimmed, 8 | properties: { 9 | darkMode: true, 10 | label: 'GitHub Dark Dimmed', 11 | previewBackground: 12 | 'linear-gradient(140deg, rgb(241 160 61), rgb(192 74 65), rgb(115, 52, 52))', 13 | terminal: { 14 | main: libColors.codemirror.bg, 15 | text: libColors.codemirror.text, 16 | tabs: { 17 | inactiveTabBackground: libColors.scale.gray[7], 18 | }, 19 | }, 20 | }, 21 | } as const); 22 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Link/Link.tsx: -------------------------------------------------------------------------------- 1 | import clsx from 'clsx'; 2 | import {JSX, splitProps} from 'solid-js'; 3 | import {Text, TextProps} from '../Text/Text'; 4 | import * as styles from './Link.css'; 5 | 6 | interface LinkProps extends TextProps<'a'> { 7 | underline?: boolean; 8 | } 9 | 10 | export function Link(props: LinkProps): JSX.Element { 11 | const [local, others] = splitProps(props, [ 12 | 'underline', 13 | 'class', 14 | 'children', 15 | 'as', 16 | ]); 17 | 18 | return ( 19 | 29 | {props.children} 30 | 31 | ); 32 | } 33 | -------------------------------------------------------------------------------- /apps/api/src/modules/preset/handlers/findAll.ts: -------------------------------------------------------------------------------- 1 | import {HandlerBuilder} from '../../../common/domainFunctions/builder.js'; 2 | import {PresetDto} from '../schema/preset-dto.schema.js'; 3 | import {PresetHandlerDependencies} from './index.js'; 4 | 5 | export const findAll = 6 | HandlerBuilder.withDependencies() 7 | .withName('findAllPresets') 8 | .withImplementation(({repository, mapper}) => { 9 | return async (ownerId: string): Promise => { 10 | const preset = await repository.findAllByOwnerId(ownerId); 11 | return preset.map(mapper.fromEntityToDto); 12 | }; 13 | }) 14 | .build(); 15 | 16 | declare module '@api/domain' { 17 | interface DomainHandlerMap { 18 | findAllPresets: typeof findAll; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/PropertyEditor/EditorSidebar.tsx: -------------------------------------------------------------------------------- 1 | import {DynamicSizedContainer} from '@ui/DynamicSizedContainer/DynamicSizedContainer'; 2 | import {EditorStyleForm} from './EditorStyleForm'; 3 | import {FrameStyleForm} from './FrameStyleForm'; 4 | import {PanelDivider} from './PanelDivider'; 5 | import {WindowStyleForm} from './WindowStyleForm'; 6 | 7 | export const EditorSidebar = () => { 8 | return ( 9 | <> 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 |
23 | 24 | ); 25 | }; 26 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/ThemeSwitcher/ThemeBoxSkeleton.tsx: -------------------------------------------------------------------------------- 1 | import {SkeletonLine} from '@ui/Skeleton/Skeleton'; 2 | import {SkeletonDivider} from '@ui/Skeleton/SkeletonDivider'; 3 | import * as styles from './ThemeBoxSkeleton.css'; 4 | 5 | export function ThemeBoxSkeleton() { 6 | return ( 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |
18 | ); 19 | } 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2-feature-request.yml: -------------------------------------------------------------------------------- 1 | name: '🚀 - Feature Request' 2 | title: '🚀 - ' 3 | description: Suggest a feature for Codeimage 4 | labels: ['feature', 'state: need triage'] 5 | 6 | body: 7 | - type: dropdown 8 | id: affected-packages 9 | attributes: 10 | label: Which @codeimage/* package(s) are relevant/releated to the feature request? 11 | options: 12 | - codeimage 13 | - config 14 | - locale 15 | - highlight 16 | - ui 17 | - Don't known / other 18 | multiple: true 19 | 20 | - type: textarea 21 | id: description 22 | attributes: 23 | label: Description 24 | placeholder: | 25 | Proposed solution. 26 | Alternatives considered. 27 | validations: 28 | required: true 29 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/Terminal/Tabs/TabAddButton/TabAddButton.tsx: -------------------------------------------------------------------------------- 1 | import {VoidProps} from 'solid-js'; 2 | import {exportExclude as _exportExclude} from '@core/directives/exportExclude'; 3 | import {PlusIcon} from '../../../Icons/PlusIcon'; 4 | import * as styles from './TabAddButton.css'; 5 | 6 | export interface TabAddButtonProps { 7 | onAdd: () => void; 8 | disabled: boolean; 9 | } 10 | 11 | export function TabAddButton(props: VoidProps) { 12 | const exportExclude = _exportExclude; 13 | 14 | return ( 15 | 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /apps/codeimage/src/state/plugins/unique-id.ts: -------------------------------------------------------------------------------- 1 | import {createUniqueId as $createUniqueId} from 'solid-js'; 2 | 3 | export function createUniqueId(v = 0): string { 4 | const id = $createUniqueId(); 5 | return `${id}$${v ?? 0}`; 6 | } 7 | 8 | export function versionateId(id: string): string { 9 | const [uid, version = null] = id.split('$'); 10 | if (!uid || version === null) { 11 | console.warn(`[DEV] Unable to versionate ${id} id`); 12 | return id; 13 | } 14 | return `${uid}$${parseInt(version, 10) + 1}`; 15 | } 16 | 17 | export const generateUid = (a = '') => { 18 | return a 19 | ? /* eslint-disable no-bitwise */ 20 | ((Number(a) ^ (Math.random() * 16)) >> (Number(a) / 4)).toString(16) 21 | : `${1e7}-${1e3}-${4e3}-${8e3}-${1e11}`.replace(/[018]/g, generateUid); 22 | }; 23 | -------------------------------------------------------------------------------- /apps/codeimage/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "jsx": "preserve", 5 | "importHelpers": true, 6 | "resolveJsonModule": true, 7 | "jsxImportSource": "solid-js", 8 | "types": [ 9 | "vite/client", 10 | "vite-plugin-pwa/client", 11 | "@types/mdx" 12 | ], 13 | "lib": [ 14 | "ESNext", 15 | "dom", 16 | "dom.iterable", 17 | "es2019", 18 | "WebWorker" 19 | ], 20 | "paths": { 21 | "@codeimage/store/*": [ 22 | "./src/state/*" 23 | ], 24 | "@core/*": [ 25 | "./src/core/*" 26 | ], 27 | "@ui/*": [ 28 | "./src/ui/*" 29 | ] 30 | } 31 | }, 32 | "include": [ 33 | "./src/**/*", 34 | "./scripts/**/*" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /apps/codeimage/src/core/operators/create-resize-observer.ts: -------------------------------------------------------------------------------- 1 | import {Observable} from 'rxjs'; 2 | 3 | const createResizeObserverFactory = () => { 4 | return (element: HTMLElement, options?: ResizeObserverOptions) => 5 | new ReactiveResizeObserver(element, options); 6 | }; 7 | 8 | class ReactiveResizeObserver extends Observable< 9 | ReadonlyArray 10 | > { 11 | constructor(element: HTMLElement, options?: ResizeObserverOptions) { 12 | let observer: ResizeObserver; 13 | 14 | super(subscriber => { 15 | observer = new ResizeObserver(entries => subscriber.next(entries)); 16 | observer.observe(element, options); 17 | return () => observer.disconnect(); 18 | }); 19 | } 20 | } 21 | 22 | export const resizeObserverFactory$ = createResizeObserverFactory(); 23 | -------------------------------------------------------------------------------- /packages/ui/src/lib/primitives/Box/Box.css.ts: -------------------------------------------------------------------------------- 1 | import {style} from '@vanilla-extract/css'; 2 | import {themeVars} from '../../theme'; 3 | 4 | export const boxBase = style({ 5 | '::-webkit-scrollbar': { 6 | width: '18px', 7 | }, 8 | 9 | '::-webkit-scrollbar-track': { 10 | backgroundColor: 'transparent', 11 | }, 12 | '::-webkit-scrollbar-thumb': { 13 | backgroundColor: themeVars.dynamicColors.scrollBar.backgroundColor, 14 | borderRadius: themeVars.borderRadius.full, 15 | border: '6px solid transparent', 16 | backgroundClip: 'content-box', 17 | transition: 'background-color .2s', 18 | }, 19 | 20 | selectors: { 21 | '&::-webkit-scrollbar-thumb:hover': { 22 | backgroundColor: themeVars.dynamicColors.scrollBar.hoverBackgroundColor, 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | jobs: 9 | release: 10 | name: Release 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout PR 14 | uses: actions/checkout@v4 15 | - name: 📥 Setup 16 | uses: ./.github/actions/setup-job 17 | - name: 📥 Monorepo install 18 | uses: ./.github/actions/pnpm-install 19 | 20 | - name: Create Release Pull Request or Publish to npm 21 | id: changesets 22 | uses: changesets/action@v1 23 | env: 24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 25 | with: 26 | version: pnpm changeset:pr 27 | title: "chore(release): version packages" 28 | commit: 'chore(release): version packages' 29 | -------------------------------------------------------------------------------- /apps/api/src/common/exceptions/HandlerError.ts: -------------------------------------------------------------------------------- 1 | import {FastifyError} from 'fastify'; 2 | import {constants} from 'http2'; 3 | 4 | type HttpStatusCode = { 5 | readonly [K in keyof typeof constants as K extends `HTTP_STATUS_${string}` 6 | ? K 7 | : never]: typeof constants[K]; 8 | }; 9 | 10 | export abstract class HandlerError< 11 | Args extends Record | void = void, 12 | > 13 | extends Error 14 | implements FastifyError 15 | { 16 | code = this.constructor.name; 17 | 18 | static httpStatusCode = constants as HttpStatusCode; 19 | 20 | constructor(args?: Args) { 21 | super(); 22 | this.message = this.createMessage(args as Args); 23 | Error.captureStackTrace(this, this.constructor); 24 | } 25 | 26 | abstract createMessage(args: Args): string; 27 | } 28 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/Icons/Code.tsx: -------------------------------------------------------------------------------- 1 | import {SvgIcon, SvgIconProps} from '@codeimage/ui'; 2 | 3 | export const CodeIcon = (props: SvgIconProps) => { 4 | return ( 5 | 11 | 16 | 17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /apps/codeimage/src/core/constants/umami.ts: -------------------------------------------------------------------------------- 1 | declare global { 2 | interface Window { 3 | umami: Umami; 4 | } 5 | } 6 | 7 | const isDev = import.meta.env.DEV; 8 | 9 | function getUmamiMock() { 10 | const umamiMock: Umami = {} as Umami; 11 | 12 | if (isDev) { 13 | umamiMock.track = (( 14 | event_name: string, 15 | event_data?: {[key: string]: string | number}, 16 | ) => { 17 | console.groupCollapsed(`[DEV] Umami track event`); 18 | console.log({ 19 | event_name, 20 | event_data, 21 | }); 22 | console.groupEnd(); 23 | }) as typeof umamiMock.track; 24 | } else { 25 | umamiMock.track = () => void 0; 26 | } 27 | 28 | return umamiMock; 29 | } 30 | 31 | export function getUmami() { 32 | return window?.umami ?? getUmamiMock(); 33 | } 34 | -------------------------------------------------------------------------------- /apps/codeimage/src/core/operators/create-mutation-observer.ts: -------------------------------------------------------------------------------- 1 | import {Observable} from 'rxjs'; 2 | 3 | const createMutationObserverFactory = () => { 4 | return (element: HTMLElement, options?: MutationObserverInit) => 5 | new ReactiveMutationObserver(element, options); 6 | }; 7 | 8 | class ReactiveMutationObserver extends Observable< 9 | ReadonlyArray 10 | > { 11 | constructor(element: HTMLElement, options?: MutationObserverInit) { 12 | let observer: MutationObserver; 13 | 14 | super(subscriber => { 15 | observer = new MutationObserver(entries => subscriber.next(entries)); 16 | observer.observe(element, options); 17 | return () => observer.disconnect(); 18 | }); 19 | } 20 | } 21 | 22 | export const mutationObserverFactory$ = createMutationObserverFactory(); 23 | -------------------------------------------------------------------------------- /apps/codeimage/src/i18n/ notFound.ts: -------------------------------------------------------------------------------- 1 | export const notFound = { 2 | it: { 3 | notFound: { 4 | title: '404', 5 | description: 'La risorsa che stai cercando non esiste', 6 | goToHome: 'Torna alla home', 7 | }, 8 | }, 9 | en: { 10 | notFound: { 11 | title: '404', 12 | description: 'The resource you are looking for does not exists', 13 | goToHome: 'Go to home', 14 | }, 15 | }, 16 | de: { 17 | notFound: { 18 | title: '404', 19 | description: 'The resource you are looking for does not exists', 20 | goToHome: 'Go to home', 21 | }, 22 | }, 23 | es: { 24 | notFound: { 25 | title: '404', 26 | description: 'The resource you are looking for does not exists', 27 | goToHome: 'Go to home', 28 | }, 29 | }, 30 | }; 31 | -------------------------------------------------------------------------------- /packages/highlight/src/lib/themes/materialVolcano/index.ts: -------------------------------------------------------------------------------- 1 | import {createTheme} from '../../core'; 2 | import {materialVolcano, palette} from './materialVolcano'; 3 | 4 | export const materialVolcanoTheme = createTheme({ 5 | id: 'materialVolcano', 6 | editorTheme: materialVolcano, 7 | properties: { 8 | darkMode: true, 9 | label: 'Material Volcano', 10 | previewBackground: 11 | 'linear-gradient(140deg, rgb(241, 160, 61), rgb(192, 74, 65), rgb(115, 52, 52))', 12 | terminal: { 13 | main: palette.background, 14 | text: palette.white, 15 | tabs: { 16 | background: '#501316', 17 | activeTabBackground: palette.background, 18 | inactiveTabBackground: '#3d0606', 19 | textColor: palette.white, 20 | }, 21 | }, 22 | }, 23 | } as const); 24 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "target": "ESNext", 5 | "module": "ESNext", 6 | "moduleResolution": "node", 7 | "allowSyntheticDefaultImports": true, 8 | "esModuleInterop": true, 9 | "jsx": "preserve", 10 | "jsxImportSource": "solid-js", 11 | "declaration": true, 12 | "sourceMap": true, 13 | "importHelpers": true, 14 | "resolveJsonModule": true, 15 | "importsNotUsedAsValues": "remove", 16 | "forceConsistentCasingInFileNames": true, 17 | "skipLibCheck": true, 18 | "types": [ 19 | "vite/client" 20 | ], 21 | "lib": [ 22 | "dom", 23 | "ESNext" 24 | ] 25 | }, 26 | "include": [ 27 | "@types", 28 | "packages", 29 | "scripts" 30 | ], 31 | "exclude": ["**/node_modules"] 32 | } 33 | -------------------------------------------------------------------------------- /apps/api/prisma/migrations/20230304194315_preset/migration.sql: -------------------------------------------------------------------------------- 1 | -- CreateTable 2 | CREATE TABLE "Preset" ( 3 | "id" TEXT NOT NULL, 4 | "name" TEXT NOT NULL, 5 | "data" JSONB NOT NULL, 6 | "version" BIGINT NOT NULL DEFAULT 1, 7 | "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, 8 | "updatedAt" TIMESTAMP(3) NOT NULL, 9 | "ownerId" TEXT NOT NULL, 10 | 11 | CONSTRAINT "Preset_pkey" PRIMARY KEY ("id") 12 | ); 13 | 14 | -- CreateIndex 15 | CREATE INDEX "Preset_name_ownerId_idx" ON "Preset"("name", "ownerId"); 16 | 17 | -- CreateIndex 18 | CREATE UNIQUE INDEX "Preset_id_ownerId_key" ON "Preset"("id", "ownerId"); 19 | 20 | -- AddForeignKey 21 | ALTER TABLE "Preset" ADD CONSTRAINT "Preset_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE; 22 | -------------------------------------------------------------------------------- /apps/api/src/plugins/prisma.ts: -------------------------------------------------------------------------------- 1 | import {PrismaClient} from '@codeimage/prisma-models'; 2 | import {FastifyPluginAsync} from 'fastify'; 3 | import fp from 'fastify-plugin'; 4 | 5 | declare module 'fastify' { 6 | interface FastifyInstance { 7 | prisma: PrismaClient; 8 | } 9 | } 10 | 11 | const prismaPlugin: FastifyPluginAsync = fp( 12 | async server => { 13 | const prisma = new PrismaClient({ 14 | datasources: { 15 | db: { 16 | url: server.config.DATABASE_URL, 17 | }, 18 | }, 19 | }); 20 | 21 | await prisma.$connect(); 22 | 23 | server.decorate('prisma', prisma); 24 | 25 | server.addHook('onClose', async server => { 26 | await server.prisma.$disconnect(); 27 | }); 28 | }, 29 | {name: 'prisma'}, 30 | ); 31 | 32 | export default prismaPlugin; 33 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/ThemeSwitcher/ThemeBoxSkeleton.css.ts: -------------------------------------------------------------------------------- 1 | import {backgroundColorVar, themeVars, withThemeMode} from '@codeimage/ui'; 2 | import {darkGrayScale} from '@codeimage/ui/themes/darkTheme'; 3 | import {style} from '@vanilla-extract/css'; 4 | import {themeBox} from './ThemeSwitcher.css'; 5 | 6 | export const wrapper = style([ 7 | themeBox, 8 | { 9 | selectors: { 10 | ...withThemeMode({ 11 | light: { 12 | vars: { 13 | [backgroundColorVar]: themeVars.backgroundColor.gray['100'], 14 | }, 15 | }, 16 | dark: { 17 | vars: { 18 | [backgroundColorVar]: darkGrayScale.gray2, 19 | }, 20 | }, 21 | }), 22 | }, 23 | }, 24 | ]); 25 | 26 | export const content = style({ 27 | padding: '20px', 28 | }); 29 | -------------------------------------------------------------------------------- /apps/codeimage/src/components/Icons/Folder.tsx: -------------------------------------------------------------------------------- 1 | import {SvgIcon, SvgIconProps} from '@codeimage/ui'; 2 | 3 | export function FolderIcon(props: SvgIconProps) { 4 | return ( 5 | 6 | 7 | 8 | ); 9 | } 10 | 11 | export function FolderOpenIcon(props: SvgIconProps) { 12 | return ( 13 | 14 | 19 | 20 | 21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /packages/config/src/lib/core/createConfiguration.ts: -------------------------------------------------------------------------------- 1 | import {type CustomTheme} from '@codeimage/highlight'; 2 | import {AppStaticConfiguration} from '../types/configuration'; 3 | import {LanguageDefinition} from '../types/language-def'; 4 | 5 | export function createConfiguration< 6 | V extends string, 7 | Themes extends readonly CustomTheme[], 8 | Locales extends readonly string[], 9 | Languages extends readonly LanguageDefinition[], 10 | Configuration extends AppStaticConfiguration< 11 | V, 12 | Themes, 13 | Locales, 14 | Languages 15 | > = AppStaticConfiguration, 16 | >(configuration: Configuration): [Configuration] { 17 | if (!configuration.version) { 18 | throw new Error('No version specified'); 19 | } 20 | 21 | return [configuration as Configuration]; 22 | } 23 | -------------------------------------------------------------------------------- /apps/api/src/schemas/index.ts: -------------------------------------------------------------------------------- 1 | export type {CreateProjectApi} from '../routes/v1/project/create.js'; 2 | export type {UpdateProjectNameApi} from '../routes/v1/project/updateName.js'; 3 | export type {DeleteProjectApi} from '../routes/v1/project/delete.js'; 4 | export type {UpdateProjectApi} from '../routes/v1/project/update.js'; 5 | export type {GetProjectByIdApi} from '../routes/v1/project/getById.js'; 6 | export type {CloneProjectApi} from '../routes/v1/project/clone.js'; 7 | 8 | export type {GetPresetByIdApi} from '../routes/v1/preset/getById.js'; 9 | export type {GetAllPresetApi} from '../routes/v1/preset/getAll.js'; 10 | export type {CreatePresetApi} from '../routes/v1/preset/create.js'; 11 | export type {UpdatePresetApi} from '../routes/v1/preset/update.js'; 12 | export type {DeletePresetApi} from '../routes/v1/preset/delete.js'; 13 | -------------------------------------------------------------------------------- /apps/website/src/components/Landing/EditorSteps/EditorScene/SnippetControls/SnippetControls.css.ts: -------------------------------------------------------------------------------- 1 | import {backgroundColorVar, themeVars} from '@codeimage/ui'; 2 | import {fallbackVar, style} from '@vanilla-extract/css'; 3 | 4 | export const headerIconRow = style({ 5 | height: '56px', 6 | alignItems: 'center', 7 | display: 'flex', 8 | paddingLeft: themeVars.spacing['4'], 9 | columnGap: themeVars.spacing['2'], 10 | }); 11 | 12 | export const headerIconRowCircle = style({ 13 | selectors: { 14 | [`${headerIconRow} &`]: { 15 | width: '15px', 16 | height: '15px', 17 | margin: 'auto 0', 18 | borderRadius: themeVars.borderRadius.full, 19 | backgroundColor: fallbackVar( 20 | backgroundColorVar, 21 | themeVars.backgroundColor.gray['500'], 22 | ), 23 | }, 24 | }, 25 | }); 26 | -------------------------------------------------------------------------------- /packages/atomic-state/src/createTrackObserver.ts: -------------------------------------------------------------------------------- 1 | import {asyncScheduler, filter, MonoTypeOperatorFunction} from 'rxjs'; 2 | import {Accessor, untrack} from 'solid-js'; 3 | 4 | export function createTrackObserver(): [ 5 | track: Accessor, 6 | untrackCallback: (cb: () => void, async?: boolean) => void, 7 | ] { 8 | let track = true; 9 | return [ 10 | () => track, 11 | (cb: () => void, async = true) => { 12 | track = false; 13 | cb(); 14 | const schedule = async 15 | ? asyncScheduler.schedule 16 | : (cb: () => void) => cb(); 17 | 18 | schedule(() => (track = true)); 19 | }, 20 | ]; 21 | } 22 | 23 | export function emitWhenTracked( 24 | trackedState: Accessor, 25 | ): MonoTypeOperatorFunction { 26 | return filter(() => untrack(trackedState)); 27 | } 28 | --------------------------------------------------------------------------------