Skip to content

Commit

Permalink
2.0 (#104)
Browse files Browse the repository at this point in the history
* parent 54c13b9
author Puru Vijay <[email protected]> 1672524660 +0530
committer Puru Vijay <[email protected]> 1672584699 +0530

parent 54c13b9
author Puru Vijay <[email protected]> 1672524660 +0530
committer Puru Vijay <[email protected]> 1672584683 +0530

Update GH action

chore: update versions (next) (#91)

* chore: update versions (next)

* Update .gitignore

* remove .pnpm-store

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Puru Vijay <[email protected]>
Co-authored-by: Puru Vijay <[email protected]>

Delete npmrc

chore: Attempt fixing changeset/action and fail

chore: update versions (next) (#93)

* chore: update versions (next)

* Delete .npmrc

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Puru Vijay <[email protected]>

Add npm auth token to action

Add NPM_TOKEN to top level env

Update release.yml

Update pnpm version

Add pnpm cache

chore: update versions (next) (#93)

* chore: update versions (next)

* Delete .npmrc

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Puru Vijay <[email protected]>

Add npm auth token to action

Update release.yml

* fix: Add recompute bounds

* feat: legacy transform & perf (#95)

* Push current version

* Set legacyTranslate to true by default

* push changset

* Docs

* Add changesets

* Better style of tags

* feat: new exposed properties from events (#96)

* Use instanceOf, return new things from events

* Rename targetNode to currentNode

* Update docs

* Better document exported types about events

* Rework some logic

* generate changsets

* Fix documentation for solid, dont ship globals file

* Update rootNode

* Use new API in themeswitcher

* feat: new output formats (#97)

* Push current trials

* New output formats

* Add changset

* chore: update versions (next) (#98)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: custom transform function (#99)

* Implement new transform property

* Add docs

* Fix installation for now

* Push sitemap

* Add changeset

* chore: update versions (next) (#100)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Make PawCursor client:only

* Update sizes

* Update script

* FIx docs

* Update deps

* Add fonts, minor fixes

* feat: 2.0 README (#102)

* Push READMEs

* Update link

* Update read the docs links

* Update code snippets

* fix: double click issue (#103)

* Exit prerelease

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 9, 2023
1 parent fdb9f56 commit 4c54702
Show file tree
Hide file tree
Showing 73 changed files with 1,863 additions and 3,375 deletions.
10 changes: 0 additions & 10 deletions .changeset/brave-keys-yawn.md

This file was deleted.

17 changes: 0 additions & 17 deletions .changeset/pre.json

This file was deleted.

52 changes: 38 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,56 @@ on:
push:
branches:
- main
- '2.0'
env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
version:
# TODO: Change this later if repo changes
if: github.repository == 'PuruVJ/neodrag'
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v2
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- name: setup node.js
uses: actions/setup-node@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: install pnpm
run: npm i pnpm@latest -g
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
- name: install dependencies
run: pnpm install --no-frozen-lockfile
node-version: 16.x

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build all packages
run: pnpm -r compile
- name: create and publish versions

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1
with:
version: pnpm ci:version
Expand All @@ -38,3 +61,4 @@ jobs:
publish: pnpm ci:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
dist/
.DS_Store
.env
.env
.pnpm-store/
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# neodrag
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<p align="center">
<a href="https://www.neodrag.dev"><img src="https://www.neodrag.dev/logo.svg" height="150" /></a>
</p>

Lightweight multi-framework libraries for draggability on the web.
<h1 align="center">
Neodrag
</h1>

<h2 align="center">
One draggable to rule em all
</h2>

<p align="center">Multi-framework libraries for dragging. Choose your framework, the dragging API behavior will stay the same 🔥</p>

<p align="center">
<a href="https://www.npmjs.com/package/@neodrag/svelte"><img src="https://img.shields.io/npm/v/@neodrag/svelte?color=e63900&label=svelte"></a>
<a href="https://www.npmjs.com/package/@neodrag/vue"><img src="https://img.shields.io/npm/v/@neodrag/vue?color=42b883&label=vue"></a>
<a href="https://www.npmjs.com/package/@neodrag/react"><img src="https://img.shields.io/npm/v/@neodrag/react?color=0098b3&label=react"></a>
<a href="https://www.npmjs.com/package/@neodrag/solid"><img src="https://img.shields.io/npm/v/@neodrag/solid?color=2c4f7d&label=solid"></a>
<a href="https://www.npmjs.com/package/@neodrag/vanilla"><img src="https://img.shields.io/npm/v/@neodrag/vanilla?color=fff&label=vanilla"></a>
<p>

<p align="center"><a href="https://www.neodrag.dev">Getting Started</a></p>

This is a monorepo containing the following packages:

Expand Down Expand Up @@ -48,4 +65,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
7 changes: 7 additions & 0 deletions config/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const coreConfig: ({
dtsBanner,
}:
| {
dtsBanner?: string;
}
| undefined) => ReturnType<typeof import('ttsup').defineConfig>;
28 changes: 28 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { defineConfig } from 'ttsup';

/**
*
* @param {Object} param0
* @param {string} param0.dtsBanner
* @returns
*/
export const coreConfig = ({ dtsBanner } = { dtsBanner: '' }) =>
defineConfig([
{
entry: ['./src/index.ts'],
format: 'esm',
external: ['vue', 'react', 'solid-js', 'svelte'],
dts: { resolve: true, banner: dtsBanner },
clean: true,
treeshake: 'smallest',
},
{
entry: ['./src/index.ts'],
minify: 'terser',
external: ['vue', 'react', 'solid-js', 'svelte'],
format: 'esm',
clean: true,
outDir: 'dist/min',
treeshake: 'smallest',
},
]);
12 changes: 12 additions & 0 deletions config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@neodrag/tsup-config",
"version": "1.0.0",
"main": "index.js",
"type": "module",
"exports": {
".": {
"import": "./index.js",
"types": "./index.d.ts"
}
}
}
50 changes: 50 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# docs

## 0.0.3

### Patch Changes

- Updated dependencies [[`bd831dcc`](https://github.com/PuruVJ/neodrag/commit/bd831dcc101d967b78505acd064cdfcde03b62ff), [`3c10f6ae`](https://github.com/PuruVJ/neodrag/commit/3c10f6ae377c3e9fc9fea963ea99204a4649806c), [`9e5c4647`](https://github.com/PuruVJ/neodrag/commit/9e5c46477c7781bc75a57944983434a0c8ceff77), [`da98e910`](https://github.com/PuruVJ/neodrag/commit/da98e910469d63e53e2462e74196bad3b90ea053), [`a1572bce`](https://github.com/PuruVJ/neodrag/commit/a1572bce5186051a5114dd580017a49fc2b3c7fc), [`8dd0d88f`](https://github.com/PuruVJ/neodrag/commit/8dd0d88ff0458c0bd6d20e3649371fdf732c9ebb)]:
- @neodrag/svelte@2.0.0

## 0.0.3-next.5

### Patch Changes

- Updated dependencies [[`a1572bc`](https://github.com/PuruVJ/neodrag/commit/a1572bce5186051a5114dd580017a49fc2b3c7fc)]:
- @neodrag/svelte@2.0.0-next.6

## 0.0.3-next.4

### Patch Changes

- Updated dependencies [[`9e5c464`](https://github.com/PuruVJ/neodrag/commit/9e5c46477c7781bc75a57944983434a0c8ceff77)]:
- @neodrag/svelte@2.0.0-next.5

## 0.0.3-next.3

### Patch Changes

- Updated dependencies []:
- @neodrag/svelte@2.0.0-next.4

## 0.0.3-next.2

### Patch Changes

- Updated dependencies [[`0f513db2`](https://github.com/PuruVJ/neodrag/commit/0f513db2c0a88ed03f0472311a03b6ae0e4f9483), [`8dd0d88f`](https://github.com/PuruVJ/neodrag/commit/8dd0d88ff0458c0bd6d20e3649371fdf732c9ebb)]:
- @neodrag/svelte@2.0.0-next.3

## 0.0.3-next.1

### Patch Changes

- Updated dependencies [[`820307b`](https://github.com/PuruVJ/neodrag/commit/820307b9e2ed5884b2c4d167ba2f7ae2bad14f87)]:
- @neodrag/svelte@2.0.0-next.2

## 0.0.3-next.0

### Patch Changes

- Updated dependencies [[`8d04e73`](https://github.com/PuruVJ/neodrag/commit/8d04e7327c81ad345610bdc87bcf0f8b6a40fa9e)]:
- @neodrag/svelte@2.0.0-next.1
28 changes: 14 additions & 14 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docs",
"type": "module",
"version": "0.0.2",
"version": "0.0.3",
"private": true,
"scripts": {
"dev": "astro dev",
Expand All @@ -20,7 +20,7 @@
"slugify": "^1.6.5",
"svelte-body": "^1.3.6",
"svelte-copy": "^1.3.0",
"svelte-inview": "^3.0.1",
"svelte-inview": "^3.0.2",
"svelte-local-storage-store": "^0.3.2",
"throttle-debounce": "^5.0.0"
},
Expand All @@ -29,29 +29,29 @@
"@astrojs/prefetch": "^0.1.1",
"@astrojs/sitemap": "^1.0.0",
"@astrojs/svelte": "^1.0.2",
"@iconify/json": "^2.1.159",
"@iconify/json": "^2.2.3",
"@types/throttle-debounce": "^5.0.0",
"astro": "^1.8.0",
"astro-compress": "^1.1.24",
"astro-critters": "^1.1.24",
"astro": "^1.9.1",
"astro-compress": "^1.1.25",
"astro-critters": "^1.1.25",
"astrojs-service-worker": "^0.0.8",
"autoprefixer": "^10.4.13",
"hast-util-to-string": "^2.0.0",
"hastscript": "^7.1.0",
"postcss": "^8.4.19",
"postcss-jit-props": "^1.0.8",
"prettier": "^2.8.1",
"prettier-plugin-astro": "^0.7.0",
"hastscript": "^7.2.0",
"postcss": "^8.4.21",
"postcss-jit-props": "^1.0.9",
"prettier": "^2.8.2",
"prettier-plugin-astro": "^0.7.2",
"rehype-autolink-headings": "^6.1.1",
"remark-custom-container": "^1.2.0",
"rollup": "^3.9.0",
"rollup": "^3.9.1",
"sass": "^1.57.1",
"svelte": "^3.55.0",
"svelte-fast-dimension": "^0.0.3",
"svelte-sequential-preprocessor": "^0.0.7",
"typescript": "^4.9.4",
"unplugin-auto-import": "^0.12.0",
"unplugin-icons": "^0.14.14",
"vite": "^4.0.3"
"unplugin-icons": "^0.15.1",
"vite": "^4.0.4"
}
}
16 changes: 14 additions & 2 deletions docs/src/components/PawCursor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import PawIcon from '~icons/mdi/paw';
import { mounted } from '$stores/mounted.store';
import type { Theme } from '$stores/user-preferences.store';
let showCustomCursor = false;
let cursorColor: Theme | undefined = 'dark';
let coordsCursor: {
x: number;
Expand Down Expand Up @@ -45,7 +47,7 @@
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['data-paw-cursor'],
attributeFilter: ['data-paw-cursor', 'data-paw-color'],
});
return result;
Expand All @@ -69,6 +71,11 @@
() => {
if (el.dataset.pawCursor === 'true') {
showCustomCursor = true;
if (el.dataset.pawColor) {
cursorColor = el.dataset.pawColor as Theme;
}
initialCursor = getComputedStyle(el).cursor;
el.style.cursor = 'none';
} else {
Expand All @@ -83,6 +90,8 @@
() => {
showCustomCursor = false;
initialCursor && (el.style.cursor = initialCursor);
cursorColor = undefined;
},
{ passive: true }
);
Expand All @@ -97,13 +106,16 @@
style:top="{coordsCursor?.y ?? 0}px"
style:left="{coordsCursor?.x ?? 0}px"
style:--opacity={showCustomCursor && coordsCursor ? 1 : 0}
style:--color="var(--app-color-{cursorColor ?? 'dark'})"
style:display={$mounted ? 'block' : 'none'}
>
<PawIcon style="font-size: 2rem;" />
</div>

<style lang="scss">
.cursor {
--color: var(--app-color-dark);
display: none;
position: fixed;
Expand All @@ -126,7 +138,7 @@
}
:global(svg path) {
fill: var(--app-color-dark);
fill: var(--color);
}
@media (hover: none) {
Expand Down
Loading

1 comment on commit 4c54702

@vercel
Copy link

@vercel vercel bot commented on 4c54702 Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.