Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e938138ff | |||
| 62590c34d1 | |||
| 01bbaebe5b | |||
| 83d9bc78f0 | |||
| ef084b893b | |||
| a382bfee01 | |||
| 6e4f529446 | |||
| cbabf43584 | |||
| 33d1425fbb | |||
| 4d1d2e6ed8 | |||
| bba5c5c3c5 |
67
.drone.yml
67
.drone.yml
@@ -4,27 +4,28 @@ type: docker
|
|||||||
name: web-core-ci
|
name: web-core-ci
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
- develop
|
- develop
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: install
|
- name: install
|
||||||
image: node:22
|
image: node:25
|
||||||
commands:
|
commands:
|
||||||
- corepack enable
|
- yarn install --frozen-lockfile
|
||||||
- corepack prepare yarn@1.22.22 --activate
|
|
||||||
- yarn install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: build
|
- name: lint
|
||||||
image: node:22
|
image: node:25
|
||||||
commands:
|
commands:
|
||||||
- corepack enable
|
- yarn lint
|
||||||
- corepack prepare yarn@1.22.22 --activate
|
|
||||||
- yarn build
|
- name: build
|
||||||
|
image: node:25
|
||||||
|
commands:
|
||||||
|
- yarn build
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@@ -32,22 +33,18 @@ type: docker
|
|||||||
name: web-core-publish
|
name: web-core-publish
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
event:
|
||||||
- main
|
- tag
|
||||||
event:
|
ref:
|
||||||
- promote
|
- refs/tags/v*
|
||||||
target:
|
|
||||||
- production
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: publish-npm
|
- name: publish-npm
|
||||||
image: node:22
|
image: node:25
|
||||||
environment:
|
environment:
|
||||||
NEXUS_NPM_TOKEN:
|
NEXUS_NPM_TOKEN:
|
||||||
from_secret: nexus_npm_token
|
from_secret: nexus_npm_token
|
||||||
commands:
|
commands:
|
||||||
- corepack enable
|
- yarn install --frozen-lockfile
|
||||||
- corepack prepare yarn@1.22.22 --activate
|
- npm config set //nexus.beatrice.wtf/repository/npm-hosted/:_authToken "$NEXUS_NPM_TOKEN"
|
||||||
- yarn install --frozen-lockfile
|
- yarn publish:nexus
|
||||||
- npm config set //nexus.beatrice.wtf/repository/npm-hosted/:_authToken "$NEXUS_NPM_TOKEN"
|
|
||||||
- yarn publish:nexus
|
|
||||||
|
|||||||
4
.prettierignore
Normal file
4
.prettierignore
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
dist
|
||||||
|
coverage
|
||||||
|
node_modules
|
||||||
|
yarn.lock
|
||||||
7
.prettierrc
Normal file
7
.prettierrc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/prettierrc",
|
||||||
|
"singleQuote": true,
|
||||||
|
"semi": true,
|
||||||
|
"printWidth": 100,
|
||||||
|
"tabWidth": 4
|
||||||
|
}
|
||||||
51
eslint.config.mjs
Normal file
51
eslint.config.mjs
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import js from '@eslint/js';
|
||||||
|
import reactHooks from 'eslint-plugin-react-hooks';
|
||||||
|
import reactRefresh from 'eslint-plugin-react-refresh';
|
||||||
|
import globals from 'globals';
|
||||||
|
import tseslint from 'typescript-eslint';
|
||||||
|
|
||||||
|
export default tseslint.config(
|
||||||
|
{
|
||||||
|
ignores: [
|
||||||
|
'dist',
|
||||||
|
'coverage',
|
||||||
|
'node_modules',
|
||||||
|
'*.config.cjs',
|
||||||
|
'vite.config.js',
|
||||||
|
'vite.config.d.ts',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
js.configs.recommended,
|
||||||
|
...tseslint.configs.recommended,
|
||||||
|
{
|
||||||
|
files: ['**/*.{ts,tsx}'],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 'latest',
|
||||||
|
sourceType: 'module',
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'no-empty': ['error', { allowEmptyCatch: true }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['src/**/*.{ts,tsx}'],
|
||||||
|
plugins: {
|
||||||
|
'react-hooks': reactHooks,
|
||||||
|
'react-refresh': reactRefresh,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
...reactHooks.configs.recommended.rules,
|
||||||
|
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['src/contexts/**/*.{ts,tsx}'],
|
||||||
|
rules: {
|
||||||
|
'react-refresh/only-export-components': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
);
|
||||||
650
license.md
Normal file
650
license.md
Normal file
@@ -0,0 +1,650 @@
|
|||||||
|
# GNU Affero General Public License
|
||||||
|
|
||||||
|
_Version 3, 19 November 2007_
|
||||||
|
_Copyright © 2007 Free Software Foundation, Inc. <<http://fsf.org/>>_
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
## Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: **(1)** assert copyright on the software, and **(2)** offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
## TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
### 0. Definitions
|
||||||
|
|
||||||
|
“This License” refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
“Copyright” also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
“The Program” refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as “you”. “Licensees” and
|
||||||
|
“recipients” may be individuals or organizations.
|
||||||
|
|
||||||
|
To “modify” a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a “modified version” of the
|
||||||
|
earlier work or a work “based on” the earlier work.
|
||||||
|
|
||||||
|
A “covered work” means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To “propagate” a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To “convey” a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays “Appropriate Legal Notices”
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that **(1)** displays an appropriate copyright notice, and **(2)**
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
### 1. Source Code
|
||||||
|
|
||||||
|
The “source code” for a work means the preferred form of the work
|
||||||
|
for making modifications to it. “Object code” means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A “Standard Interface” means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The “System Libraries” of an executable work include anything, other
|
||||||
|
than the work as a whole, that **(a)** is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and **(b)** serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
“Major Component”, in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The “Corresponding Source” for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
### 2. Basic Permissions
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
### 4. Conveying Verbatim Copies
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
### 5. Conveying Modified Source Versions
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
- **a)** The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
- **b)** The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section 7.
|
||||||
|
This requirement modifies the requirement in section 4 to
|
||||||
|
“keep intact all notices”.
|
||||||
|
- **c)** You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
- **d)** If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
“aggregate” if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
### 6. Conveying Non-Source Forms
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
- **a)** Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
- **b)** Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either **(1)** a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or **(2)** access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
- **c)** Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
- **d)** Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
- **e)** Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A “User Product” is either **(1)** a “consumer product”, which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or **(2)** anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, “normally used” refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
“Installation Information” for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
### 7. Additional Terms
|
||||||
|
|
||||||
|
“Additional permissions” are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
- **a)** Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
- **b)** Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
- **c)** Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
- **d)** Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
- **e)** Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
- **f)** Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered “further
|
||||||
|
restrictions” within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
### 8. Termination
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated **(a)**
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and **(b)** permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
### 9. Acceptance Not Required for Having Copies
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
### 10. Automatic Licensing of Downstream Recipients
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An “entity transaction” is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
### 11. Patents
|
||||||
|
|
||||||
|
A “contributor” is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's “contributor version”.
|
||||||
|
|
||||||
|
A contributor's “essential patent claims” are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, “control” includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a “patent license” is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To “grant” such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either **(1)** cause the Corresponding Source to be so
|
||||||
|
available, or **(2)** arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or **(3)** arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. “Knowingly relying” means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is “discriminatory” if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license **(a)** in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or **(b)** primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
### 12. No Surrender of Others' Freedom
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
### 13. Remote Network Interaction; Use with the GNU General Public License
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
### 14. Revised Versions of this License
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License “or any later version” applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
### 15. Disclaimer of Warranty
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
### 16. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
### 17. Interpretation of Sections 15 and 16
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
_END OF TERMS AND CONDITIONS_
|
||||||
|
|
||||||
|
## How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the “copyright” line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a “Source” link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a “copyright disclaimer” for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<<http://www.gnu.org/licenses/>>.
|
||||||
83
package.json
83
package.json
@@ -1,38 +1,51 @@
|
|||||||
{
|
{
|
||||||
"name": "@panic/web-core",
|
"name": "@panic/web-core",
|
||||||
"version": "0.1.2",
|
"version": "0.1.5",
|
||||||
"type": "module",
|
"license": "AGPL-3.0-only",
|
||||||
"main": "./dist/index.js",
|
"description": "Core auth and utilities for panic.haus web applications",
|
||||||
"module": "./dist/index.js",
|
"type": "module",
|
||||||
"types": "./dist/index.d.ts",
|
"main": "./dist/index.js",
|
||||||
"exports": {
|
"module": "./dist/index.js",
|
||||||
".": {
|
"types": "./dist/index.d.ts",
|
||||||
"types": "./dist/index.d.ts",
|
"exports": {
|
||||||
"import": "./dist/index.js"
|
".": {
|
||||||
|
"types": "./dist/index.d.ts",
|
||||||
|
"import": "./dist/index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"clean": "rm -rf dist",
|
||||||
|
"build": "yarn clean && vite build && tsc -p tsconfig.build.json",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"lint:fix": "eslint . --fix",
|
||||||
|
"format": "prettier . --write",
|
||||||
|
"format:check": "prettier . --check",
|
||||||
|
"prepublishOnly": "yarn build",
|
||||||
|
"publish:nexus": "npm publish --registry ${NEXUS_NPM_REGISTRY:-https://nexus.beatrice.wtf/repository/npm-hosted/}"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"registry": "https://nexus.beatrice.wtf/repository/npm-hosted/",
|
||||||
|
"access": "restricted"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": "^19.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^10",
|
||||||
|
"@types/react": "^19.0.0",
|
||||||
|
"@vitejs/plugin-react": "^5.0.0",
|
||||||
|
"eslint": "^10",
|
||||||
|
"eslint-plugin-react-hooks": "^7.0.1",
|
||||||
|
"eslint-plugin-react-refresh": "^0.5.1",
|
||||||
|
"globals": "^17.3.0",
|
||||||
|
"prettier": "^3.8.1",
|
||||||
|
"react": "^19.0.0",
|
||||||
|
"react-dom": "^19.0.0",
|
||||||
|
"typescript": "^5.6.2",
|
||||||
|
"typescript-eslint": "^8.56.0",
|
||||||
|
"vite": "^7.0.0"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"dist"
|
|
||||||
],
|
|
||||||
"scripts": {
|
|
||||||
"clean": "rm -rf dist",
|
|
||||||
"build": "yarn clean && vite build && tsc -p tsconfig.build.json",
|
|
||||||
"prepublishOnly": "yarn build",
|
|
||||||
"publish:nexus": "npm publish --registry ${NEXUS_NPM_REGISTRY:-https://nexus.beatrice.wtf/repository/npm-hosted/}"
|
|
||||||
},
|
|
||||||
"publishConfig": {
|
|
||||||
"registry": "https://nexus.beatrice.wtf/repository/npm-hosted/",
|
|
||||||
"access": "restricted"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"react": "^19.0.0"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/react": "^19.0.0",
|
|
||||||
"@vitejs/plugin-react": "^5.0.0",
|
|
||||||
"react": "^19.0.0",
|
|
||||||
"react-dom": "^19.0.0",
|
|
||||||
"typescript": "^5.6.2",
|
|
||||||
"vite": "^7.0.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
3
renovate.json
Normal file
3
renovate.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||||
|
}
|
||||||
@@ -1,134 +1,134 @@
|
|||||||
export type RequestOptions = {
|
export type RequestOptions = {
|
||||||
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
||||||
token?: string | null;
|
token?: string | null;
|
||||||
body?: unknown;
|
body?: unknown;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ResolveErrorInput = {
|
export type ResolveErrorInput = {
|
||||||
code?: string;
|
code?: string;
|
||||||
status?: number;
|
status?: number;
|
||||||
fallbackMessage?: string;
|
fallbackMessage?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CreateApiClientConfig = {
|
export type CreateApiClientConfig = {
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
resolveError?: (input: ResolveErrorInput) => string;
|
resolveError?: (input: ResolveErrorInput) => string;
|
||||||
inferErrorCodeFromStatus?: (status?: number | null) => string | undefined;
|
inferErrorCodeFromStatus?: (status?: number | null) => string | undefined;
|
||||||
fetchImpl?: typeof fetch;
|
fetchImpl?: typeof fetch;
|
||||||
};
|
};
|
||||||
|
|
||||||
export class ApiError extends Error {
|
export class ApiError extends Error {
|
||||||
status: number;
|
|
||||||
code?: string;
|
|
||||||
requestId?: string;
|
|
||||||
details?: unknown;
|
|
||||||
rawMessage?: string;
|
|
||||||
|
|
||||||
constructor({
|
|
||||||
message,
|
|
||||||
status,
|
|
||||||
code,
|
|
||||||
requestId,
|
|
||||||
details,
|
|
||||||
rawMessage
|
|
||||||
}: {
|
|
||||||
message: string;
|
|
||||||
status: number;
|
status: number;
|
||||||
code?: string;
|
code?: string;
|
||||||
requestId?: string;
|
requestId?: string;
|
||||||
details?: unknown;
|
details?: unknown;
|
||||||
rawMessage?: string;
|
rawMessage?: string;
|
||||||
}) {
|
|
||||||
super(message);
|
constructor({
|
||||||
this.name = 'ApiError';
|
message,
|
||||||
this.status = status;
|
status,
|
||||||
this.code = code;
|
code,
|
||||||
this.requestId = requestId;
|
requestId,
|
||||||
this.details = details;
|
details,
|
||||||
this.rawMessage = rawMessage;
|
rawMessage,
|
||||||
}
|
}: {
|
||||||
|
message: string;
|
||||||
|
status: number;
|
||||||
|
code?: string;
|
||||||
|
requestId?: string;
|
||||||
|
details?: unknown;
|
||||||
|
rawMessage?: string;
|
||||||
|
}) {
|
||||||
|
super(message);
|
||||||
|
this.name = 'ApiError';
|
||||||
|
this.status = status;
|
||||||
|
this.code = code;
|
||||||
|
this.requestId = requestId;
|
||||||
|
this.details = details;
|
||||||
|
this.rawMessage = rawMessage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||||
return typeof value === 'object' && value != null;
|
return typeof value === 'object' && value != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseErrorPayload(data: unknown) {
|
function parseErrorPayload(data: unknown) {
|
||||||
if (!isRecord(data)) {
|
if (!isRecord(data)) {
|
||||||
return {
|
return {
|
||||||
code: undefined as string | undefined,
|
code: undefined as string | undefined,
|
||||||
rawMessage: undefined as string | undefined,
|
rawMessage: undefined as string | undefined,
|
||||||
requestId: undefined as string | undefined,
|
requestId: undefined as string | undefined,
|
||||||
details: undefined as unknown
|
details: undefined as unknown,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const code = typeof data.code === 'string' ? data.code : undefined;
|
const code = typeof data.code === 'string' ? data.code : undefined;
|
||||||
const rawMessage = typeof data.error === 'string' ? data.error : undefined;
|
const rawMessage = typeof data.error === 'string' ? data.error : undefined;
|
||||||
const requestId = typeof data.requestId === 'string' ? data.requestId : undefined;
|
const requestId = typeof data.requestId === 'string' ? data.requestId : undefined;
|
||||||
const details = data.details;
|
const details = data.details;
|
||||||
|
|
||||||
return { code, rawMessage, requestId, details };
|
return { code, rawMessage, requestId, details };
|
||||||
}
|
}
|
||||||
|
|
||||||
function defaultResolveError({ status, fallbackMessage }: ResolveErrorInput): string {
|
function defaultResolveError({ status, fallbackMessage }: ResolveErrorInput): string {
|
||||||
if (fallbackMessage) {
|
if (fallbackMessage) {
|
||||||
return fallbackMessage;
|
return fallbackMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
return `Request failed (${status}).`;
|
return `Request failed (${status}).`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'Request failed. Please try again.';
|
return 'Request failed. Please try again.';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createApiClient(config: CreateApiClientConfig) {
|
export function createApiClient(config: CreateApiClientConfig) {
|
||||||
const {
|
const {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
resolveError = defaultResolveError,
|
resolveError = defaultResolveError,
|
||||||
inferErrorCodeFromStatus,
|
inferErrorCodeFromStatus,
|
||||||
fetchImpl
|
fetchImpl,
|
||||||
} = config;
|
} = config;
|
||||||
|
|
||||||
async function request<T>(path: string, options: RequestOptions = {}): Promise<T> {
|
async function request<T>(path: string, options: RequestOptions = {}): Promise<T> {
|
||||||
const { method = 'GET', token, body } = options;
|
const { method = 'GET', token, body } = options;
|
||||||
const runFetch = fetchImpl ?? fetch;
|
const runFetch = fetchImpl ?? fetch;
|
||||||
|
|
||||||
const response = await runFetch(`${baseUrl}${path}`, {
|
const response = await runFetch(`${baseUrl}${path}`, {
|
||||||
method,
|
method,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
...(token ? { Authorization: `Bearer ${token}` } : {})
|
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
||||||
},
|
},
|
||||||
body: body ? JSON.stringify(body) : undefined
|
body: body ? JSON.stringify(body) : undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
const data = await response.json().catch(() => null);
|
const data = await response.json().catch(() => null);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const parsed = parseErrorPayload(data);
|
const parsed = parseErrorPayload(data);
|
||||||
const code = parsed.code ?? inferErrorCodeFromStatus?.(response.status);
|
const code = parsed.code ?? inferErrorCodeFromStatus?.(response.status);
|
||||||
const message = resolveError({
|
const message = resolveError({
|
||||||
code,
|
code,
|
||||||
status: response.status,
|
status: response.status,
|
||||||
fallbackMessage: parsed.rawMessage
|
fallbackMessage: parsed.rawMessage,
|
||||||
});
|
});
|
||||||
|
|
||||||
throw new ApiError({
|
throw new ApiError({
|
||||||
message,
|
message,
|
||||||
status: response.status,
|
status: response.status,
|
||||||
code,
|
code,
|
||||||
requestId: parsed.requestId,
|
requestId: parsed.requestId,
|
||||||
details: parsed.details,
|
details: parsed.details,
|
||||||
rawMessage: parsed.rawMessage
|
rawMessage: parsed.rawMessage,
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return data as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
return data as T;
|
return {
|
||||||
}
|
request,
|
||||||
|
};
|
||||||
return {
|
|
||||||
request
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +1,29 @@
|
|||||||
type BuildListQueryOptions = {
|
type BuildListQueryOptions = {
|
||||||
q?: string;
|
q?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
sort?: string;
|
sort?: string;
|
||||||
defaultSort: string;
|
defaultSort: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function buildListQuery({
|
export function buildListQuery({
|
||||||
q,
|
q,
|
||||||
page = 1,
|
page = 1,
|
||||||
pageSize = 10,
|
pageSize = 10,
|
||||||
sort,
|
sort,
|
||||||
defaultSort
|
defaultSort,
|
||||||
}: BuildListQueryOptions): string {
|
}: BuildListQueryOptions): string {
|
||||||
const query = new URLSearchParams();
|
const query = new URLSearchParams();
|
||||||
const normalizedQuery = q?.trim();
|
const normalizedQuery = q?.trim();
|
||||||
const normalizedSort = sort?.trim();
|
const normalizedSort = sort?.trim();
|
||||||
|
|
||||||
if (normalizedQuery) {
|
if (normalizedQuery) {
|
||||||
query.set('q', normalizedQuery);
|
query.set('q', normalizedQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
query.set('page', String(page));
|
query.set('page', String(page));
|
||||||
query.set('pageSize', String(pageSize));
|
query.set('pageSize', String(pageSize));
|
||||||
query.set('sort', normalizedSort || defaultSort);
|
query.set('sort', normalizedSort || defaultSort);
|
||||||
|
|
||||||
return query.toString();
|
return query.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,85 +6,91 @@ const DEFAULT_REFRESH_TOKEN_KEY = 'refreshToken';
|
|||||||
const DEFAULT_LEGACY_KEYS = ['auth_token', 'auth_user', 'token'];
|
const DEFAULT_LEGACY_KEYS = ['auth_token', 'auth_user', 'token'];
|
||||||
|
|
||||||
export type AuthState<TUser> = {
|
export type AuthState<TUser> = {
|
||||||
authToken: string | null;
|
authToken: string | null;
|
||||||
refreshToken: string | null;
|
refreshToken: string | null;
|
||||||
currentUser: TUser | null;
|
currentUser: TUser | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AuthContextValue<TUser> = AuthState<TUser> & {
|
export type AuthContextValue<TUser> = AuthState<TUser> & {
|
||||||
setSession: (authToken: string, refreshToken: string, currentUser: TUser) => void;
|
setSession: (authToken: string, refreshToken: string, currentUser: TUser) => void;
|
||||||
setCurrentUser: (currentUser: TUser | null) => void;
|
setCurrentUser: (currentUser: TUser | null) => void;
|
||||||
clearSession: () => void;
|
clearSession: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CreateAuthContextOptions = {
|
export type CreateAuthContextOptions = {
|
||||||
authTokenKey?: string;
|
authTokenKey?: string;
|
||||||
refreshTokenKey?: string;
|
refreshTokenKey?: string;
|
||||||
legacyKeys?: string[];
|
legacyKeys?: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createAuthContext<TUser>(options: CreateAuthContextOptions = {}) {
|
export function createAuthContext<TUser>(options: CreateAuthContextOptions = {}) {
|
||||||
const authTokenKey = options.authTokenKey ?? DEFAULT_AUTH_TOKEN_KEY;
|
const authTokenKey = options.authTokenKey ?? DEFAULT_AUTH_TOKEN_KEY;
|
||||||
const refreshTokenKey = options.refreshTokenKey ?? DEFAULT_REFRESH_TOKEN_KEY;
|
const refreshTokenKey = options.refreshTokenKey ?? DEFAULT_REFRESH_TOKEN_KEY;
|
||||||
const legacyKeys = options.legacyKeys ?? DEFAULT_LEGACY_KEYS;
|
const legacyKeys = options.legacyKeys ?? DEFAULT_LEGACY_KEYS;
|
||||||
|
|
||||||
const AuthContext = createContext<AuthContextValue<TUser> | undefined>(undefined);
|
const AuthContext = createContext<AuthContextValue<TUser> | undefined>(undefined);
|
||||||
|
|
||||||
function readStoredSession(): AuthState<TUser> {
|
function readStoredSession(): AuthState<TUser> {
|
||||||
for (const key of legacyKeys) {
|
for (const key of legacyKeys) {
|
||||||
localStorage.removeItem(key);
|
localStorage.removeItem(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
const authToken = localStorage.getItem(authTokenKey);
|
||||||
|
const refreshToken = localStorage.getItem(refreshTokenKey);
|
||||||
|
|
||||||
|
return {
|
||||||
|
authToken,
|
||||||
|
refreshToken,
|
||||||
|
currentUser: null,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const authToken = localStorage.getItem(authTokenKey);
|
function AuthProvider({ children }: Readonly<{ children: ReactNode }>) {
|
||||||
const refreshToken = localStorage.getItem(refreshTokenKey);
|
const [state, setState] = useState<AuthState<TUser>>(readStoredSession);
|
||||||
|
|
||||||
|
const setSession = useCallback(
|
||||||
|
(authToken: string, refreshToken: string, currentUser: TUser) => {
|
||||||
|
localStorage.setItem(authTokenKey, authToken);
|
||||||
|
localStorage.setItem(refreshTokenKey, refreshToken);
|
||||||
|
setState({ authToken, refreshToken, currentUser });
|
||||||
|
},
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
const clearSession = useCallback(() => {
|
||||||
|
localStorage.removeItem(authTokenKey);
|
||||||
|
localStorage.removeItem(refreshTokenKey);
|
||||||
|
setState({ authToken: null, refreshToken: null, currentUser: null });
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const setCurrentUser = useCallback((currentUser: TUser | null) => {
|
||||||
|
setState((prev) => ({ ...prev, currentUser }));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const value = useMemo<AuthContextValue<TUser>>(
|
||||||
|
() => ({
|
||||||
|
...state,
|
||||||
|
setSession,
|
||||||
|
setCurrentUser,
|
||||||
|
clearSession,
|
||||||
|
}),
|
||||||
|
[state, setSession, setCurrentUser, clearSession],
|
||||||
|
);
|
||||||
|
|
||||||
|
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function useAuth() {
|
||||||
|
const ctx = useContext(AuthContext);
|
||||||
|
if (!ctx) {
|
||||||
|
throw new Error('useAuth must be used within AuthProvider');
|
||||||
|
}
|
||||||
|
return ctx;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
authToken,
|
AuthProvider,
|
||||||
refreshToken,
|
useAuth,
|
||||||
currentUser: null
|
AuthContext,
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
function AuthProvider({ children }: Readonly<{ children: ReactNode }>) {
|
|
||||||
const [state, setState] = useState<AuthState<TUser>>(readStoredSession);
|
|
||||||
|
|
||||||
const setSession = useCallback((authToken: string, refreshToken: string, currentUser: TUser) => {
|
|
||||||
localStorage.setItem(authTokenKey, authToken);
|
|
||||||
localStorage.setItem(refreshTokenKey, refreshToken);
|
|
||||||
setState({ authToken, refreshToken, currentUser });
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const clearSession = useCallback(() => {
|
|
||||||
localStorage.removeItem(authTokenKey);
|
|
||||||
localStorage.removeItem(refreshTokenKey);
|
|
||||||
setState({ authToken: null, refreshToken: null, currentUser: null });
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const setCurrentUser = useCallback((currentUser: TUser | null) => {
|
|
||||||
setState((prev) => ({ ...prev, currentUser }));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const value = useMemo<AuthContextValue<TUser>>(() => ({
|
|
||||||
...state,
|
|
||||||
setSession,
|
|
||||||
setCurrentUser,
|
|
||||||
clearSession
|
|
||||||
}), [state, setSession, setCurrentUser, clearSession]);
|
|
||||||
|
|
||||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;
|
|
||||||
}
|
|
||||||
|
|
||||||
function useAuth() {
|
|
||||||
const ctx = useContext(AuthContext);
|
|
||||||
if (!ctx) {
|
|
||||||
throw new Error('useAuth must be used within AuthProvider');
|
|
||||||
}
|
|
||||||
return ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
AuthProvider,
|
|
||||||
useAuth,
|
|
||||||
AuthContext
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
const MILLISECONDS_PER_SECOND = 1000;
|
const MILLISECONDS_PER_SECOND = 1000;
|
||||||
|
|
||||||
export function decodeJwtPayload(token: string): Record<string, unknown> | null {
|
export function decodeJwtPayload(token: string): Record<string, unknown> | null {
|
||||||
const parts = token.split('.');
|
const parts = token.split('.');
|
||||||
if (parts.length !== 3) {
|
if (parts.length !== 3) {
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
const base64Url = parts[1];
|
|
||||||
const base64 = base64Url.replaceAll('-', '+').replaceAll('_', '/');
|
|
||||||
const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=');
|
|
||||||
|
|
||||||
try {
|
|
||||||
const payload = JSON.parse(atob(padded));
|
|
||||||
if (payload && typeof payload === 'object') {
|
|
||||||
return payload as Record<string, unknown>;
|
|
||||||
}
|
}
|
||||||
} catch {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
const base64Url = parts[1];
|
||||||
|
const base64 = base64Url.replaceAll('-', '+').replaceAll('_', '/');
|
||||||
|
const padded = base64.padEnd(base64.length + ((4 - (base64.length % 4)) % 4), '=');
|
||||||
|
|
||||||
|
try {
|
||||||
|
const payload = JSON.parse(atob(padded));
|
||||||
|
if (payload && typeof payload === 'object') {
|
||||||
|
return payload as Record<string, unknown>;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isJwtExpired(token: string, skewSeconds = 0) {
|
export function isJwtExpired(token: string, skewSeconds = 0) {
|
||||||
const payload = decodeJwtPayload(token);
|
const payload = decodeJwtPayload(token);
|
||||||
const exp = payload?.exp;
|
const exp = payload?.exp;
|
||||||
if (typeof exp !== 'number' || !Number.isFinite(exp)) {
|
if (typeof exp !== 'number' || !Number.isFinite(exp)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const expiresAt = exp * MILLISECONDS_PER_SECOND;
|
const expiresAt = exp * MILLISECONDS_PER_SECOND;
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
return expiresAt <= now + skewSeconds * MILLISECONDS_PER_SECOND;
|
return expiresAt <= now + skewSeconds * MILLISECONDS_PER_SECOND;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import {
|
import {
|
||||||
createContext,
|
createContext,
|
||||||
useCallback,
|
useCallback,
|
||||||
useContext,
|
useContext,
|
||||||
useEffect,
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
type CSSProperties,
|
type CSSProperties,
|
||||||
type ReactNode
|
type ReactNode,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { isDesktopViewport, useSidePanelMachine } from '../panels/useSidePanelMachine';
|
import { isDesktopViewport, useSidePanelMachine } from '../panels/useSidePanelMachine';
|
||||||
|
|
||||||
@@ -18,200 +18,247 @@ const SIDEBAR_MIN_WIDTH = 220;
|
|||||||
const SIDEBAR_MAX_WIDTH = 420;
|
const SIDEBAR_MAX_WIDTH = 420;
|
||||||
const SIDEBAR_COLLAPSED_WIDTH = 56;
|
const SIDEBAR_COLLAPSED_WIDTH = 56;
|
||||||
|
|
||||||
|
export type LeftMenuSizing = {
|
||||||
|
defaultWidth?: number;
|
||||||
|
minWidth?: number;
|
||||||
|
maxWidth?: number;
|
||||||
|
collapsedWidth?: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type LeftMenuRenderState = {
|
export type LeftMenuRenderState = {
|
||||||
collapsed: boolean;
|
collapsed: boolean;
|
||||||
mobileOpen: boolean;
|
mobileOpen: boolean;
|
||||||
isDesktop: boolean;
|
isDesktop: boolean;
|
||||||
closeMenu: () => void;
|
closeMenu: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type LeftMenuContent = {
|
export type LeftMenuContent = {
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
render: (state: LeftMenuRenderState) => ReactNode;
|
render: (state: LeftMenuRenderState) => ReactNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type LeftMenuStyle = CSSProperties & {
|
export type LeftMenuStyle = CSSProperties & {
|
||||||
'--auth-sidebar-width': string;
|
'--auth-sidebar-width': string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type LeftMenuContextValue = {
|
type LeftMenuContextValue = {
|
||||||
collapsed: boolean;
|
collapsed: boolean;
|
||||||
mobileOpen: boolean;
|
mobileOpen: boolean;
|
||||||
content: LeftMenuContent;
|
content: LeftMenuContent;
|
||||||
desktopMenuStyle: LeftMenuStyle;
|
desktopMenuStyle: LeftMenuStyle;
|
||||||
openMenu: (content?: LeftMenuContent) => void;
|
openMenu: (content?: LeftMenuContent) => void;
|
||||||
closeMenu: () => void;
|
closeMenu: () => void;
|
||||||
toggleMenu: (content?: LeftMenuContent) => void;
|
toggleMenu: (content?: LeftMenuContent) => void;
|
||||||
expandMenu: () => void;
|
expandMenu: () => void;
|
||||||
collapseMenu: () => void;
|
collapseMenu: () => void;
|
||||||
toggleCollapsed: () => void;
|
toggleCollapsed: () => void;
|
||||||
setMenuContent: (content: LeftMenuContent | null) => void;
|
setMenuContent: (content: LeftMenuContent | null) => void;
|
||||||
startResize: ReturnType<typeof useSidePanelMachine>['startResize'];
|
startResize: ReturnType<typeof useSidePanelMachine>['startResize'];
|
||||||
};
|
};
|
||||||
|
|
||||||
type LeftMenuProviderProps = {
|
type LeftMenuProviderProps = {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
defaultContent: LeftMenuContent;
|
defaultContent: LeftMenuContent;
|
||||||
closeOnPathname?: string;
|
closeOnPathname?: string;
|
||||||
|
sizing?: LeftMenuSizing;
|
||||||
};
|
};
|
||||||
|
|
||||||
const LeftMenuContext = createContext<LeftMenuContextValue | undefined>(undefined);
|
const LeftMenuContext = createContext<LeftMenuContextValue | undefined>(undefined);
|
||||||
|
|
||||||
function readStoredCollapsed(): boolean {
|
function readSizingValue(value: number | undefined, fallback: number): number {
|
||||||
if (!globalThis.window) {
|
if (!Number.isFinite(value) || value == null || value <= 0) {
|
||||||
return false;
|
return fallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
return localStorage.getItem(SIDEBAR_COLLAPSED_KEY) === '1';
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveLeftMenuSizing(sizing: LeftMenuSizing | undefined) {
|
||||||
|
const requestedMinWidth = readSizingValue(sizing?.minWidth, SIDEBAR_MIN_WIDTH);
|
||||||
|
const requestedMaxWidth = readSizingValue(sizing?.maxWidth, SIDEBAR_MAX_WIDTH);
|
||||||
|
const minWidth = Math.min(requestedMinWidth, requestedMaxWidth);
|
||||||
|
const maxWidth = Math.max(requestedMinWidth, requestedMaxWidth);
|
||||||
|
const requestedDefaultWidth = readSizingValue(sizing?.defaultWidth, SIDEBAR_DEFAULT_WIDTH);
|
||||||
|
const defaultWidth = Math.min(maxWidth, Math.max(minWidth, requestedDefaultWidth));
|
||||||
|
const requestedCollapsedWidth = readSizingValue(
|
||||||
|
sizing?.collapsedWidth,
|
||||||
|
SIDEBAR_COLLAPSED_WIDTH,
|
||||||
|
);
|
||||||
|
const collapsedWidth = Math.min(minWidth, requestedCollapsedWidth);
|
||||||
|
|
||||||
|
return {
|
||||||
|
defaultWidth,
|
||||||
|
minWidth,
|
||||||
|
maxWidth,
|
||||||
|
collapsedWidth,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function readStoredCollapsed(): boolean {
|
||||||
|
if (!globalThis.window) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return localStorage.getItem(SIDEBAR_COLLAPSED_KEY) === '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function LeftMenuProvider({
|
export function LeftMenuProvider({
|
||||||
children,
|
children,
|
||||||
defaultContent,
|
defaultContent,
|
||||||
closeOnPathname
|
|
||||||
}: Readonly<LeftMenuProviderProps>) {
|
|
||||||
const [collapsed, setCollapsed] = useState<boolean>(() => readStoredCollapsed());
|
|
||||||
const [mobileOpen, setMobileOpen] = useState(false);
|
|
||||||
const [content, setContent] = useState<LeftMenuContent>(defaultContent);
|
|
||||||
const defaultContentRef = useRef(defaultContent);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const previousDefaultContent = defaultContentRef.current;
|
|
||||||
defaultContentRef.current = defaultContent;
|
|
||||||
setContent((currentContent) => {
|
|
||||||
if (currentContent === previousDefaultContent) {
|
|
||||||
return defaultContent;
|
|
||||||
}
|
|
||||||
return currentContent;
|
|
||||||
});
|
|
||||||
}, [defaultContent]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!globalThis.window) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
localStorage.setItem(SIDEBAR_COLLAPSED_KEY, collapsed ? '1' : '0');
|
|
||||||
}, [collapsed]);
|
|
||||||
|
|
||||||
const expandMenu = useCallback(() => {
|
|
||||||
setCollapsed(false);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const collapseMenu = useCallback(() => {
|
|
||||||
setCollapsed(true);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const toggleCollapsed = useCallback(() => {
|
|
||||||
setCollapsed((previous) => !previous);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const closeMobile = useCallback(() => {
|
|
||||||
setMobileOpen(false);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const setMenuContent = useCallback((nextContent: LeftMenuContent | null) => {
|
|
||||||
setContent(nextContent ?? defaultContentRef.current);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const closeMenu = useCallback(() => {
|
|
||||||
if (isDesktopViewport()) {
|
|
||||||
collapseMenu();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
closeMobile();
|
|
||||||
}, [collapseMenu, closeMobile]);
|
|
||||||
|
|
||||||
const openMenu = useCallback((nextContent?: LeftMenuContent) => {
|
|
||||||
if (nextContent) {
|
|
||||||
setContent(nextContent);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isDesktopViewport()) {
|
|
||||||
expandMenu();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setMobileOpen(true);
|
|
||||||
}, [expandMenu]);
|
|
||||||
|
|
||||||
const toggleMenu = useCallback((nextContent?: LeftMenuContent) => {
|
|
||||||
if (nextContent) {
|
|
||||||
setContent(nextContent);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isDesktopViewport()) {
|
|
||||||
toggleCollapsed();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setMobileOpen((previous) => !previous);
|
|
||||||
}, [toggleCollapsed]);
|
|
||||||
|
|
||||||
const handleCloseOnPathname = useCallback(() => {
|
|
||||||
setMobileOpen(false);
|
|
||||||
setContent(defaultContentRef.current);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const { width, startResize } = useSidePanelMachine({
|
|
||||||
storageKey: SIDEBAR_WIDTH_KEY,
|
|
||||||
defaultWidth: SIDEBAR_DEFAULT_WIDTH,
|
|
||||||
minWidth: SIDEBAR_MIN_WIDTH,
|
|
||||||
maxWidth: SIDEBAR_MAX_WIDTH,
|
|
||||||
resizeAxis: 'from-left',
|
|
||||||
resizingBodyClass: 'auth-sidebar-resizing',
|
|
||||||
isOpen: mobileOpen,
|
|
||||||
canResize: !collapsed,
|
|
||||||
shouldPersistWidth: !collapsed,
|
|
||||||
closeOnPathname,
|
closeOnPathname,
|
||||||
onCloseOnPathname: handleCloseOnPathname,
|
sizing,
|
||||||
onEscape: closeMobile
|
}: Readonly<LeftMenuProviderProps>) {
|
||||||
});
|
const { defaultWidth, minWidth, maxWidth, collapsedWidth } = resolveLeftMenuSizing(sizing);
|
||||||
|
const [collapsed, setCollapsed] = useState<boolean>(() => readStoredCollapsed());
|
||||||
|
const [mobileOpen, setMobileOpen] = useState(false);
|
||||||
|
const [content, setContent] = useState<LeftMenuContent>(defaultContent);
|
||||||
|
const defaultContentRef = useRef(defaultContent);
|
||||||
|
|
||||||
const desktopMenuStyle = useMemo<LeftMenuStyle>(() => ({
|
useEffect(() => {
|
||||||
'--auth-sidebar-width': `${collapsed ? SIDEBAR_COLLAPSED_WIDTH : width}px`
|
const previousDefaultContent = defaultContentRef.current;
|
||||||
}), [collapsed, width]);
|
defaultContentRef.current = defaultContent;
|
||||||
|
setContent((currentContent) => {
|
||||||
|
if (currentContent === previousDefaultContent) {
|
||||||
|
return defaultContent;
|
||||||
|
}
|
||||||
|
return currentContent;
|
||||||
|
});
|
||||||
|
}, [defaultContent]);
|
||||||
|
|
||||||
const value = useMemo<LeftMenuContextValue>(() => ({
|
useEffect(() => {
|
||||||
collapsed,
|
if (!globalThis.window) {
|
||||||
mobileOpen,
|
return;
|
||||||
content,
|
}
|
||||||
desktopMenuStyle,
|
|
||||||
openMenu,
|
|
||||||
closeMenu,
|
|
||||||
toggleMenu,
|
|
||||||
expandMenu,
|
|
||||||
collapseMenu,
|
|
||||||
toggleCollapsed,
|
|
||||||
setMenuContent,
|
|
||||||
startResize
|
|
||||||
}), [
|
|
||||||
collapsed,
|
|
||||||
mobileOpen,
|
|
||||||
content,
|
|
||||||
desktopMenuStyle,
|
|
||||||
openMenu,
|
|
||||||
closeMenu,
|
|
||||||
toggleMenu,
|
|
||||||
expandMenu,
|
|
||||||
collapseMenu,
|
|
||||||
toggleCollapsed,
|
|
||||||
setMenuContent,
|
|
||||||
startResize
|
|
||||||
]);
|
|
||||||
|
|
||||||
return (
|
localStorage.setItem(SIDEBAR_COLLAPSED_KEY, collapsed ? '1' : '0');
|
||||||
<LeftMenuContext.Provider value={value}>
|
}, [collapsed]);
|
||||||
{children}
|
|
||||||
</LeftMenuContext.Provider>
|
const expandMenu = useCallback(() => {
|
||||||
);
|
setCollapsed(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const collapseMenu = useCallback(() => {
|
||||||
|
setCollapsed(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const toggleCollapsed = useCallback(() => {
|
||||||
|
setCollapsed((previous) => !previous);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const closeMobile = useCallback(() => {
|
||||||
|
setMobileOpen(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const setMenuContent = useCallback((nextContent: LeftMenuContent | null) => {
|
||||||
|
setContent(nextContent ?? defaultContentRef.current);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const closeMenu = useCallback(() => {
|
||||||
|
if (isDesktopViewport()) {
|
||||||
|
collapseMenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
closeMobile();
|
||||||
|
}, [collapseMenu, closeMobile]);
|
||||||
|
|
||||||
|
const openMenu = useCallback(
|
||||||
|
(nextContent?: LeftMenuContent) => {
|
||||||
|
if (nextContent) {
|
||||||
|
setContent(nextContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDesktopViewport()) {
|
||||||
|
expandMenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setMobileOpen(true);
|
||||||
|
},
|
||||||
|
[expandMenu],
|
||||||
|
);
|
||||||
|
|
||||||
|
const toggleMenu = useCallback(
|
||||||
|
(nextContent?: LeftMenuContent) => {
|
||||||
|
if (nextContent) {
|
||||||
|
setContent(nextContent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDesktopViewport()) {
|
||||||
|
toggleCollapsed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setMobileOpen((previous) => !previous);
|
||||||
|
},
|
||||||
|
[toggleCollapsed],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleCloseOnPathname = useCallback(() => {
|
||||||
|
setMobileOpen(false);
|
||||||
|
setContent(defaultContentRef.current);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const { width, startResize } = useSidePanelMachine({
|
||||||
|
storageKey: SIDEBAR_WIDTH_KEY,
|
||||||
|
defaultWidth,
|
||||||
|
minWidth,
|
||||||
|
maxWidth,
|
||||||
|
resizeAxis: 'from-left',
|
||||||
|
resizingBodyClass: 'auth-sidebar-resizing',
|
||||||
|
isOpen: mobileOpen,
|
||||||
|
canResize: !collapsed,
|
||||||
|
shouldPersistWidth: !collapsed,
|
||||||
|
closeOnPathname,
|
||||||
|
onCloseOnPathname: handleCloseOnPathname,
|
||||||
|
onEscape: closeMobile,
|
||||||
|
});
|
||||||
|
|
||||||
|
const desktopMenuStyle = useMemo<LeftMenuStyle>(
|
||||||
|
() => ({
|
||||||
|
'--auth-sidebar-width': `${collapsed ? collapsedWidth : width}px`,
|
||||||
|
}),
|
||||||
|
[collapsed, collapsedWidth, width],
|
||||||
|
);
|
||||||
|
|
||||||
|
const value = useMemo<LeftMenuContextValue>(
|
||||||
|
() => ({
|
||||||
|
collapsed,
|
||||||
|
mobileOpen,
|
||||||
|
content,
|
||||||
|
desktopMenuStyle,
|
||||||
|
openMenu,
|
||||||
|
closeMenu,
|
||||||
|
toggleMenu,
|
||||||
|
expandMenu,
|
||||||
|
collapseMenu,
|
||||||
|
toggleCollapsed,
|
||||||
|
setMenuContent,
|
||||||
|
startResize,
|
||||||
|
}),
|
||||||
|
[
|
||||||
|
collapsed,
|
||||||
|
mobileOpen,
|
||||||
|
content,
|
||||||
|
desktopMenuStyle,
|
||||||
|
openMenu,
|
||||||
|
closeMenu,
|
||||||
|
toggleMenu,
|
||||||
|
expandMenu,
|
||||||
|
collapseMenu,
|
||||||
|
toggleCollapsed,
|
||||||
|
setMenuContent,
|
||||||
|
startResize,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
return <LeftMenuContext.Provider value={value}>{children}</LeftMenuContext.Provider>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useLeftMenu() {
|
export function useLeftMenu() {
|
||||||
const ctx = useContext(LeftMenuContext);
|
const ctx = useContext(LeftMenuContext);
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
throw new Error('useLeftMenu must be used within LeftMenuProvider');
|
throw new Error('useLeftMenu must be used within LeftMenuProvider');
|
||||||
}
|
}
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
createContext,
|
createContext,
|
||||||
useCallback,
|
useCallback,
|
||||||
useContext,
|
useContext,
|
||||||
useMemo,
|
useMemo,
|
||||||
useState,
|
useState,
|
||||||
type CSSProperties,
|
type CSSProperties,
|
||||||
type ReactNode
|
type ReactNode,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
import { isDesktopViewport, useSidePanelMachine } from '../panels/useSidePanelMachine';
|
import { isDesktopViewport, useSidePanelMachine } from '../panels/useSidePanelMachine';
|
||||||
|
|
||||||
@@ -14,126 +14,169 @@ const RIGHT_SIDEBAR_DEFAULT_WIDTH = 320;
|
|||||||
const RIGHT_SIDEBAR_MIN_WIDTH = 260;
|
const RIGHT_SIDEBAR_MIN_WIDTH = 260;
|
||||||
const RIGHT_SIDEBAR_MAX_WIDTH = 480;
|
const RIGHT_SIDEBAR_MAX_WIDTH = 480;
|
||||||
|
|
||||||
|
export type RightSidebarSizing = {
|
||||||
|
defaultWidth?: number;
|
||||||
|
minWidth?: number;
|
||||||
|
maxWidth?: number;
|
||||||
|
};
|
||||||
|
|
||||||
export type RightSidebarContent = {
|
export type RightSidebarContent = {
|
||||||
title: string;
|
title: string;
|
||||||
content: ReactNode;
|
content: ReactNode;
|
||||||
ariaLabel?: string;
|
ariaLabel?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type RightSidebarStyle = CSSProperties & {
|
export type RightSidebarStyle = CSSProperties & {
|
||||||
'--auth-right-sidebar-width': string;
|
'--auth-right-sidebar-width': string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type RightSidebarContextValue = {
|
type RightSidebarContextValue = {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
content: RightSidebarContent | null;
|
content: RightSidebarContent | null;
|
||||||
openSidebar: (content?: RightSidebarContent) => void;
|
openSidebar: (content?: RightSidebarContent) => void;
|
||||||
closeSidebar: () => void;
|
closeSidebar: () => void;
|
||||||
toggleSidebar: (content?: RightSidebarContent) => void;
|
toggleSidebar: (content?: RightSidebarContent) => void;
|
||||||
setSidebarContent: (content: RightSidebarContent | null) => void;
|
setSidebarContent: (content: RightSidebarContent | null) => void;
|
||||||
desktopSidebarStyle: RightSidebarStyle;
|
desktopSidebarStyle: RightSidebarStyle;
|
||||||
startResize: ReturnType<typeof useSidePanelMachine>['startResize'];
|
startResize: ReturnType<typeof useSidePanelMachine>['startResize'];
|
||||||
};
|
};
|
||||||
|
|
||||||
type RightSidebarProviderProps = {
|
type RightSidebarProviderProps = {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
closeOnPathname?: string;
|
closeOnPathname?: string;
|
||||||
onMobileOpenRequest?: () => void;
|
onMobileOpenRequest?: () => void;
|
||||||
|
sizing?: RightSidebarSizing;
|
||||||
};
|
};
|
||||||
|
|
||||||
const RightSidebarContext = createContext<RightSidebarContextValue | undefined>(undefined);
|
const RightSidebarContext = createContext<RightSidebarContextValue | undefined>(undefined);
|
||||||
|
|
||||||
|
function readSizingValue(value: number | undefined, fallback: number): number {
|
||||||
|
if (!Number.isFinite(value) || value == null || value <= 0) {
|
||||||
|
return fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveRightSidebarSizing(sizing: RightSidebarSizing | undefined) {
|
||||||
|
const requestedMinWidth = readSizingValue(sizing?.minWidth, RIGHT_SIDEBAR_MIN_WIDTH);
|
||||||
|
const requestedMaxWidth = readSizingValue(sizing?.maxWidth, RIGHT_SIDEBAR_MAX_WIDTH);
|
||||||
|
const minWidth = Math.min(requestedMinWidth, requestedMaxWidth);
|
||||||
|
const maxWidth = Math.max(requestedMinWidth, requestedMaxWidth);
|
||||||
|
const requestedDefaultWidth = readSizingValue(
|
||||||
|
sizing?.defaultWidth,
|
||||||
|
RIGHT_SIDEBAR_DEFAULT_WIDTH,
|
||||||
|
);
|
||||||
|
const defaultWidth = Math.min(maxWidth, Math.max(minWidth, requestedDefaultWidth));
|
||||||
|
|
||||||
|
return {
|
||||||
|
defaultWidth,
|
||||||
|
minWidth,
|
||||||
|
maxWidth,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export function RightSidebarProvider({
|
export function RightSidebarProvider({
|
||||||
children,
|
children,
|
||||||
closeOnPathname,
|
|
||||||
onMobileOpenRequest
|
|
||||||
}: Readonly<RightSidebarProviderProps>) {
|
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
|
||||||
const [content, setContent] = useState<RightSidebarContent | null>(null);
|
|
||||||
|
|
||||||
const closeSidebar = useCallback(() => {
|
|
||||||
setIsOpen(false);
|
|
||||||
setContent(null);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const setSidebarContent = useCallback((nextContent: RightSidebarContent | null) => {
|
|
||||||
setContent(nextContent);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const openSidebar = useCallback((nextContent?: RightSidebarContent) => {
|
|
||||||
const resolvedContent = nextContent ?? content;
|
|
||||||
if (!resolvedContent) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextContent) {
|
|
||||||
setContent(nextContent);
|
|
||||||
}
|
|
||||||
if (!isDesktopViewport()) {
|
|
||||||
onMobileOpenRequest?.();
|
|
||||||
}
|
|
||||||
setIsOpen(true);
|
|
||||||
}, [content, onMobileOpenRequest]);
|
|
||||||
|
|
||||||
const toggleSidebar = useCallback((nextContent?: RightSidebarContent) => {
|
|
||||||
if (isOpen) {
|
|
||||||
closeSidebar();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
openSidebar(nextContent);
|
|
||||||
}, [isOpen, closeSidebar, openSidebar]);
|
|
||||||
|
|
||||||
const { width, startResize } = useSidePanelMachine({
|
|
||||||
storageKey: RIGHT_SIDEBAR_WIDTH_KEY,
|
|
||||||
defaultWidth: RIGHT_SIDEBAR_DEFAULT_WIDTH,
|
|
||||||
minWidth: RIGHT_SIDEBAR_MIN_WIDTH,
|
|
||||||
maxWidth: RIGHT_SIDEBAR_MAX_WIDTH,
|
|
||||||
resizeAxis: 'from-right',
|
|
||||||
resizingBodyClass: 'auth-right-sidebar-resizing',
|
|
||||||
isOpen,
|
|
||||||
canResize: isOpen,
|
|
||||||
shouldPersistWidth: true,
|
|
||||||
closeOnPathname,
|
closeOnPathname,
|
||||||
onCloseOnPathname: closeSidebar,
|
onMobileOpenRequest,
|
||||||
onEscape: closeSidebar
|
sizing,
|
||||||
});
|
}: Readonly<RightSidebarProviderProps>) {
|
||||||
|
const { defaultWidth, minWidth, maxWidth } = resolveRightSidebarSizing(sizing);
|
||||||
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
const [content, setContent] = useState<RightSidebarContent | null>(null);
|
||||||
|
|
||||||
const desktopSidebarStyle = useMemo<RightSidebarStyle>(() => ({
|
const closeSidebar = useCallback(() => {
|
||||||
'--auth-right-sidebar-width': `${width}px`
|
setIsOpen(false);
|
||||||
}), [width]);
|
setContent(null);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const value = useMemo<RightSidebarContextValue>(() => ({
|
const setSidebarContent = useCallback((nextContent: RightSidebarContent | null) => {
|
||||||
isOpen,
|
setContent(nextContent);
|
||||||
content,
|
}, []);
|
||||||
openSidebar,
|
|
||||||
closeSidebar,
|
|
||||||
toggleSidebar,
|
|
||||||
setSidebarContent,
|
|
||||||
desktopSidebarStyle,
|
|
||||||
startResize
|
|
||||||
}), [
|
|
||||||
isOpen,
|
|
||||||
content,
|
|
||||||
openSidebar,
|
|
||||||
closeSidebar,
|
|
||||||
toggleSidebar,
|
|
||||||
setSidebarContent,
|
|
||||||
desktopSidebarStyle,
|
|
||||||
startResize
|
|
||||||
]);
|
|
||||||
|
|
||||||
return (
|
const openSidebar = useCallback(
|
||||||
<RightSidebarContext.Provider value={value}>
|
(nextContent?: RightSidebarContent) => {
|
||||||
{children}
|
const resolvedContent = nextContent ?? content;
|
||||||
</RightSidebarContext.Provider>
|
if (!resolvedContent) {
|
||||||
);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextContent) {
|
||||||
|
setContent(nextContent);
|
||||||
|
}
|
||||||
|
if (!isDesktopViewport()) {
|
||||||
|
onMobileOpenRequest?.();
|
||||||
|
}
|
||||||
|
setIsOpen(true);
|
||||||
|
},
|
||||||
|
[content, onMobileOpenRequest],
|
||||||
|
);
|
||||||
|
|
||||||
|
const toggleSidebar = useCallback(
|
||||||
|
(nextContent?: RightSidebarContent) => {
|
||||||
|
if (isOpen) {
|
||||||
|
closeSidebar();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
openSidebar(nextContent);
|
||||||
|
},
|
||||||
|
[isOpen, closeSidebar, openSidebar],
|
||||||
|
);
|
||||||
|
|
||||||
|
const { width, startResize } = useSidePanelMachine({
|
||||||
|
storageKey: RIGHT_SIDEBAR_WIDTH_KEY,
|
||||||
|
defaultWidth,
|
||||||
|
minWidth,
|
||||||
|
maxWidth,
|
||||||
|
resizeAxis: 'from-right',
|
||||||
|
resizingBodyClass: 'auth-right-sidebar-resizing',
|
||||||
|
isOpen,
|
||||||
|
canResize: isOpen,
|
||||||
|
shouldPersistWidth: true,
|
||||||
|
closeOnPathname,
|
||||||
|
onCloseOnPathname: closeSidebar,
|
||||||
|
onEscape: closeSidebar,
|
||||||
|
});
|
||||||
|
|
||||||
|
const desktopSidebarStyle = useMemo<RightSidebarStyle>(
|
||||||
|
() => ({
|
||||||
|
'--auth-right-sidebar-width': `${width}px`,
|
||||||
|
}),
|
||||||
|
[width],
|
||||||
|
);
|
||||||
|
|
||||||
|
const value = useMemo<RightSidebarContextValue>(
|
||||||
|
() => ({
|
||||||
|
isOpen,
|
||||||
|
content,
|
||||||
|
openSidebar,
|
||||||
|
closeSidebar,
|
||||||
|
toggleSidebar,
|
||||||
|
setSidebarContent,
|
||||||
|
desktopSidebarStyle,
|
||||||
|
startResize,
|
||||||
|
}),
|
||||||
|
[
|
||||||
|
isOpen,
|
||||||
|
content,
|
||||||
|
openSidebar,
|
||||||
|
closeSidebar,
|
||||||
|
toggleSidebar,
|
||||||
|
setSidebarContent,
|
||||||
|
desktopSidebarStyle,
|
||||||
|
startResize,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
return <RightSidebarContext.Provider value={value}>{children}</RightSidebarContext.Provider>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useRightSidebar() {
|
export function useRightSidebar() {
|
||||||
const ctx = useContext(RightSidebarContext);
|
const ctx = useContext(RightSidebarContext);
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
throw new Error('useRightSidebar must be used within RightSidebarProvider');
|
throw new Error('useRightSidebar must be used within RightSidebarProvider');
|
||||||
}
|
}
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,132 +1,132 @@
|
|||||||
export type ErrorCatalog = Record<string, string>;
|
export type ErrorCatalog = Record<string, string>;
|
||||||
|
|
||||||
type ErrorLike = {
|
type ErrorLike = {
|
||||||
code?: unknown;
|
code?: unknown;
|
||||||
status?: unknown;
|
status?: unknown;
|
||||||
message?: unknown;
|
message?: unknown;
|
||||||
rawMessage?: unknown;
|
rawMessage?: unknown;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ResolveErrorMessageOptions = {
|
export type ResolveErrorMessageOptions = {
|
||||||
code?: string | null;
|
code?: string | null;
|
||||||
status?: number | null;
|
status?: number | null;
|
||||||
context?: string;
|
context?: string;
|
||||||
fallbackMessage?: string | null;
|
fallbackMessage?: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CreateErrorResolverConfig = {
|
export type CreateErrorResolverConfig = {
|
||||||
catalog: ErrorCatalog;
|
catalog: ErrorCatalog;
|
||||||
fallbackCode?: string;
|
fallbackCode?: string;
|
||||||
defaultContext?: string;
|
defaultContext?: string;
|
||||||
contextOverrides?: Record<string, Partial<Record<string, string>>>;
|
contextOverrides?: Record<string, Partial<Record<string, string>>>;
|
||||||
inferCodeFromStatus?: (status?: number | null) => string | undefined;
|
inferCodeFromStatus?: (status?: number | null) => string | undefined;
|
||||||
inferCodeFromLegacyMessage?: (message?: string | null) => string | undefined;
|
inferCodeFromLegacyMessage?: (message?: string | null) => string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createErrorResolver(config: CreateErrorResolverConfig) {
|
export function createErrorResolver(config: CreateErrorResolverConfig) {
|
||||||
const {
|
|
||||||
catalog,
|
|
||||||
fallbackCode,
|
|
||||||
defaultContext = 'default',
|
|
||||||
contextOverrides = {},
|
|
||||||
inferCodeFromStatus,
|
|
||||||
inferCodeFromLegacyMessage
|
|
||||||
} = config;
|
|
||||||
|
|
||||||
const knownCodes = new Set(Object.keys(catalog));
|
|
||||||
|
|
||||||
function isKnownErrorCode(value: string): boolean {
|
|
||||||
return knownCodes.has(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function normalizeErrorCode(code?: string | null): string | undefined {
|
|
||||||
if (!code) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
return isKnownErrorCode(code) ? code : undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
function inferErrorCodeFromStatus(status?: number | null): string | undefined {
|
|
||||||
return inferCodeFromStatus?.(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolveErrorMessage(options: ResolveErrorMessageOptions): string {
|
|
||||||
const {
|
const {
|
||||||
code,
|
catalog,
|
||||||
status,
|
fallbackCode,
|
||||||
context = defaultContext,
|
defaultContext = 'default',
|
||||||
fallbackMessage
|
contextOverrides = {},
|
||||||
} = options;
|
inferCodeFromStatus,
|
||||||
|
inferCodeFromLegacyMessage,
|
||||||
|
} = config;
|
||||||
|
|
||||||
const resolvedCode = normalizeErrorCode(code)
|
const knownCodes = new Set(Object.keys(catalog));
|
||||||
?? inferCodeFromLegacyMessage?.(fallbackMessage)
|
|
||||||
?? inferErrorCodeFromStatus(status);
|
|
||||||
|
|
||||||
if (resolvedCode) {
|
function isKnownErrorCode(value: string): boolean {
|
||||||
const contextMessage = contextOverrides[context]?.[resolvedCode];
|
return knownCodes.has(value);
|
||||||
if (contextMessage) {
|
|
||||||
return contextMessage;
|
|
||||||
}
|
|
||||||
const catalogMessage = catalog[resolvedCode];
|
|
||||||
if (catalogMessage) {
|
|
||||||
return catalogMessage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const statusCode = inferErrorCodeFromStatus(status);
|
function normalizeErrorCode(code?: string | null): string | undefined {
|
||||||
if (statusCode) {
|
if (!code) {
|
||||||
const contextMessage = contextOverrides[context]?.[statusCode];
|
return undefined;
|
||||||
if (contextMessage) {
|
}
|
||||||
return contextMessage;
|
return isKnownErrorCode(code) ? code : undefined;
|
||||||
}
|
|
||||||
const catalogMessage = catalog[statusCode];
|
|
||||||
if (catalogMessage) {
|
|
||||||
return catalogMessage;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fallbackCode && catalog[fallbackCode]) {
|
function inferErrorCodeFromStatus(status?: number | null): string | undefined {
|
||||||
return catalog[fallbackCode];
|
return inferCodeFromStatus?.(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fallbackMessage) {
|
function resolveErrorMessage(options: ResolveErrorMessageOptions): string {
|
||||||
return fallbackMessage;
|
const { code, status, context = defaultContext, fallbackMessage } = options;
|
||||||
|
|
||||||
|
const resolvedCode =
|
||||||
|
normalizeErrorCode(code) ??
|
||||||
|
inferCodeFromLegacyMessage?.(fallbackMessage) ??
|
||||||
|
inferErrorCodeFromStatus(status);
|
||||||
|
|
||||||
|
if (resolvedCode) {
|
||||||
|
const contextMessage = contextOverrides[context]?.[resolvedCode];
|
||||||
|
if (contextMessage) {
|
||||||
|
return contextMessage;
|
||||||
|
}
|
||||||
|
const catalogMessage = catalog[resolvedCode];
|
||||||
|
if (catalogMessage) {
|
||||||
|
return catalogMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const statusCode = inferErrorCodeFromStatus(status);
|
||||||
|
if (statusCode) {
|
||||||
|
const contextMessage = contextOverrides[context]?.[statusCode];
|
||||||
|
if (contextMessage) {
|
||||||
|
return contextMessage;
|
||||||
|
}
|
||||||
|
const catalogMessage = catalog[statusCode];
|
||||||
|
if (catalogMessage) {
|
||||||
|
return catalogMessage;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fallbackCode && catalog[fallbackCode]) {
|
||||||
|
return catalog[fallbackCode];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fallbackMessage) {
|
||||||
|
return fallbackMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'Request failed. Please try again.';
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'Request failed. Please try again.';
|
function resolveOptionalErrorMessage(
|
||||||
}
|
code?: string | null,
|
||||||
|
context: string = defaultContext,
|
||||||
function resolveOptionalErrorMessage(code?: string | null, context: string = defaultContext): string | undefined {
|
): string | undefined {
|
||||||
if (!code) {
|
if (!code) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return resolveErrorMessage({ code, context });
|
return resolveErrorMessage({ code, context });
|
||||||
}
|
|
||||||
|
|
||||||
function toErrorMessage(err: unknown, context: string = defaultContext): string {
|
|
||||||
if (err && typeof err === 'object') {
|
|
||||||
const errorLike = err as ErrorLike;
|
|
||||||
const code = typeof errorLike.code === 'string' ? errorLike.code : undefined;
|
|
||||||
const status = typeof errorLike.status === 'number' ? errorLike.status : undefined;
|
|
||||||
const rawMessage = typeof errorLike.rawMessage === 'string' ? errorLike.rawMessage : undefined;
|
|
||||||
const message = typeof errorLike.message === 'string' ? errorLike.message : undefined;
|
|
||||||
|
|
||||||
return resolveErrorMessage({
|
|
||||||
code,
|
|
||||||
status,
|
|
||||||
context,
|
|
||||||
fallbackMessage: rawMessage ?? message
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return resolveErrorMessage({ context });
|
function toErrorMessage(err: unknown, context: string = defaultContext): string {
|
||||||
}
|
if (err && typeof err === 'object') {
|
||||||
|
const errorLike = err as ErrorLike;
|
||||||
|
const code = typeof errorLike.code === 'string' ? errorLike.code : undefined;
|
||||||
|
const status = typeof errorLike.status === 'number' ? errorLike.status : undefined;
|
||||||
|
const rawMessage =
|
||||||
|
typeof errorLike.rawMessage === 'string' ? errorLike.rawMessage : undefined;
|
||||||
|
const message = typeof errorLike.message === 'string' ? errorLike.message : undefined;
|
||||||
|
|
||||||
return {
|
return resolveErrorMessage({
|
||||||
isKnownErrorCode,
|
code,
|
||||||
inferErrorCodeFromStatus,
|
status,
|
||||||
resolveErrorMessage,
|
context,
|
||||||
resolveOptionalErrorMessage,
|
fallbackMessage: rawMessage ?? message,
|
||||||
toErrorMessage
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
|
return resolveErrorMessage({ context });
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
isKnownErrorCode,
|
||||||
|
inferErrorCodeFromStatus,
|
||||||
|
resolveErrorMessage,
|
||||||
|
resolveOptionalErrorMessage,
|
||||||
|
toErrorMessage,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,28 @@
|
|||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
export function useCooldownTimer(seconds = 0, enabled = true) {
|
export function useCooldownTimer(seconds = 0, enabled = true) {
|
||||||
const [cooldown, setCooldown] = useState(seconds);
|
const [cooldown, setCooldown] = useState(seconds);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!enabled || cooldown <= 0) {
|
if (!enabled || cooldown <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const timer = globalThis.setInterval(() => {
|
const timer = globalThis.setInterval(() => {
|
||||||
setCooldown((prev) => (prev > 0 ? prev - 1 : 0));
|
setCooldown((prev) => (prev > 0 ? prev - 1 : 0));
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
globalThis.clearInterval(timer);
|
globalThis.clearInterval(timer);
|
||||||
|
};
|
||||||
|
}, [enabled, cooldown]);
|
||||||
|
|
||||||
|
const startCooldown = useCallback((seconds: number) => {
|
||||||
|
setCooldown(Math.max(0, Math.floor(seconds)));
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return {
|
||||||
|
cooldown,
|
||||||
|
startCooldown,
|
||||||
};
|
};
|
||||||
}, [enabled, cooldown]);
|
|
||||||
|
|
||||||
const startCooldown = useCallback((seconds: number) => {
|
|
||||||
setCooldown(Math.max(0, Math.floor(seconds)));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return {
|
|
||||||
cooldown,
|
|
||||||
startCooldown
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,65 +4,77 @@ import { useValidatedFields } from './useValidatedFields';
|
|||||||
type FieldErrors<TValues> = Partial<Record<keyof TValues, string | undefined>>;
|
type FieldErrors<TValues> = Partial<Record<keyof TValues, string | undefined>>;
|
||||||
|
|
||||||
type UseEditableFormOptions<TValues> = {
|
type UseEditableFormOptions<TValues> = {
|
||||||
initialValues: TValues;
|
initialValues: TValues;
|
||||||
validate: (values: TValues) => FieldErrors<TValues>;
|
validate: (values: TValues) => FieldErrors<TValues>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function useEditableForm<TValues extends Record<string, string>>({
|
export function useEditableForm<TValues extends Record<string, string>>({
|
||||||
initialValues,
|
|
||||||
validate
|
|
||||||
}: UseEditableFormOptions<TValues>) {
|
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
|
||||||
|
|
||||||
const {
|
|
||||||
values,
|
|
||||||
errors,
|
|
||||||
isValid,
|
|
||||||
setValues,
|
|
||||||
setFieldValue,
|
|
||||||
validateAll,
|
|
||||||
setFieldError,
|
|
||||||
setErrors,
|
|
||||||
clearErrors
|
|
||||||
} = useValidatedFields({
|
|
||||||
initialValues,
|
initialValues,
|
||||||
validate
|
validate,
|
||||||
});
|
}: UseEditableFormOptions<TValues>) {
|
||||||
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
|
|
||||||
const startEditing = useCallback((sourceValues: TValues) => {
|
const {
|
||||||
setValues(sourceValues, { validate: true });
|
values,
|
||||||
setIsEditing(true);
|
errors,
|
||||||
}, [setValues]);
|
isValid,
|
||||||
|
setValues,
|
||||||
|
setFieldValue,
|
||||||
|
validateAll,
|
||||||
|
setFieldError,
|
||||||
|
setErrors,
|
||||||
|
clearErrors,
|
||||||
|
} = useValidatedFields({
|
||||||
|
initialValues,
|
||||||
|
validate,
|
||||||
|
});
|
||||||
|
|
||||||
const discardChanges = useCallback((sourceValues: TValues) => {
|
const startEditing = useCallback(
|
||||||
setValues(sourceValues, { clearErrors: true });
|
(sourceValues: TValues) => {
|
||||||
setIsEditing(false);
|
setValues(sourceValues, { validate: true });
|
||||||
}, [setValues]);
|
setIsEditing(true);
|
||||||
|
},
|
||||||
|
[setValues],
|
||||||
|
);
|
||||||
|
|
||||||
const loadFromSource = useCallback((sourceValues: TValues) => {
|
const discardChanges = useCallback(
|
||||||
setValues(sourceValues, { clearErrors: true });
|
(sourceValues: TValues) => {
|
||||||
}, [setValues]);
|
setValues(sourceValues, { clearErrors: true });
|
||||||
|
setIsEditing(false);
|
||||||
|
},
|
||||||
|
[setValues],
|
||||||
|
);
|
||||||
|
|
||||||
const commitSaved = useCallback((sourceValues: TValues) => {
|
const loadFromSource = useCallback(
|
||||||
setValues(sourceValues, { clearErrors: true });
|
(sourceValues: TValues) => {
|
||||||
setIsEditing(false);
|
setValues(sourceValues, { clearErrors: true });
|
||||||
}, [setValues]);
|
},
|
||||||
|
[setValues],
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
const commitSaved = useCallback(
|
||||||
values,
|
(sourceValues: TValues) => {
|
||||||
errors,
|
setValues(sourceValues, { clearErrors: true });
|
||||||
isValid,
|
setIsEditing(false);
|
||||||
setValues,
|
},
|
||||||
setFieldValue,
|
[setValues],
|
||||||
validateAll,
|
);
|
||||||
setFieldError,
|
|
||||||
setErrors,
|
return {
|
||||||
clearErrors,
|
values,
|
||||||
isEditing,
|
errors,
|
||||||
startEditing,
|
isValid,
|
||||||
discardChanges,
|
setValues,
|
||||||
loadFromSource,
|
setFieldValue,
|
||||||
commitSaved,
|
validateAll,
|
||||||
setIsEditing
|
setFieldError,
|
||||||
};
|
setErrors,
|
||||||
|
clearErrors,
|
||||||
|
isEditing,
|
||||||
|
startEditing,
|
||||||
|
discardChanges,
|
||||||
|
loadFromSource,
|
||||||
|
commitSaved,
|
||||||
|
setIsEditing,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,102 +1,111 @@
|
|||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
|
||||||
type PaginatedResourceResponse<TItem> = {
|
type PaginatedResourceResponse<TItem> = {
|
||||||
items: TItem[];
|
items: TItem[];
|
||||||
page: number;
|
page: number;
|
||||||
pageSize: number;
|
pageSize: number;
|
||||||
total: number;
|
total: number;
|
||||||
totalPages: number;
|
totalPages: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
type UsePaginatedResourceOptions<TItem> = {
|
type UsePaginatedResourceOptions<TItem> = {
|
||||||
load: (params: { q: string; page: number; pageSize: number; sort?: string }) => Promise<PaginatedResourceResponse<TItem>>;
|
load: (params: {
|
||||||
sort?: string;
|
q: string;
|
||||||
debounceMs?: number;
|
page: number;
|
||||||
initialQuery?: string;
|
pageSize: number;
|
||||||
initialPage?: number;
|
sort?: string;
|
||||||
initialPageSize?: number;
|
}) => Promise<PaginatedResourceResponse<TItem>>;
|
||||||
|
sort?: string;
|
||||||
|
debounceMs?: number;
|
||||||
|
initialQuery?: string;
|
||||||
|
initialPage?: number;
|
||||||
|
initialPageSize?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function usePaginatedResource<TItem>({
|
export function usePaginatedResource<TItem>({
|
||||||
load,
|
load,
|
||||||
sort,
|
sort,
|
||||||
debounceMs = 250,
|
debounceMs = 250,
|
||||||
initialQuery = '',
|
initialQuery = '',
|
||||||
initialPage = 1,
|
initialPage = 1,
|
||||||
initialPageSize = 10
|
initialPageSize = 10,
|
||||||
}: UsePaginatedResourceOptions<TItem>) {
|
}: UsePaginatedResourceOptions<TItem>) {
|
||||||
const [items, setItems] = useState<TItem[]>([]);
|
const [items, setItems] = useState<TItem[]>([]);
|
||||||
const [q, setQ] = useState(initialQuery);
|
const [q, setQ] = useState(initialQuery);
|
||||||
const [page, setPage] = useState(initialPage);
|
const [page, setPage] = useState(initialPage);
|
||||||
const [pageSize, setPageSize] = useState(initialPageSize);
|
const [pageSize, setPageSize] = useState(initialPageSize);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
const [totalPages, setTotalPages] = useState(0);
|
const [totalPages, setTotalPages] = useState(0);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
const [isLoading, setIsLoading] = useState(true);
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
const timer = setTimeout(() => {
|
const timer = setTimeout(() => {
|
||||||
void (async () => {
|
void (async () => {
|
||||||
try {
|
try {
|
||||||
const response = await load({
|
const response = await load({
|
||||||
q,
|
q,
|
||||||
page,
|
page,
|
||||||
pageSize,
|
pageSize,
|
||||||
sort
|
sort,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setItems(response.items);
|
setItems(response.items);
|
||||||
setTotal(response.total);
|
setTotal(response.total);
|
||||||
setTotalPages(response.totalPages);
|
setTotalPages(response.totalPages);
|
||||||
setPage(response.page);
|
setPage(response.page);
|
||||||
setPageSize(response.pageSize);
|
setPageSize(response.pageSize);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (!cancelled) {
|
if (!cancelled) {
|
||||||
setError(err instanceof Error ? err.message : 'Request failed. Please try again.');
|
setError(
|
||||||
}
|
err instanceof Error
|
||||||
} finally {
|
? err.message
|
||||||
if (!cancelled) {
|
: 'Request failed. Please try again.',
|
||||||
setIsLoading(false);
|
);
|
||||||
}
|
}
|
||||||
}
|
} finally {
|
||||||
})();
|
if (!cancelled) {
|
||||||
}, debounceMs);
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}, debounceMs);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
cancelled = true;
|
cancelled = true;
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
|
};
|
||||||
|
}, [q, page, pageSize, sort, load, debounceMs]);
|
||||||
|
|
||||||
|
const setQuery = useCallback((value: string) => {
|
||||||
|
setQ(value);
|
||||||
|
setPage(1);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const setPageSizeAndResetPage = useCallback((value: number) => {
|
||||||
|
setPageSize(value);
|
||||||
|
setPage(1);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return {
|
||||||
|
items,
|
||||||
|
q,
|
||||||
|
page,
|
||||||
|
pageSize,
|
||||||
|
total,
|
||||||
|
totalPages,
|
||||||
|
error,
|
||||||
|
isLoading,
|
||||||
|
setQuery,
|
||||||
|
setPage,
|
||||||
|
setPageSize: setPageSizeAndResetPage,
|
||||||
};
|
};
|
||||||
}, [q, page, pageSize, sort, load, debounceMs]);
|
|
||||||
|
|
||||||
const setQuery = useCallback((value: string) => {
|
|
||||||
setQ(value);
|
|
||||||
setPage(1);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const setPageSizeAndResetPage = useCallback((value: number) => {
|
|
||||||
setPageSize(value);
|
|
||||||
setPage(1);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return {
|
|
||||||
items,
|
|
||||||
q,
|
|
||||||
page,
|
|
||||||
pageSize,
|
|
||||||
total,
|
|
||||||
totalPages,
|
|
||||||
error,
|
|
||||||
isLoading,
|
|
||||||
setQuery,
|
|
||||||
setPage,
|
|
||||||
setPageSize: setPageSizeAndResetPage
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,76 +3,79 @@ import { useCallback, useMemo, useState } from 'react';
|
|||||||
export type SortDirection = 'asc' | 'desc';
|
export type SortDirection = 'asc' | 'desc';
|
||||||
|
|
||||||
export type SortState = {
|
export type SortState = {
|
||||||
field: string;
|
field: string;
|
||||||
direction: SortDirection;
|
direction: SortDirection;
|
||||||
};
|
};
|
||||||
|
|
||||||
function invertDirection(direction: SortDirection): SortDirection {
|
function invertDirection(direction: SortDirection): SortDirection {
|
||||||
return direction === 'asc' ? 'desc' : 'asc';
|
return direction === 'asc' ? 'desc' : 'asc';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatSortParam(sort: SortState | null | undefined): string | undefined {
|
export function formatSortParam(sort: SortState | null | undefined): string | undefined {
|
||||||
if (!sort) {
|
if (!sort) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return sort.direction === 'desc' ? `-${sort.field}` : sort.field;
|
return sort.direction === 'desc' ? `-${sort.field}` : sort.field;
|
||||||
}
|
}
|
||||||
|
|
||||||
type UseSortingResult = {
|
type UseSortingResult = {
|
||||||
activeSort: SortState | null;
|
activeSort: SortState | null;
|
||||||
sortParam: string | undefined;
|
sortParam: string | undefined;
|
||||||
toggleSort: (field: string) => void;
|
toggleSort: (field: string) => void;
|
||||||
setSort: (next: SortState | null) => void;
|
setSort: (next: SortState | null) => void;
|
||||||
resetSort: () => void;
|
resetSort: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function useSorting(defaultSort?: SortState | null): UseSortingResult {
|
export function useSorting(defaultSort?: SortState | null): UseSortingResult {
|
||||||
const [overrideSort, setOverrideSort] = useState<SortState | null>(null);
|
const [overrideSort, setOverrideSort] = useState<SortState | null>(null);
|
||||||
|
|
||||||
const activeSort = overrideSort ?? defaultSort ?? null;
|
const activeSort = overrideSort ?? defaultSort ?? null;
|
||||||
|
|
||||||
const toggleSort = useCallback((field: string) => {
|
const toggleSort = useCallback(
|
||||||
setOverrideSort((previousOverride) => {
|
(field: string) => {
|
||||||
const baselineSort = defaultSort ?? null;
|
setOverrideSort((previousOverride) => {
|
||||||
const currentSort = previousOverride ?? baselineSort;
|
const baselineSort = defaultSort ?? null;
|
||||||
|
const currentSort = previousOverride ?? baselineSort;
|
||||||
|
|
||||||
if (!currentSort || currentSort.field !== field) {
|
if (!currentSort || currentSort.field !== field) {
|
||||||
return { field, direction: 'asc' };
|
return { field, direction: 'asc' };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baselineSort && baselineSort.field === field) {
|
if (baselineSort && baselineSort.field === field) {
|
||||||
if (previousOverride == null) {
|
if (previousOverride == null) {
|
||||||
return { field, direction: invertDirection(baselineSort.direction) };
|
return { field, direction: invertDirection(baselineSort.direction) };
|
||||||
}
|
}
|
||||||
if (previousOverride.direction === baselineSort.direction) {
|
if (previousOverride.direction === baselineSort.direction) {
|
||||||
return { field, direction: invertDirection(baselineSort.direction) };
|
return { field, direction: invertDirection(baselineSort.direction) };
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (previousOverride == null || previousOverride.direction === 'desc') {
|
if (previousOverride == null || previousOverride.direction === 'desc') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return { field, direction: 'desc' };
|
return { field, direction: 'desc' };
|
||||||
});
|
});
|
||||||
}, [defaultSort]);
|
},
|
||||||
|
[defaultSort],
|
||||||
|
);
|
||||||
|
|
||||||
const setSort = useCallback((next: SortState | null) => {
|
const setSort = useCallback((next: SortState | null) => {
|
||||||
setOverrideSort(next);
|
setOverrideSort(next);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const resetSort = useCallback(() => {
|
const resetSort = useCallback(() => {
|
||||||
setOverrideSort(null);
|
setOverrideSort(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const sortParam = useMemo(() => formatSortParam(activeSort), [activeSort]);
|
const sortParam = useMemo(() => formatSortParam(activeSort), [activeSort]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
activeSort,
|
activeSort,
|
||||||
sortParam,
|
sortParam,
|
||||||
toggleSort,
|
toggleSort,
|
||||||
setSort,
|
setSort,
|
||||||
resetSort
|
resetSort,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
export function useSubmitState<TStatus = string | null>(initialStatus: TStatus) {
|
export function useSubmitState<TStatus = string | null>(initialStatus: TStatus) {
|
||||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||||
const [submitError, setSubmitError] = useState<string | null>(null);
|
const [submitError, setSubmitError] = useState<string | null>(null);
|
||||||
const [status, setStatus] = useState<TStatus>(initialStatus);
|
const [status, setStatus] = useState<TStatus>(initialStatus);
|
||||||
|
|
||||||
const startSubmitting = useCallback(() => {
|
const startSubmitting = useCallback(() => {
|
||||||
setIsSubmitting(true);
|
setIsSubmitting(true);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const finishSubmitting = useCallback(() => {
|
const finishSubmitting = useCallback(() => {
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const clearFeedback = useCallback(() => {
|
const clearFeedback = useCallback(() => {
|
||||||
setSubmitError(null);
|
setSubmitError(null);
|
||||||
setStatus(initialStatus);
|
setStatus(initialStatus);
|
||||||
}, [initialStatus]);
|
}, [initialStatus]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isSubmitting,
|
isSubmitting,
|
||||||
submitError,
|
submitError,
|
||||||
status,
|
status,
|
||||||
startSubmitting,
|
startSubmitting,
|
||||||
finishSubmitting,
|
finishSubmitting,
|
||||||
setSubmitError,
|
setSubmitError,
|
||||||
setStatus,
|
setStatus,
|
||||||
clearFeedback
|
clearFeedback,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,163 +4,172 @@ type FieldErrors<TValues> = Partial<Record<keyof TValues, string | undefined>>;
|
|||||||
type TouchedFields<TValues> = Partial<Record<keyof TValues, boolean>>;
|
type TouchedFields<TValues> = Partial<Record<keyof TValues, boolean>>;
|
||||||
|
|
||||||
type SetValuesOptions = {
|
type SetValuesOptions = {
|
||||||
validate?: boolean;
|
validate?: boolean;
|
||||||
clearErrors?: boolean;
|
clearErrors?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type SetFieldValueOptions = {
|
type SetFieldValueOptions = {
|
||||||
validate?: boolean;
|
validate?: boolean;
|
||||||
touch?: boolean;
|
touch?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type ValidateAllOptions = {
|
type ValidateAllOptions = {
|
||||||
touchAll?: boolean;
|
touchAll?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type UseValidatedFieldsOptions<TValues> = {
|
type UseValidatedFieldsOptions<TValues> = {
|
||||||
initialValues: TValues;
|
initialValues: TValues;
|
||||||
validate: (values: TValues) => FieldErrors<TValues>;
|
validate: (values: TValues) => FieldErrors<TValues>;
|
||||||
};
|
};
|
||||||
|
|
||||||
function hasErrors<TValues>(errors: FieldErrors<TValues>): boolean {
|
function hasErrors<TValues>(errors: FieldErrors<TValues>): boolean {
|
||||||
return Object.values(errors).some(Boolean);
|
return Object.values(errors).some(Boolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
function pickTouchedErrors<TValues>(
|
function pickTouchedErrors<TValues>(
|
||||||
errors: FieldErrors<TValues>,
|
errors: FieldErrors<TValues>,
|
||||||
touched: TouchedFields<TValues>
|
touched: TouchedFields<TValues>,
|
||||||
): FieldErrors<TValues> {
|
): FieldErrors<TValues> {
|
||||||
const next: FieldErrors<TValues> = {};
|
const next: FieldErrors<TValues> = {};
|
||||||
|
|
||||||
for (const key of Object.keys(errors) as Array<keyof TValues>) {
|
for (const key of Object.keys(errors) as Array<keyof TValues>) {
|
||||||
if (touched[key]) {
|
if (touched[key]) {
|
||||||
next[key] = errors[key];
|
next[key] = errors[key];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
||||||
function touchAll<TValues extends Record<string, string>>(values: TValues): TouchedFields<TValues> {
|
function touchAll<TValues extends Record<string, string>>(values: TValues): TouchedFields<TValues> {
|
||||||
const touched: TouchedFields<TValues> = {};
|
const touched: TouchedFields<TValues> = {};
|
||||||
|
|
||||||
for (const key of Object.keys(values) as Array<keyof TValues>) {
|
for (const key of Object.keys(values) as Array<keyof TValues>) {
|
||||||
touched[key] = true;
|
touched[key] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return touched;
|
return touched;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useValidatedFields<TValues extends Record<string, string>>({
|
export function useValidatedFields<TValues extends Record<string, string>>({
|
||||||
initialValues,
|
initialValues,
|
||||||
validate
|
validate,
|
||||||
}: UseValidatedFieldsOptions<TValues>) {
|
}: UseValidatedFieldsOptions<TValues>) {
|
||||||
const [values, setValues] = useState<TValues>(initialValues);
|
const [values, setValues] = useState<TValues>(initialValues);
|
||||||
const [allErrors, setAllErrors] = useState<FieldErrors<TValues>>(() => validate(initialValues));
|
const [allErrors, setAllErrors] = useState<FieldErrors<TValues>>(() => validate(initialValues));
|
||||||
const [touched, setTouched] = useState<TouchedFields<TValues>>({});
|
const [touched, setTouched] = useState<TouchedFields<TValues>>({});
|
||||||
|
|
||||||
const updateValues = useCallback((nextValues: TValues, options: SetValuesOptions = {}) => {
|
const updateValues = useCallback(
|
||||||
const { validate: shouldValidate = false, clearErrors = false } = options;
|
(nextValues: TValues, options: SetValuesOptions = {}) => {
|
||||||
setValues(nextValues);
|
const { validate: shouldValidate = false, clearErrors = false } = options;
|
||||||
|
setValues(nextValues);
|
||||||
|
|
||||||
if (shouldValidate || clearErrors) {
|
if (shouldValidate || clearErrors) {
|
||||||
setAllErrors(validate(nextValues));
|
setAllErrors(validate(nextValues));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clearErrors) {
|
if (clearErrors) {
|
||||||
setTouched({});
|
setTouched({});
|
||||||
}
|
}
|
||||||
}, [validate]);
|
},
|
||||||
|
[validate],
|
||||||
|
);
|
||||||
|
|
||||||
const setFieldValue = useCallback(<K extends keyof TValues>(
|
const setFieldValue = useCallback(
|
||||||
key: K,
|
<K extends keyof TValues>(
|
||||||
value: TValues[K],
|
key: K,
|
||||||
options: SetFieldValueOptions = {}
|
value: TValues[K],
|
||||||
) => {
|
options: SetFieldValueOptions = {},
|
||||||
const { validate: shouldValidate = true, touch = true } = options;
|
) => {
|
||||||
|
const { validate: shouldValidate = true, touch = true } = options;
|
||||||
|
|
||||||
if (touch) {
|
if (touch) {
|
||||||
setTouched((current) => ({
|
setTouched((current) => ({
|
||||||
...current,
|
...current,
|
||||||
[key]: true
|
[key]: true,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
setValues((current) => {
|
setValues((current) => {
|
||||||
const nextValues = {
|
const nextValues = {
|
||||||
...current,
|
...current,
|
||||||
[key]: value
|
[key]: value,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (shouldValidate) {
|
if (shouldValidate) {
|
||||||
setAllErrors(validate(nextValues));
|
setAllErrors(validate(nextValues));
|
||||||
}
|
}
|
||||||
|
|
||||||
return nextValues;
|
return nextValues;
|
||||||
});
|
});
|
||||||
}, [validate]);
|
},
|
||||||
|
[validate],
|
||||||
|
);
|
||||||
|
|
||||||
const validateAll = useCallback((options: ValidateAllOptions = {}) => {
|
const validateAll = useCallback(
|
||||||
const { touchAll: shouldTouchAll = true } = options;
|
(options: ValidateAllOptions = {}) => {
|
||||||
const nextErrors = validate(values);
|
const { touchAll: shouldTouchAll = true } = options;
|
||||||
|
const nextErrors = validate(values);
|
||||||
|
|
||||||
setAllErrors(nextErrors);
|
setAllErrors(nextErrors);
|
||||||
|
|
||||||
if (shouldTouchAll) {
|
if (shouldTouchAll) {
|
||||||
setTouched(touchAll(values));
|
setTouched(touchAll(values));
|
||||||
}
|
}
|
||||||
|
|
||||||
return nextErrors;
|
return nextErrors;
|
||||||
}, [validate, values]);
|
},
|
||||||
|
[validate, values],
|
||||||
|
);
|
||||||
|
|
||||||
const setFieldError = useCallback(<K extends keyof TValues>(key: K, message?: string) => {
|
const setFieldError = useCallback(<K extends keyof TValues>(key: K, message?: string) => {
|
||||||
setTouched((current) => ({
|
setTouched((current) => ({
|
||||||
...current,
|
...current,
|
||||||
[key]: true
|
[key]: true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
setAllErrors((current) => ({
|
setAllErrors((current) => ({
|
||||||
...current,
|
...current,
|
||||||
[key]: message
|
[key]: message,
|
||||||
}));
|
}));
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const updateErrors = useCallback((nextErrors: FieldErrors<TValues>) => {
|
const updateErrors = useCallback((nextErrors: FieldErrors<TValues>) => {
|
||||||
const nextTouched: TouchedFields<TValues> = {};
|
const nextTouched: TouchedFields<TValues> = {};
|
||||||
|
|
||||||
for (const key of Object.keys(nextErrors) as Array<keyof TValues>) {
|
for (const key of Object.keys(nextErrors) as Array<keyof TValues>) {
|
||||||
if (nextErrors[key]) {
|
if (nextErrors[key]) {
|
||||||
nextTouched[key] = true;
|
nextTouched[key] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setTouched((current) => ({
|
setTouched((current) => ({
|
||||||
...current,
|
...current,
|
||||||
...nextTouched
|
...nextTouched,
|
||||||
}));
|
}));
|
||||||
setAllErrors(nextErrors);
|
setAllErrors(nextErrors);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const clearErrors = useCallback(() => {
|
const clearErrors = useCallback(() => {
|
||||||
setAllErrors(validate(values));
|
setAllErrors(validate(values));
|
||||||
setTouched({});
|
setTouched({});
|
||||||
}, [validate, values]);
|
}, [validate, values]);
|
||||||
|
|
||||||
const errors = useMemo(() => pickTouchedErrors(allErrors, touched), [allErrors, touched]);
|
const errors = useMemo(() => pickTouchedErrors(allErrors, touched), [allErrors, touched]);
|
||||||
|
|
||||||
const isValid = useMemo(() => {
|
const isValid = useMemo(() => {
|
||||||
return !hasErrors(validate(values));
|
return !hasErrors(validate(values));
|
||||||
}, [validate, values]);
|
}, [validate, values]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
values,
|
values,
|
||||||
errors,
|
errors,
|
||||||
isValid,
|
isValid,
|
||||||
setValues: updateValues,
|
setValues: updateValues,
|
||||||
setFieldValue,
|
setFieldValue,
|
||||||
validateAll,
|
validateAll,
|
||||||
setFieldError,
|
setFieldError,
|
||||||
setErrors: updateErrors,
|
setErrors: updateErrors,
|
||||||
clearErrors
|
clearErrors,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
31
src/index.ts
31
src/index.ts
@@ -1,15 +1,27 @@
|
|||||||
export { createAuthContext } from './auth/createAuthContext';
|
export { createAuthContext } from './auth/createAuthContext';
|
||||||
export type { AuthContextValue, AuthState, CreateAuthContextOptions } from './auth/createAuthContext';
|
export type {
|
||||||
|
AuthContextValue,
|
||||||
|
AuthState,
|
||||||
|
CreateAuthContextOptions,
|
||||||
|
} from './auth/createAuthContext';
|
||||||
|
|
||||||
export { decodeJwtPayload, isJwtExpired } from './auth/jwt';
|
export { decodeJwtPayload, isJwtExpired } from './auth/jwt';
|
||||||
|
|
||||||
export { createApiClient, ApiError } from './api/createApiClient';
|
export { createApiClient, ApiError } from './api/createApiClient';
|
||||||
export type { CreateApiClientConfig, RequestOptions, ResolveErrorInput } from './api/createApiClient';
|
export type {
|
||||||
|
CreateApiClientConfig,
|
||||||
|
RequestOptions,
|
||||||
|
ResolveErrorInput,
|
||||||
|
} from './api/createApiClient';
|
||||||
|
|
||||||
export { buildListQuery } from './api/query';
|
export { buildListQuery } from './api/query';
|
||||||
|
|
||||||
export { createErrorResolver } from './errors/createErrorResolver';
|
export { createErrorResolver } from './errors/createErrorResolver';
|
||||||
export type { CreateErrorResolverConfig, ErrorCatalog, ResolveErrorMessageOptions } from './errors/createErrorResolver';
|
export type {
|
||||||
|
CreateErrorResolverConfig,
|
||||||
|
ErrorCatalog,
|
||||||
|
ResolveErrorMessageOptions,
|
||||||
|
} from './errors/createErrorResolver';
|
||||||
|
|
||||||
export { useValidatedFields } from './hooks/useValidatedFields';
|
export { useValidatedFields } from './hooks/useValidatedFields';
|
||||||
export { useEditableForm } from './hooks/useEditableForm';
|
export { useEditableForm } from './hooks/useEditableForm';
|
||||||
@@ -20,9 +32,18 @@ export type { SortDirection, SortState } from './hooks/useSorting';
|
|||||||
export { useCooldownTimer } from './hooks/useCooldownTimer';
|
export { useCooldownTimer } from './hooks/useCooldownTimer';
|
||||||
|
|
||||||
export { LeftMenuProvider, useLeftMenu } from './contexts/LeftMenuContext';
|
export { LeftMenuProvider, useLeftMenu } from './contexts/LeftMenuContext';
|
||||||
export type { LeftMenuContent, LeftMenuRenderState, LeftMenuStyle } from './contexts/LeftMenuContext';
|
export type {
|
||||||
|
LeftMenuContent,
|
||||||
|
LeftMenuRenderState,
|
||||||
|
LeftMenuSizing,
|
||||||
|
LeftMenuStyle,
|
||||||
|
} from './contexts/LeftMenuContext';
|
||||||
export { RightSidebarProvider, useRightSidebar } from './contexts/RightSidebarContext';
|
export { RightSidebarProvider, useRightSidebar } from './contexts/RightSidebarContext';
|
||||||
export type { RightSidebarContent, RightSidebarStyle } from './contexts/RightSidebarContext';
|
export type {
|
||||||
|
RightSidebarContent,
|
||||||
|
RightSidebarSizing,
|
||||||
|
RightSidebarStyle,
|
||||||
|
} from './contexts/RightSidebarContext';
|
||||||
|
|
||||||
export { formatDate, capitalize, splitAndCapitalize } from './utils/formatting';
|
export { formatDate, capitalize, splitAndCapitalize } from './utils/formatting';
|
||||||
export type { SplitMode } from './utils/formatting';
|
export type { SplitMode } from './utils/formatting';
|
||||||
|
|||||||
@@ -1,174 +1,190 @@
|
|||||||
import { useCallback, useEffect, useRef, useState, type PointerEvent as ReactPointerEvent } from 'react';
|
import {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
type PointerEvent as ReactPointerEvent,
|
||||||
|
} from 'react';
|
||||||
|
|
||||||
const DEFAULT_DESKTOP_BREAKPOINT = 1024;
|
const DEFAULT_DESKTOP_BREAKPOINT = 1024;
|
||||||
|
|
||||||
type ResizeAxis = 'from-left' | 'from-right';
|
type ResizeAxis = 'from-left' | 'from-right';
|
||||||
|
|
||||||
export type SidePanelMachineOptions = {
|
export type SidePanelMachineOptions = {
|
||||||
storageKey: string;
|
storageKey: string;
|
||||||
defaultWidth: number;
|
defaultWidth: number;
|
||||||
minWidth: number;
|
minWidth: number;
|
||||||
maxWidth: number;
|
maxWidth: number;
|
||||||
resizeAxis: ResizeAxis;
|
resizeAxis: ResizeAxis;
|
||||||
resizingBodyClass: string;
|
resizingBodyClass: string;
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
canResize: boolean;
|
canResize: boolean;
|
||||||
shouldPersistWidth: boolean;
|
shouldPersistWidth: boolean;
|
||||||
closeOnPathname?: string;
|
closeOnPathname?: string;
|
||||||
onCloseOnPathname?: () => void;
|
onCloseOnPathname?: () => void;
|
||||||
onEscape?: () => void;
|
onEscape?: () => void;
|
||||||
desktopBreakpoint?: number;
|
desktopBreakpoint?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SidePanelMachineResult = {
|
export type SidePanelMachineResult = {
|
||||||
width: number;
|
width: number;
|
||||||
isDesktop: boolean;
|
isDesktop: boolean;
|
||||||
startResize: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
startResize: (event: ReactPointerEvent<HTMLDivElement>) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function isDesktopViewport(breakpoint = DEFAULT_DESKTOP_BREAKPOINT): boolean {
|
export function isDesktopViewport(breakpoint = DEFAULT_DESKTOP_BREAKPOINT): boolean {
|
||||||
if (!globalThis.window) {
|
if (!globalThis.window) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof globalThis.window.matchMedia === 'function') {
|
if (typeof globalThis.window.matchMedia === 'function') {
|
||||||
return globalThis.window.matchMedia(`(min-width: ${breakpoint}px)`).matches;
|
return globalThis.window.matchMedia(`(min-width: ${breakpoint}px)`).matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
return window.innerWidth >= breakpoint;
|
return window.innerWidth >= breakpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useSidePanelMachine({
|
export function useSidePanelMachine({
|
||||||
storageKey,
|
storageKey,
|
||||||
defaultWidth,
|
defaultWidth,
|
||||||
minWidth,
|
minWidth,
|
||||||
maxWidth,
|
maxWidth,
|
||||||
resizeAxis,
|
resizeAxis,
|
||||||
resizingBodyClass,
|
resizingBodyClass,
|
||||||
isOpen,
|
isOpen,
|
||||||
canResize,
|
canResize,
|
||||||
shouldPersistWidth,
|
shouldPersistWidth,
|
||||||
closeOnPathname,
|
closeOnPathname,
|
||||||
onCloseOnPathname,
|
onCloseOnPathname,
|
||||||
onEscape,
|
onEscape,
|
||||||
desktopBreakpoint = DEFAULT_DESKTOP_BREAKPOINT
|
desktopBreakpoint = DEFAULT_DESKTOP_BREAKPOINT,
|
||||||
}: SidePanelMachineOptions): SidePanelMachineResult {
|
}: SidePanelMachineOptions): SidePanelMachineResult {
|
||||||
const isResizingRef = useRef(false);
|
const isResizingRef = useRef(false);
|
||||||
const resizeStartXRef = useRef(0);
|
const resizeStartXRef = useRef(0);
|
||||||
const resizeStartWidthRef = useRef(0);
|
const resizeStartWidthRef = useRef(0);
|
||||||
|
|
||||||
const clampWidth = useCallback((value: number) => {
|
const clampWidth = useCallback(
|
||||||
return Math.min(maxWidth, Math.max(minWidth, value));
|
(value: number) => {
|
||||||
}, [maxWidth, minWidth]);
|
return Math.min(maxWidth, Math.max(minWidth, value));
|
||||||
|
},
|
||||||
|
[maxWidth, minWidth],
|
||||||
|
);
|
||||||
|
|
||||||
const readStoredWidth = useCallback(() => {
|
const readStoredWidth = useCallback(() => {
|
||||||
if (!globalThis.window) {
|
if (!globalThis.window) {
|
||||||
return defaultWidth;
|
return defaultWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
const storedValue = localStorage.getItem(storageKey);
|
const storedValue = localStorage.getItem(storageKey);
|
||||||
const parsed = Number(storedValue);
|
if (storedValue == null || storedValue.trim() === '') {
|
||||||
if (!Number.isFinite(parsed)) {
|
return defaultWidth;
|
||||||
return defaultWidth;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return clampWidth(parsed);
|
const parsed = Number(storedValue);
|
||||||
}, [defaultWidth, storageKey, clampWidth]);
|
if (!Number.isFinite(parsed)) {
|
||||||
|
return defaultWidth;
|
||||||
|
}
|
||||||
|
|
||||||
const [width, setWidth] = useState<number>(() => readStoredWidth());
|
return clampWidth(parsed);
|
||||||
|
}, [defaultWidth, storageKey, clampWidth]);
|
||||||
|
|
||||||
useEffect(() => {
|
const [width, setWidth] = useState<number>(() => readStoredWidth());
|
||||||
if (closeOnPathname == null || !onCloseOnPathname) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
onCloseOnPathname();
|
useEffect(() => {
|
||||||
}, [closeOnPathname, onCloseOnPathname]);
|
if (closeOnPathname == null || !onCloseOnPathname) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
onCloseOnPathname();
|
||||||
if (!shouldPersistWidth || !globalThis.window) {
|
}, [closeOnPathname, onCloseOnPathname]);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
localStorage.setItem(storageKey, String(width));
|
useEffect(() => {
|
||||||
}, [shouldPersistWidth, storageKey, width]);
|
if (!shouldPersistWidth || !globalThis.window) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
localStorage.setItem(storageKey, String(width));
|
||||||
function handlePointerMove(event: PointerEvent) {
|
}, [shouldPersistWidth, storageKey, width]);
|
||||||
if (!isResizingRef.current || !canResize) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const deltaX = event.clientX - resizeStartXRef.current;
|
useEffect(() => {
|
||||||
const delta = resizeAxis === 'from-left' ? deltaX : -deltaX;
|
function handlePointerMove(event: PointerEvent) {
|
||||||
const nextWidth = clampWidth(resizeStartWidthRef.current + delta);
|
if (!isResizingRef.current || !canResize) {
|
||||||
setWidth(nextWidth);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopResizing() {
|
const deltaX = event.clientX - resizeStartXRef.current;
|
||||||
if (!isResizingRef.current) {
|
const delta = resizeAxis === 'from-left' ? deltaX : -deltaX;
|
||||||
return;
|
const nextWidth = clampWidth(resizeStartWidthRef.current + delta);
|
||||||
}
|
setWidth(nextWidth);
|
||||||
|
}
|
||||||
|
|
||||||
isResizingRef.current = false;
|
function stopResizing() {
|
||||||
document.body.classList.remove(resizingBodyClass);
|
if (!isResizingRef.current) {
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
globalThis.addEventListener('pointermove', handlePointerMove);
|
isResizingRef.current = false;
|
||||||
globalThis.addEventListener('pointerup', stopResizing);
|
document.body.classList.remove(resizingBodyClass);
|
||||||
|
}
|
||||||
|
|
||||||
return () => {
|
globalThis.addEventListener('pointermove', handlePointerMove);
|
||||||
globalThis.removeEventListener('pointermove', handlePointerMove);
|
globalThis.addEventListener('pointerup', stopResizing);
|
||||||
globalThis.removeEventListener('pointerup', stopResizing);
|
|
||||||
document.body.classList.remove(resizingBodyClass);
|
return () => {
|
||||||
|
globalThis.removeEventListener('pointermove', handlePointerMove);
|
||||||
|
globalThis.removeEventListener('pointerup', stopResizing);
|
||||||
|
document.body.classList.remove(resizingBodyClass);
|
||||||
|
};
|
||||||
|
}, [canResize, clampWidth, resizeAxis, resizingBodyClass]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isOpen || isDesktopViewport(desktopBreakpoint)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const previousOverflow = document.body.style.overflow;
|
||||||
|
document.body.style.overflow = 'hidden';
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
document.body.style.overflow = previousOverflow;
|
||||||
|
};
|
||||||
|
}, [isOpen, desktopBreakpoint]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isOpen || !onEscape) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleEscape = (event: KeyboardEvent) => {
|
||||||
|
if (event.key === 'Escape') {
|
||||||
|
onEscape();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
globalThis.addEventListener('keydown', handleEscape);
|
||||||
|
return () => {
|
||||||
|
globalThis.removeEventListener('keydown', handleEscape);
|
||||||
|
};
|
||||||
|
}, [isOpen, onEscape]);
|
||||||
|
|
||||||
|
const startResize = useCallback(
|
||||||
|
(event: ReactPointerEvent<HTMLDivElement>) => {
|
||||||
|
if (!canResize || !isDesktopViewport(desktopBreakpoint)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
isResizingRef.current = true;
|
||||||
|
resizeStartXRef.current = event.clientX;
|
||||||
|
resizeStartWidthRef.current = width;
|
||||||
|
document.body.classList.add(resizingBodyClass);
|
||||||
|
event.preventDefault();
|
||||||
|
},
|
||||||
|
[canResize, desktopBreakpoint, resizingBodyClass, width],
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
width,
|
||||||
|
isDesktop: isDesktopViewport(desktopBreakpoint),
|
||||||
|
startResize,
|
||||||
};
|
};
|
||||||
}, [canResize, clampWidth, resizeAxis, resizingBodyClass]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!isOpen || isDesktopViewport(desktopBreakpoint)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const previousOverflow = document.body.style.overflow;
|
|
||||||
document.body.style.overflow = 'hidden';
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
document.body.style.overflow = previousOverflow;
|
|
||||||
};
|
|
||||||
}, [isOpen, desktopBreakpoint]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!isOpen || !onEscape) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleEscape = (event: KeyboardEvent) => {
|
|
||||||
if (event.key === 'Escape') {
|
|
||||||
onEscape();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
globalThis.addEventListener('keydown', handleEscape);
|
|
||||||
return () => {
|
|
||||||
globalThis.removeEventListener('keydown', handleEscape);
|
|
||||||
};
|
|
||||||
}, [isOpen, onEscape]);
|
|
||||||
|
|
||||||
const startResize = useCallback((event: ReactPointerEvent<HTMLDivElement>) => {
|
|
||||||
if (!canResize || !isDesktopViewport(desktopBreakpoint)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
isResizingRef.current = true;
|
|
||||||
resizeStartXRef.current = event.clientX;
|
|
||||||
resizeStartWidthRef.current = width;
|
|
||||||
document.body.classList.add(resizingBodyClass);
|
|
||||||
event.preventDefault();
|
|
||||||
}, [canResize, desktopBreakpoint, resizingBodyClass, width]);
|
|
||||||
|
|
||||||
return {
|
|
||||||
width,
|
|
||||||
isDesktop: isDesktopViewport(desktopBreakpoint),
|
|
||||||
startResize
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,24 @@
|
|||||||
|
|
||||||
export function formatDate(value: string, seconds = false): string {
|
export function formatDate(value: string, seconds = false): string {
|
||||||
const options: Intl.DateTimeFormatOptions = {
|
const options: Intl.DateTimeFormatOptions = {
|
||||||
year: "numeric",
|
year: 'numeric',
|
||||||
month: "2-digit",
|
month: '2-digit',
|
||||||
day: "2-digit",
|
day: '2-digit',
|
||||||
hour: "2-digit",
|
hour: '2-digit',
|
||||||
minute: "2-digit",
|
minute: '2-digit',
|
||||||
...(seconds ? { second: "2-digit" } : {}),
|
...(seconds ? { second: '2-digit' } : {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
return new Date(value).toLocaleString("it-IT", options);
|
return new Date(value).toLocaleString('it-IT', options);
|
||||||
}
|
}
|
||||||
|
|
||||||
export const capitalize = (str: string) =>
|
export const capitalize = (str: string) =>
|
||||||
str.toLowerCase().split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ');
|
str
|
||||||
|
.toLowerCase()
|
||||||
|
.split(' ')
|
||||||
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||||
|
.join(' ');
|
||||||
|
|
||||||
export type SplitMode = "underscore" | "camel" | "auto";
|
export type SplitMode = 'underscore' | 'camel' | 'auto';
|
||||||
|
|
||||||
/** Title-case a string while preserving short all-caps acronyms (e.g., XML) */
|
/** Title-case a string while preserving short all-caps acronyms (e.g., XML) */
|
||||||
const toTitleCase = (s: string) =>
|
const toTitleCase = (s: string) =>
|
||||||
@@ -23,23 +26,23 @@ const toTitleCase = (s: string) =>
|
|||||||
.trim()
|
.trim()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.split(/\s+/)
|
.split(/\s+/)
|
||||||
.map(w =>
|
.map((w) =>
|
||||||
/^[A-Z]{2,4}$/.test(w) ? w : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()
|
/^[A-Z]{2,4}$/.test(w) ? w : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase(),
|
||||||
)
|
)
|
||||||
.join(" ");
|
.join(' ');
|
||||||
|
|
||||||
const splitUnderscoreHyphen = (s: string) => s.replaceAll(/[_-]+/g, " ");
|
const splitUnderscoreHyphen = (s: string) => s.replaceAll(/[_-]+/g, ' ');
|
||||||
|
|
||||||
/** Insert spaces at camelCase boundaries and around digit/letter edges */
|
/** Insert spaces at camelCase boundaries and around digit/letter edges */
|
||||||
const splitCamel = (s: string) =>
|
const splitCamel = (s: string) =>
|
||||||
s
|
s
|
||||||
// fooBar -> foo Bar ; foo2D -> foo 2D
|
// fooBar -> foo Bar ; foo2D -> foo 2D
|
||||||
.replaceAll(/([a-z0-9])([A-Z])/g, "$1 $2")
|
.replaceAll(/([a-z0-9])([A-Z])/g, '$1 $2')
|
||||||
// XMLHttp -> XML Http (acronym + word)
|
// XMLHttp -> XML Http (acronym + word)
|
||||||
.replaceAll(/([A-Z])([A-Z][a-z])/g, "$1 $2")
|
.replaceAll(/([A-Z])([A-Z][a-z])/g, '$1 $2')
|
||||||
// letter<->digit boundaries
|
// letter<->digit boundaries
|
||||||
.replaceAll(/([a-zA-Z])([0-9])/g, "$1 $2")
|
.replaceAll(/([a-zA-Z])([0-9])/g, '$1 $2')
|
||||||
.replaceAll(/([0-9])([a-zA-Z])/g, "$1 $2");
|
.replaceAll(/([0-9])([a-zA-Z])/g, '$1 $2');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Split and capitalize either by underscores/hyphens or camelCase.
|
* Split and capitalize either by underscores/hyphens or camelCase.
|
||||||
@@ -48,17 +51,15 @@ const splitCamel = (s: string) =>
|
|||||||
* - "camel": split on camelCase boundaries
|
* - "camel": split on camelCase boundaries
|
||||||
* - "auto": pick underscore if present, otherwise camel
|
* - "auto": pick underscore if present, otherwise camel
|
||||||
*/
|
*/
|
||||||
export function splitAndCapitalize(str?: string, mode: SplitMode = "auto"): string {
|
export function splitAndCapitalize(str?: string, mode: SplitMode = 'auto'): string {
|
||||||
if (!str) return "";
|
if (!str) return '';
|
||||||
|
|
||||||
// normalize underscores/hyphens first for auto decision
|
// normalize underscores/hyphens first for auto decision
|
||||||
const hasUnderscoreLike = /[_-]/.test(str);
|
const hasUnderscoreLike = /[_-]/.test(str);
|
||||||
const chosen: SplitMode =
|
const chosen: SplitMode = mode === 'auto' ? (hasUnderscoreLike ? 'underscore' : 'camel') : mode;
|
||||||
mode === "auto" ? (hasUnderscoreLike ? "underscore" : "camel") : mode;
|
|
||||||
|
|
||||||
const spaced =
|
const spaced = chosen === 'underscore' ? splitUnderscoreHyphen(str) : splitCamel(str);
|
||||||
chosen === "underscore" ? splitUnderscoreHyphen(str) : splitCamel(str);
|
|
||||||
|
|
||||||
// collapse extra spaces, then title-case
|
// collapse extra spaces, then title-case
|
||||||
return toTitleCase(spaced.replaceAll(/\s+/g, " ").trim());
|
return toTitleCase(spaced.replaceAll(/\s+/g, ' ').trim());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
type VerifiedEmailVisibilityOptions = {
|
type VerifiedEmailVisibilityOptions = {
|
||||||
verifiedAt: string | null;
|
verifiedAt: string | null;
|
||||||
persistedEmail: string;
|
persistedEmail: string;
|
||||||
currentEmail: string;
|
currentEmail: string;
|
||||||
isEditing: boolean;
|
isEditing: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function shouldShowVerifiedEmailBadge(options: VerifiedEmailVisibilityOptions): boolean {
|
export function shouldShowVerifiedEmailBadge(options: VerifiedEmailVisibilityOptions): boolean {
|
||||||
const { verifiedAt, persistedEmail, currentEmail, isEditing } = options;
|
const { verifiedAt, persistedEmail, currentEmail, isEditing } = options;
|
||||||
|
|
||||||
if (!verifiedAt) {
|
if (!verifiedAt) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isEditing) {
|
if (!isEditing) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return persistedEmail.trim() === currentEmail.trim();
|
return persistedEmail.trim() === currentEmail.trim();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.json",
|
"extends": "./tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"noEmit": false,
|
"noEmit": false,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"emitDeclarationOnly": true,
|
"emitDeclarationOnly": true,
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "dist",
|
"outDir": "dist",
|
||||||
"declarationMap": true
|
"declarationMap": true
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"allowImportingTsExtensions": false,
|
"allowImportingTsExtensions": false,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"types": ["react"]
|
"types": ["react"]
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,16 @@ import react from '@vitejs/plugin-react';
|
|||||||
import { resolve } from 'node:path';
|
import { resolve } from 'node:path';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
build: {
|
build: {
|
||||||
lib: {
|
lib: {
|
||||||
entry: resolve(__dirname, 'src/index.ts'),
|
entry: resolve(__dirname, 'src/index.ts'),
|
||||||
name: 'PanicCore',
|
name: 'PanicCore',
|
||||||
formats: ['es'],
|
formats: ['es'],
|
||||||
fileName: () => 'index.js'
|
fileName: () => 'index.js',
|
||||||
|
},
|
||||||
|
rollupOptions: {
|
||||||
|
external: ['react'],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rollupOptions: {
|
|
||||||
external: ['react']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|||||||
625
yarn.lock
625
yarn.lock
@@ -16,7 +16,7 @@
|
|||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/@babel/compat-data/-/compat-data-7.29.0.tgz#00d03e8c0ac24dd9be942c5370990cbe1f17d88d"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@babel/compat-data/-/compat-data-7.29.0.tgz#00d03e8c0ac24dd9be942c5370990cbe1f17d88d"
|
||||||
integrity sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==
|
integrity sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==
|
||||||
|
|
||||||
"@babel/core@^7.29.0":
|
"@babel/core@^7.24.4", "@babel/core@^7.29.0":
|
||||||
version "7.29.0"
|
version "7.29.0"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/@babel/core/-/core-7.29.0.tgz#5286ad785df7f79d656e88ce86e650d16ca5f322"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@babel/core/-/core-7.29.0.tgz#5286ad785df7f79d656e88ce86e650d16ca5f322"
|
||||||
integrity sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==
|
integrity sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
"@babel/template" "^7.28.6"
|
"@babel/template" "^7.28.6"
|
||||||
"@babel/types" "^7.28.6"
|
"@babel/types" "^7.28.6"
|
||||||
|
|
||||||
"@babel/parser@^7.1.0", "@babel/parser@^7.20.7", "@babel/parser@^7.28.6", "@babel/parser@^7.29.0":
|
"@babel/parser@^7.1.0", "@babel/parser@^7.20.7", "@babel/parser@^7.24.4", "@babel/parser@^7.28.6", "@babel/parser@^7.29.0":
|
||||||
version "7.29.0"
|
version "7.29.0"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/@babel/parser/-/parser-7.29.0.tgz#669ef345add7d057e92b7ed15f0bac07611831b6"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@babel/parser/-/parser-7.29.0.tgz#669ef345add7d057e92b7ed15f0bac07611831b6"
|
||||||
integrity sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==
|
integrity sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==
|
||||||
@@ -290,6 +290,82 @@
|
|||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz#0eaf705c941a218a43dba8e09f1df1d6cd2f1f17"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@esbuild/win32-x64/-/win32-x64-0.27.3.tgz#0eaf705c941a218a43dba8e09f1df1d6cd2f1f17"
|
||||||
integrity sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==
|
integrity sha512-4uJGhsxuptu3OcpVAzli+/gWusVGwZZHTlS63hh++ehExkVT8SgiEf7/uC/PclrPPkLhZqGgCTjd0VWLo6xMqA==
|
||||||
|
|
||||||
|
"@eslint-community/eslint-utils@^4.8.0", "@eslint-community/eslint-utils@^4.9.1":
|
||||||
|
version "4.9.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz#4e90af67bc51ddee6cdef5284edf572ec376b595"
|
||||||
|
integrity sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==
|
||||||
|
dependencies:
|
||||||
|
eslint-visitor-keys "^3.4.3"
|
||||||
|
|
||||||
|
"@eslint-community/regexpp@^4.12.2":
|
||||||
|
version "4.12.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@eslint-community/regexpp/-/regexpp-4.12.2.tgz#bccdf615bcf7b6e8db830ec0b8d21c9a25de597b"
|
||||||
|
integrity sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==
|
||||||
|
|
||||||
|
"@eslint/config-array@^0.23.2":
|
||||||
|
version "0.23.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@eslint/config-array/-/config-array-0.23.2.tgz#db85beeff7facc685a5775caacb1c845669b9470"
|
||||||
|
integrity sha512-YF+fE6LV4v5MGWRGj7G404/OZzGNepVF8fxk7jqmqo3lrza7a0uUcDnROGRBG1WFC1omYUS/Wp1f42i0M+3Q3A==
|
||||||
|
dependencies:
|
||||||
|
"@eslint/object-schema" "^3.0.2"
|
||||||
|
debug "^4.3.1"
|
||||||
|
minimatch "^10.2.1"
|
||||||
|
|
||||||
|
"@eslint/config-helpers@^0.5.2":
|
||||||
|
version "0.5.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@eslint/config-helpers/-/config-helpers-0.5.2.tgz#314c7b03d02a371ad8c0a7f6821d5a8a8437ba9d"
|
||||||
|
integrity sha512-a5MxrdDXEvqnIq+LisyCX6tQMPF/dSJpCfBgBauY+pNZ28yCtSsTvyTYrMhaI+LK26bVyCJfJkT0u8KIj2i1dQ==
|
||||||
|
dependencies:
|
||||||
|
"@eslint/core" "^1.1.0"
|
||||||
|
|
||||||
|
"@eslint/core@^1.1.0":
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@eslint/core/-/core-1.1.0.tgz#51f5cd970e216fbdae6721ac84491f57f965836d"
|
||||||
|
integrity sha512-/nr9K9wkr3P1EzFTdFdMoLuo1PmIxjmwvPozwoSodjNBdefGujXQUF93u1DDZpEaTuDvMsIQddsd35BwtrW9Xw==
|
||||||
|
dependencies:
|
||||||
|
"@types/json-schema" "^7.0.15"
|
||||||
|
|
||||||
|
"@eslint/js@^10":
|
||||||
|
version "10.0.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@eslint/js/-/js-10.0.1.tgz#1e8a876f50117af8ab67e47d5ad94d38d6622583"
|
||||||
|
integrity sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==
|
||||||
|
|
||||||
|
"@eslint/object-schema@^3.0.2":
|
||||||
|
version "3.0.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@eslint/object-schema/-/object-schema-3.0.2.tgz#c59c6a94aa4b428ed7f1615b6a4495c0a21f7a22"
|
||||||
|
integrity sha512-HOy56KJt48Bx8KmJ+XGQNSUMT/6dZee/M54XyUyuvTvPXJmsERRvBchsUVx1UMe1WwIH49XLAczNC7V2INsuUw==
|
||||||
|
|
||||||
|
"@eslint/plugin-kit@^0.6.0":
|
||||||
|
version "0.6.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@eslint/plugin-kit/-/plugin-kit-0.6.0.tgz#e0cb12ec66719cb2211ad36499fb516f2a63899d"
|
||||||
|
integrity sha512-bIZEUzOI1jkhviX2cp5vNyXQc6olzb2ohewQubuYlMXZ2Q/XjBO0x0XhGPvc9fjSIiUN0vw+0hq53BJ4eQSJKQ==
|
||||||
|
dependencies:
|
||||||
|
"@eslint/core" "^1.1.0"
|
||||||
|
levn "^0.4.1"
|
||||||
|
|
||||||
|
"@humanfs/core@^0.19.1":
|
||||||
|
version "0.19.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@humanfs/core/-/core-0.19.1.tgz#17c55ca7d426733fe3c561906b8173c336b40a77"
|
||||||
|
integrity sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==
|
||||||
|
|
||||||
|
"@humanfs/node@^0.16.6":
|
||||||
|
version "0.16.7"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@humanfs/node/-/node-0.16.7.tgz#822cb7b3a12c5a240a24f621b5a2413e27a45f26"
|
||||||
|
integrity sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==
|
||||||
|
dependencies:
|
||||||
|
"@humanfs/core" "^0.19.1"
|
||||||
|
"@humanwhocodes/retry" "^0.4.0"
|
||||||
|
|
||||||
|
"@humanwhocodes/module-importer@^1.0.1":
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c"
|
||||||
|
integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==
|
||||||
|
|
||||||
|
"@humanwhocodes/retry@^0.4.0", "@humanwhocodes/retry@^0.4.2":
|
||||||
|
version "0.4.3"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba"
|
||||||
|
integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==
|
||||||
|
|
||||||
"@jridgewell/gen-mapping@^0.3.12", "@jridgewell/gen-mapping@^0.3.5":
|
"@jridgewell/gen-mapping@^0.3.12", "@jridgewell/gen-mapping@^0.3.5":
|
||||||
version "0.3.13"
|
version "0.3.13"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f"
|
||||||
@@ -487,11 +563,21 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@babel/types" "^7.28.2"
|
"@babel/types" "^7.28.2"
|
||||||
|
|
||||||
"@types/estree@1.0.8":
|
"@types/esrecurse@^4.3.1":
|
||||||
|
version "4.3.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@types/esrecurse/-/esrecurse-4.3.1.tgz#6f636af962fbe6191b830bd676ba5986926bccec"
|
||||||
|
integrity sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==
|
||||||
|
|
||||||
|
"@types/estree@1.0.8", "@types/estree@^1.0.6", "@types/estree@^1.0.8":
|
||||||
version "1.0.8"
|
version "1.0.8"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e"
|
||||||
integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==
|
integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==
|
||||||
|
|
||||||
|
"@types/json-schema@^7.0.15":
|
||||||
|
version "7.0.15"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841"
|
||||||
|
integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==
|
||||||
|
|
||||||
"@types/react@^19.0.0":
|
"@types/react@^19.0.0":
|
||||||
version "19.2.14"
|
version "19.2.14"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/@types/react/-/react-19.2.14.tgz#39604929b5e3957e3a6fa0001dafb17c7af70bad"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@types/react/-/react-19.2.14.tgz#39604929b5e3957e3a6fa0001dafb17c7af70bad"
|
||||||
@@ -499,6 +585,102 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
csstype "^3.2.2"
|
csstype "^3.2.2"
|
||||||
|
|
||||||
|
"@typescript-eslint/eslint-plugin@8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.56.0.tgz#5aec3db807a6b8437ea5d5ebf7bd16b4119aba8d"
|
||||||
|
integrity sha512-lRyPDLzNCuae71A3t9NEINBiTn7swyOhvUj3MyUOxb8x6g6vPEFoOU+ZRmGMusNC3X3YMhqMIX7i8ShqhT74Pw==
|
||||||
|
dependencies:
|
||||||
|
"@eslint-community/regexpp" "^4.12.2"
|
||||||
|
"@typescript-eslint/scope-manager" "8.56.0"
|
||||||
|
"@typescript-eslint/type-utils" "8.56.0"
|
||||||
|
"@typescript-eslint/utils" "8.56.0"
|
||||||
|
"@typescript-eslint/visitor-keys" "8.56.0"
|
||||||
|
ignore "^7.0.5"
|
||||||
|
natural-compare "^1.4.0"
|
||||||
|
ts-api-utils "^2.4.0"
|
||||||
|
|
||||||
|
"@typescript-eslint/parser@8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/parser/-/parser-8.56.0.tgz#8ecff1678b8b1a742d29c446ccf5eeea7f971d72"
|
||||||
|
integrity sha512-IgSWvLobTDOjnaxAfDTIHaECbkNlAlKv2j5SjpB2v7QHKv1FIfjwMy8FsDbVfDX/KjmCmYICcw7uGaXLhtsLNg==
|
||||||
|
dependencies:
|
||||||
|
"@typescript-eslint/scope-manager" "8.56.0"
|
||||||
|
"@typescript-eslint/types" "8.56.0"
|
||||||
|
"@typescript-eslint/typescript-estree" "8.56.0"
|
||||||
|
"@typescript-eslint/visitor-keys" "8.56.0"
|
||||||
|
debug "^4.4.3"
|
||||||
|
|
||||||
|
"@typescript-eslint/project-service@8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/project-service/-/project-service-8.56.0.tgz#bb8562fecd8f7922e676fc6a1189c20dd7991d73"
|
||||||
|
integrity sha512-M3rnyL1vIQOMeWxTWIW096/TtVP+8W3p/XnaFflhmcFp+U4zlxUxWj4XwNs6HbDeTtN4yun0GNTTDBw/SvufKg==
|
||||||
|
dependencies:
|
||||||
|
"@typescript-eslint/tsconfig-utils" "^8.56.0"
|
||||||
|
"@typescript-eslint/types" "^8.56.0"
|
||||||
|
debug "^4.4.3"
|
||||||
|
|
||||||
|
"@typescript-eslint/scope-manager@8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/scope-manager/-/scope-manager-8.56.0.tgz#604030a4c6433df3728effdd441d47f45a86edb4"
|
||||||
|
integrity sha512-7UiO/XwMHquH+ZzfVCfUNkIXlp/yQjjnlYUyYz7pfvlK3/EyyN6BK+emDmGNyQLBtLGaYrTAI6KOw8tFucWL2w==
|
||||||
|
dependencies:
|
||||||
|
"@typescript-eslint/types" "8.56.0"
|
||||||
|
"@typescript-eslint/visitor-keys" "8.56.0"
|
||||||
|
|
||||||
|
"@typescript-eslint/tsconfig-utils@8.56.0", "@typescript-eslint/tsconfig-utils@^8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.56.0.tgz#2538ce83cbc376e685487960cbb24b65fe2abc4e"
|
||||||
|
integrity sha512-bSJoIIt4o3lKXD3xmDh9chZcjCz5Lk8xS7Rxn+6l5/pKrDpkCwtQNQQwZ2qRPk7TkUYhrq3WPIHXOXlbXP0itg==
|
||||||
|
|
||||||
|
"@typescript-eslint/type-utils@8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/type-utils/-/type-utils-8.56.0.tgz#72b4edc1fc73988998f1632b3ec99c2a66eaac6e"
|
||||||
|
integrity sha512-qX2L3HWOU2nuDs6GzglBeuFXviDODreS58tLY/BALPC7iu3Fa+J7EOTwnX9PdNBxUI7Uh0ntP0YWGnxCkXzmfA==
|
||||||
|
dependencies:
|
||||||
|
"@typescript-eslint/types" "8.56.0"
|
||||||
|
"@typescript-eslint/typescript-estree" "8.56.0"
|
||||||
|
"@typescript-eslint/utils" "8.56.0"
|
||||||
|
debug "^4.4.3"
|
||||||
|
ts-api-utils "^2.4.0"
|
||||||
|
|
||||||
|
"@typescript-eslint/types@8.56.0", "@typescript-eslint/types@^8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/types/-/types-8.56.0.tgz#a2444011b9a98ca13d70411d2cbfed5443b3526a"
|
||||||
|
integrity sha512-DBsLPs3GsWhX5HylbP9HNG15U0bnwut55Lx12bHB9MpXxQ+R5GC8MwQe+N1UFXxAeQDvEsEDY6ZYwX03K7Z6HQ==
|
||||||
|
|
||||||
|
"@typescript-eslint/typescript-estree@8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/typescript-estree/-/typescript-estree-8.56.0.tgz#fadbc74c14c5bac947db04980ff58bb178701c2e"
|
||||||
|
integrity sha512-ex1nTUMWrseMltXUHmR2GAQ4d+WjkZCT4f+4bVsps8QEdh0vlBsaCokKTPlnqBFqqGaxilDNJG7b8dolW2m43Q==
|
||||||
|
dependencies:
|
||||||
|
"@typescript-eslint/project-service" "8.56.0"
|
||||||
|
"@typescript-eslint/tsconfig-utils" "8.56.0"
|
||||||
|
"@typescript-eslint/types" "8.56.0"
|
||||||
|
"@typescript-eslint/visitor-keys" "8.56.0"
|
||||||
|
debug "^4.4.3"
|
||||||
|
minimatch "^9.0.5"
|
||||||
|
semver "^7.7.3"
|
||||||
|
tinyglobby "^0.2.15"
|
||||||
|
ts-api-utils "^2.4.0"
|
||||||
|
|
||||||
|
"@typescript-eslint/utils@8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/utils/-/utils-8.56.0.tgz#063ce6f702ec603de1b83ee795ed5e877d6f7841"
|
||||||
|
integrity sha512-RZ3Qsmi2nFGsS+n+kjLAYDPVlrzf7UhTffrDIKr+h2yzAlYP/y5ZulU0yeDEPItos2Ph46JAL5P/On3pe7kDIQ==
|
||||||
|
dependencies:
|
||||||
|
"@eslint-community/eslint-utils" "^4.9.1"
|
||||||
|
"@typescript-eslint/scope-manager" "8.56.0"
|
||||||
|
"@typescript-eslint/types" "8.56.0"
|
||||||
|
"@typescript-eslint/typescript-estree" "8.56.0"
|
||||||
|
|
||||||
|
"@typescript-eslint/visitor-keys@8.56.0":
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@typescript-eslint/visitor-keys/-/visitor-keys-8.56.0.tgz#7d6592ab001827d3ce052155edf7ecad19688d7d"
|
||||||
|
integrity sha512-q+SL+b+05Ud6LbEE35qe4A99P+htKTKVbyiNEe45eCbJFyh/HVK9QXwlrbz+Q4L8SOW4roxSVwXYj4DMBT7Ieg==
|
||||||
|
dependencies:
|
||||||
|
"@typescript-eslint/types" "8.56.0"
|
||||||
|
eslint-visitor-keys "^5.0.0"
|
||||||
|
|
||||||
"@vitejs/plugin-react@^5.0.0":
|
"@vitejs/plugin-react@^5.0.0":
|
||||||
version "5.1.4"
|
version "5.1.4"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz#5b477e060bf612a7394c4febacc5de33a219b0e4"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz#5b477e060bf612a7394c4febacc5de33a219b0e4"
|
||||||
@@ -511,11 +693,43 @@
|
|||||||
"@types/babel__core" "^7.20.5"
|
"@types/babel__core" "^7.20.5"
|
||||||
react-refresh "^0.18.0"
|
react-refresh "^0.18.0"
|
||||||
|
|
||||||
|
acorn-jsx@^5.3.2:
|
||||||
|
version "5.3.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
|
||||||
|
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
|
||||||
|
|
||||||
|
acorn@^8.16.0:
|
||||||
|
version "8.16.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/acorn/-/acorn-8.16.0.tgz#4ce79c89be40afe7afe8f3adb902a1f1ce9ac08a"
|
||||||
|
integrity sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==
|
||||||
|
|
||||||
|
ajv@^6.12.4:
|
||||||
|
version "6.14.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/ajv/-/ajv-6.14.0.tgz#fd067713e228210636ebb08c60bd3765d6dbe73a"
|
||||||
|
integrity sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==
|
||||||
|
dependencies:
|
||||||
|
fast-deep-equal "^3.1.1"
|
||||||
|
fast-json-stable-stringify "^2.0.0"
|
||||||
|
json-schema-traverse "^0.4.1"
|
||||||
|
uri-js "^4.2.2"
|
||||||
|
|
||||||
|
balanced-match@^4.0.2:
|
||||||
|
version "4.0.4"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/balanced-match/-/balanced-match-4.0.4.tgz#bfb10662feed8196a2c62e7c68e17720c274179a"
|
||||||
|
integrity sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==
|
||||||
|
|
||||||
baseline-browser-mapping@^2.9.0:
|
baseline-browser-mapping@^2.9.0:
|
||||||
version "2.10.0"
|
version "2.10.0"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz#5b09935025bf8a80e29130251e337c6a7fc8cbb9"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz#5b09935025bf8a80e29130251e337c6a7fc8cbb9"
|
||||||
integrity sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==
|
integrity sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA==
|
||||||
|
|
||||||
|
brace-expansion@^5.0.2:
|
||||||
|
version "5.0.3"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/brace-expansion/-/brace-expansion-5.0.3.tgz#6a9c6c268f85b53959ec527aeafe0f7300258eef"
|
||||||
|
integrity sha512-fy6KJm2RawA5RcHkLa1z/ScpBeA762UF9KmZQxwIbDtRJrgLzM10depAiEQ+CXYcoiqW1/m96OAAoke2nE9EeA==
|
||||||
|
dependencies:
|
||||||
|
balanced-match "^4.0.2"
|
||||||
|
|
||||||
browserslist@^4.24.0:
|
browserslist@^4.24.0:
|
||||||
version "4.28.1"
|
version "4.28.1"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95"
|
||||||
@@ -537,18 +751,32 @@ convert-source-map@^2.0.0:
|
|||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"
|
||||||
integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==
|
integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==
|
||||||
|
|
||||||
|
cross-spawn@^7.0.6:
|
||||||
|
version "7.0.6"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
|
||||||
|
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
|
||||||
|
dependencies:
|
||||||
|
path-key "^3.1.0"
|
||||||
|
shebang-command "^2.0.0"
|
||||||
|
which "^2.0.1"
|
||||||
|
|
||||||
csstype@^3.2.2:
|
csstype@^3.2.2:
|
||||||
version "3.2.3"
|
version "3.2.3"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/csstype/-/csstype-3.2.3.tgz#ec48c0f3e993e50648c86da559e2610995cf989a"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/csstype/-/csstype-3.2.3.tgz#ec48c0f3e993e50648c86da559e2610995cf989a"
|
||||||
integrity sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==
|
integrity sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==
|
||||||
|
|
||||||
debug@^4.1.0, debug@^4.3.1:
|
debug@^4.1.0, debug@^4.3.1, debug@^4.3.2, debug@^4.4.3:
|
||||||
version "4.4.3"
|
version "4.4.3"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/debug/-/debug-4.4.3.tgz#c6ae432d9bd9662582fce08709b038c58e9e3d6a"
|
||||||
integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==
|
integrity sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==
|
||||||
dependencies:
|
dependencies:
|
||||||
ms "^2.1.3"
|
ms "^2.1.3"
|
||||||
|
|
||||||
|
deep-is@^0.1.3:
|
||||||
|
version "0.1.4"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
|
||||||
|
integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==
|
||||||
|
|
||||||
electron-to-chromium@^1.5.263:
|
electron-to-chromium@^1.5.263:
|
||||||
version "1.5.302"
|
version "1.5.302"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/electron-to-chromium/-/electron-to-chromium-1.5.302.tgz#032a5802b31f7119269959c69fe2015d8dad5edb"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/electron-to-chromium/-/electron-to-chromium-1.5.302.tgz#032a5802b31f7119269959c69fe2015d8dad5edb"
|
||||||
@@ -591,11 +819,164 @@ escalade@^3.2.0:
|
|||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5"
|
||||||
integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==
|
integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==
|
||||||
|
|
||||||
|
escape-string-regexp@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
|
||||||
|
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
|
||||||
|
|
||||||
|
eslint-plugin-react-hooks@^7.0.1:
|
||||||
|
version "7.0.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz#66e258db58ece50723ef20cc159f8aa908219169"
|
||||||
|
integrity sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==
|
||||||
|
dependencies:
|
||||||
|
"@babel/core" "^7.24.4"
|
||||||
|
"@babel/parser" "^7.24.4"
|
||||||
|
hermes-parser "^0.25.1"
|
||||||
|
zod "^3.25.0 || ^4.0.0"
|
||||||
|
zod-validation-error "^3.5.0 || ^4.0.0"
|
||||||
|
|
||||||
|
eslint-plugin-react-refresh@^0.5.1:
|
||||||
|
version "0.5.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/eslint-plugin-react-refresh/-/eslint-plugin-react-refresh-0.5.1.tgz#d13f1cfea4718a108060a41219d1849287278adc"
|
||||||
|
integrity sha512-Y5sJsreCUdGcF4mLD70iJNa47Z6CX4MsqJoJBARDC/fBhmacSby7k73UuValr0F9M7GfWKpEqS4NMsniWkVxQw==
|
||||||
|
|
||||||
|
eslint-scope@^9.1.1:
|
||||||
|
version "9.1.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/eslint-scope/-/eslint-scope-9.1.1.tgz#f6a209486e38bd28356b5feb07d445cc99c89967"
|
||||||
|
integrity sha512-GaUN0sWim5qc8KVErfPBWmc31LEsOkrUJbvJZV+xuL3u2phMUK4HIvXlWAakfC8W4nzlK+chPEAkYOYb5ZScIw==
|
||||||
|
dependencies:
|
||||||
|
"@types/esrecurse" "^4.3.1"
|
||||||
|
"@types/estree" "^1.0.8"
|
||||||
|
esrecurse "^4.3.0"
|
||||||
|
estraverse "^5.2.0"
|
||||||
|
|
||||||
|
eslint-visitor-keys@^3.4.3:
|
||||||
|
version "3.4.3"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
|
||||||
|
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==
|
||||||
|
|
||||||
|
eslint-visitor-keys@^5.0.0, eslint-visitor-keys@^5.0.1:
|
||||||
|
version "5.0.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz#9e3c9489697824d2d4ce3a8ad12628f91e9f59be"
|
||||||
|
integrity sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==
|
||||||
|
|
||||||
|
eslint@^10:
|
||||||
|
version "10.0.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/eslint/-/eslint-10.0.1.tgz#b5c5f7706782a21590ba6451e7a30d2947273c2d"
|
||||||
|
integrity sha512-20MV9SUdeN6Jd84xESsKhRly+/vxI+hwvpBMA93s+9dAcjdCuCojn4IqUGS3lvVaqjVYGYHSRMCpeFtF2rQYxQ==
|
||||||
|
dependencies:
|
||||||
|
"@eslint-community/eslint-utils" "^4.8.0"
|
||||||
|
"@eslint-community/regexpp" "^4.12.2"
|
||||||
|
"@eslint/config-array" "^0.23.2"
|
||||||
|
"@eslint/config-helpers" "^0.5.2"
|
||||||
|
"@eslint/core" "^1.1.0"
|
||||||
|
"@eslint/plugin-kit" "^0.6.0"
|
||||||
|
"@humanfs/node" "^0.16.6"
|
||||||
|
"@humanwhocodes/module-importer" "^1.0.1"
|
||||||
|
"@humanwhocodes/retry" "^0.4.2"
|
||||||
|
"@types/estree" "^1.0.6"
|
||||||
|
ajv "^6.12.4"
|
||||||
|
cross-spawn "^7.0.6"
|
||||||
|
debug "^4.3.2"
|
||||||
|
escape-string-regexp "^4.0.0"
|
||||||
|
eslint-scope "^9.1.1"
|
||||||
|
eslint-visitor-keys "^5.0.1"
|
||||||
|
espree "^11.1.1"
|
||||||
|
esquery "^1.7.0"
|
||||||
|
esutils "^2.0.2"
|
||||||
|
fast-deep-equal "^3.1.3"
|
||||||
|
file-entry-cache "^8.0.0"
|
||||||
|
find-up "^5.0.0"
|
||||||
|
glob-parent "^6.0.2"
|
||||||
|
ignore "^5.2.0"
|
||||||
|
imurmurhash "^0.1.4"
|
||||||
|
is-glob "^4.0.0"
|
||||||
|
json-stable-stringify-without-jsonify "^1.0.1"
|
||||||
|
minimatch "^10.2.1"
|
||||||
|
natural-compare "^1.4.0"
|
||||||
|
optionator "^0.9.3"
|
||||||
|
|
||||||
|
espree@^11.1.1:
|
||||||
|
version "11.1.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/espree/-/espree-11.1.1.tgz#866f6bc9ccccd6f28876b7a6463abb281b9cb847"
|
||||||
|
integrity sha512-AVHPqQoZYc+RUM4/3Ly5udlZY/U4LS8pIG05jEjWM2lQMU/oaZ7qshzAl2YP1tfNmXfftH3ohurfwNAug+MnsQ==
|
||||||
|
dependencies:
|
||||||
|
acorn "^8.16.0"
|
||||||
|
acorn-jsx "^5.3.2"
|
||||||
|
eslint-visitor-keys "^5.0.1"
|
||||||
|
|
||||||
|
esquery@^1.7.0:
|
||||||
|
version "1.7.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/esquery/-/esquery-1.7.0.tgz#08d048f261f0ddedb5bae95f46809463d9c9496d"
|
||||||
|
integrity sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==
|
||||||
|
dependencies:
|
||||||
|
estraverse "^5.1.0"
|
||||||
|
|
||||||
|
esrecurse@^4.3.0:
|
||||||
|
version "4.3.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
|
||||||
|
integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==
|
||||||
|
dependencies:
|
||||||
|
estraverse "^5.2.0"
|
||||||
|
|
||||||
|
estraverse@^5.1.0, estraverse@^5.2.0:
|
||||||
|
version "5.3.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
|
||||||
|
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
|
||||||
|
|
||||||
|
esutils@^2.0.2:
|
||||||
|
version "2.0.3"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
|
||||||
|
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
|
||||||
|
|
||||||
|
fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
|
||||||
|
version "3.1.3"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
|
||||||
|
integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==
|
||||||
|
|
||||||
|
fast-json-stable-stringify@^2.0.0:
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633"
|
||||||
|
integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==
|
||||||
|
|
||||||
|
fast-levenshtein@^2.0.6:
|
||||||
|
version "2.0.6"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917"
|
||||||
|
integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==
|
||||||
|
|
||||||
fdir@^6.5.0:
|
fdir@^6.5.0:
|
||||||
version "6.5.0"
|
version "6.5.0"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/fdir/-/fdir-6.5.0.tgz#ed2ab967a331ade62f18d077dae192684d50d350"
|
||||||
integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==
|
integrity sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==
|
||||||
|
|
||||||
|
file-entry-cache@^8.0.0:
|
||||||
|
version "8.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f"
|
||||||
|
integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==
|
||||||
|
dependencies:
|
||||||
|
flat-cache "^4.0.0"
|
||||||
|
|
||||||
|
find-up@^5.0.0:
|
||||||
|
version "5.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
|
||||||
|
integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
|
||||||
|
dependencies:
|
||||||
|
locate-path "^6.0.0"
|
||||||
|
path-exists "^4.0.0"
|
||||||
|
|
||||||
|
flat-cache@^4.0.0:
|
||||||
|
version "4.0.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c"
|
||||||
|
integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==
|
||||||
|
dependencies:
|
||||||
|
flatted "^3.2.9"
|
||||||
|
keyv "^4.5.4"
|
||||||
|
|
||||||
|
flatted@^3.2.9:
|
||||||
|
version "3.3.3"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/flatted/-/flatted-3.3.3.tgz#67c8fad95454a7c7abebf74bb78ee74a44023358"
|
||||||
|
integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==
|
||||||
|
|
||||||
fsevents@~2.3.2, fsevents@~2.3.3:
|
fsevents@~2.3.2, fsevents@~2.3.3:
|
||||||
version "2.3.3"
|
version "2.3.3"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
|
||||||
@@ -606,6 +987,62 @@ gensync@^1.0.0-beta.2:
|
|||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"
|
||||||
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
|
integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==
|
||||||
|
|
||||||
|
glob-parent@^6.0.2:
|
||||||
|
version "6.0.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3"
|
||||||
|
integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==
|
||||||
|
dependencies:
|
||||||
|
is-glob "^4.0.3"
|
||||||
|
|
||||||
|
globals@^17.3.0:
|
||||||
|
version "17.3.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/globals/-/globals-17.3.0.tgz#8b96544c2fa91afada02747cc9731c002a96f3b9"
|
||||||
|
integrity sha512-yMqGUQVVCkD4tqjOJf3TnrvaaHDMYp4VlUSObbkIiuCPe/ofdMBFIAcBbCSRFWOnos6qRiTVStDwqPLUclaxIw==
|
||||||
|
|
||||||
|
hermes-estree@0.25.1:
|
||||||
|
version "0.25.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/hermes-estree/-/hermes-estree-0.25.1.tgz#6aeec17d1983b4eabf69721f3aa3eb705b17f480"
|
||||||
|
integrity sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==
|
||||||
|
|
||||||
|
hermes-parser@^0.25.1:
|
||||||
|
version "0.25.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/hermes-parser/-/hermes-parser-0.25.1.tgz#5be0e487b2090886c62bd8a11724cd766d5f54d1"
|
||||||
|
integrity sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==
|
||||||
|
dependencies:
|
||||||
|
hermes-estree "0.25.1"
|
||||||
|
|
||||||
|
ignore@^5.2.0:
|
||||||
|
version "5.3.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5"
|
||||||
|
integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==
|
||||||
|
|
||||||
|
ignore@^7.0.5:
|
||||||
|
version "7.0.5"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/ignore/-/ignore-7.0.5.tgz#4cb5f6cd7d4c7ab0365738c7aea888baa6d7efd9"
|
||||||
|
integrity sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==
|
||||||
|
|
||||||
|
imurmurhash@^0.1.4:
|
||||||
|
version "0.1.4"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
|
||||||
|
integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==
|
||||||
|
|
||||||
|
is-extglob@^2.1.1:
|
||||||
|
version "2.1.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
|
||||||
|
integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==
|
||||||
|
|
||||||
|
is-glob@^4.0.0, is-glob@^4.0.3:
|
||||||
|
version "4.0.3"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084"
|
||||||
|
integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==
|
||||||
|
dependencies:
|
||||||
|
is-extglob "^2.1.1"
|
||||||
|
|
||||||
|
isexe@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||||
|
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
|
||||||
|
|
||||||
js-tokens@^4.0.0:
|
js-tokens@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
|
||||||
@@ -616,11 +1053,48 @@ jsesc@^3.0.2:
|
|||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d"
|
||||||
integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==
|
integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==
|
||||||
|
|
||||||
|
json-buffer@3.0.1:
|
||||||
|
version "3.0.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13"
|
||||||
|
integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==
|
||||||
|
|
||||||
|
json-schema-traverse@^0.4.1:
|
||||||
|
version "0.4.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660"
|
||||||
|
integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==
|
||||||
|
|
||||||
|
json-stable-stringify-without-jsonify@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
|
||||||
|
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
|
||||||
|
|
||||||
json5@^2.2.3:
|
json5@^2.2.3:
|
||||||
version "2.2.3"
|
version "2.2.3"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
|
||||||
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
|
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==
|
||||||
|
|
||||||
|
keyv@^4.5.4:
|
||||||
|
version "4.5.4"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93"
|
||||||
|
integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==
|
||||||
|
dependencies:
|
||||||
|
json-buffer "3.0.1"
|
||||||
|
|
||||||
|
levn@^0.4.1:
|
||||||
|
version "0.4.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade"
|
||||||
|
integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==
|
||||||
|
dependencies:
|
||||||
|
prelude-ls "^1.2.1"
|
||||||
|
type-check "~0.4.0"
|
||||||
|
|
||||||
|
locate-path@^6.0.0:
|
||||||
|
version "6.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
|
||||||
|
integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
|
||||||
|
dependencies:
|
||||||
|
p-locate "^5.0.0"
|
||||||
|
|
||||||
lru-cache@^5.1.1:
|
lru-cache@^5.1.1:
|
||||||
version "5.1.1"
|
version "5.1.1"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
|
||||||
@@ -628,6 +1102,20 @@ lru-cache@^5.1.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
yallist "^3.0.2"
|
yallist "^3.0.2"
|
||||||
|
|
||||||
|
minimatch@^10.2.1:
|
||||||
|
version "10.2.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/minimatch/-/minimatch-10.2.2.tgz#361603ee323cfb83496fea2ae17cc44ea4e1f99f"
|
||||||
|
integrity sha512-+G4CpNBxa5MprY+04MbgOw1v7So6n5JY166pFi9KfYwT78fxScCeSNQSNzp6dpPSW2rONOps6Ocam1wFhCgoVw==
|
||||||
|
dependencies:
|
||||||
|
brace-expansion "^5.0.2"
|
||||||
|
|
||||||
|
minimatch@^9.0.5:
|
||||||
|
version "9.0.6"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/minimatch/-/minimatch-9.0.6.tgz#a7e3bccfcb3d78ec1bf8d51c9ba749080237a5c8"
|
||||||
|
integrity sha512-kQAVowdR33euIqeA0+VZTDqU+qo1IeVY+hrKYtZMio3Pg0P0vuh/kwRylLUddJhB6pf3q/botcOvRtx4IN1wqQ==
|
||||||
|
dependencies:
|
||||||
|
brace-expansion "^5.0.2"
|
||||||
|
|
||||||
ms@^2.1.3:
|
ms@^2.1.3:
|
||||||
version "2.1.3"
|
version "2.1.3"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
|
||||||
@@ -638,11 +1126,52 @@ nanoid@^3.3.11:
|
|||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b"
|
||||||
integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==
|
integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==
|
||||||
|
|
||||||
|
natural-compare@^1.4.0:
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
|
||||||
|
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
|
||||||
|
|
||||||
node-releases@^2.0.27:
|
node-releases@^2.0.27:
|
||||||
version "2.0.27"
|
version "2.0.27"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e"
|
||||||
integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==
|
integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==
|
||||||
|
|
||||||
|
optionator@^0.9.3:
|
||||||
|
version "0.9.4"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/optionator/-/optionator-0.9.4.tgz#7ea1c1a5d91d764fb282139c88fe11e182a3a734"
|
||||||
|
integrity sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==
|
||||||
|
dependencies:
|
||||||
|
deep-is "^0.1.3"
|
||||||
|
fast-levenshtein "^2.0.6"
|
||||||
|
levn "^0.4.1"
|
||||||
|
prelude-ls "^1.2.1"
|
||||||
|
type-check "^0.4.0"
|
||||||
|
word-wrap "^1.2.5"
|
||||||
|
|
||||||
|
p-limit@^3.0.2:
|
||||||
|
version "3.1.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
|
||||||
|
integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
|
||||||
|
dependencies:
|
||||||
|
yocto-queue "^0.1.0"
|
||||||
|
|
||||||
|
p-locate@^5.0.0:
|
||||||
|
version "5.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
|
||||||
|
integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
|
||||||
|
dependencies:
|
||||||
|
p-limit "^3.0.2"
|
||||||
|
|
||||||
|
path-exists@^4.0.0:
|
||||||
|
version "4.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
|
||||||
|
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
|
||||||
|
|
||||||
|
path-key@^3.1.0:
|
||||||
|
version "3.1.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375"
|
||||||
|
integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==
|
||||||
|
|
||||||
picocolors@^1.1.1:
|
picocolors@^1.1.1:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
|
||||||
@@ -662,6 +1191,21 @@ postcss@^8.5.6:
|
|||||||
picocolors "^1.1.1"
|
picocolors "^1.1.1"
|
||||||
source-map-js "^1.2.1"
|
source-map-js "^1.2.1"
|
||||||
|
|
||||||
|
prelude-ls@^1.2.1:
|
||||||
|
version "1.2.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
||||||
|
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
|
||||||
|
|
||||||
|
prettier@^3.8.1:
|
||||||
|
version "3.8.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/prettier/-/prettier-3.8.1.tgz#edf48977cf991558f4fcbd8a3ba6015ba2a3a173"
|
||||||
|
integrity sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==
|
||||||
|
|
||||||
|
punycode@^2.1.0:
|
||||||
|
version "2.3.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
|
||||||
|
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
|
||||||
|
|
||||||
react-dom@^19.0.0:
|
react-dom@^19.0.0:
|
||||||
version "19.2.4"
|
version "19.2.4"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/react-dom/-/react-dom-19.2.4.tgz#6fac6bd96f7db477d966c7ec17c1a2b1ad8e6591"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/react-dom/-/react-dom-19.2.4.tgz#6fac6bd96f7db477d966c7ec17c1a2b1ad8e6591"
|
||||||
@@ -723,6 +1267,23 @@ semver@^6.3.1:
|
|||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
|
||||||
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
|
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
|
||||||
|
|
||||||
|
semver@^7.7.3:
|
||||||
|
version "7.7.4"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a"
|
||||||
|
integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==
|
||||||
|
|
||||||
|
shebang-command@^2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea"
|
||||||
|
integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==
|
||||||
|
dependencies:
|
||||||
|
shebang-regex "^3.0.0"
|
||||||
|
|
||||||
|
shebang-regex@^3.0.0:
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
|
||||||
|
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
|
||||||
|
|
||||||
source-map-js@^1.2.1:
|
source-map-js@^1.2.1:
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"
|
||||||
@@ -736,6 +1297,28 @@ tinyglobby@^0.2.15:
|
|||||||
fdir "^6.5.0"
|
fdir "^6.5.0"
|
||||||
picomatch "^4.0.3"
|
picomatch "^4.0.3"
|
||||||
|
|
||||||
|
ts-api-utils@^2.4.0:
|
||||||
|
version "2.4.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/ts-api-utils/-/ts-api-utils-2.4.0.tgz#2690579f96d2790253bdcf1ca35d569ad78f9ad8"
|
||||||
|
integrity sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA==
|
||||||
|
|
||||||
|
type-check@^0.4.0, type-check@~0.4.0:
|
||||||
|
version "0.4.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
|
||||||
|
integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==
|
||||||
|
dependencies:
|
||||||
|
prelude-ls "^1.2.1"
|
||||||
|
|
||||||
|
typescript-eslint@^8.56.0:
|
||||||
|
version "8.56.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/typescript-eslint/-/typescript-eslint-8.56.0.tgz#f4686ccaaf2fb86daf0133820da40ca5961a2236"
|
||||||
|
integrity sha512-c7toRLrotJ9oixgdW7liukZpsnq5CZ7PuKztubGYlNppuTqhIoWfhgHo/7EU0v06gS2l/x0i2NEFK1qMIf0rIg==
|
||||||
|
dependencies:
|
||||||
|
"@typescript-eslint/eslint-plugin" "8.56.0"
|
||||||
|
"@typescript-eslint/parser" "8.56.0"
|
||||||
|
"@typescript-eslint/typescript-estree" "8.56.0"
|
||||||
|
"@typescript-eslint/utils" "8.56.0"
|
||||||
|
|
||||||
typescript@^5.6.2:
|
typescript@^5.6.2:
|
||||||
version "5.9.3"
|
version "5.9.3"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f"
|
||||||
@@ -749,6 +1332,13 @@ update-browserslist-db@^1.2.0:
|
|||||||
escalade "^3.2.0"
|
escalade "^3.2.0"
|
||||||
picocolors "^1.1.1"
|
picocolors "^1.1.1"
|
||||||
|
|
||||||
|
uri-js@^4.2.2:
|
||||||
|
version "4.4.1"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
|
||||||
|
integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==
|
||||||
|
dependencies:
|
||||||
|
punycode "^2.1.0"
|
||||||
|
|
||||||
vite@^7.0.0:
|
vite@^7.0.0:
|
||||||
version "7.3.1"
|
version "7.3.1"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/vite/-/vite-7.3.1.tgz#7f6cfe8fb9074138605e822a75d9d30b814d6507"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/vite/-/vite-7.3.1.tgz#7f6cfe8fb9074138605e822a75d9d30b814d6507"
|
||||||
@@ -763,7 +1353,34 @@ vite@^7.0.0:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
fsevents "~2.3.3"
|
fsevents "~2.3.3"
|
||||||
|
|
||||||
|
which@^2.0.1:
|
||||||
|
version "2.0.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
|
||||||
|
integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
|
||||||
|
dependencies:
|
||||||
|
isexe "^2.0.0"
|
||||||
|
|
||||||
|
word-wrap@^1.2.5:
|
||||||
|
version "1.2.5"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
|
||||||
|
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
|
||||||
|
|
||||||
yallist@^3.0.2:
|
yallist@^3.0.2:
|
||||||
version "3.1.1"
|
version "3.1.1"
|
||||||
resolved "https://nexus.beatrice.wtf/repository/npm-group/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
|
||||||
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
|
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
|
||||||
|
|
||||||
|
yocto-queue@^0.1.0:
|
||||||
|
version "0.1.0"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
||||||
|
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
|
||||||
|
|
||||||
|
"zod-validation-error@^3.5.0 || ^4.0.0":
|
||||||
|
version "4.0.2"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/zod-validation-error/-/zod-validation-error-4.0.2.tgz#bc605eba49ce0fcd598c127fee1c236be3f22918"
|
||||||
|
integrity sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==
|
||||||
|
|
||||||
|
"zod@^3.25.0 || ^4.0.0":
|
||||||
|
version "4.3.6"
|
||||||
|
resolved "https://nexus.beatrice.wtf/repository/npm-group/zod/-/zod-4.3.6.tgz#89c56e0aa7d2b05107d894412227087885ab112a"
|
||||||
|
integrity sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==
|
||||||
|
|||||||
Reference in New Issue
Block a user