diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..2b77952 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +node_modules +src/**/*.snap.js +.eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..66fda33 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,28 @@ +{ + "env": { + "es2017": true, + "commonjs": true, + "node": true + }, + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": ["vitest"], + "extends": ["eslint:recommended", "plugin:vitest/recommended"], + "ignorePatterns": ["**/*.snap.js"], + "overrides": [ + { + "files": ["*.svelte"], + "parser": "svelte-eslint-parser" + } + ], + "rules": { + "eqeqeq": "error", + "no-useless-escape": "off", + "no-unused-expressions": "off", + "no-unused-vars": "off", + "no-self-assign": "off", + "no-undef": "off" + } +} diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..17aa1b2 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @dysfunc diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 0000000..5bf2ae9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,40 @@ +--- +name: Bug report +about: Report a bug to help us improve the overall user experience +title: '๐ ' +labels: 'Type: Bug' +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] + +**Smartphone (please complete the following information):** + +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..643d346 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest a new feature or functionality enhancement +title: 'โจ ' +labels: 'Type: Feature' +assignees: '' +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/issue-template.md b/.github/ISSUE_TEMPLATE/issue-template.md new file mode 100644 index 0000000..5c1f484 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-template.md @@ -0,0 +1,7 @@ +--- +name: Issue +about: Track a new feature, enhancement, or general task. +title: '' +labels: '' +assignees: '' +--- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..693f195 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,37 @@ +**Why these changes?** + +**How do we test?** + +**Screenshots** + + diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml new file mode 100644 index 0000000..1ea042b --- /dev/null +++ b/.github/workflows/unit.yml @@ -0,0 +1,37 @@ +name: Unit Tests (Vitest) + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build: + runs-on: ubuntu-latest + if: | + ( + !contains(github.event.head_commit.message, '[skip ci]') && + !contains(github.event.head_commit.message, 'version bump') + ) + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + - uses: szenius/set-timezone@v1.2 + with: + timezoneLinux: "America/Los_Angeles" + timezoneMacos: "America/Los_Angeles" + timezoneWindows: "Pacific Standard Time" + - run: npm i + - run: npm test + + - uses: actions/upload-artifact@v2 + if: failure() + with: + name: unit-tests + path: ${{ github.workspace }}/coverage/ + retention-days: 5 diff --git a/.gitignore b/.gitignore index 67ef1fd..db894dd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # except !.editorconfig +!.eslintignore !.eslintrc.json !.github !.gitignore @@ -20,7 +21,6 @@ # generated .vercel /node_modules -/lib /dist # testing diff --git a/.lintstagedrc b/.lintstagedrc index 49f6ad1..b2fc60f 100755 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,3 +1,6 @@ { - "./src/**/*.{test.js,js,svelte}": ["eslint -c ./.eslintrc.js --fix", "prettier --write"] + "./src/**/*.{test.js,js,json,svelte}": [ + "eslint -c ./.eslintrc.json --fix", + "prettier --write" + ] } diff --git a/.prettierrc.json b/.prettierrc.json index 8938c9d..29ba671 100755 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -9,5 +9,14 @@ "svelteSortOrder": "options-scripts-markup-styles", "svelteStrictMode": false, "svelteBracketNewLine": true, - "svelteAllowShorthand": true -} \ No newline at end of file + "svelteAllowShorthand": true, + "plugins": ["prettier-plugin-svelte"], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index a8b14fc..990c7b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,48 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.1.1](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.0) - 2022-08-21 +## [1.0.1](https://github.com/svelte-plugins/tooltips/releases/tag/v1.0.1) - 2022-11-19 + +- feat(tooltips): add delay prop by @joligoms + +## [1.0.0](https://github.com/svelte-plugins/tooltips/releases/tag/v1.0.0) - 2022-11-13 + +- refactor(tooltips): use absolute positioning with tooltips + +## [0.1.9](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.9) - 2022-11-08 + +- New prop show that allows the user to control the tooltip visibility outside of standard actions. +- New action type added called prop. This should be used when leveraging show prop. +- Update demo containing an example of how to show + +## [0.1.8](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.8) - 2022-09-12 + +- Updated Typescript definitions +- Fixed an issue with empty state with action + +## [0.1.7](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.7) - 2022-09-12 + +- Fix an issue handling empty tooltip +- New action property that supports click or hover as triggers +- New CSS variables to control white-space +- Add Typescript definitions + +## [0.1.6](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.6) - 2022-09-09 + +- fix(offsets): properly calc position using both x and y offsets + +## [0.1.5](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.5) - 2022-09-09 + +- Includes a bug fix for a bad reference with SveltKit pre-rendering. + +## [0.1.4](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.4) - 2022-08-30 + +- This release includes a major fix for animations related to handling auto-positioning and content sizing. + +## [0.1.2](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.2) - 2022-08-21 + +- Add theme property and update documentation + +## [0.1.1](https://github.com/svelte-plugins/tooltips/releases/tag/v0.1.1) - 2022-08-21 - Initial release diff --git a/docs/public/favicon.png b/docs/favicon.png similarity index 100% rename from docs/public/favicon.png rename to docs/favicon.png diff --git a/docs/index.html b/docs/index.html index a533fd4..330fa61 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,9 +6,9 @@