diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..2306e61d --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,156 @@ +/** JS 和 TS 公用的规则 */ +const publicConfig = { + plugins: ['prettier'], + rules: { + // 启用 prettier + 'prettier/prettier': ['warn', { singleQuote: true, trailingComma: 'all' }], + + // 允许在顶层外使用 require + 'global-require': 'off', + // eslint-plugin-jsdoc 还无法识别出 TS 定义的接口 + 'jsdoc/no-undefined-types': 'off', + // 不强制要求 jsdoc + 'jsdoc/require-jsdoc': 'off', + // TS 不需要写明类型注释 + 'jsdoc/require-param-type': 'off', + 'jsdoc/require-returns-type': 'off', + // 允许使用其他的 jsdoc 标签,以便使用 typescript-json-schema + 'jsdoc/check-tag-names': 'off', + // 禁用将对象参数解构为多行 + 'jsdoc/require-param': ['warn', { checkDestructured: false }], + 'jsdoc/check-param-names': ['warn', { checkDestructured: false }], + // 允许不写返回值的描述 + 'jsdoc/require-returns': 'off', + + // 允许使用下划线命名 + 'no-underscore-dangle': 'off', + // 允许 console + 'no-console': 'off', + + // 允许 any 类型的分配 + 'no-unsafe-assignment': 'off', + // 允许在 while 的条件语句里使用括号来赋值 + 'no-cond-assign': ['off', '"except-parens"'], + + // 不检查导入模块的扩展名 + 'import/extensions': 'off', + // 禁止提醒将唯一 export 改为 default export + 'import/prefer-default-export': 'off', + // 允许使用 require + 'import/no-dynamic-require': 'off', + }, +}; + +// eslint-disable-next-line jsdoc/require-param +/** 与公用规则合并 */ +const buildConfig = ({ plugins = [], rules = {}, ...otherConfig }) => ({ + ...otherConfig, + plugins: [...publicConfig.plugins, ...plugins], + rules: { ...publicConfig.rules, ...rules }, +}); + +module.exports = { + root: true, + env: { + es2021: true, + node: true, + }, + ignorePatterns: ['dist', 'node_modules'], + overrides: [ + buildConfig({ + files: ['*.ts', '*.tsx'], + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./packages/*/tsconfig.json'], + }, + plugins: ['@typescript-eslint', 'jsdoc'], + extends: [ + 'airbnb', + 'airbnb/hooks', + 'plugin:jsdoc/recommended', + 'plugin:import/typescript', + // 'plugin:react/recommended', + 'plugin:react/jsx-runtime', + // 'plugin:react-hooks/recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:prettier/recommended', + ], + rules: { + // 使用 TS 的规则 + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': ['error'], + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': ['error'], + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { varsIgnorePattern: 'React' }, + ], + + // 自动将直接 import 的类型改为用 import type 导入 + '@typescript-eslint/consistent-type-imports': ['warn', {}], + + // 允许使用 require 导入模块。方便 Bluebird 对其进行包装 + '@typescript-eslint/no-var-requires': 'off', + // 允许不声明函数返回类型 + '@typescript-eslint/explicit-function-return-type': 'off', + // 允许使用未注释的空函数 + '@typescript-eslint/no-empty-function': 'off', + // 允许匿名的异步立即执行函数 + '@typescript-eslint/no-floating-promises': [ + 'warn', + { ignoreIIFE: true }, + ], + // 允许不显式写出导出函数的返回类型 + '@typescript-eslint/explicit-module-boundary-types': 'off', + // 禁止提醒非空断言 + '@typescript-eslint/no-non-null-assertion': 'off', + // 禁止提醒在模板表达式中使用了非字符串类型 + '@typescript-eslint/restrict-template-expressions': 'off', + // 禁用 TS 的 camelcase,用 JS 的就够了 + '@typescript-eslint/camelcase': 'off', + // 允许在 TS 允许且我已经正确处理的地方使用 Promise + '@typescript-eslint/no-misused-promises': 'off', + + // 禁止提醒使用了 any + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + // 允许访问 any 类型属性 + '@typescript-eslint/no-unsafe-member-access': 'off', + // 允许调用 any 类型变量 + '@typescript-eslint/no-unsafe-call': 'off', + // 允许分配 any 类型变量 + '@typescript-eslint/no-unsafe-assignment': 'off', + + // + // React 适配 + // + + // 使此规则支持 TS + 'react/jsx-filename-extension': [ + 'warn', + { extensions: ['.tsx', '.jsx'] }, + ], + 'react/function-component-definition': [ + 'warn', + { namedComponents: 'arrow-function' }, + ], + // 有 TS 不需要这个 + 'react/prop-types': 'off', + // 允许使用对象解构来传输 props + 'react/jsx-props-no-spreading': 'off', + }, + }), + buildConfig({ + files: ['*.js'], + extends: ['eslint:recommended', 'airbnb', 'plugin:prettier/recommended'], + rules: { + // 禁止提醒使用了 dev 的包 + 'import/no-extraneous-dependencies': 'off', + }, + }), + ], +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..de4d1f00 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist +node_modules diff --git a/ComicReadScript.code-workspace b/ComicReadScript.code-workspace new file mode 100644 index 00000000..85b2ee07 --- /dev/null +++ b/ComicReadScript.code-workspace @@ -0,0 +1,16 @@ +{ + "folders": [ + { + "path": ".", + "name": "root" + }, + { + "path": "packages/userscript", + "name": "userscript" + }, + { + "path": "packages/ui-component", + "name": "ui-component" + }, + ], +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..0ad25db4 --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + 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. + + + Copyright (C) + + 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 . + +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 +. diff --git a/README.md b/README.md new file mode 100644 index 00000000..e69de29b diff --git a/package.json b/package.json new file mode 100644 index 00000000..3dbff56e --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "comic-read-script", + "version": "0.0.1", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "hymbz", + "license": "AGPL-3.0-or-later", + "private": "true", + "workspaces": [ + "packages/*" + ], + "dependencies": { + "lodash": "^4.17.21", + "react": "^18.0.0", + "react-dom": "^18.0.0" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.20.0", + "@typescript-eslint/parser": "^5.20.0", + "eslint": "^8.13.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jsdoc": "^39.2.3", + "eslint-plugin-jsx-a11y": "^6.5.1", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-react": "^7.29.4", + "eslint-plugin-react-hooks": "^4.4.0", + "prettier": "^2.6.2", + "typescript": "^4.6.3" + } +} diff --git a/packages/ui-component/index.html b/packages/ui-component/index.html new file mode 100644 index 00000000..38f38611 --- /dev/null +++ b/packages/ui-component/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite App + + +
+ + + diff --git a/packages/ui-component/package.json b/packages/ui-component/package.json new file mode 100644 index 00000000..59f8611a --- /dev/null +++ b/packages/ui-component/package.json @@ -0,0 +1,37 @@ +{ + "name": "@crs/ui-component", + "private": true, + "type": "module", + "scripts": { + "serve": "vite", + "build": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + }, + "devDependencies": { + "@ladle/react": "^0.12.1", + "@types/node": "^17.0.25", + "@types/react": "^18.0.0", + "@types/react-dom": "^18.0.0", + "@typescript-eslint/eslint-plugin": "^5.20.0", + "@typescript-eslint/parser": "^5.20.0", + "@unocss/preset-wind": "^0.31.5", + "@vitejs/plugin-react": "^1.3.0", + "eslint": "^8.13.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-jsdoc": "^39.2.3", + "eslint-plugin-jsx-a11y": "^6.5.1", + "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-react": "^7.29.4", + "eslint-plugin-react-hooks": "^4.4.0", + "prettier": "^2.6.2", + "typescript": "^4.6.3", + "unocss": "^0.31.5", + "vite": "^2.9.5" + } +} diff --git a/packages/ui-component/src/App.tsx b/packages/ui-component/src/App.tsx new file mode 100644 index 00000000..e6838363 --- /dev/null +++ b/packages/ui-component/src/App.tsx @@ -0,0 +1,13 @@ +import { useState } from 'react'; + +const App = () => { + const [count, setCount] = useState(0); + + return ( +
+
test
+
+ ); +}; + +export default App; diff --git a/packages/ui-component/src/component/Button/Button.stories.tsx b/packages/ui-component/src/component/Button/Button.stories.tsx new file mode 100644 index 00000000..53964de3 --- /dev/null +++ b/packages/ui-component/src/component/Button/Button.stories.tsx @@ -0,0 +1,6 @@ +import component from '..'; + +export default { + title: 'Level / Sub level', +}; +export const Button = component.Button(); diff --git a/packages/ui-component/src/component/Button/index.tsx b/packages/ui-component/src/component/Button/index.tsx new file mode 100644 index 00000000..5e58e4dd --- /dev/null +++ b/packages/ui-component/src/component/Button/index.tsx @@ -0,0 +1,23 @@ +import { useState, useRef } from 'react'; + +export default () => { + console.log('import Button'); + + const Button: React.FC = () => { + const [open, setOpen] = useState(false); + + const ref = useRef() as React.MutableRefObject; + // const arrowRef = useRef() as React.MutableRefObject; + const [arrowRef, setArrowRef] = + useState | null>(null); + + return ( + <> +
Button
+
Button
+ + ); + }; + + return Button; +}; diff --git a/packages/ui-component/src/component/Manga/index.tsx b/packages/ui-component/src/component/Manga/index.tsx new file mode 100644 index 00000000..4005f4db --- /dev/null +++ b/packages/ui-component/src/component/Manga/index.tsx @@ -0,0 +1,23 @@ +import { useState, useRef } from 'react'; + +export default () => { + console.log('import Manga'); + + const Manga: React.FC = () => { + const [open, setOpen] = useState(false); + + const ref = useRef() as React.MutableRefObject; + // const arrowRef = useRef() as React.MutableRefObject; + const [arrowRef, setArrowRef] = + useState | null>(null); + + return ( + <> +
Manga
+
Manga
+ + ); + }; + + return Manga; +}; diff --git a/packages/ui-component/src/component/index.ts b/packages/ui-component/src/component/index.ts new file mode 100644 index 00000000..f0d93f50 --- /dev/null +++ b/packages/ui-component/src/component/index.ts @@ -0,0 +1,5 @@ +import Button from './Button'; + +export default { + Button, +}; diff --git a/packages/ui-component/src/main.tsx b/packages/ui-component/src/main.tsx new file mode 100644 index 00000000..9aa52ffd --- /dev/null +++ b/packages/ui-component/src/main.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App'; +import './index.css'; + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/packages/ui-component/src/vite-env.d.ts b/packages/ui-component/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/packages/ui-component/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/packages/ui-component/tsconfig.json b/packages/ui-component/tsconfig.json new file mode 100644 index 00000000..efe0ff89 --- /dev/null +++ b/packages/ui-component/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "lib": [ + "DOM", + "DOM.Iterable", + "ESNext" + ], + "composite": true, + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "Node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + }, + "include": [ + "src", + "vite.config.ts" + ] +} diff --git a/packages/ui-component/tsconfig.tsbuildinfo b/packages/ui-component/tsconfig.tsbuildinfo new file mode 100644 index 00000000..b450d587 --- /dev/null +++ b/packages/ui-component/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/.pnpm/typescript@4.6.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/.pnpm/@types+react@18.0.5/node_modules/@types/react/global.d.ts","../../node_modules/.pnpm/csstype@3.0.11/node_modules/csstype/index.d.ts","../../node_modules/.pnpm/@types+prop-types@15.7.5/node_modules/@types/prop-types/index.d.ts","../../node_modules/.pnpm/@types+scheduler@0.16.2/node_modules/@types/scheduler/tracing.d.ts","../../node_modules/.pnpm/@types+react@18.0.5/node_modules/@types/react/index.d.ts","../../node_modules/.pnpm/@types+react@18.0.5/node_modules/@types/react/jsx-runtime.d.ts","./src/app.tsx","../../node_modules/.pnpm/@types+react-dom@18.0.1/node_modules/@types/react-dom/client.d.ts","./src/main.tsx","../../node_modules/.pnpm/vite@2.9.5/node_modules/vite/types/hmrpayload.d.ts","../../node_modules/.pnpm/vite@2.9.5/node_modules/vite/types/customevent.d.ts","../../node_modules/.pnpm/vite@2.9.5/node_modules/vite/types/hot.d.ts","../../node_modules/.pnpm/vite@2.9.5/node_modules/vite/types/importmeta.d.ts","../../node_modules/.pnpm/vite@2.9.5/node_modules/vite/client.d.ts","./src/vite-env.d.ts","./src/component/button/index.tsx","./src/component/index.ts","./src/component/button/button.stories.tsx","./src/component/manga/index.tsx","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/assert.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/assert/strict.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/globals.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/async_hooks.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/buffer.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/child_process.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/cluster.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/console.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/constants.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/crypto.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/dgram.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/dns.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/dns/promises.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/domain.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/events.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/fs.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/fs/promises.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/http.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/http2.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/https.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/inspector.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/module.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/net.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/os.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/path.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/perf_hooks.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/process.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/punycode.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/querystring.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/readline.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/repl.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/stream.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/stream/promises.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/stream/consumers.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/stream/web.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/string_decoder.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/timers.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/timers/promises.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/tls.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/trace_events.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/tty.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/url.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/util.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/v8.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/vm.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/wasi.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/worker_threads.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/zlib.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/globals.global.d.ts","../../node_modules/.pnpm/@types+node@17.0.25/node_modules/@types/node/index.d.ts","../../node_modules/.pnpm/esbuild@0.14.36/node_modules/esbuild/lib/main.d.ts","../../node_modules/.pnpm/rollup@2.70.2/node_modules/rollup/dist/rollup.d.ts","../../node_modules/.pnpm/source-map-js@1.0.2/node_modules/source-map-js/source-map.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/comment.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/at-rule.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/rule.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/container.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/declaration.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/previous-map.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/input.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/css-syntax-error.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/warning.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/document.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/root.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/lazy-result.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/no-work-result.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/processor.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/result.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/node.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/list.d.ts","../../node_modules/.pnpm/postcss@8.4.12/node_modules/postcss/lib/postcss.d.ts","../../node_modules/.pnpm/vite@2.9.5/node_modules/vite/dist/node/index.d.ts","../../node_modules/.pnpm/@vitejs+plugin-react@1.3.1/node_modules/@vitejs/plugin-react/dist/index.d.ts","../../node_modules/.pnpm/@antfu+utils@0.5.1/node_modules/@antfu/utils/index.d.ts","../../node_modules/.pnpm/unconfig@0.3.3/node_modules/unconfig/dist/types-6886c41e.d.ts","../../node_modules/.pnpm/unconfig@0.3.3/node_modules/unconfig/dist/index.d.ts","../../node_modules/.pnpm/magic-string@0.25.9/node_modules/magic-string/index.d.ts","../../node_modules/.pnpm/@unocss+core@0.31.6/node_modules/@unocss/core/dist/index.d.ts","../../node_modules/.pnpm/@unocss+vite@0.31.6_vite@2.9.5/node_modules/@unocss/vite/dist/index.d.ts","../../node_modules/.pnpm/unocss@0.31.6_vite@2.9.5/node_modules/unocss/dist/vite.d.ts","../../node_modules/.pnpm/unocss@0.31.6_vite@2.9.5/node_modules/unocss/vite.d.ts","../../node_modules/.pnpm/@unocss+preset-mini@0.31.6/node_modules/@unocss/preset-mini/dist/types-f7b2c653.d.ts","../../node_modules/.pnpm/@unocss+preset-mini@0.31.6/node_modules/@unocss/preset-mini/dist/default-e6d1b2e8.d.ts","../../node_modules/.pnpm/@unocss+preset-mini@0.31.6/node_modules/@unocss/preset-mini/dist/colors-ce2fecb8.d.ts","../../node_modules/.pnpm/@unocss+preset-mini@0.31.6/node_modules/@unocss/preset-mini/dist/utilities-a7351781.d.ts","../../node_modules/.pnpm/@unocss+preset-mini@0.31.6/node_modules/@unocss/preset-mini/dist/index.d.ts","../../node_modules/.pnpm/@unocss+preset-wind@0.31.6/node_modules/@unocss/preset-wind/dist/index.d.ts","./vite.config.ts","../../node_modules/.pnpm/@types+react-dom@18.0.1/node_modules/@types/react-dom/index.d.ts","../../node_modules/.pnpm/@types+estree@0.0.39/node_modules/@types/estree/index.d.ts","../../node_modules/.pnpm/@types+json-schema@7.0.11/node_modules/@types/json-schema/index.d.ts","../../node_modules/.pnpm/@types+json5@0.0.29/node_modules/@types/json5/index.d.ts","../../node_modules/.pnpm/@types+resolve@1.17.1/node_modules/@types/resolve/index.d.ts","../../node_modules/.pnpm/@types+scheduler@0.16.2/node_modules/@types/scheduler/index.d.ts"],"fileInfos":[{"version":"3ac1b83264055b28c0165688fda6dfcc39001e9e7828f649299101c23ad0a0c3","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","2f93dda35dafec68ec217c9ce67f0f4fbbbb030c055ac312641565ad60dd7e26","aea179452def8a6152f98f63b191b84e7cbd69b0e248c91e61fb2e52328abe8c",{"version":"72704b10d97777e15f1a581b73f88273037ef752d2e50b72287bd0a90af64fe6","affectsGlobalScope":true},{"version":"dbb73d4d99be496175cb432c74c2615f78c76f4272f1d83cba11ee0ed6dbddf0","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"5075b36ab861c8c0c45377cb8c96270d7c65f0eeaf105d53fac6850da61f1027","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"e8c9f4e445a489991ca1a4232667de3ac36b07ba75ea335971fbeacf2d26fe67","affectsGlobalScope":true},{"version":"34478567f8a80171f88f2f30808beb7da15eac0538ae91282dd33dce928d98ed","affectsGlobalScope":true},{"version":"6ea9ab679ea030cf46c16a711a316078e9e02619ebaf07a7fcd16964aba88f2d","affectsGlobalScope":true},{"version":"aedb8de1abb2ff1095c153854a6df7deae4a5709c37297f9d6e9948b6806fa66","affectsGlobalScope":true},{"version":"11ffe3c281f375fff9ffdde8bbec7669b4dd671905509079f866f2354a788064","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"ea0aa24a32c073b8639aa1f3130ba0add0f0f2f76b314d9ba988a5cb91d7e3c4","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"841f34bcd947688df52cf04918b4def20032a4887c4e808ecf1e15ad717de05e","affectsGlobalScope":true},"af7fd2870746deed40e130fc0a3966de74e8f52a97ec114d0fbb35876ab05ca9","7f922cba4b5031550e679de74458dab91cf60a89a943d5229bdb7d93db78bce2","fd1374da6f974fb39feedf3dfc5d6215554bd386b73a12f980591a59e002f103","2ed12a1457cd60b31c0f44f3ea59b8bbc2ddd4a49add3165228d093878fb7c24","774044ef136a0988fcf57b36fd0985caa98fe385b5f9ee68a1731b7340b6aff4","a0b0a059575ca62004fb85797f078a0a1d044da2d5c29993f11e7ce08a1ed3b4","6527fbb9e589f6c5b3e6f45d240284d044d5530205dd7662b4a514a3bad427ce",{"version":"f62613ebe5136a0ed8c8828bdbe5c717aff2c9fed072c99d457cad4a70215070","affectsGlobalScope":true},{"version":"a5189085a767ea0ba85994cd7551ebefc7564c670b67d2de4be1f44d1a85d462","affectsGlobalScope":true},"65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5","d58071662bc09b802d5060eec76c4ac52ae228a1a45d3fc1e765af55084776d3","5497b79398f9a76faa139f0ef93750384bdab07b1385e282cd204cc5a9f29560","2573e8ec108d08d0dcf22fb5a3b7b715d04bdeda78484e8c5f6bcb6bf36d6b79","f6e4a71d70eaa6591a726e9a01534dc6efb0672c847ba0d8946d397f0918cb61","0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"c2ab70bbc7a24c42a790890739dd8a0ba9d2e15038b40dff8163a97a5d148c00","affectsGlobalScope":true},"422dbb183fdced59425ca072c8bd09efaa77ce4e2ab928ec0d8a1ce062d2a45a",{"version":"fcdcb42da18dd98dc286b1876dd425791772036012ae61263c011a76b13a190f","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","98a3ebfa494b46265634a73459050befba5da8fdc6ca0ef9b7269421780f4ff3","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","cc0b61316c4f37393f1f9595e93b673f4184e9d07f4c127165a490ec4a928668","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"bfea28e6162ed21a0aeed181b623dcf250aa79abf49e24a6b7e012655af36d81","affectsGlobalScope":true},"b8aca9d0c81abb02bec9b7621983ae65bde71da6727580070602bd2500a9ce2a","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","10d4796a130577d57003a77b95d8723530bbec84718e364aa2129fa8ffba0378","ad41bb744149e92adb06eb953da195115620a3f2ad48e7d3ae04d10762dae197","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"287b21dc1d1b9701c92e15e7dd673dfe6044b15812956377adffb6f08825b1bc","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"4cd4cff679c9b3d9239fd7bf70293ca4594583767526916af8e5d5a47d0219c7","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"3345c276cab0e76dda86c0fb79104ff915a4580ba0f3e440870e183b1baec476","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","103d70bfbeb3cd3a3f26d1705bf986322d8738c2c143f38ebb743b1e228d7444","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7",{"version":"3a2da34079a2567161c1359316a32e712404b56566c45332ac9dcee015ecce9f","affectsGlobalScope":true},"28a2e7383fd898c386ffdcacedf0ec0845e5d1a86b5a43f25b86bc315f556b79","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"9cafe917bf667f1027b2bb62e2de454ecd2119c80873ad76fc41d941089753b8","e5d6f7e77a44f7f4d3b8a08a8cfb0439aff330da22d5a78a0a9121244a23531e","54b857d9c72896e21740ad8478ffdd460a88020b5be67635ef12104afe6845d4","858d0d831826c6eb563df02f7db71c90e26deadd0938652096bea3cc14899700","d1c89db652113258e4ba4bbdf5cc7a2a3a600403d4d864a2087b95186253cd5b","11a90d2cb2eaf7fdf931a63b58279e8161f1477a1bd1e914ae026c1bbf9afed3","af18e30f3ba06e9870b61dfa4a109215caabdaa337590c51b4a044a9f338ce96","ace603f7b60599f2dcdbd71c07137b60a747dd33be540f4a294b890f9e0b89dc","7658fbdd425c656fb1849b44932ae7431e8c3198d22c65ce1490deb582743b52","7786c75c1b46e93b33c63dccf689143a5f47ff451a6b3bd9b10e4801cdeadcc2","615b7264db151461b896cd79719414d63f7b2b2100b275828e53cab95a356e2f","31491a01ed7466e0b3b0ef8407f2524683055eceb955b1d5ccf7096129468b39","f4b12f7dde4fc0e386648318481bdcfe861b566be246bebf0e8a11ebd909adf9","e8966f7c424780bb0b9d411ebe13eda8555ca15aa675603316c2952bc027b0e3","df0e5f3c4a518111d160cf3bebc9a3ac7d39c6e3bfb7a21d43c304896c3015e2","df4e2f161f74870708c2cc5e1036a6405b878496408fda1ee50d5b10e50d6601","bf791da347fb1c0ffc1e2fcd35867e64bb8355270ae26278198c521bdcf94569","0502b601548860d9eb0c7e3e591e288d0ddda9c391bf7ab00b65321a4e8a83a1","fde91356172e35b9ea68bbdf33721f7c80307a4ce65b82105eac800e9e744995","9bd5e5a4a1e66b35efe3c48ddac1116537ef86e041717f3a9b9f1e060c74efa6","d7e4a5f4ccfb749c3033fafc233073b4d1dcca0249785186c589602a81f9d86f","68161b6f3004fc10f8bb47a4986cef13c3b0728fb1ca3e1dc7316227d09b2c8d","11092a53ab654df480d5755b4425225be300ba06d05b70b9d3b7daf5e145b3dd","02d6dd49dd3cfded8ea7e3fddb6659f56bebcc5590e444517702ceb9e717af68","fb42260bbc7c430c5f09676befbb6a95a541ffa787e33c9eb70e8250a8098607","d2848ca7ad9bbfe5cfc8869e54b9df5d4af251fe965056a6e1bc9e947ca6d55c","d55e671f7befbee5c77cf04982776bbed07548b1fa243a8492a820e70e8bbe38","dd6a4b050f1016c0318291b42c98ab068e07e208b1ae8e4e27167c2b8007406f","fae67bfa22ab617e98bb4c5823c4ffe4f1aff334bb33cb0b6fadf8b07440079a","555a641c63033bd94d9717fa89bc5e4a352d6bd98e6b023aebfd63cf3496757b","fd2842d027049d4d8545df35c986e7fa376e2fb17c61f6bb63cd8613ff612c32","ecf26f77c28a2d18d0c0aeccc4c1c3db6046688e65733bae21100ee4a280af58","50f1c48f91f0a49700701081946522b12feefd584e79636ca08c7057076ca252","4d2c1a5497ce9c763319abf95a2dd6b51a1c8d327c8890812efd93b4f4ff4b75","ba2356af0767c46e945d5d215ef621b6a58ccdad32a6c80893a73f80d2fade88","4fcd1970e9e32196c1d0792337035178a77d1ae16ffb48322af5db354469fc14","67337ff6165a5224f5f9554b2bd2c0b202da4f0e3578fb9efb45cdf8842498f8","1f6f408f7ff832d9380e503def00c1b31c5898b2be7087275fb9b88c1e4c6d8c","4ac858a1cdfe24f05bada2b978cd2b74df7685de0f64fe79e67559af44a88569","ca579f66ab81fbb94022268fcb98f8eab6ad5ba3b283ef65eba4bbd7df16e9e0","89ccbe04e737ce613f5f04990271cfa84901446350b8551b0555ddf19319723b","f3e604694b624fa3f83f6684185452992088f5efb2cf136b62474aa106d6f1b6","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","8a19491eba2108d5c333c249699f40aff05ad312c04a17504573b27d91f0aede","74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"esModuleInterop":false,"jsx":4,"module":99,"skipLibCheck":true,"strict":true,"target":99,"useDefineForClassFields":true},"fileIdsList":[[114],[71,114],[74,114],[75,80,114],[76,86,87,94,103,113,114],[76,77,86,94,114],[78,114],[79,80,87,95,114],[80,103,110,114],[81,83,86,94,114],[82,114],[83,84,114],[85,86,114],[86,114],[86,87,88,103,113,114],[86,87,88,103,114],[89,94,103,113,114],[86,87,89,90,94,103,110,113,114],[89,91,103,110,113,114],[71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],[86,92,114],[93,113,114],[83,86,94,103,114],[95,114],[96,114],[74,97,114],[98,112,114,118],[99,114],[100,114],[86,101,114],[101,102,114,116],[86,103,104,105,114],[103,105,114],[103,104,114],[106,114],[107,114],[86,108,109,114],[108,109,114],[80,94,103,110,114],[111,114],[94,112,114],[75,89,100,113,114],[80,114],[103,114,115],[114,116],[114,117],[75,80,86,88,97,103,113,114,116,118],[103,114,119],[56,114],[52,53,54,55,114],[114,121],[114,147,148],[114,153],[114,149,153,154,155,156],[114,149,153],[114,149,157],[114,143,149],[114,143],[114,128],[114,128,140],[114,125,126,127,129,140],[114,131],[114,128,135,139,142],[114,130,142],[114,133,135,138,139,142],[114,133,135,136,138,139,142],[114,125,126,127,128,129,131,132,133,134,135,139,142],[114,124,125,126,127,128,129,131,132,133,134,135,136,138,139,140,141],[114,124,142],[114,135,136,137,139,142],[114,138,142],[114,128,134,139,142],[114,132,140],[114,124],[114,145,146],[114,145],[114,143,150],[114,151],[64,114],[86,87,89,91,94,103,110,113,114,119,121,122,123,142],[61,114],[62,114],[63,114],[56,57,114],[57,68,114],[57,67,114],[56,57,58,59,65,114],[65,114],[57,96,114,143,144,152,158]],"referencedMap":[[145,1],[161,1],[162,1],[163,1],[71,2],[72,2],[74,3],[75,4],[76,5],[77,6],[78,7],[79,8],[80,9],[81,10],[82,11],[83,12],[84,12],[85,13],[86,14],[87,15],[88,16],[73,1],[120,1],[89,17],[90,18],[91,19],[121,20],[92,21],[93,22],[94,23],[95,24],[96,25],[97,26],[98,27],[99,28],[100,29],[101,30],[102,31],[103,32],[105,33],[104,34],[106,35],[107,36],[108,37],[109,38],[110,39],[111,40],[112,41],[113,42],[114,43],[115,44],[116,45],[117,46],[118,47],[119,48],[54,1],[59,49],[160,49],[52,1],[56,50],[57,49],[164,51],[165,1],[55,1],[149,52],[155,53],[154,53],[157,54],[153,1],[156,55],[158,56],[150,57],[144,58],[53,1],[122,1],[148,1],[126,59],[125,60],[128,61],[132,62],[129,60],[134,63],[131,64],[136,65],[141,1],[137,66],[140,67],[142,68],[130,69],[138,70],[139,71],[135,72],[127,59],[133,73],[123,1],[124,74],[11,1],[12,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[34,1],[35,1],[36,1],[37,1],[7,1],[42,1],[38,1],[39,1],[40,1],[41,1],[8,1],[46,1],[43,1],[44,1],[45,1],[47,1],[9,1],[48,1],[49,1],[50,1],[1,1],[10,1],[51,1],[147,75],[146,76],[151,77],[152,78],[65,79],[143,80],[62,81],[61,1],[63,82],[64,83],[58,84],[69,85],[67,84],[68,86],[70,84],[60,87],[66,88],[159,89]],"exportedModulesMap":[[145,1],[161,1],[162,1],[163,1],[71,2],[72,2],[74,3],[75,4],[76,5],[77,6],[78,7],[79,8],[80,9],[81,10],[82,11],[83,12],[84,12],[85,13],[86,14],[87,15],[88,16],[73,1],[120,1],[89,17],[90,18],[91,19],[121,20],[92,21],[93,22],[94,23],[95,24],[96,25],[97,26],[98,27],[99,28],[100,29],[101,30],[102,31],[103,32],[105,33],[104,34],[106,35],[107,36],[108,37],[109,38],[110,39],[111,40],[112,41],[113,42],[114,43],[115,44],[116,45],[117,46],[118,47],[119,48],[54,1],[59,49],[160,49],[52,1],[56,50],[57,49],[164,51],[165,1],[55,1],[149,52],[155,53],[154,53],[157,54],[153,1],[156,55],[158,56],[150,57],[144,58],[53,1],[122,1],[148,1],[126,59],[125,60],[128,61],[132,62],[129,60],[134,63],[131,64],[136,65],[141,1],[137,66],[140,67],[142,68],[130,69],[138,70],[139,71],[135,72],[127,59],[133,73],[123,1],[124,74],[11,1],[12,1],[14,1],[13,1],[2,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[22,1],[3,1],[4,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[34,1],[35,1],[36,1],[37,1],[7,1],[42,1],[38,1],[39,1],[40,1],[41,1],[8,1],[46,1],[43,1],[44,1],[45,1],[47,1],[9,1],[48,1],[49,1],[50,1],[1,1],[10,1],[51,1],[147,75],[146,76],[151,77],[152,78],[65,79],[143,80],[62,81],[61,1],[63,82],[64,83],[58,84],[69,85],[67,84],[68,86],[70,84],[60,87],[66,88],[159,89]],"semanticDiagnosticsPerFile":[145,161,162,163,71,72,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,73,120,89,90,91,121,92,93,94,95,96,97,98,99,100,101,102,103,105,104,106,107,108,109,110,111,112,113,114,115,116,117,118,119,54,59,160,52,56,57,164,165,55,149,155,154,157,153,156,158,150,144,53,122,148,126,125,128,132,129,134,131,136,141,137,140,142,130,138,139,135,127,133,123,124,11,12,14,13,2,15,16,17,18,19,20,21,22,3,4,26,23,24,25,27,28,29,5,30,31,32,33,6,34,35,36,37,7,42,38,39,40,41,8,46,43,44,45,47,9,48,49,50,1,10,51,147,146,151,152,65,143,62,61,63,64,58,69,67,68,70,60,66,159],"affectedFilesPendingEmit":[[145,1],[161,1],[162,1],[163,1],[71,1],[72,1],[74,1],[75,1],[76,1],[77,1],[78,1],[79,1],[80,1],[81,1],[82,1],[83,1],[84,1],[85,1],[86,1],[87,1],[88,1],[73,1],[120,1],[89,1],[90,1],[91,1],[121,1],[92,1],[93,1],[94,1],[95,1],[96,1],[97,1],[98,1],[99,1],[100,1],[101,1],[102,1],[103,1],[105,1],[104,1],[106,1],[107,1],[108,1],[109,1],[110,1],[111,1],[112,1],[113,1],[114,1],[115,1],[116,1],[117,1],[118,1],[119,1],[54,1],[59,1],[160,1],[52,1],[56,1],[57,1],[164,1],[165,1],[55,1],[149,1],[155,1],[154,1],[157,1],[153,1],[156,1],[158,1],[150,1],[144,1],[53,1],[122,1],[148,1],[126,1],[125,1],[128,1],[132,1],[129,1],[134,1],[131,1],[136,1],[141,1],[137,1],[140,1],[142,1],[130,1],[138,1],[139,1],[135,1],[127,1],[133,1],[123,1],[124,1],[2,1],[3,1],[4,1],[5,1],[6,1],[7,1],[8,1],[9,1],[10,1],[147,1],[146,1],[151,1],[152,1],[65,1],[143,1],[62,1],[61,1],[63,1],[64,1],[58,1],[69,1],[67,1],[68,1],[70,1],[60,1],[66,1],[159,1]]},"version":"4.6.3"} \ No newline at end of file diff --git a/packages/ui-component/vite.config.ts b/packages/ui-component/vite.config.ts new file mode 100644 index 00000000..d47baf19 --- /dev/null +++ b/packages/ui-component/vite.config.ts @@ -0,0 +1,45 @@ +/* eslint-disable import/no-extraneous-dependencies */ + +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +// eslint-disable-next-line import/no-unresolved +import Unocss from 'unocss/vite'; +import presetWind from '@unocss/preset-wind'; +import * as path from 'path'; + +export default defineConfig({ + plugins: [ + react({ + // TODO:之后再尝试改为新版 + jsxRuntime: 'classic', + }), + + Unocss({ + presets: [presetWind()], + mode: 'dist-chunk', + }), + ], + + build: { + target: 'esnext', + cssCodeSplit: true, + // watch: {}, + lib: { + entry: path.resolve(__dirname, 'src/App.tsx'), + formats: ['es'], + }, + rollupOptions: { + input: { + Button: path.resolve(__dirname, 'src/component/Button/index.tsx'), + Manga: path.resolve(__dirname, 'src/component/Manga/index.tsx'), + }, + output: { + globals: { + react: 'react', + }, + entryFileNames: '[name].js', + }, + external: ['react'], + }, + }, +}); diff --git a/packages/userscript/README.md b/packages/userscript/README.md new file mode 100644 index 00000000..83a9332e --- /dev/null +++ b/packages/userscript/README.md @@ -0,0 +1,14 @@ +### dev + +通过向开发服务器请求 bundle.user.js 代码,然后用 eval 执行,来实现每次刷新都是最新的代码,也不用复制粘贴到油猴,只需要将 dev.user.js 的代码添加到油猴离去就行了。 +但如果有修改 @resource 或 @grant 之类的还是得手动更新。 + +### 动态导入外部库 + +`src\helper\import.ts` 在这个文件的 `getLib` 对象里提前声明好外部库,就能用 ``const React = await getLib.React();` 的形式来动态导入 @resource 声明的外部库了。 + +### 使用 React + +不知道为什么,就是没法使用新的 `react/jsx-runtime`,暂时就先用 `React.createElement` 吧。所以现在还需要用 `const React = await getLib.React();` 来手动把 React 导入进作用域内,再使用 JSX 语法。 + +另外为了能实现动态导入,`src\component` 内的组件不能直接 `export`,需要导出一个返回函数组件的异步函数来 `() => Promise>`。另外为了方便调用时命名(可以直接用 import 的组件名来声明变量),再在 `src\component\index.ts` 中重新声明一下。 diff --git a/packages/userscript/package.json b/packages/userscript/package.json new file mode 100644 index 00000000..d5ba8158 --- /dev/null +++ b/packages/userscript/package.json @@ -0,0 +1,40 @@ +{ + "name": "@crs/userscript", + "private": "true", + "description": "", + "main": "index.js", + "type": "module", + "scripts": { + "build": "rollup --config", + "watch": "rollup --config --watch --environment NODE_ENV:development" + }, + "author": "hymbz", + "license": "AGPL-3.0-or-later", + "dependencies": { + "@babel/runtime": "^7.17.9", + "@crs/ui-component": "workspace:*", + "axios": "^0.26.1", + "axios-userscript-adapter": "^0.1.11", + "core-js": "^3.22.0" + }, + "devDependencies": { + "@babel/core": "^7.17.9", + "@babel/plugin-transform-runtime": "^7.17.0", + "@babel/preset-env": "^7.16.11", + "@babel/preset-react": "^7.16.7", + "@rollup/plugin-babel": "^5.3.1", + "@rollup/plugin-commonjs": "^21.1.0", + "@rollup/plugin-node-resolve": "^13.2.1", + "@rollup/plugin-replace": "^4.0.0", + "@types/react": "^18.0.5", + "@types/react-dom": "^18.0.1", + "babel": "^6.23.0", + "esbuild": "^0.14.36", + "rollup": "^2.70.2", + "rollup-plugin-esbuild": "^4.9.1", + "rollup-plugin-import-css": "^3.0.3", + "rollup-plugin-serve": "^1.1.0", + "rollup-plugin-userscript-metablock": "^0.3.1", + "utility-types": "^3.10.0" + } +} diff --git a/packages/userscript/rollup.config.js b/packages/userscript/rollup.config.js new file mode 100644 index 00000000..a2cb29a6 --- /dev/null +++ b/packages/userscript/rollup.config.js @@ -0,0 +1,111 @@ +import resolve from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; +import esbuild from 'rollup-plugin-esbuild'; +import serve from 'rollup-plugin-serve'; +import replace from '@rollup/plugin-replace'; +import { babel } from '@rollup/plugin-babel'; +import css from 'rollup-plugin-import-css'; + +import metablock from 'rollup-plugin-userscript-metablock'; + +const pkg = require('./package.json'); + +const meta = { + // include: '*://localhost*', + include: '*', + connect: '*', + noframes: true, + grant: [ + 'GM.xmlHttpRequest', + 'GM.getResourceText', + 'GM.addElement', + 'unsafeWindow', + ], + resource: { + React: 'https://unpkg.com/react@18/umd/react.development.js', + ReactDOM: 'https://unpkg.com/react-dom@18/umd/react-dom.development.js', + }, + + name: pkg.name, + namespace: pkg.name, + version: pkg.version, + description: pkg.description, + author: pkg.author, + license: pkg.license, +}; + +const isDevMode = process.env.NODE_ENV === 'development'; +/** 开发服务器的端口 */ +const DEV_PORT = 2405; + +const buildConfig = (config, handleMeta = (e) => e) => ({ + plugins: [ + replace({ + DEV_PORT, + preventAssignment: true, + }), + resolve({ + browser: true, + }), + commonjs(), + css(), + esbuild({ + target: 'esnext', + }), + babel({ + targets: ['last 5 Chrome versions', 'last 5 Firefox versions'], + babelHelpers: 'runtime', + extensions: ['.ts', '.tsx', '.js'], + presets: [['@babel/preset-env'], ['@babel/preset-react']], + plugins: ['@babel/plugin-transform-runtime'], + }), + metablock({ + file: '', + override: handleMeta(meta), + }), + serve({ + contentBase: './dist', + port: DEV_PORT, + }), + ], + external: ['react'], + inlineDynamicImports: true, + + ...config, +}); + +export default async () => { + return [ + // bundle.user.js + buildConfig({ + input: 'src/index.tsx', + output: { + file: 'dist/bundle.user.js', + // format: 'umd', + sourcemap: isDevMode ? 'inline' : false, + }, + }), + // dev.user.js + buildConfig( + { + input: 'src/dev.ts', + output: { file: 'dist/dev.user.js' }, + + // 忽略使用 eval 的警告 + onwarn(warning, warn) { + if (warning.code !== 'EVAL') warn(warning); + }, + }, + ({ grant = [], ...otherMeta }) => { + return { + ...otherMeta, + + // 添加 xmlHttpRequest 权限 + grant: [...new Set([...grant, 'GM.xmlHttpRequest'])], + // 允许请求所有域 + connect: '*', + }; + }, + ), + ]; +}; diff --git a/packages/userscript/src/component/Button/index.tsx b/packages/userscript/src/component/Button/index.tsx new file mode 100644 index 00000000..e71436f3 --- /dev/null +++ b/packages/userscript/src/component/Button/index.tsx @@ -0,0 +1,26 @@ +import { getLib } from '../../helper/import'; + +export default async () => { + const React = await getLib.React(); + const { useRef, useState } = await getLib.React(); + + console.log('import Button'); + + const Button: React.FC = () => { + const [open, setOpen] = useState(false); + + const ref = useRef() as React.MutableRefObject; + // const arrowRef = useRef() as React.MutableRefObject; + const [arrowRef, setArrowRef] = + useState | null>(null); + + return ( + <> +
Button
+
Button
+ + ); + }; + + return Button; +}; diff --git a/packages/userscript/src/component/Manga/index.tsx b/packages/userscript/src/component/Manga/index.tsx new file mode 100644 index 00000000..70ff9b8c --- /dev/null +++ b/packages/userscript/src/component/Manga/index.tsx @@ -0,0 +1,26 @@ +import { getLib } from '../../helper/import'; + +export default async () => { + const React = await getLib.React(); + const { useRef, useState } = await getLib.React(); + + console.log('import Manga'); + + const Manga: React.FC = () => { + const [open, setOpen] = useState(false); + + const ref = useRef() as React.MutableRefObject; + // const arrowRef = useRef() as React.MutableRefObject; + const [arrowRef, setArrowRef] = + useState | null>(null); + + return ( + <> +
Manga
+
Manga
+ + ); + }; + + return Manga; +}; diff --git a/packages/userscript/src/component/index.ts b/packages/userscript/src/component/index.ts new file mode 100644 index 00000000..f0d93f50 --- /dev/null +++ b/packages/userscript/src/component/index.ts @@ -0,0 +1,5 @@ +import Button from './Button'; + +export default { + Button, +}; diff --git a/packages/userscript/src/dev.ts b/packages/userscript/src/dev.ts new file mode 100644 index 00000000..91c4bdf8 --- /dev/null +++ b/packages/userscript/src/dev.ts @@ -0,0 +1,16 @@ +GM.xmlHttpRequest({ + method: 'GET', + url: `http://localhost:${DEV_PORT as any}/bundle.user.js?${Date.now()}`, + timeout: 1000 * 5, + onload(r) { + if (r.status !== 200) throw new Error(`${r.status} ${r.statusText}`); + // eslint-disable-next-line no-eval + eval(`(async () => {${r.responseText}})();`); + }, + onerror: (e) => { + if (e.status === 0) throw new Error('dev server not running'); + throw new Error(String(e)); + }, +}).catch((error) => { + console.error(GM.info.script.name, error); +}); diff --git a/packages/userscript/src/helper/import.ts b/packages/userscript/src/helper/import.ts new file mode 100644 index 00000000..f1327073 --- /dev/null +++ b/packages/userscript/src/helper/import.ts @@ -0,0 +1,44 @@ +/* eslint-disable @typescript-eslint/consistent-type-imports */ + +const selfLibName = 'selfLib'; +Reflect.set(unsafeWindow, selfLibName, {}); + +/** + * 通过 Resource 导入外部模块 + * + * @param name \@resource 引用的资源名 + */ +const selfImport = async (name: string) => { + const code = await GM.getResourceText(name); + // 导入 umd 模块,同时用 call 将模块导入到 selfLib,防止污染全局作用域 + return GM.addElement('script', { + textContent: `console.log('导入:${name}');(function () {${code}}).call(window.${selfLibName});`, + }); +}; + +/** + * 获取外部模块的变量 + * + * 如果外部模块未导入,则会自动导入 + * + * @param varName 模块导入后增加的变量名 + * @param libName resource 引用的资源名 + */ +const create = + (varName: string, libName?: string): (() => Promise) => + async () => { + if (!unsafeWindow[selfLibName][varName]) + await selfImport(libName ?? varName); + return unsafeWindow[selfLibName][varName] as T; + }; + +/** + * 获取提前定义好的外部模块 + */ +export const getLib = { + React: create('React'), + ReactDOM: create('ReactDOM'), +}; + +export const React = create('React'); +export const ReactDOM = create('ReactDOM'); diff --git a/packages/userscript/src/helper/index.ts b/packages/userscript/src/helper/index.ts new file mode 100644 index 00000000..5f68171c --- /dev/null +++ b/packages/userscript/src/helper/index.ts @@ -0,0 +1,21 @@ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +import raxios from 'axios'; +import type { AxiosAdapter } from 'axios'; +import axiosGmxhrAdapter from 'axios-userscript-adapter'; + +export const axios = raxios.create({ + adapter: axiosGmxhrAdapter as AxiosAdapter, + timeout: 10 * 1000, +}); + +/** + * 对 document.querySelector 的封装 + * 将默认返回类型改为 HTMLElement + * + * @param selector * + * @returns * + */ +export const querySelector = ( + selector: string, +) => document.querySelector(selector); + diff --git a/packages/userscript/src/index.tsx b/packages/userscript/src/index.tsx new file mode 100644 index 00000000..03fb97f3 --- /dev/null +++ b/packages/userscript/src/index.tsx @@ -0,0 +1,12 @@ +import rButton from '@crs/ui-component/dist/Button'; + +import { getLib } from './helper/import'; + +// import component from './component'; + +const React = await getLib.React(); +const ReactDOM = await getLib.ReactDOM(); +const root = ReactDOM.createRoot(document.getElementById('ssr-top')!); + +const Button = await rButton(); +root.render(