├── .all-contributorsrc ├── .changeset ├── README.md └── config.json ├── .github ├── FUNDING.yml └── workflows │ ├── cr.yml │ └── release.yml ├── .gitignore ├── .prettierrc ├── .vscode └── settings.json ├── LICENSE.txt ├── README.md ├── docs ├── .gitignore ├── .npmrc ├── .prettierrc.cjs ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── settings.json ├── CHANGELOG.md ├── README.md ├── astro.config.ts ├── package.json ├── postcss.config.cjs ├── public │ ├── banner.png │ ├── favicon.png │ ├── favicon.svg │ ├── home │ │ ├── metaframeworks-dark.webp │ │ └── metaframeworks-light.webp │ ├── logo-2x.png │ ├── logo.svg │ └── logos │ │ ├── react.svg │ │ ├── solid.svg │ │ ├── svelte.svg │ │ ├── vanilla.svg │ │ └── vue.svg ├── src │ ├── actions │ │ ├── portal.ts │ │ └── typingEffect.ts │ ├── auto-imports.d.ts │ ├── components │ │ ├── Footer.svelte │ │ ├── MetaThemeColor.svelte │ │ ├── MobileNav.svelte │ │ ├── PawCursor.svelte │ │ ├── ThemeSwitcher.svelte │ │ ├── ToC.svelte │ │ ├── docs │ │ │ └── Nav.svelte │ │ ├── examples │ │ │ └── KitchenSinkDemo.svelte │ │ ├── home │ │ │ ├── ExploreFrameworks.svelte │ │ │ ├── HeroExample.svelte │ │ │ ├── RingSVG.svelte │ │ │ ├── ScrollDownIndicator.svelte │ │ │ └── features │ │ │ │ ├── bundle-sizes │ │ │ │ └── BundleSizeFeature.svelte │ │ │ │ ├── feature-box.scss │ │ │ │ ├── feature-rich │ │ │ │ └── FeatureRichFeature.svelte │ │ │ │ ├── multiple-frameworks │ │ │ │ ├── FrameworkPolygon.svelte │ │ │ │ ├── FrameworkVertex.svelte │ │ │ │ └── MultipleFrameworksFeature.svelte │ │ │ │ └── ssr-friendly │ │ │ │ └── SSRFriendlyFeature.svelte │ │ └── options │ │ │ ├── Options.astro │ │ │ ├── OptionsCode.astro │ │ │ ├── OptionsDemoBase.svelte │ │ │ ├── OptionsExample.astro │ │ │ └── OptionsExamples.svelte │ ├── css │ │ ├── breakpoints.scss │ │ ├── globals.scss │ │ ├── include-media.scss │ │ └── themes.scss │ ├── data │ │ └── sizes.json │ ├── documentation │ │ ├── exported-types.mdx │ │ ├── installation.mdx │ │ └── options │ │ │ ├── applyUserSelectHack │ │ │ ├── +option.mdx │ │ │ ├── NoUserSelect.example.svelte │ │ │ ├── UserSelect.example.svelte │ │ │ └── user-select.mixin.scss │ │ │ ├── axis │ │ │ ├── +option.mdx │ │ │ ├── BothAxis.example.svelte │ │ │ ├── NoneAxis.example.svelte │ │ │ ├── XAxis.example.svelte │ │ │ └── YAxis.example.svelte │ │ │ ├── bounds │ │ │ ├── +option.mdx │ │ │ ├── BodyBounds.example.svelte │ │ │ ├── CoordinateBounds.example.svelte │ │ │ └── ParentBounds.example.svelte │ │ │ ├── cancel │ │ │ ├── +option.mdx │ │ │ ├── MultipleCancelElement.example.svelte │ │ │ ├── MultipleCancelSelector.example.svelte │ │ │ ├── SingleCancelElement.example.svelte │ │ │ ├── SingleCancelSelector.example.svelte │ │ │ └── cancel-base.mixin.scss │ │ │ ├── defaultClass │ │ │ └── +option.mdx │ │ │ ├── defaultClassDragged │ │ │ └── +option.mdx │ │ │ ├── defaultClassDragging │ │ │ └── +option.mdx │ │ │ ├── defaultPosition │ │ │ ├── +option.mdx │ │ │ └── DefaultPosition.example.svelte │ │ │ ├── disabled │ │ │ ├── +option.mdx │ │ │ └── Disabled.example.svelte │ │ │ ├── gpuAcceleration │ │ │ ├── +option.mdx │ │ │ ├── Acceleration.example.svelte │ │ │ └── NoAcceleration.example.svelte │ │ │ ├── grid │ │ │ ├── +option.mdx │ │ │ ├── InactiveGrid.example.svelte │ │ │ ├── RectangleGrid.example.svelte │ │ │ └── SquareGrid.example.svelte │ │ │ ├── handle │ │ │ ├── +option.mdx │ │ │ ├── MultipleHandleElement.example.svelte │ │ │ ├── MultipleHandleSelector.example.svelte │ │ │ ├── SingleHandleElement.example.svelte │ │ │ ├── SingleHandleSelector.example.svelte │ │ │ └── handle-base.mixin.scss │ │ │ ├── ignoreMultitouch │ │ │ ├── +option.mdx │ │ │ ├── IgnoredMultitouch.example.svelte │ │ │ └── Multitouch.example.svelte │ │ │ ├── legacyTranslate │ │ │ ├── +option.mdx │ │ │ ├── LegacyTranslateGPU.example.svelte │ │ │ ├── LegacyTranslateNoGPU.example.svelte │ │ │ ├── TranslateGPU.example.svelte │ │ │ └── TranslateNoGPU.example.svelte │ │ │ ├── onDrag │ │ │ └── +option.mdx │ │ │ ├── onDragEnd │ │ │ └── +option.mdx │ │ │ ├── onDragStart │ │ │ └── +option.mdx │ │ │ ├── position │ │ │ ├── +option.mdx │ │ │ ├── DisabledPosition.example.svelte │ │ │ └── Position.example.svelte │ │ │ ├── recomputeBounds │ │ │ └── +option.mdx │ │ │ ├── threshold │ │ │ ├── +option.mdx │ │ │ ├── Delay.example.svelte │ │ │ └── Distance.example.svelte │ │ │ └── transform │ │ │ ├── +option.mdx │ │ │ ├── ManualTransform.example.svelte │ │ │ └── ReturnTransform.example.svelte │ ├── env.d.ts │ ├── helpers │ │ ├── constants.ts │ │ ├── framework-icons.ts │ │ └── utils.ts │ ├── layouts │ │ ├── DocsLayout.astro │ │ ├── Layout.astro │ │ ├── MainDocsLayout.astro │ │ └── ThemeWatcher.svelte │ ├── pages │ │ ├── docs │ │ │ ├── index.astro │ │ │ ├── migrating │ │ │ │ └── svelte-drag.mdx │ │ │ ├── react.mdx │ │ │ ├── solid.mdx │ │ │ ├── svelte.mdx │ │ │ ├── vanilla.mdx │ │ │ └── vue.mdx │ │ └── index.astro │ ├── state │ │ ├── auto-destroy-effect-root.svelte.ts │ │ ├── persisted.svelte.ts │ │ └── user-preferences.svelte.ts │ └── worklet │ │ └── squircle.js ├── svelte.config.js └── tsconfig.json ├── package.json ├── packages ├── config │ └── index.ts ├── core │ ├── CHANGELOG.md │ ├── package.json │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── react │ ├── CHANGELOG.md │ ├── README.md │ ├── demo │ │ ├── .gitignore │ │ ├── index.html │ │ ├── package.json │ │ ├── src │ │ │ ├── App.tsx │ │ │ ├── index.css │ │ │ ├── main.tsx │ │ │ └── vite-env.d.ts │ │ ├── tsconfig.json │ │ └── vite.config.ts │ ├── package.json │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── solid │ ├── CHANGELOG.md │ ├── README.md │ ├── demo │ │ ├── README.md │ │ ├── index.html │ │ ├── package.json │ │ ├── pnpm-lock.yaml │ │ ├── src │ │ │ ├── App.module.css │ │ │ ├── App.tsx │ │ │ ├── global.d.ts │ │ │ └── index.tsx │ │ ├── tsconfig.json │ │ └── vite.config.ts │ ├── package.json │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── svelte │ ├── CHANGELOG.md │ ├── README.md │ ├── demo │ │ ├── .gitignore │ │ ├── README.md │ │ ├── package.json │ │ ├── src │ │ │ ├── app.d.ts │ │ │ ├── app.html │ │ │ └── routes │ │ │ │ ├── 2 │ │ │ │ └── +page.svelte │ │ │ │ └── +page.svelte │ │ ├── svelte.config.js │ │ ├── tsconfig.json │ │ └── vite.config.ts │ ├── package.json │ ├── src │ │ └── index.ts │ ├── tests │ │ ├── CancelDraggable.spec.ts │ │ ├── Draggable.spec.ts │ │ ├── HandleDraggable.spec.ts │ │ ├── components │ │ │ ├── CancelDraggable.svelte │ │ │ ├── Draggable.svelte │ │ │ └── HandleDraggable.svelte │ │ └── testHelpers.ts │ ├── tsconfig.json │ ├── tsup.config.ts │ └── vitest.config.ts ├── vanilla │ ├── CHANGELOG.md │ ├── README.md │ ├── demo-umd │ │ ├── .gitignore │ │ ├── index.html │ │ ├── package.json │ │ ├── src │ │ │ ├── main.js │ │ │ └── style.css │ │ └── tsconfig.json │ ├── demo │ │ ├── .gitignore │ │ ├── favicon.svg │ │ ├── index.html │ │ ├── package.json │ │ ├── src │ │ │ ├── main.ts │ │ │ ├── style.css │ │ │ └── vite-env.d.ts │ │ └── tsconfig.json │ ├── package.json │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ └── tsup.config.ts └── vue │ ├── CHANGELOG.md │ ├── README.md │ ├── demo │ ├── .gitignore │ ├── CHANGELOG.md │ ├── README.md │ ├── index.html │ ├── package.json │ ├── src │ │ ├── App.vue │ │ ├── components │ │ │ └── HelloWorld.vue │ │ ├── env.d.ts │ │ └── main.ts │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts │ ├── package.json │ ├── src │ └── index.ts │ ├── tsconfig.json │ └── tsup.config.ts ├── pnpm-lock.yaml ├── pnpm-workspace.yaml └── scripts └── gather-sizes.ts /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "commitConvention": "angular", 8 | "contributors": [ 9 | { 10 | "login": "PuruVJ", 11 | "name": "Puru Vijay", 12 | "avatar_url": "https://avatars.githubusercontent.com/u/47742487?v=4", 13 | "profile": "https://puruvj.dev", 14 | "contributions": [ 15 | "infra", 16 | "code", 17 | "maintenance", 18 | "content", 19 | "doc", 20 | "financial", 21 | "research" 22 | ] 23 | }, 24 | { 25 | "login": "bluwy", 26 | "name": "Bjorn Lu", 27 | "avatar_url": "https://avatars.githubusercontent.com/u/34116392?v=4", 28 | "profile": "https://bjornlu.com/", 29 | "contributions": [ 30 | "code", 31 | "ideas" 32 | ] 33 | }, 34 | { 35 | "login": "matrushka", 36 | "name": "Baris Gumustas", 37 | "avatar_url": "https://avatars.githubusercontent.com/u/53268?v=4", 38 | "profile": "https://github.com/matrushka", 39 | "contributions": [ 40 | "code" 41 | ] 42 | }, 43 | { 44 | "login": "sidharth-anand", 45 | "name": "Sidharth Anand", 46 | "avatar_url": "https://avatars.githubusercontent.com/u/55060749?v=4", 47 | "profile": "https://github.com/sidharth-anand", 48 | "contributions": [ 49 | "code" 50 | ] 51 | }, 52 | { 53 | "login": "Tropix126", 54 | "name": "Tropical", 55 | "avatar_url": "https://avatars.githubusercontent.com/u/42101043?v=4", 56 | "profile": "https://github.com/Tropix126", 57 | "contributions": [ 58 | "doc" 59 | ] 60 | }, 61 | { 62 | "login": "AphLute", 63 | "name": "AphLute", 64 | "avatar_url": "https://avatars.githubusercontent.com/u/80430144?v=4", 65 | "profile": "https://earth.suncapped.com/", 66 | "contributions": [ 67 | "code" 68 | ] 69 | }, 70 | { 71 | "login": "tascodes", 72 | "name": "Tas", 73 | "avatar_url": "https://avatars.githubusercontent.com/u/32209335?v=4", 74 | "profile": "https://github.com/tascodes", 75 | "contributions": [ 76 | "infra", 77 | "code", 78 | "test" 79 | ] 80 | } 81 | ], 82 | "contributorsPerLine": 7, 83 | "skipCi": true, 84 | "repoType": "github", 85 | "repoHost": "https://github.com", 86 | "projectName": "neodrag", 87 | "projectOwner": "PuruVJ" 88 | } 89 | -------------------------------------------------------------------------------- /.changeset/README.md: -------------------------------------------------------------------------------- 1 | # Changesets 2 | 3 | Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works 4 | with multi-package repos, or single-package repos to help you version and publish your code. You can 5 | find the full documentation for it [in our repository](https://github.com/changesets/changesets) 6 | 7 | We have a quick list of common questions to get you started engaging with this project in 8 | [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) 9 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json", 3 | "changelog": ["@changesets/changelog-github", { "repo": "PuruVJ/neodrag" }], 4 | "commit": false, 5 | "linked": [], 6 | "access": "public", 7 | "baseBranch": "main", 8 | "updateInternalDependencies": "patch", 9 | "ignore": [] 10 | } 11 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | github: PuruVJ 3 | -------------------------------------------------------------------------------- /.github/workflows/cr.yml: -------------------------------------------------------------------------------- 1 | name: Continuous Releases 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v4 11 | - uses: actions/setup-node@v4 12 | with: 13 | node-version: 20 14 | 15 | - uses: pnpm/action-setup@v4 16 | with: 17 | version: 9 18 | run_install: true 19 | 20 | - name: Compile 21 | run: pnpm compile 22 | 23 | - name: Release 24 | run: pnpm dlx pkg-pr-new publish './packages/*' -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Changesets 2 | on: 3 | push: 4 | branches: 5 | - main 6 | - '2.0' 7 | env: 8 | CI: true 9 | PNPM_CACHE_FOLDER: .pnpm-store 10 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 11 | jobs: 12 | version: 13 | # TODO: Change this later if repo changes 14 | if: github.repository == 'PuruVJ/neodrag' 15 | timeout-minutes: 15 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout Repo 19 | uses: actions/checkout@v3 20 | with: 21 | # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits 22 | fetch-depth: 0 23 | - name: Setup Node.js 24 | uses: actions/setup-node@v4 25 | with: 26 | node-version: 22.x 27 | 28 | - uses: pnpm/action-setup@v4 29 | name: Install pnpm 30 | id: pnpm-install 31 | with: 32 | version: 9 33 | run_install: true 34 | 35 | - name: Get pnpm store directory 36 | id: pnpm-cache 37 | shell: bash 38 | run: | 39 | echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT 40 | 41 | - uses: actions/cache@v4 42 | name: Setup pnpm cache 43 | with: 44 | path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} 45 | key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} 46 | restore-keys: | 47 | ${{ runner.os }}-pnpm-store- 48 | 49 | - name: Build all packages 50 | run: pnpm -r compile 51 | 52 | - name: Create Release Pull Request or Publish to npm 53 | uses: changesets/action@v1 54 | with: 55 | version: pnpm ci:version 56 | commit: 'chore: update versions' 57 | title: 'chore: update versions' 58 | publish: pnpm ci:release 59 | env: 60 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 61 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | dist/ 3 | .DS_Store 4 | .env 5 | .pnpm-store/ 6 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "printWidth": 100, 4 | "useTabs": true 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.tsdk": "node_modules/typescript/lib" 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021-2022 Puru Vijay 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # build output 2 | dist/ 3 | .output/ 4 | 5 | # dependencies 6 | node_modules/ 7 | 8 | # logs 9 | npm-debug.log* 10 | yarn-debug.log* 11 | yarn-error.log* 12 | pnpm-debug.log* 13 | 14 | 15 | # environment variables 16 | .env 17 | .env.production 18 | 19 | # macOS-specific files 20 | .DS_Store 21 | 22 | .astro -------------------------------------------------------------------------------- /docs/.npmrc: -------------------------------------------------------------------------------- 1 | # Expose Astro dependencies for `pnpm` users 2 | -------------------------------------------------------------------------------- /docs/.prettierrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | useTabs: true, 3 | semi: true, 4 | printWidth: 100, 5 | singleQuote: true, 6 | 7 | plugins: [require.resolve('prettier-plugin-astro'), require.resolve('prettier-plugin-svelte')], 8 | overrides: [ 9 | { 10 | files: '*.astro', 11 | options: { 12 | parser: 'astro', 13 | }, 14 | }, 15 | { 16 | files: ['*.mdx', '*.md'], 17 | options: { 18 | useTabs: false, 19 | }, 20 | }, 21 | ], 22 | }; 23 | -------------------------------------------------------------------------------- /docs/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["astro-build.astro-vscode"], 3 | "unwantedRecommendations": [] 4 | } 5 | -------------------------------------------------------------------------------- /docs/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "command": "./node_modules/.bin/astro dev", 6 | "name": "Development server", 7 | "request": "launch", 8 | "type": "node-terminal" 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /docs/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cssvar.files": [ 3 | "./node_modules/open-props/open-props.min.css", 4 | // if you have an alternative path to where your styles are located 5 | // you can add it in this array of files 6 | "../src/css/globals.scss", 7 | "../src/css/themes.scss" 8 | ], 9 | 10 | // Do not ignore node_modules css files, which is ignored by default 11 | "cssvar.ignore": [], 12 | 13 | // add support for autocomplete in JS or JS like files 14 | "cssvar.extensions": ["css", "jsx", "tsx", "astro", "svelte", "vue"] 15 | } 16 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to [Astro](https://astro.build) 2 | 3 | [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) 4 | 5 | > 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! 6 | 7 | ![basics](https://user-images.githubusercontent.com/4677417/186188965-73453154-fdec-4d6b-9c34-cb35c248ae5b.png) 8 | 9 | ## 🚀 Project Structure 10 | 11 | Inside of your Astro project, you'll see the following folders and files: 12 | 13 | ``` 14 | / 15 | ├── public/ 16 | │ └── favicon.svg 17 | ├── src/ 18 | │ ├── components/ 19 | │ │ └── Card.astro 20 | │ ├── layouts/ 21 | │ │ └── Layout.astro 22 | │ └── pages/ 23 | │ └── index.astro 24 | └── package.json 25 | ``` 26 | 27 | Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. 28 | 29 | There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components. 30 | 31 | Any static assets, like images, can be placed in the `public/` directory. 32 | 33 | ## 🧞 Commands 34 | 35 | All commands are run from the root of the project, from a terminal: 36 | 37 | | Command | Action | 38 | | :--------------------- | :------------------------------------------------- | 39 | | `npm install` | Installs dependencies | 40 | | `npm run dev` | Starts local dev server at `localhost:3000` | 41 | | `npm run build` | Build your production site to `./dist/` | 42 | | `npm run preview` | Preview your build locally, before deploying | 43 | | `npm run astro ...` | Run CLI commands like `astro add`, `astro preview` | 44 | | `npm run astro --help` | Get help using the Astro CLI | 45 | 46 | ## 👀 Want to learn more? 47 | 48 | Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). 49 | -------------------------------------------------------------------------------- /docs/astro.config.ts: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | import { rehypeHeadingIds } from '@astrojs/markdown-remark'; 3 | import mdx from '@astrojs/mdx'; 4 | import sitemap from '@astrojs/sitemap'; 5 | import svelte from '@astrojs/svelte'; 6 | import { defineConfig } from 'astro/config'; 7 | import { h } from 'hastscript'; 8 | import rehypeAutolinkHeadings, { type Options } from 'rehype-autolink-headings'; 9 | import container from 'remark-custom-container/dist/esm/index.js'; 10 | import UnpluginIcons from 'unplugin-icons/vite'; 11 | 12 | const AnchorLinkIcon = h( 13 | 'svg', 14 | { 15 | width: '0.75em', 16 | height: '0.75em', 17 | version: 1.1, 18 | viewBox: '0 0 16 16', 19 | xlmns: 'http://www.w3.org/2000/svg', 20 | }, 21 | h('path', { 22 | fillRule: 'evenodd', 23 | fill: 'currentcolor', 24 | d: 'M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z', 25 | }), 26 | ); 27 | 28 | // https://astro.build/config 29 | export default defineConfig({ 30 | site: 'https://neodrag.dev', 31 | integrations: [svelte(), mdx(), sitemap()], 32 | 33 | markdown: { 34 | extendDefaultPlugins: true, 35 | shikiConfig: { 36 | themes: { 37 | light: 'github-light', 38 | dark: 'github-dark', 39 | }, 40 | }, 41 | // @ts-ignore 42 | remarkPlugins: [container], 43 | rehypePlugins: [ 44 | rehypeHeadingIds, 45 | [ 46 | rehypeAutolinkHeadings, 47 | { 48 | test: (heading) => /^h[1-5]$/i.test(heading.tagName), 49 | behavior: 'append', 50 | properties: { 51 | ariaHidden: 'true', 52 | tabindex: -1, 53 | class: 'unstyled heading-anchor', 54 | }, 55 | content: (heading) => [ 56 | h( 57 | `span`, 58 | { 59 | ariaHidden: 'true', 60 | }, 61 | AnchorLinkIcon, 62 | ), 63 | ], 64 | } as Options, 65 | ], 66 | ], 67 | }, 68 | 69 | vite: { 70 | // @ts-ignore 71 | plugins: [UnpluginIcons({ autoInstall: true, compiler: 'svelte' })], 72 | }, 73 | }); 74 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "type": "module", 4 | "version": "0.0.14", 5 | "private": true, 6 | "scripts": { 7 | "dev": "astro dev", 8 | "build": "astro build", 9 | "preview": "astro preview", 10 | "astro": "astro" 11 | }, 12 | "dependencies": { 13 | "@astrojs/markdown-remark": "^6.0.0", 14 | "@fontsource/jetbrains-mono": "^5.0.18", 15 | "@fontsource/plus-jakarta-sans": "^5.0.18", 16 | "@neodrag/svelte": "workspace:*", 17 | "astro-seo": "^0.8.0", 18 | "open-props": "^1.7.8", 19 | "popmotion": "^11.0.5", 20 | "runed": "^0.18.0", 21 | "slugify": "^1.6.6", 22 | "svelte-body": "^2.0.0", 23 | "svelte-copy": "^2.0.0", 24 | "svelte-inview": "^4.0.1", 25 | "throttle-debounce": "^5.0.0" 26 | }, 27 | "devDependencies": { 28 | "@astrojs/mdx": "^4.0.1", 29 | "@astrojs/sitemap": "^3.2.1", 30 | "@astrojs/svelte": "^7.0.1", 31 | "@iconify/json": "^2.2.159", 32 | "@types/throttle-debounce": "^5.0.2", 33 | "astro": "^5.0.3", 34 | "astrojs-service-worker": "^2.0.0", 35 | "autoprefixer": "^10.4.16", 36 | "hast-util-to-string": "^3.0.0", 37 | "hastscript": "^9.0.0", 38 | "postcss": "^8.4.32", 39 | "postcss-jit-props": "^1.0.14", 40 | "prettier": "^3.1.1", 41 | "prettier-plugin-astro": "^0.14.1", 42 | "prettier-plugin-svelte": "^3.3.2", 43 | "rehype-autolink-headings": "^7.1.0", 44 | "remark-custom-container": "^1.2.0", 45 | "sass": "^1.82.0", 46 | "svelte": "^5.0.0", 47 | "typescript": "^5.5.0", 48 | "unplugin-icons": "^0.21.0", 49 | "vite": "^6.0.3" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /docs/postcss.config.cjs: -------------------------------------------------------------------------------- 1 | const autoprefixer = require('autoprefixer'); 2 | const postcssJitProps = require('postcss-jit-props'); 3 | const OpenProps = require('open-props'); 4 | 5 | module.exports = { 6 | // only vars used are in build output 7 | plugins: [postcssJitProps(OpenProps), autoprefixer()], 8 | }; 9 | -------------------------------------------------------------------------------- /docs/public/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuruVJ/neodrag/61e34331987a48a49accbe62370867248c35fc07/docs/public/banner.png -------------------------------------------------------------------------------- /docs/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuruVJ/neodrag/61e34331987a48a49accbe62370867248c35fc07/docs/public/favicon.png -------------------------------------------------------------------------------- /docs/public/favicon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /docs/public/home/metaframeworks-dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuruVJ/neodrag/61e34331987a48a49accbe62370867248c35fc07/docs/public/home/metaframeworks-dark.webp -------------------------------------------------------------------------------- /docs/public/home/metaframeworks-light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuruVJ/neodrag/61e34331987a48a49accbe62370867248c35fc07/docs/public/home/metaframeworks-light.webp -------------------------------------------------------------------------------- /docs/public/logo-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuruVJ/neodrag/61e34331987a48a49accbe62370867248c35fc07/docs/public/logo-2x.png -------------------------------------------------------------------------------- /docs/public/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/public/logos/react.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/public/logos/solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/public/logos/svelte.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/public/logos/vanilla.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/public/logos/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/src/actions/portal.ts: -------------------------------------------------------------------------------- 1 | import { tick } from 'svelte'; 2 | 3 | /** 4 | * Usage:
or
5 | * 6 | * @param {HTMLElement} el 7 | * @param {HTMLElement|string} target DOM Element or CSS Selector 8 | */ 9 | export function portal(el: HTMLElement, target: HTMLElement | string = 'body') { 10 | let targetEl: HTMLElement; 11 | 12 | async function update(newTarget: HTMLElement | string) { 13 | target = newTarget; 14 | 15 | if (typeof target === 'string') { 16 | targetEl = document.querySelector(target)!; 17 | 18 | if (targetEl === null) { 19 | await tick(); 20 | targetEl = document.querySelector(target)!; 21 | } 22 | 23 | if (targetEl === null) { 24 | throw new Error(`No element found matching css selector: "${target}"`); 25 | } 26 | } else if (target instanceof HTMLElement) { 27 | targetEl = target; 28 | } else { 29 | throw new TypeError( 30 | `Unknown portal target type: ${ 31 | target === null ? 'null' : typeof target 32 | }. Allowed types: string (CSS selector) or HTMLElement.`, 33 | ); 34 | } 35 | targetEl.appendChild(el); 36 | el.hidden = false; 37 | } 38 | 39 | function destroy() { 40 | if (el.parentNode) { 41 | el.parentNode.removeChild(el); 42 | } 43 | } 44 | 45 | update(target); 46 | 47 | return { 48 | update, 49 | destroy, 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /docs/src/actions/typingEffect.ts: -------------------------------------------------------------------------------- 1 | export function typingEffect(element: HTMLElement, speed: number) { 2 | const text = element.innerHTML; 3 | 4 | element.innerHTML = ''; 5 | 6 | let i = 0; 7 | const timer = setInterval(() => { 8 | if (i < text.length) element.append(text.charAt(i++)); 9 | }, speed); 10 | 11 | return { 12 | destroy: () => clearInterval(timer), 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /docs/src/auto-imports.d.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* prettier-ignore */ 3 | // @ts-nocheck 4 | // noinspection JSUnusedGlobalSymbols 5 | // Generated by unplugin-auto-import 6 | export {} 7 | declare global { 8 | const Code: (typeof import('$components/options/OptionsCode.astro'))['default']; 9 | const Example: (typeof import('$components/options/OptionsExample.astro'))['default']; 10 | const Examples: (typeof import('$components/options/OptionsExamples.svelte'))['default']; 11 | } 12 | -------------------------------------------------------------------------------- /docs/src/components/Footer.svelte: -------------------------------------------------------------------------------- 1 | 12 | 13 | 34 | 35 | 53 | -------------------------------------------------------------------------------- /docs/src/components/MetaThemeColor.svelte: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/src/components/MobileNav.svelte: -------------------------------------------------------------------------------- 1 | 17 | 18 |
(shadow = false)} 23 | oninview_leave={() => (shadow = true)} 24 | >
25 | 26 |
27 | 31 | 32 | 33 | 34 | 37 |
38 | 39 | {#if is_nav_open} 40 | 41 |