From fd70f95224374d23157ee7c0357733102cd0df53 Mon Sep 17 00:00:00 2001
From: Alexander Neonxp Kiryukhin
Date: Sun, 18 Aug 2024 13:29:54 +0300
Subject: initial
---
node_modules/@phntms/use-local-state/.babelrc | 6 +
node_modules/@phntms/use-local-state/.eslintrc | 57 ++++
.../@phntms/use-local-state/.github/CODEOWNERS | 1 +
.../.github/ISSUE_TEMPLATE/REPORT_A_BUG.md | 41 +++
.../.github/ISSUE_TEMPLATE/REPORT_A_DOCS_ISSUE.md | 14 +
.../.github/ISSUE_TEMPLATE/REQUEST_A_FEATURE.md | 24 ++
.../.github/PULL_REQUEST_TEMPLATE.md | 12 +
.../.github/workflows/npmpublish.yml | 30 ++
.../use-local-state/.github/workflows/test.yml | 28 ++
.../@phntms/use-local-state/.prettierignore | 5 +
.../@phntms/use-local-state/CODE_OF_CONDUCT.md | 76 +++++
.../@phntms/use-local-state/CONTRIBUTING.md | 48 +++
node_modules/@phntms/use-local-state/LICENSE | 21 ++
node_modules/@phntms/use-local-state/README.md | 103 ++++++
node_modules/@phntms/use-local-state/SUPPORT.md | 4 +
.../@phntms/use-local-state/jest.config.js | 15 +
.../@phntms/use-local-state/lib/index.d.ts | 5 +
.../@phntms/use-local-state/lib/index.d.ts.map | 1 +
node_modules/@phntms/use-local-state/lib/index.js | 46 +++
.../@phntms/use-local-state/lib/index.js.map | 1 +
.../@phntms/use-local-state/lib/utils.d.ts | 3 +
.../@phntms/use-local-state/lib/utils.d.ts.map | 1 +
node_modules/@phntms/use-local-state/lib/utils.js | 6 +
.../@phntms/use-local-state/lib/utils.js.map | 1 +
node_modules/@phntms/use-local-state/package.json | 73 +++++
node_modules/@phntms/use-local-state/src/index.ts | 52 +++
node_modules/@phntms/use-local-state/src/utils.ts | 3 +
.../@phntms/use-local-state/test/index.test.tsx | 363 +++++++++++++++++++++
node_modules/@phntms/use-local-state/tsconfig.json | 24 ++
.../@phntms/use-local-state/tsconfig.test.json | 6 +
30 files changed, 1070 insertions(+)
create mode 100644 node_modules/@phntms/use-local-state/.babelrc
create mode 100644 node_modules/@phntms/use-local-state/.eslintrc
create mode 100644 node_modules/@phntms/use-local-state/.github/CODEOWNERS
create mode 100644 node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REPORT_A_BUG.md
create mode 100644 node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REPORT_A_DOCS_ISSUE.md
create mode 100644 node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REQUEST_A_FEATURE.md
create mode 100644 node_modules/@phntms/use-local-state/.github/PULL_REQUEST_TEMPLATE.md
create mode 100644 node_modules/@phntms/use-local-state/.github/workflows/npmpublish.yml
create mode 100644 node_modules/@phntms/use-local-state/.github/workflows/test.yml
create mode 100644 node_modules/@phntms/use-local-state/.prettierignore
create mode 100644 node_modules/@phntms/use-local-state/CODE_OF_CONDUCT.md
create mode 100644 node_modules/@phntms/use-local-state/CONTRIBUTING.md
create mode 100755 node_modules/@phntms/use-local-state/LICENSE
create mode 100755 node_modules/@phntms/use-local-state/README.md
create mode 100644 node_modules/@phntms/use-local-state/SUPPORT.md
create mode 100644 node_modules/@phntms/use-local-state/jest.config.js
create mode 100644 node_modules/@phntms/use-local-state/lib/index.d.ts
create mode 100644 node_modules/@phntms/use-local-state/lib/index.d.ts.map
create mode 100644 node_modules/@phntms/use-local-state/lib/index.js
create mode 100644 node_modules/@phntms/use-local-state/lib/index.js.map
create mode 100644 node_modules/@phntms/use-local-state/lib/utils.d.ts
create mode 100644 node_modules/@phntms/use-local-state/lib/utils.d.ts.map
create mode 100644 node_modules/@phntms/use-local-state/lib/utils.js
create mode 100644 node_modules/@phntms/use-local-state/lib/utils.js.map
create mode 100755 node_modules/@phntms/use-local-state/package.json
create mode 100755 node_modules/@phntms/use-local-state/src/index.ts
create mode 100644 node_modules/@phntms/use-local-state/src/utils.ts
create mode 100755 node_modules/@phntms/use-local-state/test/index.test.tsx
create mode 100644 node_modules/@phntms/use-local-state/tsconfig.json
create mode 100644 node_modules/@phntms/use-local-state/tsconfig.test.json
(limited to 'node_modules/@phntms')
diff --git a/node_modules/@phntms/use-local-state/.babelrc b/node_modules/@phntms/use-local-state/.babelrc
new file mode 100644
index 0000000..3e7174a
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.babelrc
@@ -0,0 +1,6 @@
+{
+ "presets": [
+ "@babel/preset-env",
+ "@babel/preset-typescript"
+ ]
+}
\ No newline at end of file
diff --git a/node_modules/@phntms/use-local-state/.eslintrc b/node_modules/@phntms/use-local-state/.eslintrc
new file mode 100644
index 0000000..ec7d069
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.eslintrc
@@ -0,0 +1,57 @@
+{
+ "env": {
+ "browser": true,
+ "node": true,
+ "es6": true,
+ "jest": true
+ },
+ "parser": "@typescript-eslint/parser",
+ "parserOptions": {
+ "jsx": true,
+ "useJSXTextNode": true
+ },
+ "settings": {
+ "react": {
+ "version": "detect"
+ }
+ },
+ "plugins": ["prettier", "eslint-plugin-import"],
+ "extends": [
+ "plugin:react/recommended",
+ "plugin:react-hooks/recommended",
+ "plugin:@typescript-eslint/recommended",
+ "plugin:prettier/recommended"
+ ],
+ "rules": {
+ "react-hooks/rules-of-hooks": "error",
+ "react-hooks/exhaustive-deps": "error",
+ "react/react-in-jsx-scope": "off",
+ "@typescript-eslint/explicit-function-return-type": "off",
+ "@typescript-eslint/explicit-module-boundary-types": "off",
+ "@typescript-eslint/ban-ts-comment": "off",
+ "react/prop-types": "off",
+ "import/order": [
+ "error",
+ {
+ "groups": ["builtin", "external", "internal"],
+ "pathGroups": [
+ {
+ "pattern": "react",
+ "group": "external",
+ "position": "before"
+ }
+ ],
+ "pathGroupsExcludedImportTypes": ["react"],
+ "newlines-between": "always",
+ "alphabetize": {
+ "order": "asc",
+ "caseInsensitive": true
+ }
+ }
+ ],
+ "prettier/prettier": "error"
+ },
+ "globals": {
+ "React": "writable"
+ }
+}
diff --git a/node_modules/@phntms/use-local-state/.github/CODEOWNERS b/node_modules/@phntms/use-local-state/.github/CODEOWNERS
new file mode 100644
index 0000000..6e3be23
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.github/CODEOWNERS
@@ -0,0 +1 @@
+* @digitaljohn @PauloMFJ
\ No newline at end of file
diff --git a/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REPORT_A_BUG.md b/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REPORT_A_BUG.md
new file mode 100644
index 0000000..aed65f3
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REPORT_A_BUG.md
@@ -0,0 +1,41 @@
+---
+name: "\U0001F41B Report a bug"
+about: "Is something not working as you expect?"
+---
+
+
+
+> Clearly describe the bug
+
+e.g. "Data does not persist upon refresh."
+
+> Which version of use-local-state are you using?
+
+e.g. `0.1.0`
+
+> What version of React are you using use-local-state within?
+
+e.g. `16.9.0`
+
+> What build/platform are you using?
+
+e.g. "Next.js 10"
+
+> What did you expect to happen?
+
+e.g. "Updated value to be persisted."
+
+> What actually happened (e.g. what warnings or errors did you get)?
+
+e.g. "Hook always returns default state."
+
+
diff --git a/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REPORT_A_DOCS_ISSUE.md b/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REPORT_A_DOCS_ISSUE.md
new file mode 100644
index 0000000..bcdd4be
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REPORT_A_DOCS_ISSUE.md
@@ -0,0 +1,14 @@
+---
+name: "\U0001F4DD Report a docs issue"
+about: "Is something wrong, confusing or missing in the docs?"
+---
+
+
+
+> Clearly describe the documentation issue
+
+e.g. "Documentation for setting updated state is required."
+
+> What solution would you like to see?
+
+e.g. "I suggest rewriting it so it covers the following topics in detail..."
diff --git a/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REQUEST_A_FEATURE.md b/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REQUEST_A_FEATURE.md
new file mode 100644
index 0000000..bcf02d4
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.github/ISSUE_TEMPLATE/REQUEST_A_FEATURE.md
@@ -0,0 +1,24 @@
+---
+name: "\U0001F680 Request a feature"
+about: "Do you want to suggest a new feature?"
+---
+
+
+
+> What is the problem you're trying to solve?
+
+e.g. "We need the ability reset and or clear the state..."
+
+> What solution would you like to see?
+
+e.g. "Expose a new method that..."
+
+
diff --git a/node_modules/@phntms/use-local-state/.github/PULL_REQUEST_TEMPLATE.md b/node_modules/@phntms/use-local-state/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..0aaafb8
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,12 @@
+
+
+> Which issue, if any, is this issue related to?
+
+e.g. "Closes #000" or "None, as it's a documentation fix."
+
+> Is there anything in the PR that needs further explanation?
+
+e.g. "No, it's self explanatory."
diff --git a/node_modules/@phntms/use-local-state/.github/workflows/npmpublish.yml b/node_modules/@phntms/use-local-state/.github/workflows/npmpublish.yml
new file mode 100644
index 0000000..6fb9e41
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.github/workflows/npmpublish.yml
@@ -0,0 +1,30 @@
+name: Node.js Package
+
+on:
+ release:
+ types: [created]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v1
+ with:
+ node-version: 12
+ - run: npm ci
+ - run: npm test
+
+ publish-npm:
+ needs: test
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v1
+ with:
+ node-version: 12
+ registry-url: https://registry.npmjs.org/
+ - run: npm ci
+ - run: npm publish --access=public
+ env:
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
diff --git a/node_modules/@phntms/use-local-state/.github/workflows/test.yml b/node_modules/@phntms/use-local-state/.github/workflows/test.yml
new file mode 100644
index 0000000..35f72b1
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.github/workflows/test.yml
@@ -0,0 +1,28 @@
+name: test
+
+on: [pull_request]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ node-version: [12.x, 14.x, 16.x, 18.x]
+
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+
+ - name: npm install, build, and test
+ run: |
+ npm ci
+ npm run build --if-present
+ npm run lint
+ npm test
+ env:
+ CI: true
diff --git a/node_modules/@phntms/use-local-state/.prettierignore b/node_modules/@phntms/use-local-state/.prettierignore
new file mode 100644
index 0000000..879f612
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/.prettierignore
@@ -0,0 +1,5 @@
+node_modules
+coverage
+dist
+public
+tmp
diff --git a/node_modules/@phntms/use-local-state/CODE_OF_CONDUCT.md b/node_modules/@phntms/use-local-state/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..a5ce8d8
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/CODE_OF_CONDUCT.md
@@ -0,0 +1,76 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+- Using welcoming and inclusive language
+- Being respectful of differing viewpoints and experiences
+- Gracefully accepting constructive criticism
+- Focusing on what is best for the community
+- Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+- The use of sexualized language or imagery and unwelcome sexual attention or
+ advances
+- Trolling, insulting/derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or electronic
+ address, without explicit permission
+- Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at developers@phntms.com. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq
diff --git a/node_modules/@phntms/use-local-state/CONTRIBUTING.md b/node_modules/@phntms/use-local-state/CONTRIBUTING.md
new file mode 100644
index 0000000..fb742b7
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/CONTRIBUTING.md
@@ -0,0 +1,48 @@
+# How to contribute
+
+I'm really happy that you're interested in helping out with this little project.
+
+As this is very early days for the project there's not a lot in the way of
+resources, but please check out the [documentation](./README.md), and also the
+[list of issues](https://github.com/phantomstudios/use-local-state/issues).
+
+Please submit an issue if you need help with anything.
+
+We have a [code of conduct](./CODE_OF_CONDUCT.md) so please make sure you follow
+it.
+
+## Testing
+
+Testing is performed using `jest` and is tested on Windows, Linux and MacOS with
+Node 10 and 12 runtimes. For a PR to be considered all these environments need to
+pass. Testing is automated using GitHub Actions CI.
+
+## Submitting changes
+
+Please send a
+[GitHub Pull Request to use-local-state](https://github.com/phantomstudios/use-local-state/pull/new/master)
+with a clear list of what you've done (read more about
+[pull requests](https://help.github.com/en/articles/about-pull-requests)). When you send a pull
+request, please make sure you've covered off all the points in the template.
+
+Make sure you've read about our workflow (below); in essence make sure each Pull
+Request is atomic but don't worry too much about the commits themselves as we use
+squash-and-merge.
+
+## Our workflow
+
+We use [GitHub flow](https://guides.github.com/introduction/flow/); it's a lot
+like git-flow but simpler and more forgiving. We use the `squash and merge`
+strategy to merge Pull Requests.
+
+In effect this means:
+
+- Don't worry about individual commits. They will be preserved, but not on the
+ main `master` branch history, so feel free to commit early and often, using
+ git as a save mechanism.
+- Your Pull Request title and description become very important; they are the
+ history of the master branch and explain all the changes.
+- You ought to be able to find any previous version easily using GitHub tabs, or
+ [Releases](https://github.com/phantomstudios/use-local-state/releases)
+
+Thanks, John Chipps-Harding
diff --git a/node_modules/@phntms/use-local-state/LICENSE b/node_modules/@phntms/use-local-state/LICENSE
new file mode 100755
index 0000000..ee31b07
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2021 Phantom Studios Ltd
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/node_modules/@phntms/use-local-state/README.md b/node_modules/@phntms/use-local-state/README.md
new file mode 100755
index 0000000..0b015bf
--- /dev/null
+++ b/node_modules/@phntms/use-local-state/README.md
@@ -0,0 +1,103 @@
+# use-local-state
+
+[![NPM version][npm-image]][npm-url]
+[![Actions Status][ci-image]][ci-url]
+[![PR Welcome][npm-downloads-image]][npm-downloads-url]
+
+A simple React hook that allows you to store data within `LocalStorage` with the same interface as the standard `React.useState` hook.
+
+## Introduction
+
+Just swap out your `useState` calls with `useLocalState` to persist the data between refreshes. This hook is also SSR safe and does not break when used without `window` existing.
+
+```javascript
+import useLocalState from "@phntms/use-local-state";
+
+const [value, setValue, resetValue] = useLocalState("KEY", "");
+```
+
+## Installation
+
+Install this package with `npm`.
+
+```bash
+npm i @phntms/use-local-state
+```
+
+## Usage
+
+Store a boolean to track if a user has accepted terms of use.
+
+```JSX
+import React from 'react';
+import useLocalState from '@phntms/use-local-state';
+
+const TermsExample = () = {
+ const [accepted, setAccepted] = useLocalState("TERMS_ACCEPTED", false);
+
+ return (
+ <>
+ Welcome
+ {!accepted && <>
+
Do you accept our terms?
+ + >} + > + ); +} +``` + +Store a list of bookmarks. + +```JSX +import React from 'react'; +import useLocalState from '@phntms/use-local-state'; + +interface Bookmark { + title: string; + url: string; +} + +const BookmarkExample = () = { + const [bookmarks, setBookmarks, clearBookmarks] = useLocalState