Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

docs: add license header

Abdullah Attac317774c8a03
diff --git a/commitlint.config.js b/.commitlintrc.js
similarity index 100%
rename from commitlint.config.js
rename to .commitlintrc.js
diff --git a/.eslintignore b/.eslintignore
index cfa594a1b..7a35a1735 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -4,6 +4,10 @@ coverage
node_modules
dist
+# root
+resources/
+.*.*
+
# mobile
apps/mobile/native/
apps/mobile/__tests__/
diff --git a/.eslintrc.js b/.eslintrc.js
index 4dc90711a..d9f9fb936 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -27,9 +27,13 @@ module.exports = {
"unused-imports",
"detox",
"jest",
- "react-native"
+ "react-native",
+ "license-header",
+ "react-hooks"
],
rules: {
+ "react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
+ "react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
@@ -52,7 +56,8 @@ module.exports = {
],
semi: ["error", "always"],
"@typescript-eslint/no-empty-function": "off",
- "react/prop-types": "off"
+ "react/prop-types": "off",
+ "license-header/header": ["error", "./resources/license-header.js"]
},
settings: {
react: {
@@ -60,6 +65,10 @@ module.exports = {
}
},
overrides: [
+ {
+ files: ["apps/web/__e2e__/**/**/*.{jsx,tsx,ts,js}"],
+ rules: { "react-hooks/rules-of-hooks": "off" }
+ },
{
files: ["apps/mobile/**/**/*.{jsx,tsx,ts,js}"],
env: {
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 000000000..25fa6215f
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "typescript.tsdk": "node_modules/typescript/lib"
+}
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000..e72bfddab
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is 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. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ 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.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ 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 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. Use with the GNU Affero General Public License.
+
+ 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 Affero 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 special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 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 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 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 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ 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 GPL, see
+<https://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
\ No newline at end of file
diff --git a/apps/mobile/app/app.js b/apps/mobile/app/app.js
index 0e90d6544..59e66a08b 100644
--- a/apps/mobile/app/app.js
+++ b/apps/mobile/app/app.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import { GestureHandlerRootView } from "react-native-gesture-handler";
import { SafeAreaProvider } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/assets/images/assets.js b/apps/mobile/app/assets/images/assets.js
index 2ecb13ea6..20c613f74 100644
--- a/apps/mobile/app/assets/images/assets.js
+++ b/apps/mobile/app/assets/images/assets.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export const LAUNCH_ROCKET = (color) =>
`<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" width="748.82965" height="557.20035" viewBox="0 0 748.82965 557.20035" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M276.60133,642.057c-3.59968,0-7.20676.1709-10.72934.51563l-.51267.0498c-23.36542,2.37793-40.45611,16.17286-39.75323,32.08985l.13588,2.87793c.08961,1.81933.18508,3.77539.26367,5.94531.04255,1.07031,1.31106,1.8916,2.88946,1.8916H803.62751c40.52148-.2832,80.89606-.63965,119.9956-1.05957a177.65216,177.65216,0,0,0,21.95374-1.30957c10.86591-1.48047,18.40759-4.415,23.05841-8.97168h.00147c5.78332-5.65039,5.96551-12.76562,5.6159-20.80469-.71246-16.23242-1.419-33.28515-2.12414-50.28613-.62281-14.9834-1.24274-29.92676-1.86261-44.2334-.38343-8.49023-1.23536-15.98437-7.80317-21.71191-7.11865-6.19434-20.10137-9.334-38.58831-9.334-.22333,0-.44507,0-.67133.001-57.9361.23731-115.34192,23.1709-142.8454,57.06732-3.16711,3.90332-6.11822,8.082-8.97247,12.124a158.91584,158.91584,0,0,1-13.7804,17.66406,66.94863,66.94863,0,0,1-9.10321,8.16894c-.22326.17774-.47888.36817-.7492.54883-.61847.46387-1.26477.91114-1.895,1.30957a62.04148,62.04148,0,0,1-11.60926,6.07617l-.40692.15723c-.30627.126-.6383.252-.97027.36719a68.20886,68.20886,0,0,1-7.17,2.20605c-10.484,2.66016-22.40545,3.29785-35.43151,1.89356a151.75182,151.75182,0,0,1-35.2295-8.26465c-12.06244-4.38867-23.3529-9.86035-34.27173-15.15137-4.79614-2.32519-9.75683-4.72851-14.711-7.00586-.93134-.42871-1.84723-.84765-2.7771-1.2666-6.05066-2.71484-11.5365-4.957-16.77045-6.85449a146.28118,146.28118,0,0,0-39.96478-8.52149c-14.40918-.9082-27.10688.80469-37.73191,5.07911a60.6496,60.6496,0,0,0-8.53469,4.23339c-12.58466,7.52344-20.343,18.627-27.845,29.36524-9.33233,13.35644-18.98275,27.16894-38.0382,34.3291-21.98825,8.26953-54.08371,4.834-76.791-1.14062-7.13919-1.87891-14.26956-4.04-21.16565-6.13086q-4.17768-1.26719-8.36136-2.51661c-5.48071-1.6289-9.96621-2.877-14.116-3.93066l-1.31253-.33594c-.73008-.18261-1.46088-.36523-2.20493-.53906-4.92911-1.19141-9.51892-2.12891-14.03891-2.86621l-1.06943-.17969c-2.144-.32519-4.14834-.5957-6.11526-.82324l-.78516-.08984A109.23844,109.23844,0,0,0,276.60133,642.057Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><path d="M343.64,685.3514a1.19069,1.19069,0,0,1,1.18683-1.19452h510.294a1.19069,1.19069,0,0,1,0,2.38135h-510.294A1.19066,1.19066,0,0,1,343.64,685.3514Z" transform="translate(-225.58517 -171.39982)" fill="#cacaca"/><path d="M746.00469,214.43986a42.86006,42.86006,0,0,1-11.46,29.24c-.56.61-1.15,1.2-1.75,1.77a650.40347,650.40347,0,0,0-69.84-46.89c.3-.76.62-1.51.97-2.25a43.04295,43.04295,0,0,1,82.08,18.13Z" transform="translate(-225.58517 -171.39982)" fill="#ff6584"/><path d="M780.91466,302.03984l-.04.45q-42.465-2.925-84.92-5.86c-20.45-1.41-41.61-3.01-59.68-12.69-6.86005-3.67-13.54-8.57-21.32-8.91-9.65-.43-18.07,6.32-24.69,13.36-39.13,41.68-50.46,105.41-94.36,142.02a1394.13755,1394.13755,0,0,1,98.86-197.31c7.04-11.65,15.39-24.09,28.46-27.89,12.47-3.63,25.23,1.67,36.71,8.47,2.46,1.46,4.86,2.99,7.18,4.51q26.535,17.36994,52.2,36.06995Q750.82971,277.19487,780.91466,302.03984Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><path d="M872.47466,390.43986a670.65125,670.65125,0,0,0-104.75-116.27q-16.965-14.91-34.93-28.72a650.40347,650.40347,0,0,0-69.84-46.89q-11.94-6.93-24.16-13.31c-6.33-3.29-13.07-6.3-20.37-5.83a27.10218,27.10218,0,0,0-14.07,5.41c-8.97,6.55-14.91,16.78-19.8,26.53-4.28,8.55-8.27,17.27-12.34,25.94-1.73,3.69-3.46,7.37-5.25,11.03q-9.36008,19.23-19.16,38.25-12.63,24.51-25.99,48.65-28.065,50.745-59.23,99.66-45.81006,71.895-98.02,139.43c-4.27,5.51-6.03,6.79-10.36,12.26-1,1.28-2.78-.52-1.79-1.79,36.11005-45.64,67.55005-88.76,99.25-137.58q35.85-55.215,67.76-112.88,10.245-18.49494,20.06-37.22,15.885-30.315,30.67-61.2,3.9-8.13,7.72-16.32c8.09-17.33,19.87-43.1,42.62-42.75,6.69.1,12.9,2.81,18.76,5.81,5.97,3.07,11.83,6.33,17.68,9.64q3.51,1.98,6.99,4.02,13.785,8.00994,27.16,16.69,22.32,14.47494,43.46,30.68,10.035,7.695,19.77,15.74a673.54712,673.54712,0,0,1,109.09,114.31q5.74493,7.635,11.25,15.44C875.59472,390.49986,873.40472,391.75981,872.47466,390.43986Z" transform="translate(-225.58517 -171.39982)" fill="#e4e4e4"/><path d="M769.97685,261.4421c1.32186-1.47358,2.63549-2.94715,3.966-4.42072C784.43462,245.418,795.6924,233.94944,810.1,227.2973a52.4571,52.4571,0,0,1,21.97735-5.09434c7.86453.02529,15.55227,2.08825,22.819,4.97649,3.43559,1.37253,6.79554,2.93029,10.10449,4.58908,3.781,1.903,7.4945,3.93237,11.19076,5.97852q10.40791,5.75957,20.54571,12.02432,20.17137,12.46641,39.07925,26.83584,9.80167,7.45209,19.19878,15.39253,8.74029,7.37624,17.127,15.14831c1.19563,1.10307,2.98086-.68205,1.78523-1.78512-1.47357-1.37253-2.964-2.73664-4.45443-4.08388q-6.31532-5.70906-12.8329-11.19919-11.885-10.0287-24.38547-19.2827-19.43869-14.39893-40.21568-26.84427-10.38264-6.21425-21.051-11.90647c-2.14745-1.14516-4.32-2.26509-6.51759-3.32607a103.89918,103.89918,0,0,0-15.49347-6.30688,55.11725,55.11725,0,0,0-23.40035-2.29875,60.92335,60.92335,0,0,0-21.59005,7.46889c-14.14612,7.90678-25.11773,20.13318-35.795,32.06494C767.11358,260.86109,768.89058,262.65464,769.97685,261.4421Z" transform="translate(-225.58517 -171.39982)" fill="#e4e4e4"/><path d="M480.12667,381.68342l-33.89782-12.39828-16.83038-6.15579c-5.48137-2.00484-10.94957-4.28719-16.616-5.72275a26.21362,26.21362,0,0,0-15.03952.19162,34.66256,34.66256,0,0,0-11.73046,7.27166,95.19524,95.19524,0,0,0-9.62144,10.275c-3.66428,4.40365-7.27444,8.85345-10.90079,13.28835q-22.45,27.45558-44.6064,55.14948-22.1559,27.69344-44.01554,55.62218-21.91307,27.997-43.52474,56.22818-2.64747,3.45842-5.2904,6.92031c-.97346,1.275-3.16844.018-2.18124-1.275q21.77112-28.515,43.84571-56.79666,22.1289-28.3492,44.56359-56.45793,22.43425-28.10817,45.17171-55.97256,5.66458-6.94185,11.34787-13.86842c3.196-3.89521,6.356-7.83243,9.86155-11.45793,6.43462-6.65486,14.47386-12.536,24.09692-12.69554,5.65786-.09382,11.13345,1.70155,16.3902,3.60326,5.667,2.05012,11.32041,4.1386,16.98015,6.20868l34.13486,12.485,8.53372,3.12124c1.51441.55391.8602,2.99613-.67154,2.43589Z" transform="translate(-225.58517 -171.39982)" fill="#e4e4e4"/><path d="M814.56088,241.89784c17.22612-8.85335,39.28657-7.11936,55.11616,3.94157a786.11526,786.11526,0,0,0-89.43729,20.87423C792.44014,259.5639,801.98377,248.36189,814.56088,241.89784Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><path d="M869.84659,245.80893l3.31625,2.69552c-1.12172-.94344-2.28786-1.828-3.4858-2.665C869.73362,245.82965,869.79,245.8187,869.84659,245.80893Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><path d="M387.28886,381.80727c3.33682-4.06177,6.94448-8.31469,11.93551-9.96449l4.65975.18379A528.5525,528.5525,0,0,1,263.10428,532.971Q325.19657,457.38918,387.28886,381.80727Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><path d="M736.79357,610.34291l-28.21714-12.44874V587.19183l10.0561-.05651a7.46918,7.46918,0,0,0,7.044-5.10714l7.06437-21.193a7.46924,7.46924,0,0,0-7.08594-9.83122h-17.0785v-9.959h21.44024a7.46925,7.46925,0,0,0,7.27937-5.79584l4.865-21.16286a7.46923,7.46923,0,0,0-7.27937-9.14265H708.57643v-2.48975a4.97949,4.97949,0,0,0-9.959,0v2.48975H522.26028v-2.48975a4.9795,4.9795,0,0,0-9.959,0v2.48975h-20.9108a7.46923,7.46923,0,0,0-7.27937,9.14265l4.865,21.16286a7.46925,7.46925,0,0,0,7.27937,5.79584h16.04578v9.959H500.617a7.46923,7.46923,0,0,0-7.10927,9.76L500.7181,583.141a7.46925,7.46925,0,0,0,7.15123,5.17837l4.432-.0249v9.59968l-22.82269,12.44874a7.46922,7.46922,0,0,0-7.46924,7.46922v0a7.46925,7.46925,0,0,0,7.46924,7.46925h22.82269v54.77446a4.9795,4.9795,0,0,0,9.959,0V625.2814H698.61744v54.77446a4.9795,4.9795,0,0,0,9.959,0V625.2814h28.21714a7.46925,7.46925,0,0,0,7.46925-7.46925v0A7.46922,7.46922,0,0,0,736.79357,610.34291Zm-214.53329-69.298H698.61744v9.959H522.26028Zm0,56.84925v-9.65563l176.35716-.99076v10.64639Z" transform="translate(-225.58517 -171.39982)" fill="#ccc"/><path d="M315.95555,589.21408l7.98486-26.00457a87.77022,87.77022,0,0,0-35.0839-23.50552c13.12443,21.74329.40683,50.10772,5.70643,74.94591a52.79391,52.79391,0,0,0,28.27717,35.97783l12.11706,15.0135a88.46589,88.46589,0,0,0,6.50218-73.78667,85.453,85.453,0,0,0-9.89442-19.0176C324.36444,581.302,315.95555,589.21408,315.95555,589.21408Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><path d="M272.05023,592.53665l-4.45075-26.83629a87.7702,87.7702,0,0,0-41.8846-5.39169c21.444,13.60792,22.71121,44.6671,38.53194,64.53481a52.79391,52.79391,0,0,0,41.3547,19.59061l17.541,8.03374a88.466,88.466,0,0,0-27.08773-68.942,85.45248,85.45248,0,0,0-17.3374-12.60883C276.04789,581.70478,272.05023,592.53665,272.05023,592.53665Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><path d="M902.5106,479.11845,885.044,458.26383a87.77019,87.77019,0,0,1,23.18573-35.29606c-3.63882,25.13524,19.10562,46.32412,23.87929,71.26873a52.79386,52.79386,0,0,1-12.06557,44.141l-5.327,18.54322a88.4659,88.4659,0,0,1-34.67683-65.45432,85.45238,85.45238,0,0,1,1.72257-21.36823C891.68721,475.0979,902.5106,479.11845,902.5106,479.11845Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><path d="M944.2538,465.1105,937.92125,438.655a87.77005,87.77005,0,0,1,36.49358-21.25108c-14.46674,20.87426-3.55934,49.98279-10.41151,74.43825a52.79393,52.79393,0,0,1-30.48523,34.127l-13.03785,14.2212a88.46591,88.46591,0,0,1-1.84586-74.0496,85.45328,85.45328,0,0,1,11.0716-18.35724C936.35949,456.68492,944.2538,465.1105,944.2538,465.1105Z" transform="translate(-225.58517 -171.39982)" fill="#f2f2f2"/><polygon points="373.867 536.045 362.393 541.58 335.583 499.958 352.517 491.789 373.867 536.045" fill="#ffb6b6"/><path d="M600.74559,539.92239,590.54818,555.309s-60.63447,40.15326-58.10323,55.09015c.88547,5.22518,4.73286,16.21626,9.68184,28.46477,1.52072,3.76372,8.6663,11.24446,10.34108,15.11482,8.45541,19.54026,12.66545,35.17435,16.72606,37.26588,4.50965,2.33785,4.0477.48289,6.81076,4.74524l16-6s2.492-5.59411,3.72976-8.36482-.70312-4.14914-.70312-4.14914-2.34884,1.25171-1.9409-1.37838.26732-3.45993-.70312-4.14914-4.72555-7.73579-4.72555-7.73579a69.82223,69.82223,0,0,1-8.19389-16.23385c-.89266-2.521-.8037-8.56182-2-11-2.52046-5.13691-3.41208-8.92851-7.48445-11.59957,0,0,51.26687-24.90725,56.0774-36.82s-.13917-51.19588-.13917-51.19588Z" transform="translate(-225.58517 -171.39982)" fill="#2f2e41"/><path d="M605.53555,713.49,566.738,728.60018l-.19114-.49072A16.2068,16.2068,0,0,1,575.766,707.127l.001-.00038,4.99263-8.13674,15.31681.227,3.38679-1.319Z" transform="translate(-225.58517 -171.39982)" fill="#2f2e41"/><polygon points="470.462 475.448 489.209 474.029 486.873 523.483 474.17 524.444 470.462 475.448" fill="#ffb6b6"/><path d="M593.02692,553.52922c-4.3106-18.98155,7.83714,37.61669,20.4366,48.19854,4.95423,4.16091,25.69256-.14621,42.8621,1.16619a87.67112,87.67112,0,0,1,30.31954,8.23641c-2.73885,4.99134.12692,12.43982.6598,19.13657.97215,12.21694,1.951,23.45149,1.951,23.45149s-.00949,7.98466-.54308,9.04866-.26835,1.86279,1.326,3.99393-1.06716,2.12794-1.06716,2.12794-1.06715,2.128,1.326,3.99393,8.07377,7.30057,8.07377,7.30057l15.2371-1.353c.44-5.06062,1.75485-5.72611,4.64021-9.90671,2.74584-3.95613,2.11713-27.69491.18239-49.97665-.13112-1.5101,1.975-6.26147,1.83251-7.75157-1.42952-14.95072-5.64132-25.31417-7.49858-30.90816-1.28141-3.85954-7.43466-7.18789-15.75192-9.99213-1.26923-.42794-2.58886-.84367-3.94927-1.24722-22.9351-6.80347-57.45854-10.145-57.45854-10.145l-18.87706-16.79029Z" transform="translate(-225.58517 -171.39982)" fill="#2f2e41"/><path d="M698.047,693.13029l3.44938-1.14538,11.64877-9.948,9.036,3.07948.001-.00032a16.2068,16.2068,0,0,1,20.48676,10.27369l.16594.49981-39.51465,13.1209Z" transform="translate(-225.58517 -171.39982)" fill="#2f2e41"/><path d="M610.42386,444.23228l-11.34,8.635-13.676,4.20263s-5.65377,79.52833-10.74813,84.62269-.49987,5.23128-1.52352,11.84916-3.51168,20.18377-3.51168,20.18377c34.38707,18.20258,64.03233,18.69086,87.845-2.60926a5.93117,5.93117,0,0,0-3.23608-6.69462c-4.43194-2.35163,4.08556-13.32756.4636-15.16273s1.47241-17.755,1.47241-17.755l-3.34187-33.21557,2.64024-5.30957-6.44317-32.48858-11.18013-4.083-4.466-10.76026Z" transform="translate(-225.58517 -171.39982)" fill="${color}"/><circle cx="396.44756" cy="245.59574" r="22.43078" fill="#ffb6b6"/><path d="M603.31993,585.581a9.8303,9.8303,0,0,0-11.20736-10.08022l-15.98166-31.06366L567.227,560.25692l16.54148,27.07327a9.88361,9.88361,0,0,0,19.55136-1.74918Z" transform="translate(-225.58517 -171.39982)" fill="#ffb6b6"/><path d="M576.40552,577.98205l-34.27838-53.12743.11315-.24444c.12942-.28007,7.89169-17.0446,15.413-32.39983,1.15826-2.36467,2.31081-4.69592,3.42889-6.9284q.72381-1.44525,1.42605-2.83006c3.159-6.22783,5.919-11.37528,7.56649-13.8204A29.01536,29.01536,0,0,1,585.45,456.96784l.15859-.04078.15141.06312a14.72433,14.72433,0,0,1,8.76284,16.19753,104.296,104.296,0,0,1-19.35291,43.755l-5.557,7.32473,19.31154,41.98522Z" transform="translate(-225.58517 -171.39982)" fill="${color}"/><path d="M665.672,597.791v1.42726a3.15238,3.15238,0,0,1-3.1517,3.15168H557.69779a3.15237,3.15237,0,0,1-3.1517-3.15168V597.791a3.15235,3.15235,0,0,1,3.1517-3.15167H559.559a2.65083,2.65083,0,0,1-.10157-.70776V540.43129a2.645,2.645,0,0,1,2.64324-2.64334h96.01673a2.645,2.645,0,0,1,2.64325,2.64334v53.50028a2.49845,2.49845,0,0,1-.10158.70776h1.8612A3.15235,3.15235,0,0,1,665.672,597.791Z" transform="translate(-225.58517 -171.39982)" fill="#3f3d56"/><path d="M612.17439,568.01513a5.99072,5.99072,0,1,1,5.99071-5.99072A5.99747,5.99747,0,0,1,612.17439,568.01513Zm0-10.94882a4.95811,4.95811,0,1,0,4.9581,4.9581A4.96375,4.96375,0,0,0,612.17439,557.06631Z" transform="translate(-225.58517 -171.39982)" fill="#fff"/><circle cx="384.52404" cy="388.55935" r="5.47437" fill="#fff"/><path d="M694.27889,374.33627a9.83029,9.83029,0,0,0,2.35881,14.888l-7.14559,34.1951,16.87861-6.68267,4.19795-31.44773A9.88361,9.88361,0,0,0,694.279,374.33631Z" transform="translate(-225.58517 -171.39982)" fill="#ffb6b6"/><path d="M710.402,397.18741l-6.82552,62.85653-.24182.11865c-.19928.09793-8.84664,4.33935-19.46132,9.3906-1.79066.85213-1.534,4.54333-3.40547,5.42554-1.28914.60769-4.69342-1.5973-5.996-.98816-11.6023,5.42574-23.33421,10.70159-28.00981,12.13114a29.01531,29.01531,0,0,1-19.2887-.621l-.14887-.06818-.07788-.14438a14.72433,14.72433,0,0,1,3.39225-18.10082,104.29609,104.29609,0,0,1,42.58656-21.80405l8.92931-2.19087,11.43611-44.77622Z" transform="translate(-225.58517 -171.39982)" fill="${color}"/><path d="M672.18567,373.68221l2.56841,23.30916A2.84507,2.84507,0,0,0,677.47344,399h11.83939a2.84516,2.84516,0,0,0,2.71966-2.00863l2.12733-17.86534A4.32088,4.32088,0,1,0,695.274,370.998a2.8198,2.8198,0,0,0-2.15867-.998h-18.21A2.84558,2.84558,0,0,0,672.18567,373.68221Zm22.34593,4.23569,1.303-4.23569a2.8158,2.8158,0,0,0,.04308-1.506c.05574-.003.10816-.01661.1645-.01661a3.08511,3.08511,0,0,1,0,6.17022A3.04612,3.04612,0,0,1,694.5316,377.9179Z" transform="translate(-225.58517 -171.39982)" fill="#3f3d56"/><path d="M640.30289,397.72555c-1.84465-5.36654-11.02746-9.08881-25.91418-9.60638s-18.66227,17.02576-18.66227,17.02576c-9.938,8.06174,10.61182,29.64505,11.606,28.86767l-.447-4.05508C606.1452,423.24079,603,418,607,411l3.841.0441q7.441,1.43086,14.882,2.8617l-5.87291-5.17092.1656-.25624a22.7265,22.7265,0,0,0,8.01667,2.43412c3.15652.18554,6.6074-1.0707,8.11933-3.84781a6.46562,6.46562,0,0,0,.72539-2.46008c4.25656,1.70064,6.203,6.94811,6.203,6.94811S642.14753,403.09209,640.30289,397.72555Z" transform="translate(-225.58517 -171.39982)" fill="#2f2e41"/></svg>`;
diff --git a/apps/mobile/app/common/analytics/index.js b/apps/mobile/app/common/analytics/index.js
index 2d2216555..7ce74ca3d 100644
--- a/apps/mobile/app/common/analytics/index.js
+++ b/apps/mobile/app/common/analytics/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import { MMKV } from "../database/mmkv";
import { useSettingStore } from "../../stores/use-setting-store";
diff --git a/apps/mobile/app/common/database/encryption.js b/apps/mobile/app/common/database/encryption.js
index 8eaadb055..c3441f0e9 100644
--- a/apps/mobile/app/common/database/encryption.js
+++ b/apps/mobile/app/common/database/encryption.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import "react-native-get-random-values";
import * as Keychain from "react-native-keychain";
diff --git a/apps/mobile/app/common/database/index.js b/apps/mobile/app/common/database/index.js
index c79bfa10f..f2764f3cd 100644
--- a/apps/mobile/app/common/database/index.js
+++ b/apps/mobile/app/common/database/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Database from "@notesnook/core/api/index";
import { initalize, logger as dbLogger } from "@notesnook/core/logger";
import { Platform } from "react-native";
diff --git a/apps/mobile/app/common/database/mmkv.js b/apps/mobile/app/common/database/mmkv.js
index 347cd765a..059cb3726 100644
--- a/apps/mobile/app/common/database/mmkv.js
+++ b/apps/mobile/app/common/database/mmkv.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import MMKVStorage, { ProcessingModes } from "react-native-mmkv-storage";
diff --git a/apps/mobile/app/common/database/storage.js b/apps/mobile/app/common/database/storage.js
index 8f220e0b4..57baf52a4 100644
--- a/apps/mobile/app/common/database/storage.js
+++ b/apps/mobile/app/common/database/storage.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import RNFetchBlob from "rn-fetch-blob";
import {
diff --git a/apps/mobile/app/common/filesystem/download.js b/apps/mobile/app/common/filesystem/download.js
index 409bf2542..ff5069b33 100644
--- a/apps/mobile/app/common/filesystem/download.js
+++ b/apps/mobile/app/common/filesystem/download.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import NetInfo from "@react-native-community/netinfo";
import hosts from "@notesnook/core/utils/constants";
import React from "react";
diff --git a/apps/mobile/app/common/filesystem/index.js b/apps/mobile/app/common/filesystem/index.js
index 2c9720277..b792ccca6 100644
--- a/apps/mobile/app/common/filesystem/index.js
+++ b/apps/mobile/app/common/filesystem/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
downloadAttachment,
downloadFile,
diff --git a/apps/mobile/app/common/filesystem/io.js b/apps/mobile/app/common/filesystem/io.js
index 001b7a565..a9bf0c84c 100644
--- a/apps/mobile/app/common/filesystem/io.js
+++ b/apps/mobile/app/common/filesystem/io.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import Sodium from "react-native-sodium";
import RNFetchBlob from "rn-fetch-blob";
diff --git a/apps/mobile/app/common/filesystem/upload.js b/apps/mobile/app/common/filesystem/upload.js
index 4905fb0e0..5da57f46f 100644
--- a/apps/mobile/app/common/filesystem/upload.js
+++ b/apps/mobile/app/common/filesystem/upload.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import RNFetchBlob from "rn-fetch-blob";
import { useAttachmentStore } from "../../stores/use-attachment-store";
import { db } from "../database";
diff --git a/apps/mobile/app/common/filesystem/utils.js b/apps/mobile/app/common/filesystem/utils.js
index 3d1cbbfa2..0a04f3ead 100644
--- a/apps/mobile/app/common/filesystem/utils.js
+++ b/apps/mobile/app/common/filesystem/utils.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import RNFetchBlob from "rn-fetch-blob";
export const cacheDir = RNFetchBlob.fs.dirs.CacheDir;
diff --git a/apps/mobile/app/common/logger/index.ts b/apps/mobile/app/common/logger/index.ts
index 6d9ae8814..d96ae6848 100644
--- a/apps/mobile/app/common/logger/index.ts
+++ b/apps/mobile/app/common/logger/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
function info(context: string, ...logs: unknown[]) {
console.log(`${new Date().toLocaleDateString()}::info::${context}:`, ...logs);
}
diff --git a/apps/mobile/app/components/announcements/announcement.js b/apps/mobile/app/components/announcements/announcement.js
index 3a30fc872..212950c75 100644
--- a/apps/mobile/app/components/announcements/announcement.js
+++ b/apps/mobile/app/components/announcements/announcement.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { FlatList, View } from "react-native";
import { useSelectionStore } from "../../stores/use-selection-store";
diff --git a/apps/mobile/app/components/announcements/body.js b/apps/mobile/app/components/announcements/body.js
index 85cd89532..66c17f0d9 100644
--- a/apps/mobile/app/components/announcements/body.js
+++ b/apps/mobile/app/components/announcements/body.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import Paragraph from "../ui/typography/paragraph";
import { getStyle } from "./functions";
diff --git a/apps/mobile/app/components/announcements/cta.js b/apps/mobile/app/components/announcements/cta.js
index a07a3314c..07d5ed3ab 100644
--- a/apps/mobile/app/components/announcements/cta.js
+++ b/apps/mobile/app/components/announcements/cta.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Linking, View } from "react-native";
//import SettingsBackupAndRestore from '../../screens/settings/backup-restore';
diff --git a/apps/mobile/app/components/announcements/description.js b/apps/mobile/app/components/announcements/description.js
index 49f9fed1c..60fe76d6a 100644
--- a/apps/mobile/app/components/announcements/description.js
+++ b/apps/mobile/app/components/announcements/description.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { SIZE } from "../../utils/size";
import Paragraph from "../ui/typography/paragraph";
diff --git a/apps/mobile/app/components/announcements/functions.js b/apps/mobile/app/components/announcements/functions.js
index 530421a08..b912ed626 100644
--- a/apps/mobile/app/components/announcements/functions.js
+++ b/apps/mobile/app/components/announcements/functions.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { Fragment } from "react";
import { View } from "react-native";
import { allowedPlatforms } from "../../stores/use-message-store";
diff --git a/apps/mobile/app/components/announcements/index.js b/apps/mobile/app/components/announcements/index.js
index b55f9df1a..45b959cc1 100644
--- a/apps/mobile/app/components/announcements/index.js
+++ b/apps/mobile/app/components/announcements/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { FlatList, View } from "react-native";
import { DDS } from "../../services/device-detection";
diff --git a/apps/mobile/app/components/announcements/list.js b/apps/mobile/app/components/announcements/list.js
index 201964602..c84594bb0 100644
--- a/apps/mobile/app/components/announcements/list.js
+++ b/apps/mobile/app/components/announcements/list.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/announcements/photo.js b/apps/mobile/app/components/announcements/photo.js
index 099e849c1..7e6a108fa 100644
--- a/apps/mobile/app/components/announcements/photo.js
+++ b/apps/mobile/app/components/announcements/photo.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Image } from "react-native";
import { getStyle } from "./functions";
diff --git a/apps/mobile/app/components/announcements/subheading.js b/apps/mobile/app/components/announcements/subheading.js
index 99cd2c61e..b4f4ca07d 100644
--- a/apps/mobile/app/components/announcements/subheading.js
+++ b/apps/mobile/app/components/announcements/subheading.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { SIZE } from "../../utils/size";
import Heading from "../ui/typography/heading";
diff --git a/apps/mobile/app/components/announcements/title.js b/apps/mobile/app/components/announcements/title.js
index bf931e62f..f1509a3a6 100644
--- a/apps/mobile/app/components/announcements/title.js
+++ b/apps/mobile/app/components/announcements/title.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { useMessageStore } from "../../stores/use-message-store";
diff --git a/apps/mobile/app/components/attachments/actions.js b/apps/mobile/app/components/attachments/actions.js
index a15ed94b7..d32619453 100644
--- a/apps/mobile/app/components/attachments/actions.js
+++ b/apps/mobile/app/components/attachments/actions.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React, { useEffect, useState } from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/components/attachments/attachment-item.js b/apps/mobile/app/components/attachments/attachment-item.js
index a6bffe861..a0d32590b 100644
--- a/apps/mobile/app/components/attachments/attachment-item.js
+++ b/apps/mobile/app/components/attachments/attachment-item.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { TouchableOpacity, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/attachments/index.js b/apps/mobile/app/components/attachments/index.js
index bac25ccc4..a0f08b89e 100644
--- a/apps/mobile/app/components/attachments/index.js
+++ b/apps/mobile/app/components/attachments/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import { FlatList } from "react-native-gesture-handler";
diff --git a/apps/mobile/app/components/auth/auth-modal.js b/apps/mobile/app/components/auth/auth-modal.js
index 1dcdc0db1..2ced675f3 100644
--- a/apps/mobile/app/components/auth/auth-modal.js
+++ b/apps/mobile/app/components/auth/auth-modal.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { Platform, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/components/auth/background.js b/apps/mobile/app/components/auth/background.js
index a3a559caf..acca044e1 100644
--- a/apps/mobile/app/components/auth/background.js
+++ b/apps/mobile/app/components/auth/background.js
@@ -1,2 +1,20 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export const SVG = (color) =>
`<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" width="1920" height="1080" preserveAspectRatio="none" viewBox="0 0 1920 1080"><g fill="none"><path d="M684.78-215.3C516.78-49.87 619.54 659.12 349.29 666.13 79.03 673.14-116.04 204.76-321.7 180.13" stroke="${color}" stroke-width="2"></path><path d="M1337.71-20.29C1105.2 122.03 1140.53 887.64 809.58 933.71 478.63 979.78 545.52 798.71 281.45 798.71 17.39 798.71-110.41 932.65-246.68 933.71" stroke="${color}" stroke-width="2"></path><path d="M1631.89-52.3C1379.35-21.93 1283.05 511.66 808.42 545.28 333.79 578.9 209.15 894.14-15.05 901.68" stroke="${color}" stroke-width="2"></path><path d="M1523.21-71.7C1244.4-46.38 1056.2 532.95 581.02 533.49 105.84 534.03-109.4 182.98-361.17 177.09" stroke="${color}" stroke-width="2"></path><path d="M1333.35-39.1C1041.86 57 974.42 893.52 550.36 906.48 126.3 919.44-23.8 619.56-232.63 614.88" stroke="${color}" stroke-width="2"></path></g><defs><mask id="SvgjsMask1032"><rect width="1920" height="1080" fill="#ffffff"></rect></mask></defs></svg>`;
diff --git a/apps/mobile/app/components/auth/change-password.js b/apps/mobile/app/components/auth/change-password.js
index 626fbd410..30fefaaae 100644
--- a/apps/mobile/app/components/auth/change-password.js
+++ b/apps/mobile/app/components/auth/change-password.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useRef, useState } from "react";
import { View } from "react-native";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/components/auth/common.js b/apps/mobile/app/components/auth/common.js
index eed930f2e..28839bbb8 100644
--- a/apps/mobile/app/components/auth/common.js
+++ b/apps/mobile/app/components/auth/common.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { createRef } from "react";
import { eSendEvent } from "../../services/event-manager";
import { eCloseLoginDialog } from "../../utils/events";
diff --git a/apps/mobile/app/components/auth/forgot-password.js b/apps/mobile/app/components/auth/forgot-password.js
index f141f0288..b28394d46 100644
--- a/apps/mobile/app/components/auth/forgot-password.js
+++ b/apps/mobile/app/components/auth/forgot-password.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useRef, useState } from "react";
import { View } from "react-native";
import ActionSheet from "react-native-actions-sheet";
diff --git a/apps/mobile/app/components/auth/index.js b/apps/mobile/app/components/auth/index.js
index e3a8f95a0..0c5deb2ea 100644
--- a/apps/mobile/app/components/auth/index.js
+++ b/apps/mobile/app/components/auth/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useState } from "react";
import { View } from "react-native";
import { useNavigationFocus } from "../../hooks/use-navigation-focus";
diff --git a/apps/mobile/app/components/auth/login.js b/apps/mobile/app/components/auth/login.js
index 6a5e7cd44..e0a5325ae 100644
--- a/apps/mobile/app/components/auth/login.js
+++ b/apps/mobile/app/components/auth/login.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import { SheetManager } from "react-native-actions-sheet";
diff --git a/apps/mobile/app/components/auth/session-expired.js b/apps/mobile/app/components/auth/session-expired.js
index e2be40e5c..f9fc1fa7a 100644
--- a/apps/mobile/app/components/auth/session-expired.js
+++ b/apps/mobile/app/components/auth/session-expired.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { Modal, View } from "react-native";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/components/auth/signup.js b/apps/mobile/app/components/auth/signup.js
index bd2acbfaf..ac098672f 100644
--- a/apps/mobile/app/components/auth/signup.js
+++ b/apps/mobile/app/components/auth/signup.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useRef, useState } from "react";
import { Dimensions, View } from "react-native";
import Animated, { FadeInDown, FadeOutUp } from "react-native-reanimated";
diff --git a/apps/mobile/app/components/auth/two-factor.js b/apps/mobile/app/components/auth/two-factor.js
index 5fd5251e8..14703f199 100644
--- a/apps/mobile/app/components/auth/two-factor.js
+++ b/apps/mobile/app/components/auth/two-factor.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import { db } from "../../common/database/index";
diff --git a/apps/mobile/app/components/container/container-header.js b/apps/mobile/app/components/container/container-header.js
index 6c13fd2b5..0e673b299 100644
--- a/apps/mobile/app/components/container/container-header.js
+++ b/apps/mobile/app/components/container/container-header.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { useSelectionStore } from "../../stores/use-selection-store";
diff --git a/apps/mobile/app/components/container/floating-button.js b/apps/mobile/app/components/container/floating-button.js
index a42c6d05a..7bfd08ed8 100644
--- a/apps/mobile/app/components/container/floating-button.js
+++ b/apps/mobile/app/components/container/floating-button.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import { Keyboard, Platform, View } from "react-native";
import Animated, {
diff --git a/apps/mobile/app/components/container/index.js b/apps/mobile/app/components/container/index.js
index e59cdbad1..dbb1abf75 100644
--- a/apps/mobile/app/components/container/index.js
+++ b/apps/mobile/app/components/container/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { KeyboardAvoidingView, Platform, SafeAreaView } from "react-native";
import useIsFloatingKeyboard from "../../hooks/use-is-floating-keyboard";
diff --git a/apps/mobile/app/components/delay-layout/default-placeholder.tsx b/apps/mobile/app/components/delay-layout/default-placeholder.tsx
index 7e0ce7623..20f010c80 100644
--- a/apps/mobile/app/components/delay-layout/default-placeholder.tsx
+++ b/apps/mobile/app/components/delay-layout/default-placeholder.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { useMessageStore } from "../../stores/use-message-store";
diff --git a/apps/mobile/app/components/delay-layout/index.tsx b/apps/mobile/app/components/delay-layout/index.tsx
index 1be80379b..f588c2d05 100644
--- a/apps/mobile/app/components/delay-layout/index.tsx
+++ b/apps/mobile/app/components/delay-layout/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ViewProps } from "react-native";
import Animated, { FadeOutUp } from "react-native-reanimated";
diff --git a/apps/mobile/app/components/delay-layout/settings-placeholder.tsx b/apps/mobile/app/components/delay-layout/settings-placeholder.tsx
index 6e7e8ea97..358849c87 100644
--- a/apps/mobile/app/components/delay-layout/settings-placeholder.tsx
+++ b/apps/mobile/app/components/delay-layout/settings-placeholder.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { useThemeStore } from "../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/dialog-provider/index.js b/apps/mobile/app/components/dialog-provider/index.js
index ddeb06178..803894ac3 100644
--- a/apps/mobile/app/components/dialog-provider/index.js
+++ b/apps/mobile/app/components/dialog-provider/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { useNoteStore } from "../../stores/use-notes-store";
import { useThemeStore } from "../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/dialog-provider/recievers.js b/apps/mobile/app/components/dialog-provider/recievers.js
index 54da9358d..3e9e0a3dc 100644
--- a/apps/mobile/app/components/dialog-provider/recievers.js
+++ b/apps/mobile/app/components/dialog-provider/recievers.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { eSendEvent } from "../../services/event-manager";
import {
eCloseActionSheet,
diff --git a/apps/mobile/app/components/dialog/base-dialog.js b/apps/mobile/app/components/dialog/base-dialog.js
index 9e9a0fcca..17cfc092c 100644
--- a/apps/mobile/app/components/dialog/base-dialog.js
+++ b/apps/mobile/app/components/dialog/base-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import {
KeyboardAvoidingView,
diff --git a/apps/mobile/app/components/dialog/dialog-buttons.js b/apps/mobile/app/components/dialog/dialog-buttons.js
index 774c9384f..7c8dfe185 100644
--- a/apps/mobile/app/components/dialog/dialog-buttons.js
+++ b/apps/mobile/app/components/dialog/dialog-buttons.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ActivityIndicator, StyleSheet, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/dialog/dialog-container.js b/apps/mobile/app/components/dialog/dialog-container.js
index 7aa2ddc4a..d9affd111 100644
--- a/apps/mobile/app/components/dialog/dialog-container.js
+++ b/apps/mobile/app/components/dialog/dialog-container.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { DDS } from "../../services/device-detection";
diff --git a/apps/mobile/app/components/dialog/dialog-header.tsx b/apps/mobile/app/components/dialog/dialog-header.tsx
index cca2951f4..89dd6aaa1 100644
--- a/apps/mobile/app/components/dialog/dialog-header.tsx
+++ b/apps/mobile/app/components/dialog/dialog-header.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Text, View } from "react-native";
import { useThemeStore } from "../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/dialog/functions.ts b/apps/mobile/app/components/dialog/functions.ts
index 29f04d575..d38c20094 100644
--- a/apps/mobile/app/components/dialog/functions.ts
+++ b/apps/mobile/app/components/dialog/functions.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { eSendEvent } from "../../services/event-manager";
import { eCloseSimpleDialog, eOpenSimpleDialog } from "../../utils/events";
diff --git a/apps/mobile/app/components/dialog/index.js b/apps/mobile/app/components/dialog/index.js
index 8b1ace5d4..e74abd619 100644
--- a/apps/mobile/app/components/dialog/index.js
+++ b/apps/mobile/app/components/dialog/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import { DDS } from "../../services/device-detection";
diff --git a/apps/mobile/app/components/dialogs/add-topic/index.js b/apps/mobile/app/components/dialogs/add-topic/index.js
index 001658a7b..9feb23ed1 100644
--- a/apps/mobile/app/components/dialogs/add-topic/index.js
+++ b/apps/mobile/app/components/dialogs/add-topic/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { createRef } from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/components/dialogs/jump-to-section/index.js b/apps/mobile/app/components/dialogs/jump-to-section/index.js
index 8fc1841a6..906692a37 100644
--- a/apps/mobile/app/components/dialogs/jump-to-section/index.js
+++ b/apps/mobile/app/components/dialogs/jump-to-section/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { ScrollView, View } from "react-native";
import { DDS } from "../../../services/device-detection";
diff --git a/apps/mobile/app/components/dialogs/result/index.js b/apps/mobile/app/components/dialogs/result/index.js
index 52d3df2b3..51aa548e0 100644
--- a/apps/mobile/app/components/dialogs/result/index.js
+++ b/apps/mobile/app/components/dialogs/result/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import { DDS } from "../../../services/device-detection";
diff --git a/apps/mobile/app/components/dialogs/result/pro-features.js b/apps/mobile/app/components/dialogs/result/pro-features.js
index e63551101..9fb2189a2 100644
--- a/apps/mobile/app/components/dialogs/result/pro-features.js
+++ b/apps/mobile/app/components/dialogs/result/pro-features.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/dialogs/vault/index.js b/apps/mobile/app/components/dialogs/vault/index.js
index 4014fb683..499dcaaac 100644
--- a/apps/mobile/app/components/dialogs/vault/index.js
+++ b/apps/mobile/app/components/dialogs/vault/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React, { Component, createRef } from "react";
import { InteractionManager, View } from "react-native";
diff --git a/apps/mobile/app/components/exception-handler/index.tsx b/apps/mobile/app/components/exception-handler/index.tsx
index bc1a47614..9c6593b19 100644
--- a/apps/mobile/app/components/exception-handler/index.tsx
+++ b/apps/mobile/app/components/exception-handler/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import RNBootSplash from "react-native-bootsplash";
import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/components/header/index.js b/apps/mobile/app/components/header/index.js
index cfce6f621..e30998b2d 100644
--- a/apps/mobile/app/components/header/index.js
+++ b/apps/mobile/app/components/header/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { Platform, StyleSheet, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/components/header/left-menus.js b/apps/mobile/app/components/header/left-menus.js
index 67835b88b..83ea4f6f0 100644
--- a/apps/mobile/app/components/header/left-menus.js
+++ b/apps/mobile/app/components/header/left-menus.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { notesnook } from "../../../e2e/test.ids";
import { DDS } from "../../services/device-detection";
diff --git a/apps/mobile/app/components/header/right-menus.js b/apps/mobile/app/components/header/right-menus.js
index 811e500fc..1913ee0ce 100644
--- a/apps/mobile/app/components/header/right-menus.js
+++ b/apps/mobile/app/components/header/right-menus.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useRef } from "react";
import { Platform, StyleSheet, View } from "react-native";
import Menu from "react-native-reanimated-material-menu";
diff --git a/apps/mobile/app/components/header/title.js b/apps/mobile/app/components/header/title.js
index 08cc4be6c..2e79a62b6 100644
--- a/apps/mobile/app/components/header/title.js
+++ b/apps/mobile/app/components/header/title.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { Platform, View } from "react-native";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/components/image-preview/index.js b/apps/mobile/app/components/image-preview/index.js
index 95d975ee5..0129f60be 100644
--- a/apps/mobile/app/components/image-preview/index.js
+++ b/apps/mobile/app/components/image-preview/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import ImageViewer from "react-native-image-zoom-viewer";
diff --git a/apps/mobile/app/components/intro/index.js b/apps/mobile/app/components/intro/index.js
index 85da6f239..3f90eb698 100644
--- a/apps/mobile/app/components/intro/index.js
+++ b/apps/mobile/app/components/intro/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import {
Dimensions,
diff --git a/apps/mobile/app/components/intro/welcome.js b/apps/mobile/app/components/intro/welcome.js
index 845d43a54..fc138af6e 100644
--- a/apps/mobile/app/components/intro/welcome.js
+++ b/apps/mobile/app/components/intro/welcome.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import Animated, { FadeInDown } from "react-native-reanimated";
import umami from "../../common/analytics";
diff --git a/apps/mobile/app/components/launcher/index.js b/apps/mobile/app/components/launcher/index.js
index 0348ddc7a..d69e441f7 100644
--- a/apps/mobile/app/components/launcher/index.js
+++ b/apps/mobile/app/components/launcher/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef } from "react";
import { Platform, View } from "react-native";
import RNBootSplash from "react-native-bootsplash";
diff --git a/apps/mobile/app/components/list-items/footer/index.js b/apps/mobile/app/components/list-items/footer/index.js
index b9976c4c3..53b05cdb5 100644
--- a/apps/mobile/app/components/list-items/footer/index.js
+++ b/apps/mobile/app/components/list-items/footer/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { View } from "react-native";
import React from "react";
export const Footer = () => {
diff --git a/apps/mobile/app/components/list-items/headers/header.js b/apps/mobile/app/components/list-items/headers/header.js
index 2fcf5fa7d..c36e1958d 100644
--- a/apps/mobile/app/components/list-items/headers/header.js
+++ b/apps/mobile/app/components/list-items/headers/header.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { useThemeStore } from "../../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/list-items/headers/notebook-header.js b/apps/mobile/app/components/list-items/headers/notebook-header.js
index 76033c599..2f679ac1b 100644
--- a/apps/mobile/app/components/list-items/headers/notebook-header.js
+++ b/apps/mobile/app/components/list-items/headers/notebook-header.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useRef, useState } from "react";
import React from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/components/list-items/headers/section-header.js b/apps/mobile/app/components/list-items/headers/section-header.js
index 3e275a008..08cdde531 100644
--- a/apps/mobile/app/components/list-items/headers/section-header.js
+++ b/apps/mobile/app/components/list-items/headers/section-header.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { TouchableOpacity, useWindowDimensions, View } from "react-native";
import { useThemeStore } from "../../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/list-items/note/index.js b/apps/mobile/app/components/list-items/note/index.js
index 42ee67892..a8cafa246 100644
--- a/apps/mobile/app/components/list-items/note/index.js
+++ b/apps/mobile/app/components/list-items/note/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { decode, EntityLevel } from "entities";
import React from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/components/list-items/note/wrapper.js b/apps/mobile/app/components/list-items/note/wrapper.js
index 4bdb80684..c64a5af75 100644
--- a/apps/mobile/app/components/list-items/note/wrapper.js
+++ b/apps/mobile/app/components/list-items/note/wrapper.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import NoteItem from ".";
import { notesnook } from "../../../../e2e/test.ids";
diff --git a/apps/mobile/app/components/list-items/notebook/index.js b/apps/mobile/app/components/list-items/notebook/index.js
index 822f3acd7..1e228bc46 100644
--- a/apps/mobile/app/components/list-items/notebook/index.js
+++ b/apps/mobile/app/components/list-items/notebook/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/list-items/notebook/wrapper.js b/apps/mobile/app/components/list-items/notebook/wrapper.js
index 55b954fa5..8260da6cb 100644
--- a/apps/mobile/app/components/list-items/notebook/wrapper.js
+++ b/apps/mobile/app/components/list-items/notebook/wrapper.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { NotebookItem } from ".";
import Notebook from "../../../screens/notebook";
diff --git a/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js b/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js
index 995ebcff9..006d19a04 100644
--- a/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js
+++ b/apps/mobile/app/components/list-items/selection-wrapper/action-strip.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React, { useEffect, useState } from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/components/list-items/selection-wrapper/back-fill.js b/apps/mobile/app/components/list-items/selection-wrapper/back-fill.js
index a66b03c1d..a73bc5c53 100644
--- a/apps/mobile/app/components/list-items/selection-wrapper/back-fill.js
+++ b/apps/mobile/app/components/list-items/selection-wrapper/back-fill.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { useEditorStore } from "../../../stores/use-editor-store";
diff --git a/apps/mobile/app/components/list-items/selection-wrapper/index.js b/apps/mobile/app/components/list-items/selection-wrapper/index.js
index c8cb392b2..80086e2d6 100644
--- a/apps/mobile/app/components/list-items/selection-wrapper/index.js
+++ b/apps/mobile/app/components/list-items/selection-wrapper/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import {
eSubscribeEvent,
diff --git a/apps/mobile/app/components/list-items/selection-wrapper/selection.js b/apps/mobile/app/components/list-items/selection-wrapper/selection.js
index 01d5227a1..4cf44c8ef 100644
--- a/apps/mobile/app/components/list-items/selection-wrapper/selection.js
+++ b/apps/mobile/app/components/list-items/selection-wrapper/selection.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { TouchableOpacity, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/list-items/tag/index.js b/apps/mobile/app/components/list-items/tag/index.js
index 44e816bd1..f90488fab 100644
--- a/apps/mobile/app/components/list-items/tag/index.js
+++ b/apps/mobile/app/components/list-items/tag/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { notesnook } from "../../../../e2e/test.ids";
diff --git a/apps/mobile/app/components/list/card.js b/apps/mobile/app/components/list/card.js
index 038d199cb..3fcb7bd9f 100644
--- a/apps/mobile/app/components/list/card.js
+++ b/apps/mobile/app/components/list/card.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/list/empty.js b/apps/mobile/app/components/list/empty.js
index e2b76d982..4e4f77f64 100644
--- a/apps/mobile/app/components/list/empty.js
+++ b/apps/mobile/app/components/list/empty.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ActivityIndicator, useWindowDimensions, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/components/list/index.js b/apps/mobile/app/components/list/index.js
index b0e5474e6..871ca78a9 100644
--- a/apps/mobile/app/components/list/index.js
+++ b/apps/mobile/app/components/list/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useRef } from "react";
import { FlatList, RefreshControl, View } from "react-native";
import Animated, { FadeInDown } from "react-native-reanimated";
diff --git a/apps/mobile/app/components/merge-conflicts/index.js b/apps/mobile/app/components/merge-conflicts/index.js
index 9c11ec64f..460da90f0 100644
--- a/apps/mobile/app/components/merge-conflicts/index.js
+++ b/apps/mobile/app/components/merge-conflicts/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import KeepAwake from "@sayem314/react-native-keep-awake";
import React, { useEffect, useRef, useState } from "react";
import { Modal, SafeAreaView, Text, View } from "react-native";
diff --git a/apps/mobile/app/components/note-history/index.js b/apps/mobile/app/components/note-history/index.js
index f93ec6752..ed77e4d7d 100644
--- a/apps/mobile/app/components/note-history/index.js
+++ b/apps/mobile/app/components/note-history/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useCallback, useEffect, useState } from "react";
import { Text, View } from "react-native";
import { FlatList } from "react-native-gesture-handler";
diff --git a/apps/mobile/app/components/note-history/preview.js b/apps/mobile/app/components/note-history/preview.js
index 56386fa78..28f725567 100644
--- a/apps/mobile/app/components/note-history/preview.js
+++ b/apps/mobile/app/components/note-history/preview.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/components/premium/compact-features.js b/apps/mobile/app/components/premium/compact-features.js
index 8fd0db498..b2e1b25bd 100644
--- a/apps/mobile/app/components/premium/compact-features.js
+++ b/apps/mobile/app/components/premium/compact-features.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ScrollView } from "react-native";
import { FeatureBlock } from "./feature";
diff --git a/apps/mobile/app/components/premium/component.js b/apps/mobile/app/components/premium/component.js
index 5ca38753d..91b3625a1 100644
--- a/apps/mobile/app/components/premium/component.js
+++ b/apps/mobile/app/components/premium/component.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useState } from "react";
import { ActivityIndicator, ScrollView, View } from "react-native";
import { LAUNCH_ROCKET } from "../../assets/images/assets";
diff --git a/apps/mobile/app/components/premium/expiring.js b/apps/mobile/app/components/premium/expiring.js
index aee8b2dea..044f550c6 100644
--- a/apps/mobile/app/components/premium/expiring.js
+++ b/apps/mobile/app/components/premium/expiring.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import { usePricing } from "../../hooks/use-pricing";
diff --git a/apps/mobile/app/components/premium/feature.js b/apps/mobile/app/components/premium/feature.js
index 865daec66..01194de3d 100644
--- a/apps/mobile/app/components/premium/feature.js
+++ b/apps/mobile/app/components/premium/feature.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Text, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/premium/features.js b/apps/mobile/app/components/premium/features.js
index ac91a6b45..29a3600bf 100644
--- a/apps/mobile/app/components/premium/features.js
+++ b/apps/mobile/app/components/premium/features.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export const features = [
{
title: "Focused on privacy",
diff --git a/apps/mobile/app/components/premium/group.js b/apps/mobile/app/components/premium/group.js
index 136a9ec5d..c8f0ee74b 100644
--- a/apps/mobile/app/components/premium/group.js
+++ b/apps/mobile/app/components/premium/group.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ScrollView, View } from "react-native";
import { useThemeStore } from "../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/premium/index.js b/apps/mobile/app/components/premium/index.js
index d320dab36..91efe3901 100644
--- a/apps/mobile/app/components/premium/index.js
+++ b/apps/mobile/app/components/premium/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { createRef } from "react";
import {
eSubscribeEvent,
diff --git a/apps/mobile/app/components/premium/offer.js b/apps/mobile/app/components/premium/offer.js
index 8fd104ebb..52a0f12ea 100644
--- a/apps/mobile/app/components/premium/offer.js
+++ b/apps/mobile/app/components/premium/offer.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Text } from "react-native";
import { useThemeStore } from "../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/premium/premium-toast.js b/apps/mobile/app/components/premium/premium-toast.js
index 1cd989816..cda1a249f 100644
--- a/apps/mobile/app/components/premium/premium-toast.js
+++ b/apps/mobile/app/components/premium/premium-toast.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import Animated, { FadeInUp, FadeOutUp } from "react-native-reanimated";
diff --git a/apps/mobile/app/components/premium/pricing-item.js b/apps/mobile/app/components/premium/pricing-item.js
index 6646eba69..8b9daa974 100644
--- a/apps/mobile/app/components/premium/pricing-item.js
+++ b/apps/mobile/app/components/premium/pricing-item.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { SIZE } from "../../utils/size";
diff --git a/apps/mobile/app/components/premium/pricing-plans.js b/apps/mobile/app/components/premium/pricing-plans.js
index 282d7dd5b..0738078b6 100644
--- a/apps/mobile/app/components/premium/pricing-plans.js
+++ b/apps/mobile/app/components/premium/pricing-plans.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { ActivityIndicator, Platform, Text, View } from "react-native";
import * as RNIap from "react-native-iap";
diff --git a/apps/mobile/app/components/premium/pro-tag.js b/apps/mobile/app/components/premium/pro-tag.js
index d38208d03..a8a253669 100644
--- a/apps/mobile/app/components/premium/pro-tag.js
+++ b/apps/mobile/app/components/premium/pro-tag.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/properties/color-tags.js b/apps/mobile/app/components/properties/color-tags.js
index 3fa68ae9d..6270b23c1 100644
--- a/apps/mobile/app/components/properties/color-tags.js
+++ b/apps/mobile/app/components/properties/color-tags.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useState } from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/properties/date-meta.js b/apps/mobile/app/components/properties/date-meta.js
index f28d7d439..a04f27e13 100644
--- a/apps/mobile/app/components/properties/date-meta.js
+++ b/apps/mobile/app/components/properties/date-meta.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { useThemeStore } from "../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/properties/dev-mode.js b/apps/mobile/app/components/properties/dev-mode.js
index 8cbae865f..04be7d25f 100644
--- a/apps/mobile/app/components/properties/dev-mode.js
+++ b/apps/mobile/app/components/properties/dev-mode.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/components/properties/index.js b/apps/mobile/app/components/properties/index.js
index ede8cf5b6..27cb27856 100644
--- a/apps/mobile/app/components/properties/index.js
+++ b/apps/mobile/app/components/properties/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Platform, View } from "react-native";
import { ScrollView } from "react-native-gesture-handler";
diff --git a/apps/mobile/app/components/properties/items.js b/apps/mobile/app/components/properties/items.js
index 9bcfac370..a4043e1dd 100644
--- a/apps/mobile/app/components/properties/items.js
+++ b/apps/mobile/app/components/properties/items.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { FlatList } from "react-native-gesture-handler";
diff --git a/apps/mobile/app/components/properties/notebooks.js b/apps/mobile/app/components/properties/notebooks.js
index e38ce5767..d75e0992d 100644
--- a/apps/mobile/app/components/properties/notebooks.js
+++ b/apps/mobile/app/components/properties/notebooks.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ScrollView, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/properties/synced.js b/apps/mobile/app/components/properties/synced.js
index 6074a3b8e..0a2908b80 100644
--- a/apps/mobile/app/components/properties/synced.js
+++ b/apps/mobile/app/components/properties/synced.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/properties/tags.js b/apps/mobile/app/components/properties/tags.js
index aab64901f..871e87589 100644
--- a/apps/mobile/app/components/properties/tags.js
+++ b/apps/mobile/app/components/properties/tags.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/components/properties/topics.js b/apps/mobile/app/components/properties/topics.js
index 28588163f..e9f62684c 100644
--- a/apps/mobile/app/components/properties/topics.js
+++ b/apps/mobile/app/components/properties/topics.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { TopicNotes } from "../../screens/notes/topic-notes";
diff --git a/apps/mobile/app/components/selection-header/index.js b/apps/mobile/app/components/selection-header/index.js
index 6a527408a..7a5cd11cf 100644
--- a/apps/mobile/app/components/selection-header/index.js
+++ b/apps/mobile/app/components/selection-header/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import { BackHandler, Platform, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/components/sheet-provider/index.js b/apps/mobile/app/components/sheet-provider/index.js
index 296cbec64..3625ac987 100644
--- a/apps/mobile/app/components/sheet-provider/index.js
+++ b/apps/mobile/app/components/sheet-provider/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { ActivityIndicator, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/sheets/add-notebook/index.js b/apps/mobile/app/components/sheets/add-notebook/index.js
index 86ca0f3c2..095d1551f 100644
--- a/apps/mobile/app/components/sheets/add-notebook/index.js
+++ b/apps/mobile/app/components/sheets/add-notebook/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { createRef } from "react";
import {
Keyboard,
diff --git a/apps/mobile/app/components/sheets/add-to/index.js b/apps/mobile/app/components/sheets/add-to/index.js
index 3bbad29ef..bc91de3ae 100644
--- a/apps/mobile/app/components/sheets/add-to/index.js
+++ b/apps/mobile/app/components/sheets/add-to/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { createRef, useEffect, useState } from "react";
import { Keyboard, TouchableOpacity, View } from "react-native";
import { FlatList } from "react-native-gesture-handler";
diff --git a/apps/mobile/app/components/sheets/export-notes/index.js b/apps/mobile/app/components/sheets/export-notes/index.js
index 38423c2c3..26ea58923 100644
--- a/apps/mobile/app/components/sheets/export-notes/index.js
+++ b/apps/mobile/app/components/sheets/export-notes/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { Fragment, useEffect, useRef, useState } from "react";
import { Platform, StyleSheet, View } from "react-native";
import FileViewer from "react-native-file-viewer";
diff --git a/apps/mobile/app/components/sheets/export-notes/share.js b/apps/mobile/app/components/sheets/export-notes/share.js
index 6c135badb..a2a10df91 100644
--- a/apps/mobile/app/components/sheets/export-notes/share.js
+++ b/apps/mobile/app/components/sheets/export-notes/share.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import FileViewer from "react-native-file-viewer";
diff --git a/apps/mobile/app/components/sheets/github/issue.js b/apps/mobile/app/components/sheets/github/issue.js
index 92dc7f529..e166d932d 100644
--- a/apps/mobile/app/components/sheets/github/issue.js
+++ b/apps/mobile/app/components/sheets/github/issue.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React, { useRef, useState } from "react";
import { Linking, Platform, Text, TextInput, View } from "react-native";
diff --git a/apps/mobile/app/components/sheets/manage-tags/index.js b/apps/mobile/app/components/sheets/manage-tags/index.js
index a9cf6a589..8139a0f38 100644
--- a/apps/mobile/app/components/sheets/manage-tags/index.js
+++ b/apps/mobile/app/components/sheets/manage-tags/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { ScrollView, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/sheets/migrate/index.tsx b/apps/mobile/app/components/sheets/migrate/index.tsx
index f15f2f1f8..5a408360c 100644
--- a/apps/mobile/app/components/sheets/migrate/index.tsx
+++ b/apps/mobile/app/components/sheets/migrate/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useState } from "react";
import { View } from "react-native";
import { db } from "../../../common/database";
diff --git a/apps/mobile/app/components/sheets/move-notes/movenote.tsx b/apps/mobile/app/components/sheets/move-notes/movenote.tsx
index 7a502694b..74d0fafbe 100644
--- a/apps/mobile/app/components/sheets/move-notes/movenote.tsx
+++ b/apps/mobile/app/components/sheets/move-notes/movenote.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { NotebookType, NoteType, TopicType } from "app/utils/types";
import React, { RefObject, useState } from "react";
import { Platform, View } from "react-native";
diff --git a/apps/mobile/app/components/sheets/new-feature/index.tsx b/apps/mobile/app/components/sheets/new-feature/index.tsx
index aaa95192e..2c2dc83f5 100644
--- a/apps/mobile/app/components/sheets/new-feature/index.tsx
+++ b/apps/mobile/app/components/sheets/new-feature/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform, View } from "react-native";
import { APP_VERSION } from "../../../version";
import { eSendEvent, presentSheet } from "../../../services/event-manager";
diff --git a/apps/mobile/app/components/sheets/progress/index.tsx b/apps/mobile/app/components/sheets/progress/index.tsx
index 7c207f5f4..d5df48e16 100644
--- a/apps/mobile/app/components/sheets/progress/index.tsx
+++ b/apps/mobile/app/components/sheets/progress/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import useSyncProgress from "../../../hooks/use-sync-progress";
diff --git a/apps/mobile/app/components/sheets/publish-note/index.js b/apps/mobile/app/components/sheets/publish-note/index.js
index fe54a3529..56ef61700 100644
--- a/apps/mobile/app/components/sheets/publish-note/index.js
+++ b/apps/mobile/app/components/sheets/publish-note/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React, { useEffect, useRef, useState } from "react";
import { ActivityIndicator, TouchableOpacity, View } from "react-native";
diff --git a/apps/mobile/app/components/sheets/rate-app/index.js b/apps/mobile/app/components/sheets/rate-app/index.js
index c6cdbe50d..a010c4990 100644
--- a/apps/mobile/app/components/sheets/rate-app/index.js
+++ b/apps/mobile/app/components/sheets/rate-app/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { Linking, View } from "react-native";
import {
diff --git a/apps/mobile/app/components/sheets/recovery-key/index.js b/apps/mobile/app/components/sheets/recovery-key/index.js
index 082312c86..5a31c4929 100644
--- a/apps/mobile/app/components/sheets/recovery-key/index.js
+++ b/apps/mobile/app/components/sheets/recovery-key/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React, { createRef } from "react";
import { Platform, View } from "react-native";
diff --git a/apps/mobile/app/components/sheets/restore-data/index.js b/apps/mobile/app/components/sheets/restore-data/index.js
index 0354c4a06..acb6d71f6 100644
--- a/apps/mobile/app/components/sheets/restore-data/index.js
+++ b/apps/mobile/app/components/sheets/restore-data/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { createRef, useEffect, useState } from "react";
import { ActivityIndicator, Platform, View } from "react-native";
import DocumentPicker from "react-native-document-picker";
diff --git a/apps/mobile/app/components/sheets/sort/index.js b/apps/mobile/app/components/sheets/sort/index.js
index bfa311a25..eb1109c70 100644
--- a/apps/mobile/app/components/sheets/sort/index.js
+++ b/apps/mobile/app/components/sheets/sort/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useState } from "react";
import { View } from "react-native";
import { db } from "../../../common/database";
diff --git a/apps/mobile/app/components/sheets/update/index.js b/apps/mobile/app/components/sheets/update/index.js
index 8c3bc14f1..a7744d0de 100644
--- a/apps/mobile/app/components/sheets/update/index.js
+++ b/apps/mobile/app/components/sheets/update/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { Linking, View } from "react-native";
import { checkVersion } from "react-native-check-version";
diff --git a/apps/mobile/app/components/side-menu/color-section.js b/apps/mobile/app/components/side-menu/color-section.js
index bf2103f77..7b2613a81 100644
--- a/apps/mobile/app/components/side-menu/color-section.js
+++ b/apps/mobile/app/components/side-menu/color-section.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import Navigation from "../../services/navigation";
diff --git a/apps/mobile/app/components/side-menu/index.js b/apps/mobile/app/components/side-menu/index.js
index cbcaa9abe..2d531ceed 100644
--- a/apps/mobile/app/components/side-menu/index.js
+++ b/apps/mobile/app/components/side-menu/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useCallback } from "react";
import { FlatList, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/components/side-menu/menu-item.js b/apps/mobile/app/components/side-menu/menu-item.js
index f5656b93e..e129f15e7 100644
--- a/apps/mobile/app/components/side-menu/menu-item.js
+++ b/apps/mobile/app/components/side-menu/menu-item.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/side-menu/pinned-section.js b/apps/mobile/app/components/side-menu/pinned-section.js
index 8445e9d62..2259ecb3d 100644
--- a/apps/mobile/app/components/side-menu/pinned-section.js
+++ b/apps/mobile/app/components/side-menu/pinned-section.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { FlatList, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/components/side-menu/user-status.js b/apps/mobile/app/components/side-menu/user-status.js
index 25e0b4c90..27fd27c45 100644
--- a/apps/mobile/app/components/side-menu/user-status.js
+++ b/apps/mobile/app/components/side-menu/user-status.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ActivityIndicator, Platform, View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/components/tabs/index.tsx b/apps/mobile/app/components/tabs/index.tsx
index 2e6dce440..111b2121f 100644
--- a/apps/mobile/app/components/tabs/index.tsx
+++ b/apps/mobile/app/components/tabs/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, {
forwardRef,
RefObject,
diff --git a/apps/mobile/app/components/tip/index.tsx b/apps/mobile/app/components/tip/index.tsx
index eeb9543b6..d71dcf9bc 100644
--- a/apps/mobile/app/components/tip/index.tsx
+++ b/apps/mobile/app/components/tip/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Image, TextStyle, View, ViewStyle } from "react-native";
import { MMKV } from "../../common/database/mmkv";
diff --git a/apps/mobile/app/components/toast/index.js b/apps/mobile/app/components/toast/index.js
index e1984be5e..2aa2a2352 100644
--- a/apps/mobile/app/components/toast/index.js
+++ b/apps/mobile/app/components/toast/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { Keyboard, View } from "react-native";
import Animated, { FadeInUp, FadeOutUp } from "react-native-reanimated";
diff --git a/apps/mobile/app/components/ui/animated-button.tsx/index.tsx b/apps/mobile/app/components/ui/animated-button.tsx/index.tsx
index 1d5d4d6e4..cf28d659e 100644
--- a/apps/mobile/app/components/ui/animated-button.tsx/index.tsx
+++ b/apps/mobile/app/components/ui/animated-button.tsx/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ActivityIndicator, ColorValue, ViewStyle } from "react-native";
import Animated, {
diff --git a/apps/mobile/app/components/ui/button/index.tsx b/apps/mobile/app/components/ui/button/index.tsx
index a7b5cacba..fc5037fe9 100644
--- a/apps/mobile/app/components/ui/button/index.tsx
+++ b/apps/mobile/app/components/ui/button/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import {
ActivityIndicator,
diff --git a/apps/mobile/app/components/ui/icon-button/index.tsx b/apps/mobile/app/components/ui/icon-button/index.tsx
index 3b143a594..78dbba711 100644
--- a/apps/mobile/app/components/ui/icon-button/index.tsx
+++ b/apps/mobile/app/components/ui/icon-button/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ColorValue, GestureResponderEvent, ViewStyle } from "react-native";
import Animated, { Layout } from "react-native-reanimated";
diff --git a/apps/mobile/app/components/ui/input/index.tsx b/apps/mobile/app/components/ui/input/index.tsx
index ff021c876..acce3af78 100644
--- a/apps/mobile/app/components/ui/input/index.tsx
+++ b/apps/mobile/app/components/ui/input/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { RefObject, useState } from "react";
import {
ColorValue,
diff --git a/apps/mobile/app/components/ui/notice/index.tsx b/apps/mobile/app/components/ui/notice/index.tsx
index ec345e1a4..de6f89ca7 100644
--- a/apps/mobile/app/components/ui/notice/index.tsx
+++ b/apps/mobile/app/components/ui/notice/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { useThemeStore } from "../../../stores/use-theme-store";
diff --git a/apps/mobile/app/components/ui/pressable/index.tsx b/apps/mobile/app/components/ui/pressable/index.tsx
index ec0b1a6bb..ead5cecbe 100644
--- a/apps/mobile/app/components/ui/pressable/index.tsx
+++ b/apps/mobile/app/components/ui/pressable/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { RefObject, useCallback } from "react";
import {
ColorValue,
diff --git a/apps/mobile/app/components/ui/seperator/index.tsx b/apps/mobile/app/components/ui/seperator/index.tsx
index 7bb09c64a..e42a3dbed 100644
--- a/apps/mobile/app/components/ui/seperator/index.tsx
+++ b/apps/mobile/app/components/ui/seperator/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
const Seperator = ({ half = false }) => {
diff --git a/apps/mobile/app/components/ui/sheet/index.js b/apps/mobile/app/components/ui/sheet/index.js
index 640a215e4..7d08a5fed 100644
--- a/apps/mobile/app/components/ui/sheet/index.js
+++ b/apps/mobile/app/components/ui/sheet/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Platform, View } from "react-native";
import ActionSheet from "react-native-actions-sheet";
diff --git a/apps/mobile/app/components/ui/svg/index.tsx b/apps/mobile/app/components/ui/svg/index.tsx
index 25bb16c88..2e89b61ce 100644
--- a/apps/mobile/app/components/ui/svg/index.tsx
+++ b/apps/mobile/app/components/ui/svg/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import { SvgXml } from "./lazy";
diff --git a/apps/mobile/app/components/ui/svg/lazy.js b/apps/mobile/app/components/ui/svg/lazy.js
index d96ef9388..1add77c20 100644
--- a/apps/mobile/app/components/ui/svg/lazy.js
+++ b/apps/mobile/app/components/ui/svg/lazy.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import module_svg from "./module-svg";
export const QRCode = module_svg.QRCode;
diff --git a/apps/mobile/app/components/ui/svg/module-svg.js b/apps/mobile/app/components/ui/svg/module-svg.js
index 653332c9f..6deff9d1f 100644
--- a/apps/mobile/app/components/ui/svg/module-svg.js
+++ b/apps/mobile/app/components/ui/svg/module-svg.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable @typescript-eslint/no-var-requires */
import { Bar, Circle } from "react-native-progress";
import QRCode from "react-native-qrcode-svg";
diff --git a/apps/mobile/app/components/ui/time-since/index.tsx b/apps/mobile/app/components/ui/time-since/index.tsx
index dadb4dd5c..b474daa28 100644
--- a/apps/mobile/app/components/ui/time-since/index.tsx
+++ b/apps/mobile/app/components/ui/time-since/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { TextProps } from "react-native";
import { timeSince } from "../../../utils/time";
diff --git a/apps/mobile/app/components/ui/transitions/bouncing-view.js b/apps/mobile/app/components/ui/transitions/bouncing-view.js
index 6126c4142..f9dcf1456 100644
--- a/apps/mobile/app/components/ui/transitions/bouncing-view.js
+++ b/apps/mobile/app/components/ui/transitions/bouncing-view.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import Animated, {
Easing,
diff --git a/apps/mobile/app/components/ui/typography/heading.tsx b/apps/mobile/app/components/ui/typography/heading.tsx
index a86b0acf7..2c70ba581 100644
--- a/apps/mobile/app/components/ui/typography/heading.tsx
+++ b/apps/mobile/app/components/ui/typography/heading.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useMemo } from "react";
import { Platform, Text, TextProps } from "react-native";
import Animated, {
diff --git a/apps/mobile/app/components/ui/typography/paragraph.tsx b/apps/mobile/app/components/ui/typography/paragraph.tsx
index 7be705e25..403ef09d8 100644
--- a/apps/mobile/app/components/ui/typography/paragraph.tsx
+++ b/apps/mobile/app/components/ui/typography/paragraph.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useMemo } from "react";
import { Text, TextProps } from "react-native";
import Animated, {
diff --git a/apps/mobile/app/components/walkthroughs/index.tsx b/apps/mobile/app/components/walkthroughs/index.tsx
index 6b5e335c6..534c21925 100644
--- a/apps/mobile/app/components/walkthroughs/index.tsx
+++ b/apps/mobile/app/components/walkthroughs/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useState } from "react";
import { LayoutAnimation, View } from "react-native";
import { MMKV } from "../../common/database/mmkv";
diff --git a/apps/mobile/app/components/walkthroughs/walkthroughs.tsx b/apps/mobile/app/components/walkthroughs/walkthroughs.tsx
index b1fdeeb95..6e38c2741 100644
--- a/apps/mobile/app/components/walkthroughs/walkthroughs.tsx
+++ b/apps/mobile/app/components/walkthroughs/walkthroughs.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Linking, View } from "react-native";
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
diff --git a/apps/mobile/app/features.ts b/apps/mobile/app/features.ts
index 71f52a54d..198de663e 100644
--- a/apps/mobile/app/features.ts
+++ b/apps/mobile/app/features.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { FeatureType } from "./components/sheets/new-feature";
export const features: FeatureType[] = [];
diff --git a/apps/mobile/app/hooks/use-actions.js b/apps/mobile/app/hooks/use-actions.js
index a780f3e03..8169c90bb 100644
--- a/apps/mobile/app/hooks/use-actions.js
+++ b/apps/mobile/app/hooks/use-actions.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React, { useEffect, useState } from "react";
import { Platform } from "react-native";
diff --git a/apps/mobile/app/hooks/use-app-events.js b/apps/mobile/app/hooks/use-app-events.js
index fe79b7622..53c7afdf9 100644
--- a/apps/mobile/app/hooks/use-app-events.js
+++ b/apps/mobile/app/hooks/use-app-events.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import NetInfo from "@react-native-community/netinfo";
import { EV, EVENTS } from "@notesnook/core/common";
import { useEffect, useRef } from "react";
diff --git a/apps/mobile/app/hooks/use-app-state.ts b/apps/mobile/app/hooks/use-app-state.ts
index 577c5104b..66a803edf 100644
--- a/apps/mobile/app/hooks/use-app-state.ts
+++ b/apps/mobile/app/hooks/use-app-state.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { AppState, AppStateStatus } from "react-native";
diff --git a/apps/mobile/app/hooks/use-attachment-progress.js b/apps/mobile/app/hooks/use-attachment-progress.js
index 42ce51463..e1c1dc88a 100644
--- a/apps/mobile/app/hooks/use-attachment-progress.js
+++ b/apps/mobile/app/hooks/use-attachment-progress.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { useAttachmentStore } from "../stores/use-attachment-store";
diff --git a/apps/mobile/app/hooks/use-delay-layout.ts b/apps/mobile/app/hooks/use-delay-layout.ts
index fb1c1ae10..3227103f4 100644
--- a/apps/mobile/app/hooks/use-delay-layout.ts
+++ b/apps/mobile/app/hooks/use-delay-layout.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { InteractionManager } from "react-native";
diff --git a/apps/mobile/app/hooks/use-editor-tags.ts b/apps/mobile/app/hooks/use-editor-tags.ts
index 9440ca2a6..acd058ee3 100644
--- a/apps/mobile/app/hooks/use-editor-tags.ts
+++ b/apps/mobile/app/hooks/use-editor-tags.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { eSubscribeEvent, eUnSubscribeEvent } from "../services/event-manager";
import { useEditorStore } from "../stores/use-editor-store";
diff --git a/apps/mobile/app/hooks/use-immediate.ts b/apps/mobile/app/hooks/use-immediate.ts
index 89e7bd0ec..54f5cb4cd 100644
--- a/apps/mobile/app/hooks/use-immediate.ts
+++ b/apps/mobile/app/hooks/use-immediate.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { DependencyList, EffectCallback, useEffect } from "react";
const useImmediateEffect = (callback: EffectCallback, deps: DependencyList) => {
diff --git a/apps/mobile/app/hooks/use-is-floating-keyboard.ts b/apps/mobile/app/hooks/use-is-floating-keyboard.ts
index 47c4a83d9..a4d7f9bf3 100644
--- a/apps/mobile/app/hooks/use-is-floating-keyboard.ts
+++ b/apps/mobile/app/hooks/use-is-floating-keyboard.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { Keyboard, KeyboardEvent, useWindowDimensions } from "react-native";
diff --git a/apps/mobile/app/hooks/use-keyboard.ts b/apps/mobile/app/hooks/use-keyboard.ts
index b9412a84a..13d63409f 100644
--- a/apps/mobile/app/hooks/use-keyboard.ts
+++ b/apps/mobile/app/hooks/use-keyboard.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { Keyboard, KeyboardEventListener, ScreenRect } from "react-native";
diff --git a/apps/mobile/app/hooks/use-navigation-focus.ts b/apps/mobile/app/hooks/use-navigation-focus.ts
index 11879adc4..ed9cbe010 100644
--- a/apps/mobile/app/hooks/use-navigation-focus.ts
+++ b/apps/mobile/app/hooks/use-navigation-focus.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { NativeStackNavigationProp } from "@react-navigation/native-stack";
import { RefObject, useCallback, useEffect, useRef, useState } from "react";
diff --git a/apps/mobile/app/hooks/use-pricing.ts b/apps/mobile/app/hooks/use-pricing.ts
index a2357ff19..3887466fb 100644
--- a/apps/mobile/app/hooks/use-pricing.ts
+++ b/apps/mobile/app/hooks/use-pricing.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { Platform } from "react-native";
import { Subscription } from "react-native-iap";
diff --git a/apps/mobile/app/hooks/use-rotator.ts b/apps/mobile/app/hooks/use-rotator.ts
index b062abea3..1dbd49a2b 100644
--- a/apps/mobile/app/hooks/use-rotator.ts
+++ b/apps/mobile/app/hooks/use-rotator.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useRef, useState } from "react";
/**
diff --git a/apps/mobile/app/hooks/use-sync-progress.ts b/apps/mobile/app/hooks/use-sync-progress.ts
index be7a4d355..53f89955c 100644
--- a/apps/mobile/app/hooks/use-sync-progress.ts
+++ b/apps/mobile/app/hooks/use-sync-progress.ts
@@ -1,4 +1,22 @@
-import { EVENTS } from "@streetwriters/notesnook-core/common";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { EVENTS } from "@notesnook/core/common";
import { useCallback, useEffect, useState } from "react";
import { db } from "../common/database";
diff --git a/apps/mobile/app/hooks/use-timer.ts b/apps/mobile/app/hooks/use-timer.ts
index a67f5748b..d5059011d 100644
--- a/apps/mobile/app/hooks/use-timer.ts
+++ b/apps/mobile/app/hooks/use-timer.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useRef, useState } from "react";
const timers: { [name: string]: number } = {};
diff --git a/apps/mobile/app/hooks/use-tooltip.ts b/apps/mobile/app/hooks/use-tooltip.ts
index c72391859..515a2f79d 100644
--- a/apps/mobile/app/hooks/use-tooltip.ts
+++ b/apps/mobile/app/hooks/use-tooltip.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { RefObject, useEffect, useRef } from "react";
import { Platform } from "react-native";
import RNTooltips from "react-native-tooltips";
diff --git a/apps/mobile/app/hooks/use-vault-status.js b/apps/mobile/app/hooks/use-vault-status.js
index 2cd2d3f8c..7d4673eae 100644
--- a/apps/mobile/app/hooks/use-vault-status.js
+++ b/apps/mobile/app/hooks/use-vault-status.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useCallback, useEffect } from "react";
import BiometicService from "../services/biometrics";
import { eSubscribeEvent, eUnSubscribeEvent } from "../services/event-manager";
diff --git a/apps/mobile/app/navigation/index.js b/apps/mobile/app/navigation/index.js
index 98a329ed8..c819f4e28 100644
--- a/apps/mobile/app/navigation/index.js
+++ b/apps/mobile/app/navigation/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { SafeAreaView } from "react-native";
import DelayLayout from "../components/delay-layout";
diff --git a/apps/mobile/app/navigation/navigation-stack.js b/apps/mobile/app/navigation/navigation-stack.js
index 76381501b..a19169be3 100644
--- a/apps/mobile/app/navigation/navigation-stack.js
+++ b/apps/mobile/app/navigation/navigation-stack.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import * as React from "react";
diff --git a/apps/mobile/app/navigation/tabs-holder.js b/apps/mobile/app/navigation/tabs-holder.js
index 4ce586759..288e9f55f 100644
--- a/apps/mobile/app/navigation/tabs-holder.js
+++ b/apps/mobile/app/navigation/tabs-holder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
activateKeepAwake,
deactivateKeepAwake
diff --git a/apps/mobile/app/screens/editor/index.tsx b/apps/mobile/app/screens/editor/index.tsx
index f0f5685e3..1942d051d 100755
--- a/apps/mobile/app/screens/editor/index.tsx
+++ b/apps/mobile/app/screens/editor/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable @typescript-eslint/no-var-requires */
import { EV, EVENTS } from "@notesnook/core/common";
import React, {
diff --git a/apps/mobile/app/screens/editor/loading.js b/apps/mobile/app/screens/editor/loading.js
index 5dff103a5..077183f6a 100644
--- a/apps/mobile/app/screens/editor/loading.js
+++ b/apps/mobile/app/screens/editor/loading.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import Animated, {
diff --git a/apps/mobile/app/screens/editor/progress.js b/apps/mobile/app/screens/editor/progress.js
index da0359724..e74da1e89 100644
--- a/apps/mobile/app/screens/editor/progress.js
+++ b/apps/mobile/app/screens/editor/progress.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
diff --git a/apps/mobile/app/screens/editor/source.ts b/apps/mobile/app/screens/editor/source.ts
index 9f79d02b5..8326457fe 100644
--- a/apps/mobile/app/screens/editor/source.ts
+++ b/apps/mobile/app/screens/editor/source.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
export const EDITOR_URI =
diff --git a/apps/mobile/app/screens/editor/tiptap/commands.ts b/apps/mobile/app/screens/editor/tiptap/commands.ts
index 721292c74..69222998b 100644
--- a/apps/mobile/app/screens/editor/tiptap/commands.ts
+++ b/apps/mobile/app/screens/editor/tiptap/commands.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import type {
Attachment,
AttachmentProgress
diff --git a/apps/mobile/app/screens/editor/tiptap/picker.js b/apps/mobile/app/screens/editor/tiptap/picker.js
index 3c3048567..87a3df1cd 100644
--- a/apps/mobile/app/screens/editor/tiptap/picker.js
+++ b/apps/mobile/app/screens/editor/tiptap/picker.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Platform, View } from "react-native";
import DocumentPicker from "react-native-document-picker";
diff --git a/apps/mobile/app/screens/editor/tiptap/types.ts b/apps/mobile/app/screens/editor/tiptap/types.ts
index b087453da..371864a95 100644
--- a/apps/mobile/app/screens/editor/tiptap/types.ts
+++ b/apps/mobile/app/screens/editor/tiptap/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEditor } from "./use-editor";
import type { ToolbarGroupDefinition } from "@notesnook/editor/dist/toolbar/types";
import { ThemeStore } from "../../../stores/use-theme-store";
diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts b/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts
index 9bb0cdaa1..7f5e5dd90 100644
--- a/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts
+++ b/apps/mobile/app/screens/editor/tiptap/use-editor-events.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable no-case-declarations */
/* eslint-disable @typescript-eslint/no-var-requires */
import { getDefaultPresets } from "@streetwriters/editor/dist/toolbar/tool-definitions";
diff --git a/apps/mobile/app/screens/editor/tiptap/use-editor.ts b/apps/mobile/app/screens/editor/tiptap/use-editor.ts
index fc4bc017f..697dba349 100644
--- a/apps/mobile/app/screens/editor/tiptap/use-editor.ts
+++ b/apps/mobile/app/screens/editor/tiptap/use-editor.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import WebView from "react-native-webview";
diff --git a/apps/mobile/app/screens/editor/tiptap/utils.ts b/apps/mobile/app/screens/editor/tiptap/utils.ts
index 734e9b1ca..6cb5dc500 100644
--- a/apps/mobile/app/screens/editor/tiptap/utils.ts
+++ b/apps/mobile/app/screens/editor/tiptap/utils.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { createRef, MutableRefObject, RefObject } from "react";
import { TextInput } from "react-native";
import WebView from "react-native-webview";
diff --git a/apps/mobile/app/screens/editor/wrapper.js b/apps/mobile/app/screens/editor/wrapper.js
index de2e6909a..632d73d21 100644
--- a/apps/mobile/app/screens/editor/wrapper.js
+++ b/apps/mobile/app/screens/editor/wrapper.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import {
AppState,
diff --git a/apps/mobile/app/screens/favorites/index.tsx b/apps/mobile/app/screens/favorites/index.tsx
index b3170fd17..a64b470fd 100644
--- a/apps/mobile/app/screens/favorites/index.tsx
+++ b/apps/mobile/app/screens/favorites/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { db } from "../../common/database";
import DelayLayout from "../../components/delay-layout";
diff --git a/apps/mobile/app/screens/home/index.tsx b/apps/mobile/app/screens/home/index.tsx
index c716f1bba..9987d36a9 100755
--- a/apps/mobile/app/screens/home/index.tsx
+++ b/apps/mobile/app/screens/home/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { db } from "../../common/database";
import { FloatingButton } from "../../components/container/floating-button";
diff --git a/apps/mobile/app/screens/notebook/index.tsx b/apps/mobile/app/screens/notebook/index.tsx
index 9e7bf52a0..04dd02bd8 100644
--- a/apps/mobile/app/screens/notebook/index.tsx
+++ b/apps/mobile/app/screens/notebook/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { groupArray } from "@notesnook/core/utils/grouping";
import { qclone } from "qclone";
import React, { useEffect, useRef, useState } from "react";
diff --git a/apps/mobile/app/screens/notebooks/index.tsx b/apps/mobile/app/screens/notebooks/index.tsx
index 07b915173..159b23a39 100644
--- a/apps/mobile/app/screens/notebooks/index.tsx
+++ b/apps/mobile/app/screens/notebooks/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { db } from "../../common/database";
import { FloatingButton } from "../../components/container/floating-button";
diff --git a/apps/mobile/app/screens/notes/colored.tsx b/apps/mobile/app/screens/notes/colored.tsx
index ce81677b9..123f944d3 100644
--- a/apps/mobile/app/screens/notes/colored.tsx
+++ b/apps/mobile/app/screens/notes/colored.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { groupArray } from "@notesnook/core/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
diff --git a/apps/mobile/app/screens/notes/common.ts b/apps/mobile/app/screens/notes/common.ts
index 1a5cb2e72..d2cddfac0 100644
--- a/apps/mobile/app/screens/notes/common.ts
+++ b/apps/mobile/app/screens/notes/common.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { DDS } from "../../services/device-detection";
import { eSendEvent } from "../../services/event-manager";
import Navigation, { NotesScreenParams } from "../../services/navigation";
diff --git a/apps/mobile/app/screens/notes/index.tsx b/apps/mobile/app/screens/notes/index.tsx
index 184215298..1ba87aa04 100644
--- a/apps/mobile/app/screens/notes/index.tsx
+++ b/apps/mobile/app/screens/notes/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { FloatingButton } from "../../components/container/floating-button";
import DelayLayout from "../../components/delay-layout";
diff --git a/apps/mobile/app/screens/notes/monographs.tsx b/apps/mobile/app/screens/notes/monographs.tsx
index 51bd00183..ca009ab6a 100644
--- a/apps/mobile/app/screens/notes/monographs.tsx
+++ b/apps/mobile/app/screens/notes/monographs.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { groupArray } from "@notesnook/core/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
diff --git a/apps/mobile/app/screens/notes/tagged.tsx b/apps/mobile/app/screens/notes/tagged.tsx
index 8c26f0095..72c44554b 100644
--- a/apps/mobile/app/screens/notes/tagged.tsx
+++ b/apps/mobile/app/screens/notes/tagged.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { groupArray } from "@notesnook/core/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
diff --git a/apps/mobile/app/screens/notes/topic-notes.tsx b/apps/mobile/app/screens/notes/topic-notes.tsx
index 80156f4ba..1183991df 100644
--- a/apps/mobile/app/screens/notes/topic-notes.tsx
+++ b/apps/mobile/app/screens/notes/topic-notes.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { groupArray } from "@notesnook/core/utils/grouping";
import React from "react";
import NotesPage, { PLACEHOLDER_DATA } from ".";
diff --git a/apps/mobile/app/screens/search/index.js b/apps/mobile/app/screens/search/index.js
index 03584e9a1..b1d2a8c6d 100644
--- a/apps/mobile/app/screens/search/index.js
+++ b/apps/mobile/app/screens/search/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import DelayLayout from "../../components/delay-layout";
import List from "../../components/list";
diff --git a/apps/mobile/app/screens/search/search-bar.js b/apps/mobile/app/screens/search/search-bar.js
index 7106f753a..ad9379c36 100644
--- a/apps/mobile/app/screens/search/search-bar.js
+++ b/apps/mobile/app/screens/search/search-bar.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import { View } from "react-native";
import { TextInput } from "react-native-gesture-handler";
diff --git a/apps/mobile/app/screens/settings/2fa.tsx b/apps/mobile/app/screens/settings/2fa.tsx
index 11eccc9c1..9b795f88e 100644
--- a/apps/mobile/app/screens/settings/2fa.tsx
+++ b/apps/mobile/app/screens/settings/2fa.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import React, {
Dispatch,
diff --git a/apps/mobile/app/screens/settings/app-lock.js b/apps/mobile/app/screens/settings/app-lock.js
index 4d3130d9c..c270f1a7f 100644
--- a/apps/mobile/app/screens/settings/app-lock.js
+++ b/apps/mobile/app/screens/settings/app-lock.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useState } from "react";
import { Dimensions, LayoutAnimation, Platform, View } from "react-native";
import Animated, { FadeInDown, FadeOutUp } from "react-native-reanimated";
diff --git a/apps/mobile/app/screens/settings/appearance.js b/apps/mobile/app/screens/settings/appearance.js
index 8c8c16b4d..72b14065c 100644
--- a/apps/mobile/app/screens/settings/appearance.js
+++ b/apps/mobile/app/screens/settings/appearance.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useRef, useState } from "react";
import { View } from "react-native";
import Menu, { MenuItem } from "react-native-reanimated-material-menu";
diff --git a/apps/mobile/app/screens/settings/backup-restore.js b/apps/mobile/app/screens/settings/backup-restore.js
index 1e92458d4..1588daeaf 100644
--- a/apps/mobile/app/screens/settings/backup-restore.js
+++ b/apps/mobile/app/screens/settings/backup-restore.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Platform, TouchableOpacity, View } from "react-native";
import Paragraph from "../../components/ui/typography/paragraph";
diff --git a/apps/mobile/app/screens/settings/components.tsx b/apps/mobile/app/screens/settings/components.tsx
index 71aec8d6e..adb8b7f58 100644
--- a/apps/mobile/app/screens/settings/components.tsx
+++ b/apps/mobile/app/screens/settings/components.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { ReactElement } from "react";
import { AccentColorPicker, HomagePageSelector } from "./appearance";
import { AutomaticBackupsSelector } from "./backup-restore";
diff --git a/apps/mobile/app/screens/settings/debug.tsx b/apps/mobile/app/screens/settings/debug.tsx
index 4405cb1d9..fcce6cd5b 100644
--- a/apps/mobile/app/screens/settings/debug.tsx
+++ b/apps/mobile/app/screens/settings/debug.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import { LogMessage } from "@streetwriters/logger";
import { format, LogLevel, logManager } from "@notesnook/core/logger";
diff --git a/apps/mobile/app/screens/settings/editor/common.tsx b/apps/mobile/app/screens/settings/editor/common.tsx
index fe663e195..28b8c96a4 100644
--- a/apps/mobile/app/screens/settings/editor/common.tsx
+++ b/apps/mobile/app/screens/settings/editor/common.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Group } from "./group";
import { DraggableItem } from "./state";
diff --git a/apps/mobile/app/screens/settings/editor/configure-toolbar.tsx b/apps/mobile/app/screens/settings/editor/configure-toolbar.tsx
index 08d11a118..b3700b76f 100644
--- a/apps/mobile/app/screens/settings/editor/configure-toolbar.tsx
+++ b/apps/mobile/app/screens/settings/editor/configure-toolbar.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { StyleSheet, View } from "react-native";
import { DraxProvider, DraxScrollView } from "react-native-drax";
diff --git a/apps/mobile/app/screens/settings/editor/group.tsx b/apps/mobile/app/screens/settings/editor/group.tsx
index fd1ac8405..27740502d 100644
--- a/apps/mobile/app/screens/settings/editor/group.tsx
+++ b/apps/mobile/app/screens/settings/editor/group.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import * as React from "react";
import { View } from "react-native";
import { DraxDragWithReceiverEventData, DraxView } from "react-native-drax";
diff --git a/apps/mobile/app/screens/settings/editor/state.ts b/apps/mobile/app/screens/settings/editor/state.ts
index c50881afd..1d4e7623f 100644
--- a/apps/mobile/app/screens/settings/editor/state.ts
+++ b/apps/mobile/app/screens/settings/editor/state.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import type { ToolbarGroupDefinition } from "@notesnook/editor/dist/toolbar/types";
import create, { State } from "zustand";
import { persist, StateStorage } from "zustand/middleware";
diff --git a/apps/mobile/app/screens/settings/editor/tool-sheet.tsx b/apps/mobile/app/screens/settings/editor/tool-sheet.tsx
index e5a7464da..521824319 100644
--- a/apps/mobile/app/screens/settings/editor/tool-sheet.tsx
+++ b/apps/mobile/app/screens/settings/editor/tool-sheet.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolId } from "@notesnook/editor/dist/toolbar";
import React, { RefObject } from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/screens/settings/editor/tool.tsx b/apps/mobile/app/screens/settings/editor/tool.tsx
index 982c8fbd8..ab4b0c9b0 100644
--- a/apps/mobile/app/screens/settings/editor/tool.tsx
+++ b/apps/mobile/app/screens/settings/editor/tool.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import * as React from "react";
import { View } from "react-native";
import { DraxDragWithReceiverEventData, DraxView } from "react-native-drax";
diff --git a/apps/mobile/app/screens/settings/editor/toolbar-definition.ts b/apps/mobile/app/screens/settings/editor/toolbar-definition.ts
index 12f31b7f0..f43aeaa9d 100644
--- a/apps/mobile/app/screens/settings/editor/toolbar-definition.ts
+++ b/apps/mobile/app/screens/settings/editor/toolbar-definition.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Icons } from "@notesnook/editor/dist/toolbar/icons";
import {
getDefaultPresets,
diff --git a/apps/mobile/app/screens/settings/functions.js b/apps/mobile/app/screens/settings/functions.js
index 7dc58b930..c0569e383 100644
--- a/apps/mobile/app/screens/settings/functions.js
+++ b/apps/mobile/app/screens/settings/functions.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { presentDialog } from "../../components/dialog/functions";
import { ToastEvent } from "../../services/event-manager";
import { db } from "../../common/database";
diff --git a/apps/mobile/app/screens/settings/group.tsx b/apps/mobile/app/screens/settings/group.tsx
index 16987c9c1..35ffa1375 100644
--- a/apps/mobile/app/screens/settings/group.tsx
+++ b/apps/mobile/app/screens/settings/group.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import React, { useEffect } from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/screens/settings/home.tsx b/apps/mobile/app/screens/settings/home.tsx
index 28d8ae73b..8cb6981b0 100644
--- a/apps/mobile/app/screens/settings/home.tsx
+++ b/apps/mobile/app/screens/settings/home.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import React, { useEffect, useState } from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/screens/settings/index.tsx b/apps/mobile/app/screens/settings/index.tsx
index 2a0d111d6..b8c6e132a 100644
--- a/apps/mobile/app/screens/settings/index.tsx
+++ b/apps/mobile/app/screens/settings/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import React from "react";
import useNavigationStore from "../../stores/use-navigation-store";
diff --git a/apps/mobile/app/screens/settings/section-group.tsx b/apps/mobile/app/screens/settings/section-group.tsx
index e9e49ee93..f0b9d470d 100644
--- a/apps/mobile/app/screens/settings/section-group.tsx
+++ b/apps/mobile/app/screens/settings/section-group.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { View } from "react-native";
import Heading from "../../components/ui/typography/heading";
diff --git a/apps/mobile/app/screens/settings/section-item.tsx b/apps/mobile/app/screens/settings/section-item.tsx
index e04a690a6..bc558a912 100644
--- a/apps/mobile/app/screens/settings/section-item.tsx
+++ b/apps/mobile/app/screens/settings/section-item.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
NavigationProp,
StackActions,
diff --git a/apps/mobile/app/screens/settings/settings-data.tsx b/apps/mobile/app/screens/settings/settings-data.tsx
index 13e704742..0dbb4745a 100644
--- a/apps/mobile/app/screens/settings/settings-data.tsx
+++ b/apps/mobile/app/screens/settings/settings-data.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import dayjs from "dayjs";
import React from "react";
import { Linking, Platform } from "react-native";
diff --git a/apps/mobile/app/screens/settings/subscription.js b/apps/mobile/app/screens/settings/subscription.js
index ae447f09d..e3a769900 100644
--- a/apps/mobile/app/screens/settings/subscription.js
+++ b/apps/mobile/app/screens/settings/subscription.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Linking, Platform, View } from "react-native";
import { Button } from "../../components/ui/button";
diff --git a/apps/mobile/app/screens/settings/types.ts b/apps/mobile/app/screens/settings/types.ts
index 0342428b0..fcec7cd72 100644
--- a/apps/mobile/app/screens/settings/types.ts
+++ b/apps/mobile/app/screens/settings/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Settings } from "../../stores/use-setting-store";
export type SettingSection = {
diff --git a/apps/mobile/app/screens/settings/user-section.js b/apps/mobile/app/screens/settings/user-section.js
index afb3478a8..17f708b0b 100644
--- a/apps/mobile/app/screens/settings/user-section.js
+++ b/apps/mobile/app/screens/settings/user-section.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import dayjs from "dayjs";
import React from "react";
import { View } from "react-native";
diff --git a/apps/mobile/app/screens/tags/index.tsx b/apps/mobile/app/screens/tags/index.tsx
index 61260ed04..8dbf3f989 100644
--- a/apps/mobile/app/screens/tags/index.tsx
+++ b/apps/mobile/app/screens/tags/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { db } from "../../common/database";
import DelayLayout from "../../components/delay-layout";
diff --git a/apps/mobile/app/screens/trash/index.tsx b/apps/mobile/app/screens/trash/index.tsx
index 92833970c..64d63278f 100644
--- a/apps/mobile/app/screens/trash/index.tsx
+++ b/apps/mobile/app/screens/trash/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { db } from "../../common/database";
import { FloatingButton } from "../../components/container/floating-button";
diff --git a/apps/mobile/app/services/backup.js b/apps/mobile/app/services/backup.js
index 98bb89bdc..7576b08b7 100644
--- a/apps/mobile/app/services/backup.js
+++ b/apps/mobile/app/services/backup.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import FileViewer from "react-native-file-viewer";
import * as ScopedStorage from "react-native-scoped-storage";
diff --git a/apps/mobile/app/services/biometrics.ts b/apps/mobile/app/services/biometrics.ts
index 95adb4380..5d41ec2cc 100644
--- a/apps/mobile/app/services/biometrics.ts
+++ b/apps/mobile/app/services/biometrics.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import FingerprintScanner, {
AuthenticateIOS
diff --git a/apps/mobile/app/services/device-detection.js b/apps/mobile/app/services/device-detection.js
index 76691c398..dd88520e3 100644
--- a/apps/mobile/app/services/device-detection.js
+++ b/apps/mobile/app/services/device-detection.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Dimensions, PixelRatio, Platform } from "react-native";
import DeviceInfo from "react-native-device-info";
diff --git a/apps/mobile/app/services/event-manager.ts b/apps/mobile/app/services/event-manager.ts
index efff214fb..1292c83db 100644
--- a/apps/mobile/app/services/event-manager.ts
+++ b/apps/mobile/app/services/event-manager.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Clipboard from "@react-native-clipboard/clipboard";
import EventManager from "@notesnook/core/utils/eventmanager";
import { RefObject } from "react";
diff --git a/apps/mobile/app/services/exporter.js b/apps/mobile/app/services/exporter.js
index 1a747cebc..7c583e6d4 100644
--- a/apps/mobile/app/services/exporter.js
+++ b/apps/mobile/app/services/exporter.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { decode, EntityLevel } from "entities";
import { Platform } from "react-native";
import RNHTMLtoPDF from "react-native-html-to-pdf-lite";
diff --git a/apps/mobile/app/services/message.js b/apps/mobile/app/services/message.js
index f3b084a6f..6ac501edf 100644
--- a/apps/mobile/app/services/message.js
+++ b/apps/mobile/app/services/message.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useMessageStore } from "../stores/use-message-store";
import {
eOpenLoginDialog,
diff --git a/apps/mobile/app/services/navigation.ts b/apps/mobile/app/services/navigation.ts
index 98fb53320..e3e6cd1c6 100755
--- a/apps/mobile/app/services/navigation.ts
+++ b/apps/mobile/app/services/navigation.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { StackActions } from "@react-navigation/native";
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import { useFavoriteStore } from "../stores/use-favorite-store";
diff --git a/apps/mobile/app/services/notifications.ts b/apps/mobile/app/services/notifications.ts
index d498ab464..d9bf977b7 100644
--- a/apps/mobile/app/services/notifications.ts
+++ b/apps/mobile/app/services/notifications.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import PushNotification, {
Importance,
diff --git a/apps/mobile/app/services/premium.js b/apps/mobile/app/services/premium.js
index b888e09ee..66534d5a9 100644
--- a/apps/mobile/app/services/premium.js
+++ b/apps/mobile/app/services/premium.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { CHECK_IDS } from "@notesnook/core/common";
import React from "react";
import { Platform } from "react-native";
diff --git a/apps/mobile/app/services/search.js b/apps/mobile/app/services/search.js
index b6ca1bf2c..c3e58591a 100644
--- a/apps/mobile/app/services/search.js
+++ b/apps/mobile/app/services/search.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useSearchStore } from "../stores/use-search-store";
import { db } from "../common/database";
diff --git a/apps/mobile/app/services/settings.ts b/apps/mobile/app/services/settings.ts
index 23a60a80f..8feb12277 100644
--- a/apps/mobile/app/services/settings.ts
+++ b/apps/mobile/app/services/settings.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import { enabled } from "react-native-privacy-snapshot";
import { SettingStore } from "../stores/use-setting-store";
diff --git a/apps/mobile/app/services/sync.js b/apps/mobile/app/services/sync.js
index 99d98d9c6..0032641c4 100644
--- a/apps/mobile/app/services/sync.js
+++ b/apps/mobile/app/services/sync.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import NetInfo from "@react-native-community/netinfo";
import { EVENTS } from "@notesnook/core/common";
import { initAfterSync } from "../stores/index";
diff --git a/apps/mobile/app/services/tip-manager.ts b/apps/mobile/app/services/tip-manager.ts
index b00d894be..a4832e9e1 100644
--- a/apps/mobile/app/services/tip-manager.ts
+++ b/apps/mobile/app/services/tip-manager.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useRef, useState } from "react";
import { MMKV } from "../common/database/mmkv";
diff --git a/apps/mobile/app/services/validation.js b/apps/mobile/app/services/validation.js
index a0d22d5ac..6aabb6216 100644
--- a/apps/mobile/app/services/validation.js
+++ b/apps/mobile/app/services/validation.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import isEmail from "validator/lib/isEmail";
export function validateEmail(email) {
diff --git a/apps/mobile/app/stores/index.ts b/apps/mobile/app/stores/index.ts
index 5e83d3e45..d1833dc76 100644
--- a/apps/mobile/app/stores/index.ts
+++ b/apps/mobile/app/stores/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { db } from "../common/database";
import Navigation from "../services/navigation";
import { useFavoriteStore } from "./use-favorite-store";
diff --git a/apps/mobile/app/stores/use-attachment-store.ts b/apps/mobile/app/stores/use-attachment-store.ts
index 87da1cf50..9e6150bfa 100644
--- a/apps/mobile/app/stores/use-attachment-store.ts
+++ b/apps/mobile/app/stores/use-attachment-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create from "zustand";
import { editorController } from "../screens/editor/tiptap/utils";
diff --git a/apps/mobile/app/stores/use-editor-store.ts b/apps/mobile/app/stores/use-editor-store.ts
index 5a9ca58f3..3e586d6d3 100644
--- a/apps/mobile/app/stores/use-editor-store.ts
+++ b/apps/mobile/app/stores/use-editor-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create, { State } from "zustand";
import { eSubscribeEvent, eUnSubscribeEvent } from "../services/event-manager";
diff --git a/apps/mobile/app/stores/use-favorite-store.ts b/apps/mobile/app/stores/use-favorite-store.ts
index d9271aa52..ce248174a 100644
--- a/apps/mobile/app/stores/use-favorite-store.ts
+++ b/apps/mobile/app/stores/use-favorite-store.ts
@@ -1,4 +1,22 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NoteType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-menu-store.ts b/apps/mobile/app/stores/use-menu-store.ts
index c146ae198..454e1e61b 100644
--- a/apps/mobile/app/stores/use-menu-store.ts
+++ b/apps/mobile/app/stores/use-menu-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create, { State } from "zustand";
import { db } from "../common/database";
import { ColorType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-message-store.ts b/apps/mobile/app/stores/use-message-store.ts
index 291348eb9..ec55dac9c 100644
--- a/apps/mobile/app/stores/use-message-store.ts
+++ b/apps/mobile/app/stores/use-message-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import create, { State } from "zustand";
import { APP_VERSION } from "../version";
diff --git a/apps/mobile/app/stores/use-navigation-store.ts b/apps/mobile/app/stores/use-navigation-store.ts
index 2091ba2e5..334793927 100644
--- a/apps/mobile/app/stores/use-navigation-store.ts
+++ b/apps/mobile/app/stores/use-navigation-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create, { State } from "zustand";
import { COLORS_NOTE } from "../utils/color-scheme";
import {
diff --git a/apps/mobile/app/stores/use-notebook-store.ts b/apps/mobile/app/stores/use-notebook-store.ts
index 471a9380f..ed44600b0 100644
--- a/apps/mobile/app/stores/use-notebook-store.ts
+++ b/apps/mobile/app/stores/use-notebook-store.ts
@@ -1,4 +1,22 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NotebookType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-notes-store.ts b/apps/mobile/app/stores/use-notes-store.ts
index f8644d0df..346a1dcb4 100644
--- a/apps/mobile/app/stores/use-notes-store.ts
+++ b/apps/mobile/app/stores/use-notes-store.ts
@@ -1,4 +1,22 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { NoteType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-search-store.ts b/apps/mobile/app/stores/use-search-store.ts
index 1dfa00256..9694522f5 100644
--- a/apps/mobile/app/stores/use-search-store.ts
+++ b/apps/mobile/app/stores/use-search-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create, { State } from "zustand";
export interface SearchStore extends State {
diff --git a/apps/mobile/app/stores/use-selection-store.ts b/apps/mobile/app/stores/use-selection-store.ts
index 1bff5c410..5796d2b3e 100644
--- a/apps/mobile/app/stores/use-selection-store.ts
+++ b/apps/mobile/app/stores/use-selection-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create, { State } from "zustand";
import { history } from "../utils";
diff --git a/apps/mobile/app/stores/use-setting-store.ts b/apps/mobile/app/stores/use-setting-store.ts
index ed5bc2cf5..e2177efc4 100644
--- a/apps/mobile/app/stores/use-setting-store.ts
+++ b/apps/mobile/app/stores/use-setting-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Dimensions } from "react-native";
import Config from "react-native-config";
import { FileType } from "react-native-scoped-storage";
diff --git a/apps/mobile/app/stores/use-tag-store.ts b/apps/mobile/app/stores/use-tag-store.ts
index 065a65ced..255f536e9 100644
--- a/apps/mobile/app/stores/use-tag-store.ts
+++ b/apps/mobile/app/stores/use-tag-store.ts
@@ -1,5 +1,23 @@
-import "@streetwriters/notesnook-core/types";
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import "@notesnook/core/types";
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { TagType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-theme-store.ts b/apps/mobile/app/stores/use-theme-store.ts
index 919908332..6ce47221d 100644
--- a/apps/mobile/app/stores/use-theme-store.ts
+++ b/apps/mobile/app/stores/use-theme-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Appearance } from "react-native";
import create, { State } from "zustand";
import { COLOR_SCHEME_DARK, COLOR_SCHEME_LIGHT } from "../utils/color-scheme";
diff --git a/apps/mobile/app/stores/use-trash-store.ts b/apps/mobile/app/stores/use-trash-store.ts
index 96ed2a597..035354a88 100644
--- a/apps/mobile/app/stores/use-trash-store.ts
+++ b/apps/mobile/app/stores/use-trash-store.ts
@@ -1,4 +1,22 @@
-import { groupArray } from "@streetwriters/notesnook-core/utils/grouping";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { groupArray } from "@notesnook/core/utils/grouping";
import create, { State } from "zustand";
import { db } from "../common/database";
import { TrashType } from "../utils/types";
diff --git a/apps/mobile/app/stores/use-user-store.ts b/apps/mobile/app/stores/use-user-store.ts
index 5ad93a743..24ff5f7b3 100644
--- a/apps/mobile/app/stores/use-user-store.ts
+++ b/apps/mobile/app/stores/use-user-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create, { State } from "zustand";
export interface UserStore extends State {
diff --git a/apps/mobile/app/utils/color-scheme/index.js b/apps/mobile/app/utils/color-scheme/index.js
index 2c09bb97d..691e2e5aa 100644
--- a/apps/mobile/app/utils/color-scheme/index.js
+++ b/apps/mobile/app/utils/color-scheme/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform, StatusBar } from "react-native";
import { AndroidModule } from "..";
import { eSendEvent } from "../../services/event-manager";
diff --git a/apps/mobile/app/utils/color-scheme/utils.js b/apps/mobile/app/utils/color-scheme/utils.js
index 2415e3cc7..746f3b3aa 100644
--- a/apps/mobile/app/utils/color-scheme/utils.js
+++ b/apps/mobile/app/utils/color-scheme/utils.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Appearance } from "react-native";
import {
COLOR_SCHEME,
diff --git a/apps/mobile/app/utils/constants.js b/apps/mobile/app/utils/constants.js
index 212c6c7a3..42744e126 100644
--- a/apps/mobile/app/utils/constants.js
+++ b/apps/mobile/app/utils/constants.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Platform } from "react-native";
import { Monographs } from "../screens/notes/monographs";
diff --git a/apps/mobile/app/utils/events.js b/apps/mobile/app/utils/events.js
index 47fadfebc..c6051ce1b 100644
--- a/apps/mobile/app/utils/events.js
+++ b/apps/mobile/app/utils/events.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export const eOnLoadNote = "500";
export const eOpenActionSheet = "501";
diff --git a/apps/mobile/app/utils/functions.js b/apps/mobile/app/utils/functions.js
index cba12a640..aade92e91 100644
--- a/apps/mobile/app/utils/functions.js
+++ b/apps/mobile/app/utils/functions.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Linking } from "react-native";
import { history } from ".";
import { eSendEvent, ToastEvent } from "../services/event-manager";
diff --git a/apps/mobile/app/utils/global-refs.ts b/apps/mobile/app/utils/global-refs.ts
index 3300a70e2..811f02e61 100644
--- a/apps/mobile/app/utils/global-refs.ts
+++ b/apps/mobile/app/utils/global-refs.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { createNavigationContainerRef } from "@react-navigation/native";
import { createRef } from "react";
import { TextInput, View } from "react-native";
diff --git a/apps/mobile/app/utils/index.js b/apps/mobile/app/utils/index.js
index c847b5e14..32c968a8d 100755
--- a/apps/mobile/app/utils/index.js
+++ b/apps/mobile/app/utils/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { AppState, Dimensions, NativeModules, Platform } from "react-native";
import {
beginBackgroundTask,
diff --git a/apps/mobile/app/utils/layout-manager.js b/apps/mobile/app/utils/layout-manager.js
index 465843098..b9525e8fb 100644
--- a/apps/mobile/app/utils/layout-manager.js
+++ b/apps/mobile/app/utils/layout-manager.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
function withAnimation(_duration = 300) {
return;
}
diff --git a/apps/mobile/app/utils/sanitizer/index.js b/apps/mobile/app/utils/sanitizer/index.js
index a19e63d14..64ff0c3b9 100644
--- a/apps/mobile/app/utils/sanitizer/index.js
+++ b/apps/mobile/app/utils/sanitizer/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/*jshint node:true*/
/**
diff --git a/apps/mobile/app/utils/size/index.js b/apps/mobile/app/utils/size/index.js
index 2722c1234..87256f83e 100644
--- a/apps/mobile/app/utils/size/index.js
+++ b/apps/mobile/app/utils/size/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Dimensions, PixelRatio, Platform } from "react-native";
import { DDS } from "../../services/device-detection";
diff --git a/apps/mobile/app/utils/sse/even-source-ios.js b/apps/mobile/app/utils/sse/even-source-ios.js
index e7f910108..76715c290 100644
--- a/apps/mobile/app/utils/sse/even-source-ios.js
+++ b/apps/mobile/app/utils/sse/even-source-ios.js
@@ -1,27 +1,21 @@
-/**
- * Copyright (c) 2020 Adam Chelminski
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
+/* This file is part of the Notesnook project (https://notesnook.com/)
*
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * Copyright (C) 2022 Streetwriters (Private) Limited
*
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
*
- * @format
+ * 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 General Public License for more details.
*
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
"use strict";
import _reactNative from "react-native";
import _eventTargetShim from "event-target-shim";
diff --git a/apps/mobile/app/utils/sse/event-source.js b/apps/mobile/app/utils/sse/event-source.js
index 923882f05..65979ba2b 100644
--- a/apps/mobile/app/utils/sse/event-source.js
+++ b/apps/mobile/app/utils/sse/event-source.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { NativeEventEmitter, NativeModules, Platform } from "react-native";
const NativeEventSource =
diff --git a/apps/mobile/app/utils/time/index.ts b/apps/mobile/app/utils/time/index.ts
index 18e429513..8a6d5e6e7 100644
--- a/apps/mobile/app/utils/time/index.ts
+++ b/apps/mobile/app/utils/time/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export const sleep = (duration: number) =>
new Promise((resolve) => setTimeout(() => resolve(true), duration));
diff --git a/apps/mobile/app/utils/types.ts b/apps/mobile/app/utils/types.ts
index a2afde0a9..09636016c 100644
--- a/apps/mobile/app/utils/types.ts
+++ b/apps/mobile/app/utils/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
// eslint-disable-next-line @typescript-eslint/ban-types
export type LiteralUnion<T extends U, U = string> = T | (U & {});
diff --git a/apps/mobile/app/version.js b/apps/mobile/app/version.js
index cbc930a8f..9595ad40e 100644
--- a/apps/mobile/app/version.js
+++ b/apps/mobile/app/version.js
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export const APP_VERSION = 217;
diff --git a/apps/mobile/e2e/environment.js b/apps/mobile/e2e/environment.js
index 46207ddfd..e65279b8f 100644
--- a/apps/mobile/e2e/environment.js
+++ b/apps/mobile/e2e/environment.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
DetoxCircusEnvironment,
SpecReporter,
diff --git a/apps/mobile/e2e/setup.ts b/apps/mobile/e2e/setup.ts
index 0d565f10d..3dc604c42 100644
--- a/apps/mobile/e2e/setup.ts
+++ b/apps/mobile/e2e/setup.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { device } from "detox";
beforeAll(async () => {
diff --git a/apps/mobile/e2e/test.ids.js b/apps/mobile/e2e/test.ids.js
index 56b09650b..0886215b7 100644
--- a/apps/mobile/e2e/test.ids.js
+++ b/apps/mobile/e2e/test.ids.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const notesnook = {
editor: {
back: "editor.back",
diff --git a/apps/mobile/e2e/tests/auth.e2e.js b/apps/mobile/e2e/tests/auth.e2e.js
index 77a470011..d2e52c982 100644
--- a/apps/mobile/e2e/tests/auth.e2e.js
+++ b/apps/mobile/e2e/tests/auth.e2e.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
tapByText,
prepare,
diff --git a/apps/mobile/e2e/tests/index.e2e.js b/apps/mobile/e2e/tests/index.e2e.js
index 75d92f8e6..7d168f7ca 100644
--- a/apps/mobile/e2e/tests/index.e2e.js
+++ b/apps/mobile/e2e/tests/index.e2e.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { navigate, tapByText, prepare, sleep } from "./utils";
describe("APP LAUNCH AND NAVIGATION", () => {
diff --git a/apps/mobile/e2e/tests/note.e2e.js b/apps/mobile/e2e/tests/note.e2e.js
index d46dd16ef..b04332dfb 100644
--- a/apps/mobile/e2e/tests/note.e2e.js
+++ b/apps/mobile/e2e/tests/note.e2e.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { notesnook } from "../test.ids";
import {
navigate,
diff --git a/apps/mobile/e2e/tests/notebook.e2e.js b/apps/mobile/e2e/tests/notebook.e2e.js
index da92be273..33ad3cee8 100644
--- a/apps/mobile/e2e/tests/notebook.e2e.js
+++ b/apps/mobile/e2e/tests/notebook.e2e.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { notesnook } from "../test.ids";
import {
tapById,
diff --git a/apps/mobile/e2e/tests/search.e2e.js b/apps/mobile/e2e/tests/search.e2e.js
index 27bcce52d..04e559c85 100644
--- a/apps/mobile/e2e/tests/search.e2e.js
+++ b/apps/mobile/e2e/tests/search.e2e.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
tapById,
visibleByText,
diff --git a/apps/mobile/e2e/tests/sort.e2e.js b/apps/mobile/e2e/tests/sort.e2e.js
index 8d4317665..ff6df27f7 100644
--- a/apps/mobile/e2e/tests/sort.e2e.js
+++ b/apps/mobile/e2e/tests/sort.e2e.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { notesnook } from "../test.ids";
import {
tapById,
diff --git a/apps/mobile/e2e/tests/tag.e2e.js b/apps/mobile/e2e/tests/tag.e2e.js
index 08fac85ac..777426087 100644
--- a/apps/mobile/e2e/tests/tag.e2e.js
+++ b/apps/mobile/e2e/tests/tag.e2e.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { notesnook } from "../test.ids";
import {
navigate,
diff --git a/apps/mobile/e2e/tests/utils.js b/apps/mobile/e2e/tests/utils.js
index 6c992001c..7c06613af 100644
--- a/apps/mobile/e2e/tests/utils.js
+++ b/apps/mobile/e2e/tests/utils.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { notesnook } from "../test.ids";
import { readFileSync } from "fs";
import { expect as jestExpect } from "@jest/globals";
diff --git a/apps/mobile/e2e/tests/vault.e2e.js b/apps/mobile/e2e/tests/vault.e2e.js
index d5fa1af22..3169bddba 100644
--- a/apps/mobile/e2e/tests/vault.e2e.js
+++ b/apps/mobile/e2e/tests/vault.e2e.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { notesnook } from "../test.ids";
import {
tapById,
diff --git a/apps/mobile/share/index.js b/apps/mobile/share/index.js
index 19da17826..b376e8f17 100644
--- a/apps/mobile/share/index.js
+++ b/apps/mobile/share/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { Fragment } from "react";
import { Modal, Platform } from "react-native";
import ShareView from "./share";
diff --git a/apps/mobile/share/quick-note.js b/apps/mobile/share/quick-note.js
index bd452b817..aeec8915c 100644
--- a/apps/mobile/share/quick-note.js
+++ b/apps/mobile/share/quick-note.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { Component } from "react";
import { Appearance, SafeAreaView } from "react-native";
import RNBootSplash from "react-native-bootsplash";
diff --git a/apps/mobile/share/search.js b/apps/mobile/share/search.js
index 2e1d4a1ea..b14ab4154 100644
--- a/apps/mobile/share/search.js
+++ b/apps/mobile/share/search.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useRef, useState } from "react";
import {
ActivityIndicator,
diff --git a/apps/mobile/share/share.js b/apps/mobile/share/share.js
index dd856891a..bccd032ba 100644
--- a/apps/mobile/share/share.js
+++ b/apps/mobile/share/share.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { getPreviewData } from "@flyerhq/react-native-link-preview";
import { parseHTML } from "@notesnook/core/utils/htmlparser";
import React, { useEffect, useRef, useState } from "react";
diff --git a/apps/mobile/share/store.js b/apps/mobile/share/store.js
index f5ed0296a..32ef74acc 100644
--- a/apps/mobile/share/store.js
+++ b/apps/mobile/share/store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Appearance } from "react-native";
import create from "zustand";
import {
diff --git a/apps/web/__e2e__/checkout.test.js b/apps/web/__e2e__/checkout.test.js
index 8a4ad7c65..0405f85ce 100644
--- a/apps/web/__e2e__/checkout.test.js
+++ b/apps/web/__e2e__/checkout.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test, expect } = require("@playwright/test");
const { getTestId, loginUser } = require("./utils");
diff --git a/apps/web/__e2e__/colors.issues.test.js b/apps/web/__e2e__/colors.issues.test.js
index 5205fe99c..38fd9b48f 100644
--- a/apps/web/__e2e__/colors.issues.test.js
+++ b/apps/web/__e2e__/colors.issues.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test } = require("@playwright/test");
const { getTestId } = require("./utils");
const { useContextMenu, clickMenuItem } = require("./utils/actions");
diff --git a/apps/web/__e2e__/editor.test.js b/apps/web/__e2e__/editor.test.js
index 0be77353d..3145a1b79 100644
--- a/apps/web/__e2e__/editor.test.js
+++ b/apps/web/__e2e__/editor.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test, expect } = require("@playwright/test");
const {
createNote,
@@ -234,7 +252,7 @@ test.skip("last line doesn't get saved if it's font is different", async () => {
test("editing a note and switching immediately to another note and making an edit shouldn't overlap both notes", async ({
page
-}, { setTimeout }) => {
+}) => {
await createNoteAndCheckPresence({
title: "Test note 1",
content: "53ad8e4e40ebebd0f400498d"
diff --git a/apps/web/__e2e__/importer.test.js b/apps/web/__e2e__/importer.test.js
index 18de82f85..2f73ad43b 100644
--- a/apps/web/__e2e__/importer.test.js
+++ b/apps/web/__e2e__/importer.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test, expect } = require("@playwright/test");
const { getTestId, isTestAll, loginUser } = require("./utils");
const path = require("path");
diff --git a/apps/web/__e2e__/navigation.test.js b/apps/web/__e2e__/navigation.test.js
index 2771b8f1e..8e4e403c6 100644
--- a/apps/web/__e2e__/navigation.test.js
+++ b/apps/web/__e2e__/navigation.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable no-undef */
const { test, expect } = require("@playwright/test");
diff --git a/apps/web/__e2e__/notebooks.issues.test.js b/apps/web/__e2e__/notebooks.issues.test.js
index a2c9bd69b..90dfd5ff4 100644
--- a/apps/web/__e2e__/notebooks.issues.test.js
+++ b/apps/web/__e2e__/notebooks.issues.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test } = require("@playwright/test");
test.skip("TODO: pin 3 notebooks & make sure they can be unpinned");
test.skip("TODO: pin 4 notebooks & make sure 4th pin shows an error");
diff --git a/apps/web/__e2e__/notebooks.test.js b/apps/web/__e2e__/notebooks.test.js
index e98866748..e02f00430 100644
--- a/apps/web/__e2e__/notebooks.test.js
+++ b/apps/web/__e2e__/notebooks.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable no-undef */
const { test, expect } = require("@playwright/test");
const { getTestId, createNote, NOTE, NOTEBOOK } = require("./utils");
diff --git a/apps/web/__e2e__/notehistory.test.js b/apps/web/__e2e__/notehistory.test.js
index b21dfc3d9..0528a92d6 100644
--- a/apps/web/__e2e__/notehistory.test.js
+++ b/apps/web/__e2e__/notehistory.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test, expect } = require("@playwright/test");
const { NOTE, getTestId, getEditorContent, editNote } = require("./utils");
const { createNoteAndCheckPresence, isPresent } = require("./utils/conditions");
diff --git a/apps/web/__e2e__/notes.issues.test.js b/apps/web/__e2e__/notes.issues.test.js
index f2b5e86ba..72b870d3a 100644
--- a/apps/web/__e2e__/notes.issues.test.js
+++ b/apps/web/__e2e__/notes.issues.test.js
@@ -1,2 +1,20 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test } = require("@playwright/test");
test.skip("TODO: make sure jump to group works");
diff --git a/apps/web/__e2e__/notes.test.js b/apps/web/__e2e__/notes.test.js
index b0c392fe8..4d27b43e6 100644
--- a/apps/web/__e2e__/notes.test.js
+++ b/apps/web/__e2e__/notes.test.js
@@ -1,4 +1,21 @@
-/* eslint-disable react-hooks/rules-of-hooks */
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable no-undef */
/**
@@ -89,7 +106,7 @@ async function openLockedNote(noteSelector, title = NOTE.title) {
await page.click(getTestId("unlock-note-submit"));
}
-async function checkNotePinned(noteSelector, pause) {
+async function checkNotePinned(noteSelector) {
await openContextMenu(noteSelector);
await checkMenuItemText("pin", "Unpin");
diff --git a/apps/web/__e2e__/tags.test.js b/apps/web/__e2e__/tags.test.js
index 7f197c059..62dd12983 100644
--- a/apps/web/__e2e__/tags.test.js
+++ b/apps/web/__e2e__/tags.test.js
@@ -1,4 +1,21 @@
-/* eslint-disable react-hooks/rules-of-hooks */
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test, expect } = require("@playwright/test");
const { getTestId, createNote, NOTE } = require("./utils");
const {
@@ -77,11 +94,11 @@ async function renameTag(tagSelector, newTitle, expected) {
await checkTagPresence(expected);
}
-test("create a tag", async ({ page }) => {
+test("create a tag", async () => {
await createTagAndCheckPresence("helloworld");
});
-test("edit a tag", async ({ page }) => {
+test("edit a tag", async () => {
const tagSelector = await createTagAndCheckPresence("helloworld");
await renameTag(tagSelector, "new world", "newworld");
diff --git a/apps/web/__e2e__/user.test.js b/apps/web/__e2e__/user.test.js
index b0cf2c938..181fe1b34 100644
--- a/apps/web/__e2e__/user.test.js
+++ b/apps/web/__e2e__/user.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { test, expect } = require("@playwright/test");
const { getTestId, isTestAll, loginUser, USER } = require("./utils");
const { isAbsent, isPresent } = require("./utils/conditions");
diff --git a/apps/web/__e2e__/utils/actions.js b/apps/web/__e2e__/utils/actions.js
index 93a272494..fccb017fe 100644
--- a/apps/web/__e2e__/utils/actions.js
+++ b/apps/web/__e2e__/utils/actions.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable no-undef */
const { getTestId } = require("./index");
const Menu = require("./menuitemidbuilder");
diff --git a/apps/web/__e2e__/utils/conditions.js b/apps/web/__e2e__/utils/conditions.js
index 3cbdd9436..d1a490a64 100644
--- a/apps/web/__e2e__/utils/conditions.js
+++ b/apps/web/__e2e__/utils/conditions.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable no-undef */
const { expect } = require("@playwright/test");
diff --git a/apps/web/__e2e__/utils/index.js b/apps/web/__e2e__/utils/index.js
index f3868fb12..f25e25181 100644
--- a/apps/web/__e2e__/utils/index.js
+++ b/apps/web/__e2e__/utils/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable no-undef */
const fs = require("fs");
const dotenv = require("dotenv");
@@ -78,7 +96,7 @@ async function editNote(title, content, noDelay = false) {
}
async function downloadFile(downloadActionSelector, encoding) {
- return new Promise(async (resolve) => {
+ return new Promise((resolve) => {
page.on("download", async (download) => {
const path = await download.path();
resolve(fs.readFileSync(path, { encoding }));
diff --git a/apps/web/__e2e__/utils/listitemidbuilder.js b/apps/web/__e2e__/utils/listitemidbuilder.js
index 4cc2aaf62..d536a820d 100644
--- a/apps/web/__e2e__/utils/listitemidbuilder.js
+++ b/apps/web/__e2e__/utils/listitemidbuilder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { getTestId } = require(".");
class ListItemIDBuilder {
diff --git a/apps/web/__e2e__/utils/menuitemidbuilder.js b/apps/web/__e2e__/utils/menuitemidbuilder.js
index cfffdfa3e..5006184b6 100644
--- a/apps/web/__e2e__/utils/menuitemidbuilder.js
+++ b/apps/web/__e2e__/utils/menuitemidbuilder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { getTestId } = require(".");
class MenuItemIDBuilder {
diff --git a/apps/web/desktop/autoupdate.js b/apps/web/desktop/autoupdate.js
index a64c77dff..0cc0ff578 100644
--- a/apps/web/desktop/autoupdate.js
+++ b/apps/web/desktop/autoupdate.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { autoUpdater } = require("electron-updater");
const { EVENTS } = require("./events");
const { sendMessageToRenderer } = require("./ipc/utils");
diff --git a/apps/web/desktop/changelog.js b/apps/web/desktop/changelog.js
index ade346d2c..43cae3c99 100644
--- a/apps/web/desktop/changelog.js
+++ b/apps/web/desktop/changelog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const showdown = require("showdown");
var converter = new showdown.Converter();
diff --git a/apps/web/desktop/config/theme.js b/apps/web/desktop/config/theme.js
index 746120b8b..95834dc13 100644
--- a/apps/web/desktop/config/theme.js
+++ b/apps/web/desktop/config/theme.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const JSONStorage = require("../jsonstorage");
const { nativeTheme } = require("electron");
diff --git a/apps/web/desktop/config/windowstate.js b/apps/web/desktop/config/windowstate.js
index 947182d45..423587de1 100644
--- a/apps/web/desktop/config/windowstate.js
+++ b/apps/web/desktop/config/windowstate.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const JSONStorage = require("../jsonstorage");
const electron = require("electron");
const screen = electron.screen || electron.remote.screen;
@@ -109,7 +127,9 @@ class WindowState {
this.state.isMaximized = win.isMaximized();
this.state.isFullScreen = win.isFullScreen();
this.state.displayBounds = screen.getDisplayMatching(winBounds).bounds;
- } catch (err) {}
+ } catch (err) {
+ console.error(err);
+ }
}
saveState(win) {
diff --git a/apps/web/desktop/config/zoomfactor.js b/apps/web/desktop/config/zoomfactor.js
index 8cee836e5..69cd2b450 100644
--- a/apps/web/desktop/config/zoomfactor.js
+++ b/apps/web/desktop/config/zoomfactor.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const JSONStorage = require("../jsonstorage");
function getZoomFactor() {
diff --git a/apps/web/desktop/electron.js b/apps/web/desktop/electron.js
index b7231c0f3..7f668d2e1 100644
--- a/apps/web/desktop/electron.js
+++ b/apps/web/desktop/electron.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
require("isomorphic-fetch");
const { app, BrowserWindow, nativeTheme, shell } = require("electron");
const path = require("path");
@@ -16,7 +34,9 @@ const { EVENTS } = require("./events");
require("./ipc/index.js");
try {
require("electron-reloader")(module);
-} catch (_) {}
+} catch (_) {
+ // ignore
+}
// only run a single instance
if (!app.requestSingleInstanceLock()) {
diff --git a/apps/web/desktop/events.js b/apps/web/desktop/events.js
index 483f5f96d..02686ccfe 100644
--- a/apps/web/desktop/events.js
+++ b/apps/web/desktop/events.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
module.exports.EVENTS = {
checkingForUpdate: "checkingForUpdate",
updateAvailable: "updateAvailable",
diff --git a/apps/web/desktop/ipc/actions/changeAppTheme.js b/apps/web/desktop/ipc/actions/changeAppTheme.js
index 0eb67d4e5..dc0fe94b2 100644
--- a/apps/web/desktop/ipc/actions/changeAppTheme.js
+++ b/apps/web/desktop/ipc/actions/changeAppTheme.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { setTheme } = require("../../config/theme");
module.exports = (args) => {
diff --git a/apps/web/desktop/ipc/actions/checkForUpdate.js b/apps/web/desktop/ipc/actions/checkForUpdate.js
index 1a68d3c4f..dd4435303 100644
--- a/apps/web/desktop/ipc/actions/checkForUpdate.js
+++ b/apps/web/desktop/ipc/actions/checkForUpdate.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { autoUpdater } = require("electron-updater");
module.exports = () => {
diff --git a/apps/web/desktop/ipc/actions/downloadUpdate.js b/apps/web/desktop/ipc/actions/downloadUpdate.js
index 25a530509..a6421ac4f 100644
--- a/apps/web/desktop/ipc/actions/downloadUpdate.js
+++ b/apps/web/desktop/ipc/actions/downloadUpdate.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { CancellationToken } = require("builder-util-runtime");
const { autoUpdater } = require("electron-updater");
const { EVENTS } = require("../../events");
diff --git a/apps/web/desktop/ipc/actions/index.js b/apps/web/desktop/ipc/actions/index.js
index c56f13104..fe7d9b7f6 100644
--- a/apps/web/desktop/ipc/actions/index.js
+++ b/apps/web/desktop/ipc/actions/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const changeAppTheme = require("./changeAppTheme");
const checkForUpdate = require("./checkForUpdate");
const downloadUpdate = require("./downloadUpdate");
diff --git a/apps/web/desktop/ipc/actions/installUpdate.js b/apps/web/desktop/ipc/actions/installUpdate.js
index 84d56dda1..8a447cca2 100644
--- a/apps/web/desktop/ipc/actions/installUpdate.js
+++ b/apps/web/desktop/ipc/actions/installUpdate.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { autoUpdater } = require("electron-updater");
module.exports = () => {
diff --git a/apps/web/desktop/ipc/actions/open.js b/apps/web/desktop/ipc/actions/open.js
index bf03256c1..00ee84a88 100644
--- a/apps/web/desktop/ipc/actions/open.js
+++ b/apps/web/desktop/ipc/actions/open.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { shell } = require("electron");
const { resolvePath } = require("../utils");
module.exports = (args) => {
diff --git a/apps/web/desktop/ipc/actions/saveFile.js b/apps/web/desktop/ipc/actions/saveFile.js
index 62e99f096..0c290641a 100644
--- a/apps/web/desktop/ipc/actions/saveFile.js
+++ b/apps/web/desktop/ipc/actions/saveFile.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const fs = require("fs");
const path = require("path");
const { logger } = require("../../logger");
diff --git a/apps/web/desktop/ipc/actions/setZoomFactor.js b/apps/web/desktop/ipc/actions/setZoomFactor.js
index b914fc315..e4360d4ac 100644
--- a/apps/web/desktop/ipc/actions/setZoomFactor.js
+++ b/apps/web/desktop/ipc/actions/setZoomFactor.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { setZoomFactor } = require("../../config/zoomfactor");
module.exports = (args) => {
diff --git a/apps/web/desktop/ipc/calls/getZoomFactor.js b/apps/web/desktop/ipc/calls/getZoomFactor.js
index 6bc0f4d4f..77ea53fd8 100644
--- a/apps/web/desktop/ipc/calls/getZoomFactor.js
+++ b/apps/web/desktop/ipc/calls/getZoomFactor.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { getZoomFactor } = require("../../config/zoomfactor");
module.exports = function () {
diff --git a/apps/web/desktop/ipc/calls/index.js b/apps/web/desktop/ipc/calls/index.js
index 1450156eb..e460945d7 100644
--- a/apps/web/desktop/ipc/calls/index.js
+++ b/apps/web/desktop/ipc/calls/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const getZoomFactor = require("./getZoomFactor");
const selectDirectory = require("./selectDirectory");
diff --git a/apps/web/desktop/ipc/calls/selectDirectory.js b/apps/web/desktop/ipc/calls/selectDirectory.js
index c8f99554a..e4e4d1d07 100644
--- a/apps/web/desktop/ipc/calls/selectDirectory.js
+++ b/apps/web/desktop/ipc/calls/selectDirectory.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { dialog } = require("electron");
const { resolvePath } = require("../utils");
diff --git a/apps/web/desktop/ipc/index.js b/apps/web/desktop/ipc/index.js
index 070399746..9ef92be52 100644
--- a/apps/web/desktop/ipc/index.js
+++ b/apps/web/desktop/ipc/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { ipcMain } = require("electron");
const { logger } = require("../logger");
const { getAction } = require("./actions");
diff --git a/apps/web/desktop/ipc/utils.js b/apps/web/desktop/ipc/utils.js
index a24a073d6..644b7c7c5 100644
--- a/apps/web/desktop/ipc/utils.js
+++ b/apps/web/desktop/ipc/utils.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { logger } = require("../logger");
const { app } = require("electron");
const path = require("path");
@@ -16,9 +34,10 @@ function resolvePath(_path) {
let resolved = segment;
try {
resolved = app.getPath(resolved);
- } finally {
- return resolved;
+ } catch (e) {
+ // ignore
}
+ return resolved;
})
);
}
diff --git a/apps/web/desktop/jsonstorage/index.js b/apps/web/desktop/jsonstorage/index.js
index 66887d65a..d1a33ce19 100644
--- a/apps/web/desktop/jsonstorage/index.js
+++ b/apps/web/desktop/jsonstorage/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const fs = require("fs");
const { app } = require("electron");
const path = require("path");
diff --git a/apps/web/desktop/logger.js b/apps/web/desktop/logger.js
index 0c353be68..3ec389257 100644
--- a/apps/web/desktop/logger.js
+++ b/apps/web/desktop/logger.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { app } = require("electron");
const { diary, enable, default_reporter } = require("diary");
const fs = require("fs");
diff --git a/apps/web/desktop/menu.js b/apps/web/desktop/menu.js
index ce2967a8d..4afb2d617 100644
--- a/apps/web/desktop/menu.js
+++ b/apps/web/desktop/menu.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { Menu, MenuItem, clipboard } = require("electron");
/**
diff --git a/apps/web/desktop/paths.js b/apps/web/desktop/paths.js
index 706293946..0c4ad3854 100644
--- a/apps/web/desktop/paths.js
+++ b/apps/web/desktop/paths.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
module.exports.PATHS = {
backupsDirectory: "documents/Notesnook/backups",
logsDirectory: "logs/"
diff --git a/apps/web/desktop/preload.js b/apps/web/desktop/preload.js
index 2d41f68cc..bdd4ca550 100644
--- a/apps/web/desktop/preload.js
+++ b/apps/web/desktop/preload.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { contextBridge, ipcRenderer } = require("electron");
// Expose protected methods that allow the renderer process to use
diff --git a/apps/web/desktop/protocol.js b/apps/web/desktop/protocol.js
index ee578dcbf..8dd4d7428 100644
--- a/apps/web/desktop/protocol.js
+++ b/apps/web/desktop/protocol.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { protocol } = require("electron");
const { isDevelopment, getPath } = require("./utils");
const fs = require("fs");
diff --git a/apps/web/desktop/scripts/removeLocales.js b/apps/web/desktop/scripts/removeLocales.js
index 758f0073f..214b7b65b 100644
--- a/apps/web/desktop/scripts/removeLocales.js
+++ b/apps/web/desktop/scripts/removeLocales.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
//https://www.electron.build/configuration/configuration#afterpack
exports.default = async function (context) {
//console.log(context)
diff --git a/apps/web/desktop/utils.js b/apps/web/desktop/utils.js
index 945937f86..b8e1c545b 100644
--- a/apps/web/desktop/utils.js
+++ b/apps/web/desktop/utils.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { app } = require("electron");
const path = require("path");
const fs = require("fs");
@@ -23,7 +41,9 @@ function getPath(filePath) {
if (result.isDirectory()) {
return getPath(path.join(filePath, "index.html"));
}
- } catch (_) {}
+ } catch (_) {
+ // ignore
+ }
}
module.exports = { getPath, isDevelopment };
diff --git a/apps/web/package.json b/apps/web/package.json
index 1118cd775..b16b02fe1 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -71,8 +71,6 @@
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2",
"@types/react-modal": "^3.13.1",
- "@types/rebass": "^4.0.10",
- "@types/rebass__forms": "^4.0.6",
"buffer": "^6.0.3",
"chalk": "^4.1.0",
"dotenv": "^10.0.0",
diff --git a/apps/web/playwright.config.js b/apps/web/playwright.config.js
index 952c4f82b..7cfa1f820 100644
--- a/apps/web/playwright.config.js
+++ b/apps/web/playwright.config.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const IS_CI = !!process.env.CI;
const projects = IS_CI
diff --git a/apps/web/public/diff.worker.js b/apps/web/public/diff.worker.js
deleted file mode 100644
index 1f2fec0b3..000000000
--- a/apps/web/public/diff.worker.js
+++ /dev/null
@@ -1,892 +0,0 @@
-/* eslint-disable no-restricted-globals */
-/*
- * htmldiff.js is a library that compares HTML content. It creates a diff between two
- * HTML documents by combining the two documents and wrapping the differences with
- * <ins> and <del> tags. Here is a high-level overview of how the diff works.
- *
- * 1. Tokenize the before and after HTML with html_to_tokens.
- * 2. Generate a list of operations that convert the before list of tokens to the after
- * list of tokens with calculate_operations, which does the following:
- * a. Find all the matching blocks of tokens between the before and after lists of
- * tokens with find_matching_blocks. This is done by finding the single longest
- * matching block with find_match, then recursively finding the next longest
- * matching block that precede and follow the longest matching block with
- * recursively_find_matching_blocks.
- * b. Determine insertions, deletions, and replacements from the matching blocks.
- * This is done in calculate_operations.
- * 3. Render the list of operations by wrapping tokens with <ins> and <del> tags where
- * appropriate with render_operations.
- *
- * Example usage:
- *
- * var htmldiff = require('htmldiff.js');
- *
- * htmldiff('<p>this is some text</p>', '<p>this is some more text</p>')
- * == '<p>this is some <ins>more </ins>text</p>'
- *
- * htmldiff('<p>this is some text</p>', '<p>this is some more text</p>', 'diff-class')
- * == '<p>this is some <ins class="diff-class">more </ins>text</p>'
- */
-
-function is_start_of_tag(char) {
- return char === "<";
-}
-const IS_CLOSE_TAG_REGEX = /^\s*<\s*\/[^>]+>\s*$/;
-function is_close_tag(tag) {
- return IS_CLOSE_TAG_REGEX.test(tag);
-}
-
-const IS_TAG_REGEX = /^\s*<[^>]+>\s*$/;
-function is_tag(token) {
- return IS_TAG_REGEX.test(token);
-}
-
-function isnt_tag(token) {
- return !is_tag(token);
-}
-
-/*
- * Checks if the current word is the beginning of an atomic tag. An atomic tag is one whose
- * child nodes should not be compared - the entire tag should be treated as one token. This
- * is useful for tags where it does not make sense to insert <ins> and <del> tags.
- *
- * @param {string} word The characters of the current token read so far.
- *
- * @return {string|null} The name of the atomic tag if the word will be an atomic tag,
- * null otherwise
- */
-const IS_START_ATOMIC_TAG = /^<(iframe|object|math|svg|script)/;
-function is_start_of_atomic_tag(word) {
- var result = IS_START_ATOMIC_TAG.exec(word);
- if (result) {
- result = result[1];
- }
- return result;
-}
-
-/*
- * Checks if a tag is a void tag.
- *
- * @param {string} token The token to check.
- *
- * @return {boolean} True if the token is a void tag, false otherwise.
- */
-const IS_VOID_TAG_REGEX = /^\s*<[^>]+\/>\s*$/;
-function is_void_tag(token) {
- return IS_VOID_TAG_REGEX.test(token);
-}
-
-/*
- * Checks if a token can be wrapped inside a tag.
- *
- * @param {string} token The token to check.
- *
- * @return {boolean} True if the token can be wrapped inside a tag, false otherwise.
- */
-function is_wrappable(token) {
- return isnt_tag(token) || is_start_of_atomic_tag(token) || is_void_tag(token);
-}
-
-/*
- * A Match stores the information of a matching block. A matching block is a list of
- * consecutive tokens that appear in both the before and after lists of tokens.
- *
- * @param {number} start_in_before The index of the first token in the list of before tokens.
- * @param {number} start_in_after The index of the first token in the list of after tokens.
- * @param {number} length The number of consecutive matching tokens in this block.
- */
-function Match(start_in_before, start_in_after, length) {
- this.start_in_before = start_in_before;
- this.start_in_after = start_in_after;
- this.length = length;
- this.end_in_before = this.start_in_before + this.length - 1;
- this.end_in_after = this.start_in_after + this.length - 1;
-}
-
-function return_dual_pane(before, after) {
- return {
- before: before,
- after: after
- };
-}
-
-/*
- * Merge tokens in component by regex rule.
- *
- * @param {find_regex} dictate witch tag we want to merge.
- * @param {words Array.<string>} input data already parsed array(html tags) by html_tokens method.
- * @return {Array.<string>} The list of tokens with merged components requested by component_search_role.
- */
-function merge_html_by_class(find_regex, words) {
- var merged_words_array = [],
- merged_words_to_string = "",
- count_open_tags = 0;
-
- for (var i = 0; i < words.length; i++) {
- var tag_part = words[i];
- //merge html tags until parent tag is not closed (also ignore self closed html tags)
- if (count_open_tags > 0 || find_regex.test(tag_part)) {
- if (
- is_start_of_tag(tag_part.slice(0, 1)) &&
- !is_void_tag(tag_part) &&
- !is_start_of_atomic_tag(tag_part)
- ) {
- count_open_tags += is_close_tag(tag_part) ? -1 : 1;
- }
- //combine all html string from html tokens while all condition are true
- merged_words_to_string += tag_part;
- //after parent tag is closed push as one html token
- if (count_open_tags === 0) {
- merged_words_array.push(merged_words_to_string);
- merged_words_to_string = "";
- }
- } else {
- //all tags that are not part of components we wont to merge just ignore
- merged_words_array.push(tag_part);
- }
- }
- return merged_words_array;
-}
-
-/*
- * Tokenizes a string of HTML.
- *
- * @param {string} html The string to tokenize.
- *
- * @return {Array.<string>} The list of tokens.
- */
-
-function html_to_tokens(html, components_search_rule) {
- let words = [];
- const range = {
- start: 0,
- end: 0,
- tagOpen: false,
- whitespaceOpen: false,
- ampersandOpen: false
- };
- for (var i = 0; i < html.length; ++i) {
- const s = html[i];
-
- if (s === " " || s === "\n" || s === "\r" || s === "\t") {
- if (range.tagOpen || range.whitespaceOpen) continue;
-
- //range.end = i;
- if (range.start !== i) words.push(html.slice(range.start, i));
-
- range.whitespaceOpen = true;
- range.start = i;
- } else if (range.whitespaceOpen) {
- range.whitespaceOpen = false;
- // range.end = i;
- words.push(html.slice(range.start, i));
- range.start = i;
- }
-
- if (s === "<") {
- range.tagOpen = true;
-
- if (range.start !== i) {
- words.push(html.slice(range.start, i));
- }
-
- range.start = i;
- } else if (s === ">") {
- range.tagOpen = false;
- words.push(html.slice(range.start, i + 1));
- range.start = i + 1;
- } else if (!range.ampersandOpen && s === "&") {
- range.ampersandOpen = true;
- if (range.start !== i) words.push(html.slice(range.start, i));
- range.start = i;
- } else if (range.ampersandOpen && s === ";") {
- range.ampersandOpen = false;
- words.push(html.slice(range.start, i + 1));
- range.start = i + 1;
- }
- }
- if (range.start !== html.length) {
- words.push(html.slice(range.start, html.length));
- }
-
- return components_search_rule
- ? merge_html_by_class(components_search_rule, words)
- : words;
-}
-
-/*
- * Creates a key that should be used to match tokens. This is useful, for example, if we want
- * to consider two open tag tokens as equal, even if they don't have the same attributes. We
- * use a key instead of overwriting the token because we may want to render the original string
- * without losing the attributes.
- *
- * @param {string} token The token to create the key for.
- *
- * @return {string} The identifying key that should be used to match before and after tokens.
- */
-function get_key_for_token(token) {
- var tag_name = /<([^\s>]+)[\s>]/.exec(token);
- if (tag_name) {
- return "<" + tag_name[1].toLowerCase() + ">";
- }
- if (token) {
- return token.replace(/(\s+|&nbsp;|&#160;)/g, " ");
- }
- return token;
-}
-
-/*
- * Finds the matching block with the most consecutive tokens within the given range in the
- * before and after lists of tokens.
- *
- * @param {Array.<string>} before_tokens The before list of tokens.
- * @param {Array.<string>} after_tokens The after list of tokens.
- * @param {Object} index_of_before_locations_in_after_tokens The index that is used to search
- * for tokens in the after list.
- * @param {number} start_in_before The beginning of the range in the list of before tokens.
- * @param {number} end_in_before The end of the range in the list of before tokens.
- * @param {number} start_in_after The beginning of the range in the list of after tokens.
- * @param {number} end_in_after The end of the range in the list of after tokens.
- *
- * @return {Match} A Match that describes the best matching block in the given range.
- */
-
-function find_match(
- before_tokens,
- after_tokens,
- index_of_before_locations_in_after_tokens,
- start_in_before,
- end_in_before,
- start_in_after,
- end_in_after
-) {
- var best_match_in_before = start_in_before;
- var best_match_in_after = start_in_after;
- var best_match_length = 0;
- var match_length_at = {};
-
- for (
- var index_in_before = start_in_before;
- index_in_before < end_in_before;
- index_in_before++
- ) {
- var new_match_length_at = {};
- var looking_for = get_key_for_token(before_tokens[index_in_before]);
-
- var locations_in_after =
- index_of_before_locations_in_after_tokens[looking_for];
-
- for (var i = 0; i < locations_in_after.length; i++) {
- var index_in_after = locations_in_after[i];
- if (index_in_after < start_in_after) continue;
- if (index_in_after >= end_in_after) break;
-
- if (!match_length_at[index_in_after - 1]) {
- match_length_at[index_in_after - 1] = 0;
- }
- var new_match_length = match_length_at[index_in_after - 1] + 1;
- new_match_length_at[index_in_after] = new_match_length;
-
- if (new_match_length > best_match_length) {
- best_match_in_before = index_in_before - new_match_length + 1;
- best_match_in_after = index_in_after - new_match_length + 1;
- best_match_length = new_match_length;
- }
- }
-
- match_length_at = new_match_length_at;
- }
- if (best_match_length !== 0) {
- return new Match(
- best_match_in_before,
- best_match_in_after,
- best_match_length
- );
- }
- return null;
-}
-
-/*
- * Finds all the matching blocks within the given range in the before and after lists of
- * tokens. This function is called recursively to find the next best matches that precede
- * and follow the first best match.
- *
- * @param {Array.<string>} before_tokens The before list of tokens.
- * @param {Array.<string>} after_tokens The after list of tokens.
- * @param {Object} index_of_before_locations_in_after_tokens The index that is used to search
- * for tokens in the after list.
- * @param {number} start_in_before The beginning of the range in the list of before tokens.
- * @param {number} end_in_before The end of the range in the list of before tokens.
- * @param {number} start_in_after The beginning of the range in the list of after tokens.
- * @param {number} end_in_after The end of the range in the list of after tokens.
- * @param {Array.<Match>} matching_blocks The list of matching blocks found so far.
- *
- * @return {Array.<Match>} The list of matching blocks in this range.
- */
-function recursively_find_matching_blocks(
- before_tokens,
- after_tokens,
- index_of_before_locations_in_after_tokens,
- start_in_before,
- end_in_before,
- start_in_after,
- end_in_after,
- matching_blocks
-) {
- var match = find_match(
- before_tokens,
- after_tokens,
- index_of_before_locations_in_after_tokens,
- start_in_before,
- end_in_before,
- start_in_after,
- end_in_after
- );
- if (match) {
- if (
- start_in_before < match.start_in_before &&
- start_in_after < match.start_in_after
- ) {
- recursively_find_matching_blocks(
- before_tokens,
- after_tokens,
- index_of_before_locations_in_after_tokens,
- start_in_before,
- match.start_in_before,
- start_in_after,
- match.start_in_after,
- matching_blocks
- );
- }
- matching_blocks.push(match);
- if (
- match.end_in_before <= end_in_before &&
- match.end_in_after <= end_in_after
- ) {
- recursively_find_matching_blocks(
- before_tokens,
- after_tokens,
- index_of_before_locations_in_after_tokens,
- match.end_in_before + 1,
- end_in_before,
- match.end_in_after + 1,
- end_in_after,
- matching_blocks
- );
- }
- }
- return matching_blocks;
-}
-
-/*
- * Creates an index (A.K.A. hash table) that will be used to match the list of before
- * tokens with the list of after tokens.
- *
- * @param {Object} options An object with the following:
- * - {Array.<string>} find_these The list of tokens that will be used to search.
- * - {Array.<string>} in_these The list of tokens that will be returned.
- *
- * @return {Object} An index that can be used to search for tokens.
- */
-function create_index(options) {
- if (!options.find_these) {
- throw new Error("params must have find_these key");
- }
- if (!options.in_these) {
- throw new Error("params must have in_these key");
- }
- var queries = options.find_these.map(function (token) {
- return get_key_for_token(token);
- });
- var results = options.in_these.map(function (token) {
- return get_key_for_token(token);
- });
- var index = {};
- for (var i = 0; i < queries.length; i++) {
- var query = queries[i];
- index[query] = [];
- }
-
- results.forEach((item, i) => {
- const array = index[item];
- if (array) array.push(i);
- });
- return index;
-}
-
-/*
- * Finds all the matching blocks in the before and after lists of tokens. This function
- * is a wrapper for the recursive function recursively_find_matching_blocks.
- *
- * @param {Array.<string>} before_tokens The before list of tokens.
- * @param {Array.<string>} after_tokens The after list of tokens.
- *
- * @return {Array.<Match>} The list of matching blocks.
- */
-function find_matching_blocks(before_tokens, after_tokens) {
- var matching_blocks = [];
-
- var index_of_before_locations_in_after_tokens = create_index({
- find_these: before_tokens,
- in_these: after_tokens
- });
-
- return recursively_find_matching_blocks(
- before_tokens,
- after_tokens,
- index_of_before_locations_in_after_tokens,
- 0,
- before_tokens.length,
- 0,
- after_tokens.length,
- matching_blocks
- );
-}
-
-/*
- * Gets a list of operations required to transform the before list of tokens into the
- * after list of tokens. An operation describes whether a particular list of consecutive
- * tokens are equal, replaced, inserted, or deleted.
- *
- * @param {Array.<string>} before_tokens The before list of tokens.
- * @param {Array.<string>} after_tokens The after list of tokens.
- *
- * @return {Array.<Object>} The list of operations to transform the before list of
- * tokens into the after list of tokens, where each operation has the following
- * keys:
- * - {string} action One of {'replace', 'insert', 'delete', 'equal'}.
- * - {number} start_in_before The beginning of the range in the list of before tokens.
- * - {number} end_in_before The end of the range in the list of before tokens.
- * - {number} start_in_after The beginning of the range in the list of after tokens.
- * - {number} end_in_after The end of the range in the list of after tokens.
- */
-function calculate_operations(before_tokens, after_tokens) {
- if (!before_tokens) {
- throw new Error("before_tokens?");
- }
- if (!after_tokens) {
- throw new Error("after_tokens?");
- }
-
- var position_in_before = 0;
- var position_in_after = 0;
- var operations = [];
- var action_map = {
- "false,false": "replace",
- "true,false": "insert",
- "false,true": "delete",
- "true,true": "none"
- };
- var matches = find_matching_blocks(before_tokens, after_tokens);
- matches.push(new Match(before_tokens.length, after_tokens.length, 0));
-
- for (var index = 0; index < matches.length; index++) {
- var match = matches[index];
- var match_starts_at_current_position_in_before =
- position_in_before === match.start_in_before;
- var match_starts_at_current_position_in_after =
- position_in_after === match.start_in_after;
- var action_up_to_match_positions =
- action_map[
- [
- match_starts_at_current_position_in_before,
- match_starts_at_current_position_in_after
- ].toString()
- ];
- if (action_up_to_match_positions !== "none") {
- operations.push({
- action: action_up_to_match_positions,
- start_in_before: position_in_before,
- end_in_before:
- action_up_to_match_positions !== "insert"
- ? match.start_in_before - 1
- : void 0,
- start_in_after: position_in_after,
- end_in_after:
- action_up_to_match_positions !== "delete"
- ? match.start_in_after - 1
- : void 0
- });
- }
- if (match.length !== 0) {
- operations.push({
- action: "equal",
- start_in_before: match.start_in_before,
- end_in_before: match.end_in_before,
- start_in_after: match.start_in_after,
- end_in_after: match.end_in_after
- });
- }
- position_in_before = match.end_in_before + 1;
- position_in_after = match.end_in_after + 1;
- }
-
- var post_processed = [];
- var last_op = {
- action: "none"
- };
-
- function is_single_whitespace(op) {
- if (op.action !== "equal") {
- return false;
- }
- if (op.end_in_before - op.start_in_before !== 0) {
- return false;
- }
- return /^\s$/.test(
- before_tokens.slice(op.start_in_before, op.end_in_before + 1)
- );
- }
-
- for (var i = 0; i < operations.length; i++) {
- var op = operations[i];
-
- if (
- (is_single_whitespace(op) && last_op.action === "replace") ||
- (op.action === "replace" && last_op.action === "replace")
- ) {
- last_op.end_in_before = op.end_in_before;
- last_op.end_in_after = op.end_in_after;
- } else {
- post_processed.push(op);
- last_op = op;
- }
- }
- return post_processed;
-}
-
-/*
- * Returns a list of tokens of a particular type starting at a given index.
- *
- * @param {number} start The index of first token to test.
- * @param {Array.<string>} content The list of tokens.
- * @param {function} predicate A function that returns true if a token is of
- * a particular type, false otherwise. It should accept the following
- * parameters:
- * - {string} The token to test.
- */
-function consecutive_where(start, content, predicate) {
- content = content.slice(start, content.length + 1);
- var last_matching_index = null;
-
- for (var index = 0; index < content.length; index++) {
- var token = content[index];
- var answer = predicate(token);
-
- if (answer === true) {
- last_matching_index = index;
- }
- if (answer === false) {
- break;
- }
- }
-
- if (last_matching_index !== null) {
- return content.slice(0, last_matching_index + 1);
- }
- return [];
-}
-
-/*
- * Wraps and concatenates a list of tokens with a tag. Does not wrap tag tokens,
- * unless they are wrappable (i.e. void and atomic tags).
- *
- * @param {sting} tag The tag name of the wrapper tags.
- * @param {Array.<string>} content The list of tokens to wrap.
- * @param {string} class_name (Optional) The class name to include in the wrapper tag.
- */
-function wrap(tag, content, class_name) {
- var rendering = "";
- var position = 0;
- var length = content.length;
-
- while (true) {
- if (position >= length) break;
- var non_tags = consecutive_where(position, content, is_wrappable);
- position += non_tags.length;
- if (non_tags.length !== 0) {
- var val = non_tags.join("");
- if (val.trim()) {
- rendering += `<span class="diff-${tag} ${
- class_name || ""
- }">${val}</span>`;
- }
- }
-
- if (position >= length) break;
- var tags = consecutive_where(position, content, is_tag);
- position += tags.length;
- rendering += tags.join("");
- }
- return rendering;
-}
-
-/*
- * op_map.equal/insert/delete/replace are functions that render an operation into
- * HTML content.
- *
- * @param {Object} op The operation that applies to a prticular list of tokens. Has the
- * following keys:
- * - {string} action One of {'replace', 'insert', 'delete', 'equal'}.
- * - {number} start_in_before The beginning of the range in the list of before tokens.
- * - {number} end_in_before The end of the range in the list of before tokens.
- * - {number} start_in_after The beginning of the range in the list of after tokens.
- * - {number} end_in_after The end of the range in the list of after tokens.
- * @param {Array.<string>} before_tokens The before list of tokens.
- * @param {Array.<string>} after_tokens The after list of tokens.
- * @param {string} class_name (Optional) The class name to include in the wrapper tag.
- *
- * @return {string} The rendering of that operation.
- */
-var op_map = {
- equal: function (op, before_tokens, after_tokens, class_name) {
- return after_tokens.slice(op.start_in_after, op.end_in_after + 1).join("");
- },
- insert: function (op, before_tokens, after_tokens, class_name) {
- var val = after_tokens.slice(op.start_in_after, op.end_in_after + 1);
- return wrap("ins", val, class_name);
- },
- delete: function (op, before_tokens, after_tokens, class_name) {
- var val = before_tokens.slice(op.start_in_before, op.end_in_before + 1);
- return wrap("del", val, class_name);
- }
-};
-
-op_map.replace = function (op, before_tokens, after_tokens, class_name) {
- return [
- op_map["delete"](op, before_tokens, after_tokens, class_name),
- op_map.insert(op, before_tokens, after_tokens, class_name)
- ];
-};
-
-/*
- * Renders a list of operations into HTML content. The result is the combined version
- * of the before and after tokens with the differences wrapped in tags.
- *
- * @param {Array.<string>} before_tokens The before list of tokens.
- * @param {Array.<string>} after_tokens The after list of tokens.
- * @param {Array.<Object>} operations The list of operations to transform the before
- * list of tokens into the after list of tokens, where each operation has the
- * following keys:
- * - {string} action One of {'replace', 'insert', 'delete', 'equal'}.
- * - {number} start_in_before The beginning of the range in the list of before tokens.
- * - {number} end_in_before The end of the range in the list of before tokens.
- * - {number} start_in_after The beginning of the range in the list of after tokens.
- * - {number} end_in_after The end of the range in the list of after tokens.
- * @param {string} class_name (Optional) The class name to include in the wrapper tag.
- *
- * @return {string} The rendering of the list of operations.
- */
-function render_operations(
- before_tokens,
- after_tokens,
- operations,
- class_name
-) {
- var rendering = "";
- for (var i = 0; i < operations.length; i++) {
- var op = operations[i];
- const result = op_map[op.action](
- op,
- before_tokens,
- after_tokens,
- class_name
- );
- if (op.action === "replace") {
- rendering += result[0] + result[1];
- } else {
- rendering += result;
- }
- }
- return rendering;
-}
-
-/**
- * htmldiff thinks that atomic or component objects are equal if their tag names are the same, because of it <div class="slideshow"> === <div class="here"> for example
- * this function compares them
- */
-function render_equal_components(
- before,
- after,
- ops,
- class_name,
- components_search_rule
-) {
- var i, j, r, attrs;
- var op;
- var amount;
- var before_token, after_token;
- var before_token_match, after_token_match;
- for (i = 0; i < ops.length; i++) {
- op = ops[i];
- if (op.action === "equal") {
- amount = op.end_in_before - op.start_in_before + 1; // +1 since the array is 0 based
- for (j = 0; j < amount; j++) {
- before_token = before[op.start_in_before + j];
- after_token = after[op.start_in_after + j];
- if (before_token !== after_token) {
- before_token_match = components_search_rule.exec(before_token);
- after_token_match = components_search_rule.exec(after_token);
- if (before_token_match && after_token_match) {
- if (
- before_token_match[1].toLowerCase() ===
- after_token_match[1].toLowerCase()
- ) {
- // compare content of these two same components
- r = diff(before_token, after_token, class_name);
- after[op.start_in_after + j] = r;
- } else {
- // components are different, wrap before by 'del' and after by 'ins'
- attrs = class_name ? ' class="' + class_name + '"' : "";
- r =
- "<del" +
- attrs +
- ">" +
- before_token +
- "</del>" +
- "<ins" +
- attrs +
- ">" +
- after_token +
- "</ins>";
- after[op.start_in_after + j] = r;
- }
- }
- }
- }
- }
- }
-}
-
-/*
- * Compares two pieces of HTML content and returns the combined content with differences
- * wrapped in <ins> and <del> tags.
- *
- * @param {string} before The HTML content before the changes.
- * @param {string} after The HTML content after the changes.
- * @param {string} class_name (Optional) The class attribute to include in <ins> and <del> tags.
- *
- * @return {string} The combined HTML content with differences wrapped in <ins> and <del> tags.
- */
-function diff(before, after, class_name, components_search_rule) {
- if (before === after) return before;
- before = html_to_tokens(before, components_search_rule);
- after = html_to_tokens(after, components_search_rule);
- var ops = calculate_operations(before, after);
-
- if (components_search_rule) {
- render_equal_components(
- before,
- after,
- ops,
- class_name,
- components_search_rule
- );
- }
-
- return render_operations(before, after, ops, class_name);
-}
-
-function render_operations_dual_pane(before_tokens, after_tokens, operations) {
- var after_render, before_render, next_block, op, _i, _len;
- before_render = "";
- after_render = "";
- for (_i = 0, _len = operations.length; _i < _len; _i++) {
- op = operations[_i];
- next_block = op_map[op.action](op, before_tokens, after_tokens);
- switch (op.action) {
- case "equal":
- before_render += next_block;
- after_render += next_block;
- break;
- case "insert":
- after_render += next_block;
- break;
- case "delete":
- before_render += next_block;
- break;
- case "replace":
- before_render += next_block[0];
- after_render += next_block[1];
- break;
- default:
- continue;
- }
- }
- return return_dual_pane(before_render, after_render);
-}
-
-function diff_dual_pane(before, after) {
- if (!before || !after) return { before, after };
-
- var ops;
- if (before === after) {
- return return_dual_pane(before, after);
- }
- before = html_to_tokens(before);
- after = html_to_tokens(after);
- ops = calculate_operations(before, after);
- return render_operations_dual_pane(before, after, ops);
-}
-
-diff.html_to_tokens = html_to_tokens;
-diff.merge_html_by_class = merge_html_by_class;
-diff.find_matching_blocks = find_matching_blocks;
-
-find_matching_blocks.find_match = find_match;
-find_matching_blocks.create_index = create_index;
-find_matching_blocks.get_key_for_token = get_key_for_token;
-
-diff.calculate_operations = calculate_operations;
-diff.render_operations = render_operations;
-diff.diff_dual_pane = diff_dual_pane;
-
-diff.clean = function (html) {
- const tokens = html_to_tokens(html);
- let isDiffSpanOpen = false;
- return tokens.reduce((result, token) => {
- if (token.includes(`span class="diff-`)) {
- isDiffSpanOpen = true;
- return result;
- } else if (isDiffSpanOpen && token.includes("</span>")) {
- isDiffSpanOpen = false;
- return result;
- }
- return result + token;
- }, "");
-};
-
-if (self.document) {
- self.htmlDiff = diff;
-} else {
- self.addEventListener("message", onMessage);
-}
-
-function onMessage(ev) {
- const { type, data, messageId } = ev.data;
- try {
- switch (type) {
- case "generate": {
- const { before, after } = data;
- const result = diff.diff_dual_pane(before, after);
- sendMessage("generate", result, messageId);
- break;
- }
- case "clean": {
- const { html } = data;
- const cleanHtml = diff.clean(html);
- sendMessage("clean", cleanHtml, messageId);
- break;
- }
- default:
- return;
- }
- } catch (error) {
- console.error("Crypto worker error:", error, messageId, type);
- sendMessage(type, { error: error.message }, messageId);
- }
-}
-
-function sendMessage(type, data, messageId) {
- postMessage({ type, data, messageId });
-}
diff --git a/apps/web/scripts/analyze.js b/apps/web/scripts/analyze.js
index 969249969..e50d33e6d 100644
--- a/apps/web/scripts/analyze.js
+++ b/apps/web/scripts/analyze.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
process.env.NODE_ENV = "production";
const webpack = require("webpack");
diff --git a/apps/web/src/app-effects.js b/apps/web/src/app-effects.js
index 858df1301..e5a05f856 100644
--- a/apps/web/src/app-effects.js
+++ b/apps/web/src/app-effects.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect } from "react";
import { useStore } from "./stores/app-store";
import { useStore as useUserStore } from "./stores/user-store";
diff --git a/apps/web/src/app-effects.mobile.js b/apps/web/src/app-effects.mobile.js
index 7f4b0da21..784e39e9e 100644
--- a/apps/web/src/app-effects.mobile.js
+++ b/apps/web/src/app-effects.mobile.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect } from "react";
import { useStore } from "./stores/app-store";
import useSlider from "./hooks/use-slider";
@@ -14,7 +32,7 @@ export default function MobileAppEffects({ sliderId, overlayId, setShow }) {
const isFocusMode = useStore((store) => store.isFocusMode);
const [slideToIndex] = useSlider(sliderId, {
- onSliding: (e, { lastSlide, position, lastPosition }) => {
+ onSliding: (_e, { position }) => {
if (!isMobile) return;
const offset = 70;
const width = 300;
diff --git a/apps/web/src/app.js b/apps/web/src/app.js
index ca77bff0b..6e1a9be92 100644
--- a/apps/web/src/app.js
+++ b/apps/web/src/app.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useState, Suspense, useMemo, useRef, useEffect } from "react";
import { Box, Flex } from "@streetwriters/rebass";
import ThemeProvider from "./components/theme-provider";
diff --git a/apps/web/src/commands/change-app-theme.js b/apps/web/src/commands/change-app-theme.js
index f8620153c..260b0c931 100644
--- a/apps/web/src/commands/change-app-theme.js
+++ b/apps/web/src/commands/change-app-theme.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { invokeCommand } from "./index";
export default function changeAppTheme(theme) {
diff --git a/apps/web/src/commands/check-for-update.js b/apps/web/src/commands/check-for-update.js
index ec3b46464..42247bcaf 100644
--- a/apps/web/src/commands/check-for-update.js
+++ b/apps/web/src/commands/check-for-update.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EVENTS } from "@notesnook/desktop/events";
import { AppEventManager } from "../common/app-events";
import { isDesktop } from "../utils/platform";
diff --git a/apps/web/src/commands/download-update.js b/apps/web/src/commands/download-update.js
index d25778f4c..6c379dc4f 100644
--- a/apps/web/src/commands/download-update.js
+++ b/apps/web/src/commands/download-update.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { isDesktop } from "../utils/platform";
import { invokeCommand } from "./index";
diff --git a/apps/web/src/commands/index.js b/apps/web/src/commands/index.js
index a7158170a..8071bca69 100644
--- a/apps/web/src/commands/index.js
+++ b/apps/web/src/commands/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { AppEventManager } from "../common/app-events";
import { isDesktop } from "../utils/platform";
diff --git a/apps/web/src/commands/install-update.js b/apps/web/src/commands/install-update.js
index d072e2726..1fa44777a 100644
--- a/apps/web/src/commands/install-update.js
+++ b/apps/web/src/commands/install-update.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { isDesktop } from "../utils/platform";
import { invokeCommand } from "./index";
diff --git a/apps/web/src/commands/open.js b/apps/web/src/commands/open.js
index cbbfebfb0..f117c0c99 100644
--- a/apps/web/src/commands/open.js
+++ b/apps/web/src/commands/open.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { invokeCommand } from "./index";
export function openPath(path) {
diff --git a/apps/web/src/commands/save-file.js b/apps/web/src/commands/save-file.js
index b8d2a0743..d23de7058 100644
--- a/apps/web/src/commands/save-file.js
+++ b/apps/web/src/commands/save-file.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { invokeCommand } from "./index";
export default function saveFile(filePath, data) {
diff --git a/apps/web/src/commands/set-zoom-factor.js b/apps/web/src/commands/set-zoom-factor.js
index d7a1dd870..58ae47368 100644
--- a/apps/web/src/commands/set-zoom-factor.js
+++ b/apps/web/src/commands/set-zoom-factor.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { invokeCommand } from "./index";
export default function setZoomFactor(zoomFactor) {
diff --git a/apps/web/src/common/app-events.js b/apps/web/src/common/app-events.js
index 737fb6df3..59397a235 100644
--- a/apps/web/src/common/app-events.js
+++ b/apps/web/src/common/app-events.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import EventManager from "@notesnook/core/utils/event-manager";
export const AppEventManager = new EventManager();
diff --git a/apps/web/src/common/attachments.js b/apps/web/src/common/attachments.js
index 7922d1efa..d5fe96eed 100644
--- a/apps/web/src/common/attachments.js
+++ b/apps/web/src/common/attachments.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import FS from "../interfaces/fs";
import { db } from "./db";
diff --git a/apps/web/src/common/constants.ts b/apps/web/src/common/constants.ts
index 0e4ff9924..e54ddefdd 100644
--- a/apps/web/src/common/constants.ts
+++ b/apps/web/src/common/constants.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export const COLORS = [
"red",
"orange",
diff --git a/apps/web/src/common/db.js b/apps/web/src/common/db.js
index d2c06c035..da2d42458 100644
--- a/apps/web/src/common/db.js
+++ b/apps/web/src/common/db.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EventSourcePolyfill as EventSource } from "event-source-polyfill";
import { NNStorage } from "../interfaces/storage";
import { logger } from "../utils/logger";
diff --git a/apps/web/src/common/dialog-controller.tsx b/apps/web/src/common/dialog-controller.tsx
index b760e1ec4..da598bbae 100644
--- a/apps/web/src/common/dialog-controller.tsx
+++ b/apps/web/src/common/dialog-controller.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ReactDOM from "react-dom";
import { Dialogs } from "../components/dialogs";
import { hardNavigate } from "../navigation";
@@ -36,7 +54,7 @@ function showDialog<TId extends DialogIds, TReturnType>(
id: TId,
render: RenderDialog<TId, TReturnType>
): Promise<TReturnType> {
- return new Promise((resolve, reject) => {
+ return new Promise((resolve) => {
if (openDialogs[id]) return false;
const container = document.createElement("div");
@@ -73,7 +91,7 @@ export function showAddNotebookDialog() {
return showDialog("AddNotebookDialog", (Dialog, perform) => (
<Dialog
isOpen={true}
- onDone={async (nb: any) => {
+ onDone={async (nb: Record<string, unknown>) => {
// add the notebook to db
await db.notebooks?.add({ ...nb });
notebookStore.refresh();
@@ -96,13 +114,13 @@ export function showEditNotebookDialog(notebookId: string) {
isOpen={true}
notebook={notebook}
edit={true}
- onDone={async (nb: any, deletedTopics: string[]) => {
+ onDone={async (nb: Record<string, unknown>, deletedTopics: string[]) => {
// we remove the topics from notebook
// beforehand so we can add them manually, later
const topics = qclone(nb.topics);
nb.topics = [];
- let notebookId = await db.notebooks?.add(nb);
+ const notebookId = await db.notebooks?.add(nb);
// add or delete topics as required
const notebookTopics = db.notebooks?.notebook(notebookId).topics;
@@ -311,7 +329,7 @@ export function showLoadingDialog(dialogData: LoadingDialogProps) {
type ProgressDialogProps = {
title: string;
subtitle: string;
- action: any;
+ action: (...args: never[]) => void;
};
export function showProgressDialog<T>(dialogData: ProgressDialogProps) {
const { title, subtitle, action } = dialogData;
@@ -473,7 +491,7 @@ export function showCreateTopicDialog() {
onClose={() => {
perform(false);
}}
- onAction={async (topic: any) => {
+ onAction={async (topic: Record<string, unknown>) => {
if (!topic) return;
const notebookId = notebookStore.get().selectedNotebookId;
await db.notebooks?.notebook(notebookId).topics.add(topic);
@@ -486,9 +504,8 @@ export function showCreateTopicDialog() {
}
export function showEditTopicDialog(notebookId: string, topicId: string) {
- const topic: any = db.notebooks
- ?.notebook(notebookId)
- ?.topics?.topic(topicId)?._topic;
+ const topic = db.notebooks?.notebook(notebookId)?.topics?.topic(topicId)
+ ?._topic as Record<string, unknown> | undefined;
if (!topic) return;
return showDialog("ItemDialog", (Dialog, perform) => (
<Dialog
@@ -500,7 +517,7 @@ export function showEditTopicDialog(notebookId: string, topicId: string) {
onClose={() => perform(false)}
onAction={async (t: string) => {
await db.notebooks
- ?.notebook(topic.notebookId)
+ ?.notebook(topic.notebookId as string)
.topics.add({ ...topic, title: t });
notebookStore.setSelectedNotebook(topic.notebookId);
appStore.refreshNavItems();
@@ -606,7 +623,7 @@ export function showTrackingDetailsDialog() {
}
export function showAnnouncementDialog(
- announcement: any,
+ announcement: { id: string },
remove: (id: string) => void
) {
return showDialog("AnnouncementDialog", (Dialog, perform) => (
diff --git a/apps/web/src/common/export.ts b/apps/web/src/common/export.ts
index ef76cf8d5..db39cccca 100644
--- a/apps/web/src/common/export.ts
+++ b/apps/web/src/common/export.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { db } from "./db";
import { TaskManager } from "./task-manager";
import { zip } from "../utils/zip";
@@ -10,7 +28,7 @@ export async function exportToPDF(
): Promise<boolean> {
if (!content) return false;
const { default: printjs } = await import("print-js");
- return new Promise(async (resolve) => {
+ return new Promise((resolve) => {
printjs({
printable: content,
type: "raw-html",
@@ -35,14 +53,16 @@ export async function exportNotes(
subtitle: "Please wait while your notes are exported.",
action: async (report) => {
if (format === "pdf") {
- const note = db.notes!.note(noteIds[0]);
+ const note = db.notes?.note(noteIds[0]);
+ if (!note) return false;
return await exportToPDF(note.title, await note.export("html", null));
}
- var files = [];
+ const files = [];
let index = 0;
- for (var noteId of noteIds) {
- const note = db.notes!.note(noteId);
+ for (const noteId of noteIds) {
+ const note = db.notes?.note(noteId);
+ if (!note) continue;
report({
current: ++index,
total: noteIds.length,
diff --git a/apps/web/src/common/height-calculator.js b/apps/web/src/common/height-calculator.js
index 4bf41bec1..e90c84900 100644
--- a/apps/web/src/common/height-calculator.js
+++ b/apps/web/src/common/height-calculator.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const SINGLE_LINE_HEIGHT = 1.4;
const DEFAULT_FONT_SIZE = document.getElementById("p").clientHeight - 1;
diff --git a/apps/web/src/common/index.js b/apps/web/src/common/index.js
index f05ecb7b6..cffd99fb7 100644
--- a/apps/web/src/common/index.js
+++ b/apps/web/src/common/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
showFeatureDialog,
showLoadingDialog,
@@ -82,7 +100,7 @@ export async function selectBackupFile() {
if (!file) return;
const reader = new FileReader();
- const backup = await new Promise((resolve, reject) => {
+ const backup = await new Promise((resolve) => {
reader.addEventListener("load", (event) => {
const text = event.target.result;
try {
diff --git a/apps/web/src/common/key-map.js b/apps/web/src/common/key-map.js
index 26a78de8f..29a2d827f 100644
--- a/apps/web/src/common/key-map.js
+++ b/apps/web/src/common/key-map.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import hotkeys from "hotkeys-js";
import { navigate } from "../navigation";
// import { store as themestore } from "../stores/theme-store";
@@ -111,7 +129,7 @@ const KEYMAP = [
];
export function registerKeyMap() {
- hotkeys.filter = function (e) {
+ hotkeys.filter = function () {
return true;
};
diff --git a/apps/web/src/common/list-profiles.js b/apps/web/src/common/list-profiles.js
index ae493b12a..b1fbcd52f 100644
--- a/apps/web/src/common/list-profiles.js
+++ b/apps/web/src/common/list-profiles.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { navigate } from "../navigation/";
import Note from "../components/note";
import Notebook from "../components/notebook";
@@ -77,7 +95,7 @@ const TrashProfile = createProfile(
);
const AttachmentProfile = createProfile(
- (index, item, type) => <Attachment index={index} item={item} />,
+ (index, item) => <Attachment index={index} item={item} />,
(item) => getNoteHeight(item),
Math.max(MAX_HEIGHTS.note, MAX_HEIGHTS.notebook)
);
diff --git a/apps/web/src/common/multi-select.ts b/apps/web/src/common/multi-select.ts
index 2e0a7a182..62ffd38f4 100644
--- a/apps/web/src/common/multi-select.ts
+++ b/apps/web/src/common/multi-select.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { showMultiDeleteConfirmation } from "./dialog-controller";
import { store as noteStore } from "../stores/note-store";
import { store as notebookStore } from "../stores/notebook-store";
@@ -8,7 +26,13 @@ import Vault from "./vault";
import { showItemDeletedToast } from "./toasts";
import { TaskManager } from "./task-manager";
-async function moveNotesToTrash(notes: any[], confirm = true) {
+type Item = {
+ id: string;
+ locked?: boolean;
+ metadata?: Record<string, unknown>;
+};
+
+async function moveNotesToTrash(notes: Item[], confirm = true) {
const item = notes[0];
if (confirm && !(await showMultiDeleteConfirmation(notes.length))) return;
@@ -22,7 +46,7 @@ async function moveNotesToTrash(notes: any[], confirm = true) {
}
const items = notes.map((item) => {
- if (item.locked || db.monographs!.isPublished(item.id)) return 0;
+ if (item.locked || db.monographs?.isPublished(item.id)) return 0;
return item.id;
});
@@ -40,7 +64,7 @@ async function moveNotesToTrash(notes: any[], confirm = true) {
showToast("success", `${items.length} notes moved to trash`);
}
-async function moveNotebooksToTrash(notebooks: any[]) {
+async function moveNotebooksToTrash(notebooks: Item[]) {
const item = notebooks[0];
const isMultiselect = notebooks.length > 1;
if (isMultiselect) {
@@ -67,7 +91,7 @@ async function moveNotebooksToTrash(notebooks: any[]) {
}
}
-async function deleteTopics(notebookId: string, topics: any[]) {
+async function deleteTopics(notebookId: string, topics: Item[]) {
await TaskManager.startTask({
type: "status",
id: "deleteTopics",
@@ -75,8 +99,8 @@ async function deleteTopics(notebookId: string, topics: any[]) {
report({
text: `Deleting ${topics.length} topics...`
});
- await db
- .notebooks!.notebook(notebookId)
+ await db.notebooks
+ ?.notebook(notebookId)
.topics.delete(...topics.map((t) => t.id));
notebookStore.setSelectedNotebook(notebookId);
}
@@ -84,7 +108,7 @@ async function deleteTopics(notebookId: string, topics: any[]) {
showToast("success", `${topics.length} topics deleted`);
}
-async function deleteAttachments(attachments: any[]) {
+async function deleteAttachments(attachments: Item[]) {
if (
!window.confirm(
"Are you sure you want to permanently delete these attachments? This action is IRREVERSIBLE."
@@ -103,7 +127,7 @@ async function deleteAttachments(attachments: any[]) {
current: i,
total: attachments.length
});
- await attachmentStore.permanentDelete(attachment.metadata.hash);
+ await attachmentStore.permanentDelete(attachment.metadata?.hash);
}
}
});
diff --git a/apps/web/src/common/reminders.js b/apps/web/src/common/reminders.js
index 44b64aa15..509279d3b 100644
--- a/apps/web/src/common/reminders.js
+++ b/apps/web/src/common/reminders.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Config from "../utils/config";
import { createBackup, verifyAccount } from "./index";
import { db } from "./db";
diff --git a/apps/web/src/common/store.js b/apps/web/src/common/store.js
index 078397fc9..f6b638fb1 100644
--- a/apps/web/src/common/store.js
+++ b/apps/web/src/common/store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import produce, { immerable, setAutoFreeze } from "immer";
import create from "zustand";
setAutoFreeze(false);
diff --git a/apps/web/src/common/task-manager.ts b/apps/web/src/common/task-manager.ts
index b3b405b82..132bfc815 100644
--- a/apps/web/src/common/task-manager.ts
+++ b/apps/web/src/common/task-manager.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { removeStatus, updateStatus } from "../hooks/use-status";
import { showProgressDialog } from "./dialog-controller";
@@ -38,7 +56,7 @@ type ProgressReportCallback = (progress: TaskProgress) => void;
export class TaskManager {
static async startTask<T>(task: TaskDefinition<T>): Promise<T> {
switch (task.type) {
- case "status":
+ case "status": {
const statusTask = task;
const result = await statusTask.action((progress) => {
let percentage: number | undefined = undefined;
@@ -54,12 +72,14 @@ export class TaskManager {
});
removeStatus(statusTask.id);
return result;
- case "modal":
+ }
+ case "modal": {
return await showProgressDialog<T>({
title: task.title,
subtitle: task.subtitle,
action: task.action
});
+ }
}
}
}
diff --git a/apps/web/src/common/toasts.js b/apps/web/src/common/toasts.js
index ef00212f5..e45f149ac 100644
--- a/apps/web/src/common/toasts.js
+++ b/apps/web/src/common/toasts.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { db } from "./db";
import { store as notestore } from "../stores/note-store";
import { store as nbstore } from "../stores/notebook-store";
diff --git a/apps/web/src/common/toolbar-config.ts b/apps/web/src/common/toolbar-config.ts
index 95a061770..b301b4aa2 100644
--- a/apps/web/src/common/toolbar-config.ts
+++ b/apps/web/src/common/toolbar-config.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { getDefaultPresets, ToolbarGroupDefinition } from "@notesnook/editor";
import { db } from "./db";
diff --git a/apps/web/src/common/vault.js b/apps/web/src/common/vault.js
index 922a72697..2c3f1afa2 100644
--- a/apps/web/src/common/vault.js
+++ b/apps/web/src/common/vault.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { db } from "../common/db";
import { showPasswordDialog } from "../common/dialog-controller";
import { showToast } from "../utils/toast";
diff --git a/apps/web/src/components/accent-item/index.js b/apps/web/src/components/accent-item/index.js
index 6364e069b..78be75869 100644
--- a/apps/web/src/components/accent-item/index.js
+++ b/apps/web/src/components/accent-item/index.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex } from "@streetwriters/rebass";
import * as Icon from "../icons";
import { useStore as useThemeStore } from "../../stores/theme-store";
diff --git a/apps/web/src/components/accordion/index.js b/apps/web/src/components/accordion/index.js
index b2de12845..8b5be5746 100644
--- a/apps/web/src/components/accordion/index.js
+++ b/apps/web/src/components/accordion/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text } from "@streetwriters/rebass";
import { useEffect, useState } from "react";
import { ChevronDown, ChevronUp } from "../icons";
diff --git a/apps/web/src/components/animated/index.js b/apps/web/src/components/animated/index.js
index ce4568d15..966ea20b2 100644
--- a/apps/web/src/components/animated/index.js
+++ b/apps/web/src/components/animated/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { m } from "framer-motion";
import { Flex, Box, Image, Text } from "@streetwriters/rebass";
import { Input } from "@streetwriters/rebass-forms";
diff --git a/apps/web/src/components/announcements/body.js b/apps/web/src/components/announcements/body.js
index 8ccec339c..ba576ed17 100644
--- a/apps/web/src/components/announcements/body.js
+++ b/apps/web/src/components/announcements/body.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
Box,
Button,
@@ -141,7 +159,7 @@ function List({ item }) {
flexDirection="column"
>
{items.map((item) => (
- <ListItem item={item} />
+ <ListItem key={item.text} item={item} />
))}
</Flex>
);
@@ -207,6 +225,7 @@ function CalltoActions({ item, removeAnnouncement }) {
)
.map((action, index) => (
<CalltoAction
+ key={index}
action={action}
index={index}
variant={
@@ -272,24 +291,29 @@ function CalltoAction({ action, variant, sx, removeAnnouncement }) {
closeOpenedDialog();
trackEvent(ANALYTICS_EVENTS.announcementCta, action.data);
switch (action.type) {
- case "link":
+ case "link": {
const url = new URL(action.data);
const target =
url.origin === window.location.origin ? "_self" : "_blank";
window.open(action.data, target, "noopener noreferrer");
break;
- case "promo":
+ }
+ case "promo": {
const [coupon, plan] = action.data.split(":");
await showBuyDialog(plan, coupon);
break;
- case "force-sync":
+ }
+ case "force-sync": {
await appStore.sync(true, true);
break;
- case "backup":
+ }
+ case "backup": {
await createBackup(true);
break;
- default:
+ }
+ default: {
return;
+ }
}
}}
>
diff --git a/apps/web/src/components/announcements/index.js b/apps/web/src/components/announcements/index.js
index 811d1a2a0..db2947966 100644
--- a/apps/web/src/components/announcements/index.js
+++ b/apps/web/src/components/announcements/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useMemo } from "react";
import { Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/attachment/index.js b/apps/web/src/components/attachment/index.js
index 70bc416d0..ef74f96d6 100644
--- a/apps/web/src/components/attachment/index.js
+++ b/apps/web/src/components/attachment/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Flex, Text } from "@streetwriters/rebass";
import { formatBytes } from "../../utils/filename";
import ListItem from "../list-item";
diff --git a/apps/web/src/components/auth-container/index.js b/apps/web/src/components/auth-container/index.js
index c62e0755f..258764925 100644
--- a/apps/web/src/components/auth-container/index.js
+++ b/apps/web/src/components/auth-container/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useMemo } from "react";
import { Box, Flex, Image, Text } from "@streetwriters/rebass";
import ThemeProvider from "../theme-provider";
@@ -91,27 +109,27 @@ function AuthContainer(props) {
<path
d="M1184.21-85.14C1033.8-60.27 964.89 302.42 717.38 307.22 469.87 312.02 483.97 244.72 250.55 244.72 17.13 244.72-98.53 307.08-216.28 307.22"
stroke="var(--text)"
- stroke-width="2"
+ strokeWidth="2"
></path>
<path
d="M641.38-10.43C534.57 43 590.55 387.5 384.53 392.38 178.52 397.26 2.17 282.99-129.16 282.38"
stroke="var(--text)"
- stroke-width="2"
+ strokeWidth="2"
></path>
<path
d="M1136.18-29.24C957.53-5.77 852.26 404.49 561.01 405.07 269.76 405.65 142.54 160.4-14.16 155.07"
stroke="var(--text)"
- stroke-width="2"
+ strokeWidth="2"
></path>
<path
d="M508.47-71.88C398.16-66.29 333.42 117.75 114.38 127.84-104.65 137.93-170.96 308.31-279.7 312.84"
stroke="var(--text)"
- stroke-width="2"
+ strokeWidth="2"
></path>
<path
d="M1104.88-26.74C976.63-19.04 883.5 217.2 653.03 218.11 422.55 219.02 427.1 155.61 201.17 155.61-24.75 155.61-136.64 217.96-250.68 218.11"
stroke="var(--text)"
- stroke-width="2"
+ strokeWidth="2"
></path>
</g>
<defs>
diff --git a/apps/web/src/components/cached-router/index.js b/apps/web/src/components/cached-router/index.js
index 3a287e557..81c83ff1d 100644
--- a/apps/web/src/components/cached-router/index.js
+++ b/apps/web/src/components/cached-router/index.js
@@ -1,4 +1,22 @@
-import React, { useEffect } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { useEffect } from "react";
import ReactDOM from "react-dom";
import { getHomeRoute, NavigationEvents } from "../../navigation";
import { store as selectionStore } from "../../stores/selection-store";
diff --git a/apps/web/src/components/dialogs/add-notebook-dialog.js b/apps/web/src/components/dialogs/add-notebook-dialog.js
index dc9d813d4..38a360c6d 100644
--- a/apps/web/src/components/dialogs/add-notebook-dialog.js
+++ b/apps/web/src/components/dialogs/add-notebook-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/dialogs/announcement-dialog.js b/apps/web/src/components/dialogs/announcement-dialog.js
index e990ddfba..835378ece 100644
--- a/apps/web/src/components/dialogs/announcement-dialog.js
+++ b/apps/web/src/components/dialogs/announcement-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Modal from "react-modal";
import { useTheme } from "@emotion/react";
import { Flex } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/dialogs/attachments-dialog.js b/apps/web/src/components/dialogs/attachments-dialog.js
index 7a6386f53..9cd6f63e0 100644
--- a/apps/web/src/components/dialogs/attachments-dialog.js
+++ b/apps/web/src/components/dialogs/attachments-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect } from "react";
import { Flex } from "@streetwriters/rebass";
import { getTotalSize } from "../../common/attachments";
diff --git a/apps/web/src/components/dialogs/buy-dialog/buy-dialog.tsx b/apps/web/src/components/dialogs/buy-dialog/buy-dialog.tsx
index 0a8b67971..d42909c1e 100644
--- a/apps/web/src/components/dialogs/buy-dialog/buy-dialog.tsx
+++ b/apps/web/src/components/dialogs/buy-dialog/buy-dialog.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useRef, useState } from "react";
import { Text, Flex, Button } from "@streetwriters/rebass";
import * as Icon from "../../icons";
@@ -20,6 +38,7 @@ import { TaskManager } from "../../../common/task-manager";
import { db } from "../../../common/db";
import { useCheckoutStore } from "./store";
import { getCurrencySymbol } from "./helpers";
+import { Theme } from "@notesnook/theme";
type BuyDialogProps = {
couponCode?: string;
@@ -29,7 +48,7 @@ type BuyDialogProps = {
export function BuyDialog(props: BuyDialogProps) {
const { onClose, couponCode, plan } = props;
- const theme: any = useTheme();
+ const theme = useTheme() as Theme;
useEffect(() => {
return () => {
@@ -44,11 +63,13 @@ export function BuyDialog(props: BuyDialogProps) {
shouldCloseOnEsc
shouldReturnFocusAfterClose
shouldFocusAfterRender
- onAfterOpen={(e: any) => {
- if (!onClose) return;
+ onAfterOpen={(e) => {
+ if (!e || !onClose) return;
// we need this work around because ReactModal content spreads over the overlay
const child = e.contentEl.firstElementChild;
- e.contentEl.onmousedown = function (e: any) {
+ if (!child || !(child instanceof HTMLElement)) return;
+
+ e.contentEl.onmousedown = function (e) {
if (!e.screenX && !e.screenY) return;
if (
e.x < child.offsetLeft ||
@@ -209,7 +230,6 @@ function Details(props: DetailsProps) {
return (
<PaddleCheckout
plan={selectedPlan}
- // @ts-ignore TODO
theme={theme}
user={user}
coupon={couponCode}
@@ -345,32 +365,29 @@ function SelectedPlan(props: SelectedPlanProps) {
onApplyCoupon(undefined);
}, [onApplyCoupon, setIsApplyingCoupon]);
- useEffect(
- () => {
- if (!couponInputRef.current) return;
- setIsApplyingCoupon(false);
+ useEffect(() => {
+ if (!couponInputRef.current) return;
+ setIsApplyingCoupon(false);
- const couponValue = couponInputRef.current.value;
+ const couponValue = couponInputRef.current.value;
- const isInvalidCoupon =
- (!!couponValue && couponValue !== pricingInfo?.coupon) ||
- (!!couponCode && couponCode !== pricingInfo?.coupon);
+ const isInvalidCoupon =
+ (!!couponValue && couponValue !== pricingInfo?.coupon) ||
+ (!!couponCode && couponCode !== pricingInfo?.coupon);
- setIsInvalidCoupon(isInvalidCoupon);
- if (isInvalidCoupon) {
- if (couponCode) couponInputRef.current.value = couponCode;
- return;
- }
+ setIsInvalidCoupon(isInvalidCoupon);
+ if (isInvalidCoupon) {
+ if (couponCode) couponInputRef.current.value = couponCode;
+ return;
+ }
- const pricingInfoCoupon = pricingInfo?.coupon || "";
- if (couponValue !== pricingInfoCoupon) {
- couponInputRef.current.value = pricingInfoCoupon;
- onApplyCoupon(pricingInfo?.coupon);
- }
- },
+ const pricingInfoCoupon = pricingInfo?.coupon || "";
+ if (couponValue !== pricingInfoCoupon) {
+ couponInputRef.current.value = pricingInfoCoupon;
+ onApplyCoupon(pricingInfo?.coupon);
+ }
// eslint-disable-next-line react-hooks/exhaustive-deps
- [pricingInfo, onApplyCoupon, setIsApplyingCoupon]
- );
+ }, [pricingInfo, onApplyCoupon, setIsApplyingCoupon]);
return (
<>
diff --git a/apps/web/src/components/dialogs/buy-dialog/features.tsx b/apps/web/src/components/dialogs/buy-dialog/features.tsx
index 3345b3015..4071e0953 100644
--- a/apps/web/src/components/dialogs/buy-dialog/features.tsx
+++ b/apps/web/src/components/dialogs/buy-dialog/features.tsx
@@ -1,9 +1,28 @@
-import { Text, Flex, Box } from "@streetwriters/rebass";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { Text, Flex, Box, BoxProps } from "@streetwriters/rebass";
import * as Icon from "../../icons";
type Feature = {
+ id: string;
title?: string;
- icon?: (props: any) => JSX.Element;
+ icon?: (props: BoxProps) => JSX.Element;
pro?: boolean;
};
@@ -23,22 +42,27 @@ const sections: Section[] = [
"Everything you do in Notesnook stays private. We use XChaCha20-Poly1305-IETF and Argon2 to encrypt your notes.",
features: [
{
+ id: "zero-ads",
title: "Zero ads & zero trackers",
icon: Icon.Billboard
},
{
+ id: "on-device-encryption",
title: "On device encryption",
icon: Icon.Cellphone
},
{
+ id: "secure-app-lock",
title: "Secure app lock for all",
icon: Icon.CellphoneLock
},
{
+ id: "end-to-end-encrypted",
title: "100% end-to-end encrypted",
icon: Icon.Lock
},
{
+ id: "private-vault",
title: "Private vault for notes",
icon: Icon.ShieldLock,
pro: true
@@ -57,27 +81,35 @@ const sections: Section[] = [
columns: 8,
features: [
{
+ id: "ios",
icon: Icon.iOS
},
{
+ id: "android",
icon: Icon.Android
},
{
+ id: "windows",
icon: Icon.Windows
},
{
+ id: "linux",
icon: Icon.Linux
},
{
+ id: "macos",
icon: Icon.MacOS
},
{
+ id: "chrome",
icon: Icon.Chrome
},
{
+ id: "firefox",
icon: Icon.Firefox
},
{
+ id: "safari",
icon: Icon.Safari
}
]
@@ -89,22 +121,27 @@ const sections: Section[] = [
pro: true,
features: [
{
+ id: "bulletproof-encryption",
title: "Bulletproof encryption",
icon: Icon.Lock
},
{
+ id: "4k-images",
title: "High quality 4K images",
icon: Icon.ImageMultiple
},
{
+ id: "unlimited-storage",
title: "Unlimited storage",
icon: Icon.Harddisk
},
{
+ id: "500-mb-files",
title: "Upto 500 MB per file",
icon: Icon.FileCabinet
},
{
+ id: "file-types",
title: "All file types supported",
icon: Icon.File
}
@@ -121,14 +158,17 @@ const sections: Section[] = [
"Publishing is nothing new but we offer fully encrypted, anonymous publishing. Take any note & share it with the world.",
features: [
{
+ id: "anon-publishing",
title: "Anonymous publishing",
icon: Icon.Anonymous
},
{
+ id: "password-protected-publishing",
title: "Password protection",
icon: Icon.CloudLock
},
{
+ id: "self-destructive-notes",
title: "Self destructable notes",
icon: Icon.Timebomb
}
@@ -140,20 +180,24 @@ const sections: Section[] = [
"We offer multiple ways to keep you organized. The only limit is your imagination.",
features: [
{
+ id: "unlimited-notebooks",
title: "Unlimited notebooks*",
icon: Icon.Notebook2,
pro: true
},
{
+ id: "colors-tags",
title: "Colors & tags*",
icon: Icon.Palette,
pro: true
},
{
+ id: "side-menu-shortcuts",
title: "Side menu shortcuts",
icon: Icon.Shortcut
},
{
+ id: "pins-favorites",
title: "Pins & favorites",
icon: Icon.Pin
}
@@ -168,18 +212,22 @@ const sections: Section[] = [
pro: true,
features: [
{
+ id: "lists-tables",
title: "Lists & tables",
icon: Icon.Table
},
{
+ id: "image-embeds",
title: "Images & embeds",
icon: Icon.Embed
},
{
+ id: "checklists",
title: "Checklists",
icon: Icon.CheckCircleOutline
},
{
+ id: "md-shortcuts",
title: "Markdown shortcuts",
icon: Icon.Markdown
}
@@ -192,25 +240,30 @@ const sections: Section[] = [
// info: "* Free users can export notes in well formatted plain text.",
features: [
{
+ id: "export-markdown",
title: "Export as Markdown",
icon: Icon.Markdown,
pro: true
},
{
+ id: "export-pdf",
title: "Export as PDF",
icon: Icon.PDF,
pro: true
},
{
+ id: "export-html",
title: "Export as HTML",
icon: Icon.HTML,
pro: true
},
{
+ id: "export-txt",
title: "Export as text",
icon: Icon.Text
},
{
+ id: "bulk-exports",
title: "Bulk exports",
icon: Icon.Export
}
@@ -222,11 +275,13 @@ const sections: Section[] = [
"Do not worry about losing your data. Turn on automatic backups on weekly or daily basis.",
features: [
{
+ id: "auto-backups",
title: "Automatic monthly, weekly & daily backups",
icon: Icon.Backup,
pro: true
},
{
+ id: "backup-encryption",
title: "Backup encryption",
icon: Icon.EncryptedBackup,
pro: true
@@ -240,14 +295,17 @@ const sections: Section[] = [
pro: true,
features: [
{
+ id: "10-themes",
title: "10+ themes",
icon: Icon.Accent
},
{
+ id: "dark-mode",
title: "Automatic dark mode",
icon: Icon.Theme
},
{
+ id: "default-home-page",
title: "Change default home page",
icon: Icon.Home
}
@@ -267,7 +325,7 @@ export function Features() {
bg="background"
>
{sections.map((section) => (
- <Flex flexDirection="column" px={6} pb={50}>
+ <Flex key={section.title} flexDirection="column" px={6} pb={50}>
{section.pro && (
<Flex
bg="bgSecondary"
@@ -301,7 +359,11 @@ export function Features() {
mt={4}
>
{section.features.map((feature) => (
- <Flex alignItems="start" flexDirection="column">
+ <Flex
+ key={feature.id}
+ alignItems="start"
+ flexDirection="column"
+ >
{feature.icon && (
<feature.icon size={20} color="text" sx={{ mb: 1 }} />
)}
diff --git a/apps/web/src/components/dialogs/buy-dialog/helpers.ts b/apps/web/src/components/dialogs/buy-dialog/helpers.ts
index bd343ae57..d9ee7b661 100644
--- a/apps/web/src/components/dialogs/buy-dialog/helpers.ts
+++ b/apps/web/src/components/dialogs/buy-dialog/helpers.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
getCurrencySymbol as _getSymbol,
ICurrencySymbols
diff --git a/apps/web/src/components/dialogs/buy-dialog/index.ts b/apps/web/src/components/dialogs/buy-dialog/index.ts
index 8079239c2..cc9b31444 100644
--- a/apps/web/src/components/dialogs/buy-dialog/index.ts
+++ b/apps/web/src/components/dialogs/buy-dialog/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export { BuyDialog as default } from "./buy-dialog";
diff --git a/apps/web/src/components/dialogs/buy-dialog/paddle.tsx b/apps/web/src/components/dialogs/buy-dialog/paddle.tsx
index b6fb0e3d0..c18b0f92d 100644
--- a/apps/web/src/components/dialogs/buy-dialog/paddle.tsx
+++ b/apps/web/src/components/dialogs/buy-dialog/paddle.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState, useRef, useCallback } from "react";
import { Box, Flex } from "@streetwriters/rebass";
import Loader from "../../loader";
diff --git a/apps/web/src/components/dialogs/buy-dialog/plan-list.tsx b/apps/web/src/components/dialogs/buy-dialog/plan-list.tsx
index 78715de7e..45ddecd7e 100644
--- a/apps/web/src/components/dialogs/buy-dialog/plan-list.tsx
+++ b/apps/web/src/components/dialogs/buy-dialog/plan-list.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Text, Flex, Button } from "@streetwriters/rebass";
import * as Icon from "../../icons";
import { ReactComponent as Nomad } from "../../../assets/nomad.svg";
@@ -40,6 +58,7 @@ export function PlansList(props: PlansListProps) {
const metadata = PLAN_METADATA[plan.period];
return (
<Button
+ key={metadata.title}
disabled={isLoading}
data-test-id={`checkout-plan-${plan.period}`}
variant="tool"
diff --git a/apps/web/src/components/dialogs/buy-dialog/plans.ts b/apps/web/src/components/dialogs/buy-dialog/plans.ts
index fb0bca1e7..fe5bc5b75 100644
--- a/apps/web/src/components/dialogs/buy-dialog/plans.ts
+++ b/apps/web/src/components/dialogs/buy-dialog/plans.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { isTesting } from "../../../utils/platform";
import { Period, Plan } from "./types";
@@ -31,7 +49,7 @@ export const PLAN_METADATA: Record<Period, PlanMetadata> = {
yearly: { title: "Yearly", subtitle: `Pay once a year.` }
};
-var CACHED_PLANS: Plan[];
+let CACHED_PLANS: Plan[];
export async function getPlans(): Promise<Plan[] | null> {
if (isTesting()) return DEFAULT_PLANS;
if (CACHED_PLANS) return CACHED_PLANS;
@@ -53,7 +71,7 @@ export function usePlans() {
(async function () {
try {
setIsLoading(true);
- let plans = await getPlans();
+ const plans = await getPlans();
if (!plans) return;
setPlans(plans);
setDiscount(Math.max(...plans.map((p) => p.discount)));
diff --git a/apps/web/src/components/dialogs/buy-dialog/store.ts b/apps/web/src/components/dialogs/buy-dialog/store.ts
index 61c70816d..7ebd00192 100644
--- a/apps/web/src/components/dialogs/buy-dialog/store.ts
+++ b/apps/web/src/components/dialogs/buy-dialog/store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Plan, PricingInfo } from "./types";
import create from "zustand";
import produce from "immer";
@@ -13,7 +31,7 @@ interface ICheckoutStore {
onApplyCoupon: (couponCode?: string) => void;
reset: () => void;
}
-export const useCheckoutStore = create<ICheckoutStore>((set, get) => ({
+export const useCheckoutStore = create<ICheckoutStore>((set) => ({
selectedPlan: undefined,
pricingInfo: undefined,
couponCode: undefined,
diff --git a/apps/web/src/components/dialogs/buy-dialog/types.ts b/apps/web/src/components/dialogs/buy-dialog/types.ts
index e8b411ba1..1f8fa6123 100644
--- a/apps/web/src/components/dialogs/buy-dialog/types.ts
+++ b/apps/web/src/components/dialogs/buy-dialog/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export type Period = "monthly" | "yearly";
export enum PaddleEvents {
@@ -112,7 +130,7 @@ export interface CheckoutData {
charge_currency: string;
customer: Customer;
items: Item[];
- available_payment_methods: any[];
+ available_payment_methods: unknown[];
total: TotalPrice[];
pending_payment: boolean;
completed: boolean;
diff --git a/apps/web/src/components/dialogs/confirm.js b/apps/web/src/components/dialogs/confirm.js
index 52a804bd7..6d3563fb1 100644
--- a/apps/web/src/components/dialogs/confirm.js
+++ b/apps/web/src/components/dialogs/confirm.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Text } from "@streetwriters/rebass";
import Dialog from "./dialog";
diff --git a/apps/web/src/components/dialogs/dialog-loader.tsx b/apps/web/src/components/dialogs/dialog-loader.tsx
index 9ba6da422..d11be0647 100644
--- a/apps/web/src/components/dialogs/dialog-loader.tsx
+++ b/apps/web/src/components/dialogs/dialog-loader.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Dialog from "./dialog";
import Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css";
diff --git a/apps/web/src/components/dialogs/dialog.js b/apps/web/src/components/dialogs/dialog.js
index cd9a05658..45e2a3c28 100644
--- a/apps/web/src/components/dialogs/dialog.js
+++ b/apps/web/src/components/dialogs/dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text, Button as RebassButton } from "@streetwriters/rebass";
import * as Icon from "../icons";
import Modal from "react-modal";
diff --git a/apps/web/src/components/dialogs/email-verification-dialog.js b/apps/web/src/components/dialogs/email-verification-dialog.js
index 64190de1b..5eef1d65f 100644
--- a/apps/web/src/components/dialogs/email-verification-dialog.js
+++ b/apps/web/src/components/dialogs/email-verification-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect } from "react";
import { Flex, Text } from "@streetwriters/rebass";
import Dialog from "./dialog";
@@ -85,8 +103,8 @@ function EmailVerificationDialog(props) {
sx={{ mt: 2, bg: "bgSecondary", borderRadius: "default" }}
>
<Text variant={"body"} px={1} pb={1}>
- If you didn't get an email from us or the confirmation link isn't
- working,{" "}
+ {`If you didn't get an email from us or the confirmation link isn't
+ working,`}{" "}
<b>please send us an email from your registered email address</b>{" "}
and we will manually confirm your account.
</Text>
diff --git a/apps/web/src/components/dialogs/feature-dialog.tsx b/apps/web/src/components/dialogs/feature-dialog.tsx
index 332d6f76a..421bab3ea 100644
--- a/apps/web/src/components/dialogs/feature-dialog.tsx
+++ b/apps/web/src/components/dialogs/feature-dialog.tsx
@@ -1,4 +1,22 @@
-import { Text, Flex } from "@streetwriters/rebass";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { Text, Flex, BoxProps } from "@streetwriters/rebass";
import Dialog from "./dialog";
import * as Icon from "../icons";
import { getHomeRoute, hardNavigate } from "../../navigation";
@@ -9,12 +27,12 @@ import { useEffect } from "react";
type CallToAction = {
title: string;
- icon?: (props: any) => JSX.Element;
+ icon?: (props: BoxProps) => JSX.Element;
action?: () => void;
};
type SubFeature = {
title: string;
- icon?: (props: any) => JSX.Element;
+ icon?: (props: BoxProps) => JSX.Element;
subtitle?: string | JSX.Element;
};
type Feature = {
@@ -148,6 +166,7 @@ function FeatureDialog(props: FeatureDialogProps) {
<Flex flexDirection="column" overflowY="auto" mt={2}>
{feature.subFeatures?.map((feature) => (
<Flex
+ key={feature.title}
mb={2}
bg="bgSecondary"
p={2}
diff --git a/apps/web/src/components/dialogs/import-dialog.js b/apps/web/src/components/dialogs/import-dialog.js
index 5ba7a3bcf..e1b4cf05c 100644
--- a/apps/web/src/components/dialogs/import-dialog.js
+++ b/apps/web/src/components/dialogs/import-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useMemo, useState } from "react";
import { Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
@@ -107,6 +125,7 @@ function ImportDialog(props) {
<Flex flexDirection="column" my={1} bg="errorBg" p={1}>
{errors.map((error) => (
<Text
+ key={error.message}
variant="body"
sx={{
color: "error"
@@ -150,6 +169,7 @@ function ImportDialog(props) {
<Flex flexDirection="column" mt={1}>
{files.map((file, i) => (
<Text
+ key={file.name}
p={1}
sx={{
":hover": { bg: "hover" },
@@ -201,6 +221,7 @@ function ImportDialog(props) {
<Flex flexDirection="column" mt={1}>
{notes.map((note, i) => (
<Flex
+ key={note.title}
data-test-id={`note-${i}`}
p={1}
sx={{
diff --git a/apps/web/src/components/dialogs/index.ts b/apps/web/src/components/dialogs/index.ts
index af9e30ad1..7c0c8a8e5 100644
--- a/apps/web/src/components/dialogs/index.ts
+++ b/apps/web/src/components/dialogs/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
const AddNotebookDialog = React.lazy(() => import("./add-notebook-dialog"));
diff --git a/apps/web/src/components/dialogs/issue-dialog.tsx b/apps/web/src/components/dialogs/issue-dialog.tsx
index 8428bf962..e9e62a4a0 100644
--- a/apps/web/src/components/dialogs/issue-dialog.tsx
+++ b/apps/web/src/components/dialogs/issue-dialog.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text } from "@streetwriters/rebass";
import { appVersion } from "../../utils/version";
import Field from "../field";
diff --git a/apps/web/src/components/dialogs/item-dialog.js b/apps/web/src/components/dialogs/item-dialog.js
index 9c95b78e0..6ff2e326f 100644
--- a/apps/web/src/components/dialogs/item-dialog.js
+++ b/apps/web/src/components/dialogs/item-dialog.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box } from "@streetwriters/rebass";
import Dialog from "./dialog";
import Field from "../field";
diff --git a/apps/web/src/components/dialogs/loading-dialog.js b/apps/web/src/components/dialogs/loading-dialog.js
index a394efb52..0bc1b0d32 100644
--- a/apps/web/src/components/dialogs/loading-dialog.js
+++ b/apps/web/src/components/dialogs/loading-dialog.js
@@ -1,4 +1,22 @@
-import React, { useEffect } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { useEffect } from "react";
import { Box, Text } from "@streetwriters/rebass";
import Dialog from "./dialog";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/dialogs/mfa/multi-factor-dialog.tsx b/apps/web/src/components/dialogs/mfa/multi-factor-dialog.tsx
index ad5ccf5f3..d638ded48 100644
--- a/apps/web/src/components/dialogs/mfa/multi-factor-dialog.tsx
+++ b/apps/web/src/components/dialogs/mfa/multi-factor-dialog.tsx
@@ -1,9 +1,34 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useState } from "react";
import { Text } from "@streetwriters/rebass";
import { Perform } from "../../../common/dialog-controller";
import Dialog from "../dialog";
-import { FallbackStep, fallbackSteps, Step, steps } from "./steps";
-import { AuthenticatorType } from "./types";
+import {
+ AuthenticatorOnNext,
+ AuthenticatorTypeOnNext,
+ FallbackStep,
+ fallbackSteps,
+ Step,
+ steps
+} from "./steps";
+import { Authenticator, AuthenticatorType, OnNextFunction } from "./types";
type MultifactorDialogProps = {
onClose: Perform;
@@ -12,11 +37,14 @@ type MultifactorDialogProps = {
export default function MultifactorDialog(props: MultifactorDialogProps) {
const { onClose, primaryMethod } = props;
- const [step, setStep] = useState<FallbackStep | Step>(
- primaryMethod ? fallbackSteps.choose(primaryMethod) : steps.choose()
- );
+ const [step, setStep] = useState<
+ | Step<AuthenticatorOnNext>
+ | Step<AuthenticatorTypeOnNext>
+ | FallbackStep<OnNextFunction>
+ >(primaryMethod ? fallbackSteps.choose(primaryMethod) : steps.choose());
const [error, setError] = useState<string>();
+ if (!step) return null;
return (
<Dialog
isOpen={true}
@@ -42,17 +70,16 @@ export default function MultifactorDialog(props: MultifactorDialogProps) {
>
{step.component && (
<step.component
- onNext={(...args) => {
+ onNext={(arg: AuthenticatorType | Authenticator) => {
if (!step.next) return onClose(true);
- const nextStepCreator: Function =
+ const nextStep =
step.next !== "recoveryCodes" && primaryMethod
- ? fallbackSteps[step.next]
- : steps[step.next];
-
- const nextStep = primaryMethod
- ? nextStepCreator(...args, primaryMethod)
- : nextStepCreator(...args);
+ ? fallbackSteps[step.next](
+ arg as AuthenticatorType & Authenticator,
+ primaryMethod
+ )
+ : steps[step.next](arg as AuthenticatorType & Authenticator);
setStep(nextStep);
}}
diff --git a/apps/web/src/components/dialogs/mfa/recovery-code-dialog.tsx b/apps/web/src/components/dialogs/mfa/recovery-code-dialog.tsx
index 1f6edc661..20b505002 100644
--- a/apps/web/src/components/dialogs/mfa/recovery-code-dialog.tsx
+++ b/apps/web/src/components/dialogs/mfa/recovery-code-dialog.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useState } from "react";
import { Text } from "@streetwriters/rebass";
import { Perform } from "../../../common/dialog-controller";
diff --git a/apps/web/src/components/dialogs/mfa/steps.tsx b/apps/web/src/components/dialogs/mfa/steps.tsx
index 9f7efad2f..274c8f14e 100644
--- a/apps/web/src/components/dialogs/mfa/steps.tsx
+++ b/apps/web/src/components/dialogs/mfa/steps.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, {
PropsWithChildren,
Suspense,
@@ -34,7 +52,8 @@ import {
AuthenticatorType,
StepComponent,
SubmitCodeFunction,
- StepComponentProps
+ StepComponentProps,
+ OnNextFunction
} from "./types";
import { showMultifactorDialog } from "../../../common/dialog-controller";
const QRCode = React.lazy(
@@ -44,23 +63,31 @@ const QRCode = React.lazy(
export type Steps = typeof steps;
export type FallbackSteps = typeof fallbackSteps;
export type StepKeys = keyof Steps; // "choose" | "setup" | "recoveryCodes" | "finish";
-export type FallbackStepKeys = keyof FallbackSteps;
+export type FallbackStepKeys = "choose" | "setup" | "finish";
-export type Step = {
+export type Step<
+ T extends OnNextFunction = AuthenticatorTypeOnNext | AuthenticatorOnNext
+> = {
title?: string;
description?: string;
- component?: StepComponent;
+ component?: StepComponent<T>;
next?: StepKeys;
cancellable?: boolean;
};
-export type FallbackStep = Step & {
+export type FallbackStep<
+ T extends OnNextFunction =
+ | AuthenticatorTypeOnNext
+ | AuthenticatorOnNext
+ | OnNextFunction
+> = Step<T> & {
next?: FallbackStepKeys;
};
-type AuthenticatorSelectorProps = StepComponentProps & {
- authenticator: AuthenticatorType;
- isFallback?: boolean;
-};
+type AuthenticatorSelectorProps =
+ StepComponentProps<AuthenticatorTypeOnNext> & {
+ authenticator: AuthenticatorType;
+ isFallback?: boolean;
+ };
type VerifyAuthenticatorFormProps = PropsWithChildren<{
codeHelpText: string;
@@ -92,9 +119,11 @@ const Authenticators: Authenticator[] = [
icon: MFAEmail
}
];
+export type AuthenticatorOnNext = (authenticator: Authenticator) => void;
+export type AuthenticatorTypeOnNext = (type: AuthenticatorType) => void;
export const steps = {
- choose: (): Step => ({
+ choose: (): Step<AuthenticatorOnNext> => ({
title: "Protect your notes by enabling 2FA",
description: "Choose how you want to receive your authentication codes.",
component: ({ onNext }) => (
@@ -106,7 +135,7 @@ export const steps = {
next: "setup",
cancellable: true
}),
- setup: (authenticator: Authenticator): Step => ({
+ setup: (authenticator: Authenticator): Step<AuthenticatorTypeOnNext> => ({
title: authenticator.title,
description: authenticator.subtitle,
next: "recoveryCodes",
@@ -118,7 +147,9 @@ export const steps = {
),
cancellable: true
}),
- recoveryCodes: (authenticatorType: AuthenticatorType): Step => ({
+ recoveryCodes: (
+ authenticatorType: AuthenticatorType
+ ): Step<AuthenticatorTypeOnNext> => ({
title: "Save your recovery codes",
description: `If you lose access to your ${
authenticatorType === "email"
@@ -137,7 +168,9 @@ export const steps = {
),
next: "finish"
}),
- finish: (authenticatorType: AuthenticatorType): Step => ({
+ finish: (
+ authenticatorType: AuthenticatorType
+ ): Step<AuthenticatorTypeOnNext> => ({
component: ({ onNext, onClose, onError }) => (
<TwoFactorEnabled
onClose={onClose}
@@ -150,7 +183,9 @@ export const steps = {
} as const;
export const fallbackSteps = {
- choose: (primaryMethod: AuthenticatorType): FallbackStep => ({
+ choose: (
+ primaryMethod: AuthenticatorType
+ ): FallbackStep<AuthenticatorOnNext> => ({
title: "Add a fallback 2FA method",
description:
"A fallback method helps you get your 2FA codes on an alternative device in case you lose your primary device.",
@@ -165,7 +200,9 @@ export const fallbackSteps = {
next: "setup",
cancellable: true
}),
- setup: (authenticator: Authenticator): FallbackStep => ({
+ setup: (
+ authenticator: Authenticator
+ ): FallbackStep<AuthenticatorTypeOnNext> => ({
title: authenticator.title,
description: authenticator.subtitle,
next: "finish",
@@ -181,7 +218,7 @@ export const fallbackSteps = {
finish: (
fallbackMethod: AuthenticatorType,
primaryMethod: AuthenticatorType
- ): FallbackStep => ({
+ ): FallbackStep<OnNextFunction> => ({
component: ({ onNext, onClose }) => (
<Fallback2FAEnabled
onNext={onNext}
@@ -193,16 +230,17 @@ export const fallbackSteps = {
})
} as const;
-type ChooseAuthenticatorProps = StepComponentProps & {
+type ChooseAuthenticatorProps = StepComponentProps<AuthenticatorOnNext> & {
authenticators: AuthenticatorType[];
};
function ChooseAuthenticator(props: ChooseAuthenticatorProps) {
const [selected, setSelected] = useSessionState("selectedAuthenticator", 0);
const { authenticators, onNext } = props;
- const filteredAuthenticators = authenticators.map(
- (a) => Authenticators.find((auth) => auth.type === a)!
- );
+ const filteredAuthenticators = authenticators
+ .map((a) => Authenticators.find((auth) => auth.type === a))
+ .filter((a) => !!a) as Authenticator[];
+
return (
<Flex
as="form"
@@ -218,6 +256,7 @@ function ChooseAuthenticator(props: ChooseAuthenticatorProps) {
>
{filteredAuthenticators.map((auth, index) => (
<Button
+ key={auth.type}
type="button"
variant={"secondary"}
mt={2}
@@ -276,7 +315,7 @@ function AuthenticatorSelector(props: AuthenticatorSelectorProps) {
async (code) => {
try {
if (isFallback) await db.mfa?.enableFallback(authenticator, code);
- else await db.mfa!.enable(authenticator, code);
+ else await db.mfa?.enable(authenticator, code);
onNext(authenticator);
} catch (e) {
const error = e as Error;
@@ -305,7 +344,7 @@ function SetupAuthenticatorApp(props: SetupAuthenticatorProps) {
useEffect(() => {
(async function () {
- setAuthenticatorDetails(await db.mfa!.setup("app"));
+ setAuthenticatorDetails(await db.mfa?.setup("app"));
})();
}, []);
@@ -333,8 +372,8 @@ function SetupAuthenticatorApp(props: SetupAuthenticatorProps) {
)}
</Box>
<Text variant={"subBody"}>
- If you can't scan the QR code above, enter this text instead (spaces
- don't matter):
+ {`If you can't scan the QR code above, enter this text instead (spaces
+ don't matter):`}
</Text>
<Flex
bg="bgSecondary"
@@ -388,7 +427,8 @@ function SetupEmail(props: SetupAuthenticatorProps) {
useEffect(() => {
(async () => {
- const { email } = await db.user!.getUser();
+ if (!db.user) return;
+ const { email } = await db.user.getUser();
setEmail(email);
})();
}, []);
@@ -418,7 +458,7 @@ function SetupEmail(props: SetupAuthenticatorProps) {
onClick={async () => {
setIsSending(true);
try {
- await db.mfa!.setup("email");
+ await db.mfa?.setup("email");
setEnabled(false);
} catch (e) {
const error = e as Error;
@@ -515,7 +555,7 @@ function SetupSMS(props: SetupAuthenticatorProps) {
setIsSending(true);
try {
- await db.mfa!.setup("sms", phoneNumber);
+ await db.mfa?.setup("sms", phoneNumber);
setEnabled(false);
} catch (e) {
const error = e as Error;
@@ -631,6 +671,7 @@ function BackupRecoveryCodes(props: TwoFactorEnabledProps) {
>
{codes.map((code) => (
<Text
+ key={code}
className="selectable"
as="code"
variant={"subheading"}
@@ -646,6 +687,7 @@ function BackupRecoveryCodes(props: TwoFactorEnabledProps) {
<Flex sx={{ justifyContent: "start", alignItems: "center", mt: 2 }}>
{actions.map((action) => (
<Button
+ key={action.title}
id={`btn-${action.title.toLowerCase()}`}
type="button"
variant="secondary"
@@ -663,7 +705,7 @@ function BackupRecoveryCodes(props: TwoFactorEnabledProps) {
);
}
-type TwoFactorEnabledProps = StepComponentProps & {
+type TwoFactorEnabledProps = StepComponentProps<AuthenticatorTypeOnNext> & {
authenticatorType: AuthenticatorType;
};
function TwoFactorEnabled(props: TwoFactorEnabledProps) {
@@ -705,7 +747,7 @@ function TwoFactorEnabled(props: TwoFactorEnabledProps) {
);
}
-type Fallback2FAEnabledProps = StepComponentProps & {
+type Fallback2FAEnabledProps = StepComponentProps<OnNextFunction> & {
fallbackMethod: AuthenticatorType;
primaryMethod: AuthenticatorType;
};
diff --git a/apps/web/src/components/dialogs/mfa/types.ts b/apps/web/src/components/dialogs/mfa/types.ts
index dd2c962ee..c8fdad2b3 100644
--- a/apps/web/src/components/dialogs/mfa/types.ts
+++ b/apps/web/src/components/dialogs/mfa/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { BoxProps } from "@streetwriters/rebass";
import { Perform } from "../../../common/dialog-controller";
@@ -11,12 +29,16 @@ export type Authenticator = {
recommended?: boolean;
};
-export type StepComponentProps = {
- onNext: (...args: any[]) => void;
+export type StepComponentProps<T extends OnNextFunction> = {
+ onNext: T;
onClose?: Perform;
onError?: (error: string) => void;
};
-export type StepComponent = React.FunctionComponent<StepComponentProps>;
+export type StepComponent<T extends OnNextFunction> = React.FunctionComponent<
+ StepComponentProps<T>
+>;
export type SubmitCodeFunction = (code: string) => void;
+
+export type OnNextFunction = (...args: never[]) => void;
diff --git a/apps/web/src/components/dialogs/migration-dialog.tsx b/apps/web/src/components/dialogs/migration-dialog.tsx
index 073b73354..47fd26202 100644
--- a/apps/web/src/components/dialogs/migration-dialog.tsx
+++ b/apps/web/src/components/dialogs/migration-dialog.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Text } from "@streetwriters/rebass";
import { createBackup } from "../../common";
import { db } from "../../common/db";
diff --git a/apps/web/src/components/dialogs/move-note-dialog.js b/apps/web/src/components/dialogs/move-note-dialog.js
index 68a6829fe..725690525 100644
--- a/apps/web/src/components/dialogs/move-note-dialog.js
+++ b/apps/web/src/components/dialogs/move-note-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useRef, useState } from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/dialogs/onboarding-dialog.js b/apps/web/src/components/dialogs/onboarding-dialog.js
index e9f7f4a32..f2662071d 100644
--- a/apps/web/src/components/dialogs/onboarding-dialog.js
+++ b/apps/web/src/components/dialogs/onboarding-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Text, Flex, Button, Image, Box } from "@streetwriters/rebass";
import Dialog from "./dialog";
import * as Icon from "../icons";
@@ -205,6 +223,7 @@ function Importer({ onClose }) {
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 1fr 1fr", gap: 1 }}>
{importers.map((importer) => (
<Flex
+ key={importer.title}
sx={{
display: "flex",
flexDirection: "row",
@@ -293,6 +312,7 @@ function Support() {
<Box my={4} sx={{ display: "grid", gridTemplateColumns: "1fr 1fr" }}>
{supportChannels.map((channel) => (
<Button
+ key={channel.key}
as="a"
href={channel.url}
variant={"icon"}
@@ -331,6 +351,7 @@ function ThemeSelector() {
const isSelected = currentTheme === theme.key;
return (
<Flex
+ key={theme.key}
flexDirection={"column"}
p={20}
alignItems="center"
diff --git a/apps/web/src/components/dialogs/password-dialog.js b/apps/web/src/components/dialogs/password-dialog.js
index 3403c1a66..47d18f9c3 100644
--- a/apps/web/src/components/dialogs/password-dialog.js
+++ b/apps/web/src/components/dialogs/password-dialog.js
@@ -1,4 +1,22 @@
-import React, { useState, useCallback, useMemo } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { useState, useCallback, useMemo } from "react";
import { Box, Text } from "@streetwriters/rebass";
import Dialog from "./dialog";
import Field from "../field";
diff --git a/apps/web/src/components/dialogs/progress-dialog.js b/apps/web/src/components/dialogs/progress-dialog.js
index 0a4bf2d76..a47ac613e 100644
--- a/apps/web/src/components/dialogs/progress-dialog.js
+++ b/apps/web/src/components/dialogs/progress-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { Box, Flex, Text } from "@streetwriters/rebass";
import Dialog from "./dialog";
diff --git a/apps/web/src/components/dialogs/prompt.tsx b/apps/web/src/components/dialogs/prompt.tsx
index c89b313c8..752e2c741 100644
--- a/apps/web/src/components/dialogs/prompt.tsx
+++ b/apps/web/src/components/dialogs/prompt.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useRef } from "react";
import { Perform } from "../../common/dialog-controller";
import Field from "../field";
diff --git a/apps/web/src/components/dialogs/recovery-key-dialog.js b/apps/web/src/components/dialogs/recovery-key-dialog.js
index 9e14baa7a..b5024a6c1 100644
--- a/apps/web/src/components/dialogs/recovery-key-dialog.js
+++ b/apps/web/src/components/dialogs/recovery-key-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { Text, Flex, Button } from "@streetwriters/rebass";
import Dialog from "./dialog";
diff --git a/apps/web/src/components/dialogs/reminder-dialog.js b/apps/web/src/components/dialogs/reminder-dialog.js
index e01935dfa..7aadf23ce 100644
--- a/apps/web/src/components/dialogs/reminder-dialog.js
+++ b/apps/web/src/components/dialogs/reminder-dialog.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Text, Flex, Box } from "@streetwriters/rebass";
import Dialog from "./dialog";
import * as Icon from "../icons";
@@ -123,6 +141,7 @@ function ReminderDialog(props) {
>
{reminder.features.map((feature) => (
<Flex
+ key={feature.title}
p={1}
sx={{
borderRadius: "default",
diff --git a/apps/web/src/components/dialogs/toolbar-config-dialog.tsx b/apps/web/src/components/dialogs/toolbar-config-dialog.tsx
index 29a233382..e58e64799 100644
--- a/apps/web/src/components/dialogs/toolbar-config-dialog.tsx
+++ b/apps/web/src/components/dialogs/toolbar-config-dialog.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Button, Flex, FlexProps, Text } from "@streetwriters/rebass";
import { Perform } from "../../common/dialog-controller";
import Dialog from "./dialog";
@@ -6,8 +24,8 @@ import {
getToolDefinition,
Icon,
Icons,
+ ToolbarDefinition,
ToolbarGroupDefinition,
- ToolDefinition,
ToolId
} from "@notesnook/editor";
import {
@@ -173,7 +191,7 @@ export default function ToolbarConfigDialog(props: ToolbarConfigDialogProps) {
}}
>
<SortableContext items={items} strategy={verticalListSortingStrategy}>
- {items?.map((item, index) => {
+ {items?.map((item) => {
const deleted = isDeleted(items, item);
const hasSubGroup =
isGroup(item) &&
@@ -296,7 +314,11 @@ function TreeNodeComponent(props: TreeNodeComponentProps) {
}}
>
{item.icon && (
- <Icon path={(Icons as any)[item.icon]} size={16} color="icon" />
+ <Icon
+ path={(Icons as Record<string, string>)[item.icon]}
+ size={16}
+ color="icon"
+ />
)}
<Text variant={"body"} sx={{ ml: 1 }}>
{item.title}
@@ -354,9 +376,7 @@ function SortableWrapper(props: SortableWrapperProps) {
id="add-item"
variant={"tool"}
sx={{ p: "small", opacity: 0, mr: 1 }}
- onClick={(e) => {
- onAdd();
- }}
+ onClick={() => onAdd()}
>
<Icon path={Icons.plus} size={16} color="icon" />
</Button>
@@ -366,9 +386,7 @@ function SortableWrapper(props: SortableWrapperProps) {
id="remove-item"
variant={"tool"}
sx={{ p: "small", opacity: 0 }}
- onClick={(e) => {
- onRemove(item);
- }}
+ onClick={() => onRemove(item)}
>
<Icon path={Icons.delete} size={16} color="icon" />
</Button>
@@ -393,18 +411,15 @@ type Subgroup = BaseTreeNode<"group"> & {
type Group = BaseTreeNode<"group">;
type Item = BaseTreeNode<"item"> & {
- toolId: string;
+ toolId: ToolId;
icon: string;
collapsed?: boolean;
};
type TreeNode = Group | Item | Subgroup;
-function flatten(
- tools: ToolbarGroupDefinition[],
- depth: number = 0
-): TreeNode[] {
- let nodes: TreeNode[] = [];
+function flatten(tools: ToolbarGroupDefinition[], depth = 0): TreeNode[] {
+ const nodes: TreeNode[] = [];
let groupCount = 1;
for (const tool of tools) {
if (Array.isArray(tool)) {
@@ -415,27 +430,27 @@ function flatten(
nodes.push(...flatten(tool as ToolbarGroupDefinition[], depth + 1));
++groupCount;
} else {
- const { icon, title } = getToolDefinition(tool as any);
+ const { icon, title } = getToolDefinition(tool);
nodes.push(createItem({ toolId: tool, depth, title, icon }));
}
}
return nodes;
}
-function unflatten(items: TreeNode[]): ToolbarGroupDefinition[] {
- let tools: ToolbarGroupDefinition[] = [];
+function unflatten(items: TreeNode[]): ToolbarDefinition {
+ const tools: ToolbarDefinition = [];
for (let i = 0; i < items.length; i++) {
const item = items[i];
if (isGroup(item) || isSubgroup(item)) {
const group = getGroup(items, item.id);
console.log(group?.items);
if (!group) continue;
- tools.push(unflatten(group.items.slice(1)) as any);
+ tools.push(unflatten(group.items.slice(1)) as ToolbarGroupDefinition);
// skip all the group's items
i += group.items.length - 1;
} else {
- tools.push(item.toolId as any);
+ (tools as ToolbarGroupDefinition).push(item.toolId);
}
}
return tools;
@@ -451,14 +466,13 @@ function createGroup(config: Partial<Group>): Group {
};
}
-function createItem(config: Partial<Item>): Item {
+function createItem(config: Partial<Item> & { toolId: ToolId }): Item {
return {
type: "item",
id: id(),
depth: 0,
title: "",
icon: "",
- toolId: "",
...config
};
}
@@ -674,11 +688,11 @@ function addGroup(items: TreeNode[]) {
}
export function getDisabledTools(tools: TreeNode[]) {
- const allTools = getAllTools() as Record<string, ToolDefinition>;
+ const allTools = getAllTools();
const disabled: ToolbarGroupDefinition = [];
const items: Item[] = tools.filter((t) => isItem(t)) as Item[];
for (const key in allTools) {
- const tool = allTools[key];
+ const tool = allTools[key as ToolId];
if (tool.conditional) continue;
if (items.findIndex((t) => t.toolId === key) <= -1)
disabled.push(key as ToolId);
diff --git a/apps/web/src/components/dialogs/tracking-details-dialog.js b/apps/web/src/components/dialogs/tracking-details-dialog.js
index 886960cd6..437a123b1 100644
--- a/apps/web/src/components/dialogs/tracking-details-dialog.js
+++ b/apps/web/src/components/dialogs/tracking-details-dialog.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Text } from "@streetwriters/rebass";
import { ANALYTICS_EVENTS } from "../../utils/analytics";
import Dialog from "./dialog";
@@ -30,7 +47,7 @@ function TrackingDetailsDialog(props) {
</Text>
</tr>
{events.map((event) => (
- <tr>
+ <tr key={event.name}>
<Text
as="td"
sx={{ wordWrap: "break-word", maxWidth: 130 }}
diff --git a/apps/web/src/components/diff-viewer/content-toggle.js b/apps/web/src/components/diff-viewer/content-toggle.js
index 79a5ab3c7..6c8e93057 100644
--- a/apps/web/src/components/diff-viewer/content-toggle.js
+++ b/apps/web/src/components/diff-viewer/content-toggle.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { formatDate } from "@notesnook/core/utils/date";
import { Flex, Button } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/diff-viewer/index.js b/apps/web/src/components/diff-viewer/index.js
index c8d1f78b5..26a4b5a84 100644
--- a/apps/web/src/components/diff-viewer/index.js
+++ b/apps/web/src/components/diff-viewer/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useState, useEffect, useCallback } from "react";
import { Flex, Text, Button } from "@streetwriters/rebass";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/dropdown-button/index.js b/apps/web/src/components/dropdown-button/index.js
index 204620f34..32956f668 100644
--- a/apps/web/src/components/dropdown-button/index.js
+++ b/apps/web/src/components/dropdown-button/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Button, Flex } from "@streetwriters/rebass";
import { useMenuTrigger } from "../../hooks/use-menu";
import { ChevronDown } from "../icons";
diff --git a/apps/web/src/components/editor/-placeholder.js b/apps/web/src/components/editor/-placeholder.js
index 8935f3f2d..366ebf606 100644
--- a/apps/web/src/components/editor/-placeholder.js
+++ b/apps/web/src/components/editor/-placeholder.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Logo from "../../assets/logo.svg";
import LogoDark from "../../assets/logo-dark.svg";
import { Button, Flex, Image, Text } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/editor/context.ts b/apps/web/src/components/editor/context.ts
index fb7c89496..1bae00dec 100644
--- a/apps/web/src/components/editor/context.ts
+++ b/apps/web/src/components/editor/context.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useRef } from "react";
import { IEditor, NoteStatistics } from "./types";
import createStore from "../../common/store";
diff --git a/apps/web/src/components/editor/footer.js b/apps/web/src/components/editor/footer.js
index 1c0f0d51e..5c2e37d30 100644
--- a/apps/web/src/components/editor/footer.js
+++ b/apps/web/src/components/editor/footer.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { formatDate } from "@notesnook/core/utils/date";
import { Flex, Text } from "@streetwriters/rebass";
import { useStore } from "../../stores/editor-store";
diff --git a/apps/web/src/components/editor/header.js b/apps/web/src/components/editor/header.js
index 75c360543..75c51b9ad 100644
--- a/apps/web/src/components/editor/header.js
+++ b/apps/web/src/components/editor/header.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useStore } from "../../stores/editor-store";
import { Input } from "@streetwriters/rebass-forms";
@@ -136,7 +154,7 @@ function Autosuggest({
placeholder="Add a tag..."
data-test-id="editor-tag-input"
fontSize="subtitle"
- onFocus={(e) => {
+ onFocus={() => {
const text = getInputValue();
if (!text) setFiltered(defaultItems);
}}
diff --git a/apps/web/src/components/editor/index.tsx b/apps/web/src/components/editor/index.tsx
index 37f76c2f5..58f2c8983 100644
--- a/apps/web/src/components/editor/index.tsx
+++ b/apps/web/src/components/editor/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
useEffect,
useCallback,
@@ -18,7 +36,6 @@ import Header from "./header";
import { Attachment } from "../icons";
import { useEditorInstance } from "./context";
import { attachFile, AttachmentProgress, insertAttachment } from "./picker";
-import { DropEvent } from "react-dropzone";
import { downloadAttachment } from "../../common/attachments";
import { EV, EVENTS } from "@notesnook/core/common";
import { db } from "../../common/db";
@@ -410,7 +427,7 @@ function DropZone(props: DropZoneProps) {
if (!editor || !e.dataTransfer.files?.length) return;
e.preventDefault();
- for (let file of e.dataTransfer.files) {
+ for (const file of e.dataTransfer.files) {
const result = await attachFile(file);
if (!result) continue;
editor.current?.attachFile(result);
@@ -451,7 +468,7 @@ function useDragOverlay() {
overlay.style.display = "flex";
}
- function hideOverlay(e: DragEvent | DropEvent) {
+ function hideOverlay() {
if (!overlay) return;
overlay.style.display = "none";
}
diff --git a/apps/web/src/components/editor/loading.tsx b/apps/web/src/components/editor/loading.tsx
index 9fb9aff92..98e8b87d9 100644
--- a/apps/web/src/components/editor/loading.tsx
+++ b/apps/web/src/components/editor/loading.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/editor/picker.ts b/apps/web/src/components/editor/picker.ts
index facf6ffa2..f8d5b3265 100644
--- a/apps/web/src/components/editor/picker.ts
+++ b/apps/web/src/components/editor/picker.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SerializedKey } from "@notesnook/crypto/dist/src/types";
import { AppEventManager, AppEvents } from "../../common/app-events";
import { db } from "../../common/db";
@@ -96,7 +114,7 @@ async function pickImage(selectedImage: File, options?: AddAttachmentOptions) {
}
async function getEncryptionKey(): Promise<SerializedKey> {
- const key = await db.attachments!.generateKey();
+ const key = await db.attachments?.generateKey();
if (!key) throw new Error("Could not generate a new encryption key.");
return key;
}
@@ -113,7 +131,7 @@ export function showFilePicker({
input.dispatchEvent(new MouseEvent("click"));
input.onchange = async function () {
if (!input.files) return resolve(undefined);
- var file = input.files[0];
+ const file = input.files[0];
if (!file) return resolve(undefined);
resolve(file);
};
@@ -166,15 +184,15 @@ async function addAttachment(
throw new Error(
`Please select the same file for reuploading. Expected hash ${expectedFileHash} but got ${hash}.`
);
- const exists = db.attachments!.exists(hash);
+ const exists = db.attachments?.exists(hash);
if (forceWrite || !exists) {
- let key: SerializedKey = await getEncryptionKey();
+ const key: SerializedKey = await getEncryptionKey();
const output = await fs.writeEncryptedFile(file, key, hash);
if (!output) throw new Error("Could not encrypt file.");
if (forceWrite && exists) await db.attachments?.reset(hash);
- await db.attachments!.add({
+ await db.attachments?.add({
...output,
hash,
hashType,
diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx
index 28be585d8..51f4c30a6 100644
--- a/apps/web/src/components/editor/tiptap.tsx
+++ b/apps/web/src/components/editor/tiptap.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "@notesnook/editor/styles/styles.css";
import "@notesnook/editor/styles/katex.min.css";
import "@notesnook/editor/styles/katex-fonts.css";
@@ -26,7 +44,7 @@ import { showBuyDialog } from "../../common/dialog-controller";
import { useStore as useSettingsStore } from "../../stores/setting-store";
const SAVE_INTERVAL = process.env.REACT_APP_TEST ? 0 : 300;
-var saveTimeout = 0;
+let saveTimeout = 0;
type TipTapProps = {
editorContainer: HTMLElement;
onLoad?: () => void;
@@ -83,7 +101,7 @@ function TipTap(props: TipTapProps) {
if (event.clipboardData?.files?.length && onAttachFile) {
event.preventDefault();
event.stopPropagation();
- for (let file of event.clipboardData.files) {
+ for (const file of event.clipboardData.files) {
onAttachFile(file);
}
return true;
@@ -284,7 +302,7 @@ function toIEditor(editor: Editor): IEditor {
sendAttachmentProgress: (hash, type, progress) =>
editor.current?.commands.setAttachmentProgress({
hash,
- type: type as any,
+ type,
progress
})
};
@@ -314,7 +332,7 @@ function countWords(str: string) {
let count = 0;
let shouldCount = false;
- for (var i = 0; i < str.length; ++i) {
+ for (let i = 0; i < str.length; ++i) {
const s = str[i];
if (
diff --git a/apps/web/src/components/editor/title-box.tsx b/apps/web/src/components/editor/title-box.tsx
index 64509d202..68e0b99de 100644
--- a/apps/web/src/components/editor/title-box.tsx
+++ b/apps/web/src/components/editor/title-box.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { Input } from "@streetwriters/rebass-forms";
diff --git a/apps/web/src/components/editor/toolbar.js b/apps/web/src/components/editor/toolbar.js
index 3f11569c4..fd36ea737 100644
--- a/apps/web/src/components/editor/toolbar.js
+++ b/apps/web/src/components/editor/toolbar.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useMemo, useState } from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
@@ -12,7 +30,7 @@ import { db } from "../../common/db";
import { useEditorInstance, useHistory, useSearch } from "./context";
// TODO: this needs to be cleaned up!
-function Toolbar(props) {
+function Toolbar() {
const sessionId = useStore((store) => store.session.id);
const isLocked = useStore((store) => store.session.locked);
const [isFullscreen, setIsFullscreen] = useState(false);
diff --git a/apps/web/src/components/editor/types.ts b/apps/web/src/components/editor/types.ts
index 3df958cdf..e42f14801 100644
--- a/apps/web/src/components/editor/types.ts
+++ b/apps/web/src/components/editor/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Attachment } from "./picker";
export type NoteStatistics = {
@@ -15,7 +33,7 @@ export interface IEditor {
loadImage: (hash: string, src: string) => void;
sendAttachmentProgress: (
hash: string,
- type: string,
+ type: "download" | "upload" | "encrypt",
progress: number
) => void;
}
diff --git a/apps/web/src/components/field/index.js b/apps/web/src/components/field/index.js
index bf044c73c..312eb6ce9 100644
--- a/apps/web/src/components/field/index.js
+++ b/apps/web/src/components/field/index.js
@@ -1,4 +1,22 @@
-import React, { useState } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { useState } from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
import { Input, Label } from "@streetwriters/rebass-forms";
import * as Icon from "../icons";
@@ -176,7 +194,7 @@ function Field(props) {
{validatePassword && (
<Flex flexDirection="column" mt={1}>
{rules.map((rule) => (
- <Flex>
+ <Flex key={rule.title}>
{rule.isValid ? (
<Icon.Check color="success" size={14} />
) : (
diff --git a/apps/web/src/components/global-menu-wrapper/index.js b/apps/web/src/components/global-menu-wrapper/index.js
index 21102cae6..8f1e0969c 100644
--- a/apps/web/src/components/global-menu-wrapper/index.js
+++ b/apps/web/src/components/global-menu-wrapper/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Menu from "../menu";
import { useMenuTrigger, useMenu, getPosition } from "../../hooks/use-menu";
import Modal from "react-modal";
diff --git a/apps/web/src/components/group-header/index.js b/apps/web/src/components/group-header/index.js
index f1296f9b7..45d229334 100644
--- a/apps/web/src/components/group-header/index.js
+++ b/apps/web/src/components/group-header/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import * as Icon from "../icons";
import { useEffect, useMemo, useRef, useState } from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
@@ -230,7 +248,7 @@ function GroupHeader(props) {
: Icon.SortDesc
}
title={`Grouped by ${groupByToTitleMap[groupOptions.groupBy]}`}
- onClick={(e) => {
+ onClick={() => {
const groupOptions = db.settings.getGroupOptions(type);
setGroupOptions(groupOptions);
@@ -252,7 +270,7 @@ function GroupHeader(props) {
? "Switch to detailed view"
: "Switch to compact view"
}
- onClick={(e) =>
+ onClick={() =>
setViewMode(viewMode === "compact" ? "detailed" : "compact")
}
/>
diff --git a/apps/web/src/components/hash-router/index.js b/apps/web/src/components/hash-router/index.js
index ead085274..32473c3bc 100644
--- a/apps/web/src/components/hash-router/index.js
+++ b/apps/web/src/components/hash-router/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import useHashRoutes from "../../hooks/use-hash-routes";
import hashroutes from "../../navigation/hash-routes";
diff --git a/apps/web/src/components/icon-tag/index.js b/apps/web/src/components/icon-tag/index.js
index 6e54b80c6..412c82663 100644
--- a/apps/web/src/components/icon-tag/index.js
+++ b/apps/web/src/components/icon-tag/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text } from "@streetwriters/rebass";
function IconTag({ text, title, icon: Icon, onClick, styles, testId }) {
diff --git a/apps/web/src/components/icons/index.js b/apps/web/src/components/icons/index.js
index d585e309c..355dd2bd0 100644
--- a/apps/web/src/components/icons/index.js
+++ b/apps/web/src/components/icons/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useState } from "react";
import MDIIcon from "@mdi/react";
import {
diff --git a/apps/web/src/components/icons/resolver.js b/apps/web/src/components/icons/resolver.js
index 8b4a1fdcf..da83214a7 100644
--- a/apps/web/src/components/icons/resolver.js
+++ b/apps/web/src/components/icons/resolver.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { toTitleCase, toCamelCase } = require("../../utils/string");
var icons = undefined;
diff --git a/apps/web/src/components/install-notice/index.js b/apps/web/src/components/install-notice/index.js
index 8f31f2746..5e1a8d895 100644
--- a/apps/web/src/components/install-notice/index.js
+++ b/apps/web/src/components/install-notice/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ReactDOM from "react-dom";
import { Box, Button, Flex, Text } from "@streetwriters/rebass";
import Config from "../../utils/config";
@@ -64,6 +82,7 @@ export default function InstallNotice({ onClose }) {
>
{nativeFeatures.map((feature) => (
<Flex
+ key={feature}
p={1}
sx={{
borderRadius: "default",
@@ -89,7 +108,7 @@ export default function InstallNotice({ onClose }) {
Config.set("installNotice", false);
}}
>
- Don't show again
+ {`Don't show again`}
</Button>
</Flex>
</Flex>
diff --git a/apps/web/src/components/list-container/index.js b/apps/web/src/components/list-container/index.js
index 57325c0ae..b04bc5d0b 100644
--- a/apps/web/src/components/list-container/index.js
+++ b/apps/web/src/components/list-container/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useMemo, useRef, useState } from "react";
import { Flex, Button } from "@streetwriters/rebass";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/list-item/index.js b/apps/web/src/components/list-item/index.js
index 1bbb1ca22..ad9b2257c 100644
--- a/apps/web/src/components/list-item/index.js
+++ b/apps/web/src/components/list-item/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
import {
diff --git a/apps/web/src/components/loader/index.js b/apps/web/src/components/loader/index.js
index f8efab1b9..7577e3638 100644
--- a/apps/web/src/components/loader/index.js
+++ b/apps/web/src/components/loader/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text } from "@streetwriters/rebass";
import { Loading } from "../icons";
diff --git a/apps/web/src/components/loaders/editor-loader.tsx b/apps/web/src/components/loaders/editor-loader.tsx
index 74049156e..fbc29edb3 100644
--- a/apps/web/src/components/loaders/editor-loader.tsx
+++ b/apps/web/src/components/loaders/editor-loader.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { memo } from "react";
import Skeleton from "react-loading-skeleton";
import { Box, Flex } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/loaders/list-loader.tsx b/apps/web/src/components/loaders/list-loader.tsx
index a6b91680b..9f15b8808 100644
--- a/apps/web/src/components/loaders/list-loader.tsx
+++ b/apps/web/src/components/loaders/list-loader.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { memo } from "react";
import Skeleton from "react-loading-skeleton";
import { Box, Flex } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/loaders/navigation-loader.tsx b/apps/web/src/components/loaders/navigation-loader.tsx
index 96c25da8d..b26b67820 100644
--- a/apps/web/src/components/loaders/navigation-loader.tsx
+++ b/apps/web/src/components/loaders/navigation-loader.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { memo } from "react";
import Skeleton from "react-loading-skeleton";
import { Box, Flex } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/loaders/status-bar-loader.tsx b/apps/web/src/components/loaders/status-bar-loader.tsx
index c3aea9c0d..0b3301f95 100644
--- a/apps/web/src/components/loaders/status-bar-loader.tsx
+++ b/apps/web/src/components/loaders/status-bar-loader.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { memo } from "react";
import Skeleton from "react-loading-skeleton";
import { Box } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/loaders/view-loader.tsx b/apps/web/src/components/loaders/view-loader.tsx
index 375c68952..5603d5178 100644
--- a/apps/web/src/components/loaders/view-loader.tsx
+++ b/apps/web/src/components/loaders/view-loader.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { memo } from "react";
import Skeleton from "react-loading-skeleton";
import { Box, Flex } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/menu/index.js b/apps/web/src/components/menu/index.js
index 70f283923..77fafd1d2 100644
--- a/apps/web/src/components/menu/index.js
+++ b/apps/web/src/components/menu/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useCallback, useRef, useEffect, useState } from "react";
import { Flex, Text } from "@streetwriters/rebass";
import { getPosition } from "../../hooks/use-menu";
diff --git a/apps/web/src/components/menu/menu-item.js b/apps/web/src/components/menu/menu-item.js
index 4598027f1..b1183f8c4 100644
--- a/apps/web/src/components/menu/menu-item.js
+++ b/apps/web/src/components/menu/menu-item.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Check, ChevronRight, Pro } from "../icons";
import { useRef } from "react";
import { Flex, Box, Text, Button } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/navigation-menu/index.js b/apps/web/src/components/navigation-menu/index.js
index 35564c6cb..75265e240 100644
--- a/apps/web/src/components/navigation-menu/index.js
+++ b/apps/web/src/components/navigation-menu/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect } from "react";
import { Box, Button, Flex } from "@streetwriters/rebass";
import {
@@ -243,7 +261,7 @@ function NavigationMenu(props) {
filter: "brightness(100%)"
}
}}
- onClick={(e) => {
+ onClick={() => {
setFollowSystemTheme(false);
toggleNightMode();
}}
diff --git a/apps/web/src/components/navigation-menu/navigation-item.js b/apps/web/src/components/navigation-menu/navigation-item.js
index f12e9154c..6c1a28485 100644
--- a/apps/web/src/components/navigation-menu/navigation-item.js
+++ b/apps/web/src/components/navigation-menu/navigation-item.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Button, Flex, Text } from "@streetwriters/rebass";
import { useStore as useAppStore } from "../../stores/app-store";
import { useMenuTrigger } from "../../hooks/use-menu";
diff --git a/apps/web/src/components/note/index.js b/apps/web/src/components/note/index.js
index c73086e87..61f6dda87 100644
--- a/apps/web/src/components/note/index.js
+++ b/apps/web/src/components/note/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useMemo } from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/notebook/index.js b/apps/web/src/components/notebook/index.js
index 538bc1138..3c8cf3008 100644
--- a/apps/web/src/components/notebook/index.js
+++ b/apps/web/src/components/notebook/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Flex, Text } from "@streetwriters/rebass";
import ListItem from "../list-item";
@@ -45,7 +63,7 @@ function Notebook(props) {
key={topic.id}
text={topic.title}
icon={Icon.Topic}
- onClick={(e) => {
+ onClick={() => {
navigate(`/notebooks/${notebook.id}/${topic.id}`);
}}
/>
diff --git a/apps/web/src/components/placeholders/attachments-placeholder.js b/apps/web/src/components/placeholders/attachments-placeholder.js
index f011ad94c..871b00912 100644
--- a/apps/web/src/components/placeholders/attachments-placeholder.js
+++ b/apps/web/src/components/placeholders/attachments-placeholder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
function AttachmentsPlaceholder() {
diff --git a/apps/web/src/components/placeholders/favorites-placeholder.js b/apps/web/src/components/placeholders/favorites-placeholder.js
index c2a20f4ef..518953d66 100644
--- a/apps/web/src/components/placeholders/favorites-placeholder.js
+++ b/apps/web/src/components/placeholders/favorites-placeholder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
function FavoritesPlaceholder() {
diff --git a/apps/web/src/components/placeholders/index.js b/apps/web/src/components/placeholders/index.js
index c6ef3029d..1667c91bb 100644
--- a/apps/web/src/components/placeholders/index.js
+++ b/apps/web/src/components/placeholders/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/placeholders/loader.js b/apps/web/src/components/placeholders/loader.js
index e6710aa6c..35e4b4611 100644
--- a/apps/web/src/components/placeholders/loader.js
+++ b/apps/web/src/components/placeholders/loader.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useLayoutEffect } from "react";
import { ReactComponent as Note } from "../../assets/note2.svg";
import { ReactComponent as Notebook } from "../../assets/notebook.svg";
diff --git a/apps/web/src/components/placeholders/monographs-placeholder.js b/apps/web/src/components/placeholders/monographs-placeholder.js
index c2ff1255f..babe9996d 100644
--- a/apps/web/src/components/placeholders/monographs-placeholder.js
+++ b/apps/web/src/components/placeholders/monographs-placeholder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
function MonographsPlaceholder() {
diff --git a/apps/web/src/components/placeholders/notebooks-placeholder.js b/apps/web/src/components/placeholders/notebooks-placeholder.js
index 63e623195..3e735cf49 100644
--- a/apps/web/src/components/placeholders/notebooks-placeholder.js
+++ b/apps/web/src/components/placeholders/notebooks-placeholder.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
import { Plus } from "../icons";
import { hashNavigate } from "../../navigation";
diff --git a/apps/web/src/components/placeholders/notesplacholder.js b/apps/web/src/components/placeholders/notesplacholder.js
index e04e5f870..fc13827b7 100644
--- a/apps/web/src/components/placeholders/notesplacholder.js
+++ b/apps/web/src/components/placeholders/notesplacholder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
import * as Icon from "../icons";
import { hashNavigate } from "../../navigation";
diff --git a/apps/web/src/components/placeholders/search-placeholder.js b/apps/web/src/components/placeholders/search-placeholder.js
index 6d08ecb4d..4694aa901 100644
--- a/apps/web/src/components/placeholders/search-placeholder.js
+++ b/apps/web/src/components/placeholders/search-placeholder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
function SearchPlaceholder({ text }) {
diff --git a/apps/web/src/components/placeholders/tags-placeholder.js b/apps/web/src/components/placeholders/tags-placeholder.js
index cf749fd2c..507e69e42 100644
--- a/apps/web/src/components/placeholders/tags-placeholder.js
+++ b/apps/web/src/components/placeholders/tags-placeholder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
function TagsPlaceholder() {
diff --git a/apps/web/src/components/placeholders/topics-placeholder.js b/apps/web/src/components/placeholders/topics-placeholder.js
index 03eb1f954..c1dec02f9 100644
--- a/apps/web/src/components/placeholders/topics-placeholder.js
+++ b/apps/web/src/components/placeholders/topics-placeholder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
import { Plus } from "../icons";
import { hashNavigate } from "../../navigation";
diff --git a/apps/web/src/components/placeholders/trash-placeholder.js b/apps/web/src/components/placeholders/trash-placeholder.js
index 07729c4f1..bb7f4eb17 100644
--- a/apps/web/src/components/placeholders/trash-placeholder.js
+++ b/apps/web/src/components/placeholders/trash-placeholder.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Placeholder from "./index";
function TrashPlaceholder() {
diff --git a/apps/web/src/components/progress-bar/index.js b/apps/web/src/components/progress-bar/index.js
index b4a68ce8c..8104acd16 100644
--- a/apps/web/src/components/progress-bar/index.js
+++ b/apps/web/src/components/progress-bar/index.js
@@ -1,5 +1,23 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useAnimation } from "framer-motion";
-import React, { useEffect } from "react";
+import { useEffect } from "react";
import { Flex } from "@streetwriters/rebass";
import { AnimatedBox } from "../animated";
diff --git a/apps/web/src/components/properties/index.js b/apps/web/src/components/properties/index.js
index 1554a76a3..1706a22ea 100644
--- a/apps/web/src/components/properties/index.js
+++ b/apps/web/src/components/properties/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useCallback, useEffect, useState } from "react";
import * as Icon from "../icons";
import { Flex, Text } from "@streetwriters/rebass";
@@ -59,7 +77,7 @@ function Properties(props) {
const isPreviewMode = sessionType === "preview";
const changeState = useCallback(
- function changeState(prop, value) {
+ function changeState(prop) {
switch (prop) {
case "locked":
return store.get().session.locked
diff --git a/apps/web/src/components/properties/toggle.js b/apps/web/src/components/properties/toggle.js
index a9ad0cce2..db6846372 100644
--- a/apps/web/src/components/properties/toggle.js
+++ b/apps/web/src/components/properties/toggle.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text } from "@streetwriters/rebass";
import { useStore } from "../../stores/editor-store";
import Switch from "../switch";
diff --git a/apps/web/src/components/publish-view/index.js b/apps/web/src/components/publish-view/index.js
index 3ccf942ba..c49289ecd 100644
--- a/apps/web/src/components/publish-view/index.js
+++ b/apps/web/src/components/publish-view/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useMemo, useState } from "react";
import ReactDOM from "react-dom";
import { Flex, Text, Button } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/reminder-bar/index.js b/apps/web/src/components/reminder-bar/index.js
index a8cc73be7..fd5ee043d 100644
--- a/apps/web/src/components/reminder-bar/index.js
+++ b/apps/web/src/components/reminder-bar/index.js
@@ -1,4 +1,22 @@
-import React, { useMemo } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { useMemo } from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
import { useStore as useAppStore } from "../../stores/app-store";
import { Reminders } from "../../common/reminders";
diff --git a/apps/web/src/components/route-container/index.js b/apps/web/src/components/route-container/index.js
index a8df1e978..bb8823654 100644
--- a/apps/web/src/components/route-container/index.js
+++ b/apps/web/src/components/route-container/index.js
@@ -1,4 +1,22 @@
-import React, { useEffect, useRef, useState } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { useEffect, useRef, useState } from "react";
import { Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../icons";
import { useStore } from "../../stores/app-store";
diff --git a/apps/web/src/components/scroll-container/index.js b/apps/web/src/components/scroll-container/index.js
index f0ba1010e..88cd010d0 100644
--- a/apps/web/src/components/scroll-container/index.js
+++ b/apps/web/src/components/scroll-container/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useRef } from "react";
import { Box } from "@streetwriters/rebass";
import { Scrollbars } from "rc-scrollbars";
@@ -64,7 +82,7 @@ export function FlexScrollContainer({
flex: "1 1 auto",
...style
}}
- renderView={({ style, ...props }) => (
+ renderView={({ _style, ...props }) => (
<Box
{...props}
className={className}
diff --git a/apps/web/src/components/search/index.js b/apps/web/src/components/search/index.js
index 39d5fa533..5b0924e8b 100644
--- a/apps/web/src/components/search/index.js
+++ b/apps/web/src/components/search/index.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import * as Icon from "../icons";
import "./search.css";
import Field from "../field";
diff --git a/apps/web/src/components/status-bar/index.js b/apps/web/src/components/status-bar/index.js
index eeda39698..da68394e4 100644
--- a/apps/web/src/components/status-bar/index.js
+++ b/apps/web/src/components/status-bar/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Button, Flex, Text } from "@streetwriters/rebass";
import EditorFooter from "../editor/footer";
import {
diff --git a/apps/web/src/components/switch/index.js b/apps/web/src/components/switch/index.js
index c50a38dd3..3fc4e243d 100644
--- a/apps/web/src/components/switch/index.js
+++ b/apps/web/src/components/switch/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ReactToggle from "react-toggle";
import "react-toggle/style.css";
import "./style.css";
diff --git a/apps/web/src/components/tag/index.js b/apps/web/src/components/tag/index.js
index 4340a7fdd..96e50d4c7 100644
--- a/apps/web/src/components/tag/index.js
+++ b/apps/web/src/components/tag/index.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ListItem from "../list-item";
import { hashNavigate, navigate } from "../../navigation";
import { Text } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/theme-provider/index.js b/apps/web/src/components/theme-provider/index.js
index 63bb4f028..5da25070a 100644
--- a/apps/web/src/components/theme-provider/index.js
+++ b/apps/web/src/components/theme-provider/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useStore } from "../../stores/theme-store";
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
import { useTheme } from "@notesnook/theme";
diff --git a/apps/web/src/components/time-ago/index.js b/apps/web/src/components/time-ago/index.js
index 39c9a58a8..29779365d 100644
--- a/apps/web/src/components/time-ago/index.js
+++ b/apps/web/src/components/time-ago/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { formatDate } from "@notesnook/core/utils/date";
import React, { useEffect, useRef } from "react";
import { Text } from "@streetwriters/rebass";
diff --git a/apps/web/src/components/tip/index.js b/apps/web/src/components/tip/index.js
index 1a4271192..5f3d57fe2 100644
--- a/apps/web/src/components/tip/index.js
+++ b/apps/web/src/components/tip/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Text } from "@streetwriters/rebass";
function TextWithTip({ text, tip, sx, color }) {
diff --git a/apps/web/src/components/toggle/index.js b/apps/web/src/components/toggle/index.js
index 04a1b1772..510eb3169 100644
--- a/apps/web/src/components/toggle/index.js
+++ b/apps/web/src/components/toggle/index.js
@@ -1,4 +1,22 @@
-import React, { useCallback } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { useCallback } from "react";
import { showBuyDialog } from "../../common/dialog-controller";
import Tip from "../tip";
import { isUserPremium } from "../../hooks/use-is-user-premium";
diff --git a/apps/web/src/components/topic/index.js b/apps/web/src/components/topic/index.js
index bd964ba85..d5413527a 100644
--- a/apps/web/src/components/topic/index.js
+++ b/apps/web/src/components/topic/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import ListItem from "../list-item";
import { db } from "../../common/db";
diff --git a/apps/web/src/components/trash-item/index.js b/apps/web/src/components/trash-item/index.js
index b97880d58..a66b0299e 100644
--- a/apps/web/src/components/trash-item/index.js
+++ b/apps/web/src/components/trash-item/index.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ListItem from "../list-item";
import { showMultiPermanentDeleteConfirmation } from "../../common/dialog-controller";
import * as Icon from "../icons";
diff --git a/apps/web/src/components/unlock/index.js b/apps/web/src/components/unlock/index.js
index cf472c1d4..bcea2bf06 100644
--- a/apps/web/src/components/unlock/index.js
+++ b/apps/web/src/components/unlock/index.js
@@ -1,4 +1,22 @@
-import React, {
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import {
useRef,
useState,
useCallback,
diff --git a/apps/web/src/hooks/use-announcements.js b/apps/web/src/hooks/use-announcements.js
index eba9ffa56..939b96324 100644
--- a/apps/web/src/hooks/use-announcements.js
+++ b/apps/web/src/hooks/use-announcements.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useState } from "react";
import { SUBSCRIPTION_STATUS } from "../common/constants";
import { db } from "../common/db";
@@ -24,15 +42,15 @@ export default function useAnnouncements(type = "inline") {
: await db.announcements();
} catch (e) {
console.error(e);
- } finally {
- if (cancelled) return;
- let announcements = [];
- for (let announcement of CACHED_ANNOUNCEMENTS) {
- if (!(await shouldShowAnnouncement(announcement))) continue;
- announcements.push(announcement);
- }
- setAnnouncements(announcements);
}
+
+ if (cancelled) return;
+ let announcements = [];
+ for (let announcement of CACHED_ANNOUNCEMENTS) {
+ if (!(await shouldShowAnnouncement(announcement))) continue;
+ announcements.push(announcement);
+ }
+ setAnnouncements(announcements);
})();
return () => {
cancelled = true;
diff --git a/apps/web/src/hooks/use-auto-updater.js b/apps/web/src/hooks/use-auto-updater.js
index 599d7a853..40cf3afd3 100644
--- a/apps/web/src/hooks/use-auto-updater.js
+++ b/apps/web/src/hooks/use-auto-updater.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { AppEventManager } from "../common/app-events";
import { EVENTS } from "@notesnook/desktop/events";
diff --git a/apps/web/src/hooks/use-database.js b/apps/web/src/hooks/use-database.js
index bcb5f5723..677677cf7 100644
--- a/apps/web/src/hooks/use-database.js
+++ b/apps/web/src/hooks/use-database.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import { initializeDatabase } from "../common/db";
import { loadTrackerScript } from "../utils/analytics";
diff --git a/apps/web/src/hooks/use-hash-location.ts b/apps/web/src/hooks/use-hash-location.ts
index 9e0c1ee80..1fd119ada 100644
--- a/apps/web/src/hooks/use-hash-location.ts
+++ b/apps/web/src/hooks/use-hash-location.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useState, useEffect } from "react";
import { hashNavigate } from "../navigation";
@@ -28,7 +46,9 @@ export default function useHashLocation() {
useEffect(() => {
// this function is called whenever the hash changes
const handler = (e: HashChangeEvent) => {
- const update = (e as any).notify === undefined ? true : (e as any).notify;
+ const event = e as HashChangeEvent & { notify: boolean };
+
+ const update = event.notify === undefined ? true : event.notify;
console.log(currentLocation());
setLoc({
location: currentLocation(),
diff --git a/apps/web/src/hooks/use-hash-routes.js b/apps/web/src/hooks/use-hash-routes.js
index 6dae05b01..13c18f6df 100644
--- a/apps/web/src/hooks/use-hash-routes.js
+++ b/apps/web/src/hooks/use-hash-routes.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import makeMatcher from "wouter/matcher";
import useHashLocation from "./use-hash-location";
diff --git a/apps/web/src/hooks/use-is-user-premium.js b/apps/web/src/hooks/use-is-user-premium.js
index 1e518f408..684d143ec 100644
--- a/apps/web/src/hooks/use-is-user-premium.js
+++ b/apps/web/src/hooks/use-is-user-premium.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SUBSCRIPTION_STATUS } from "../common/constants";
import {
useStore as useUserStore,
diff --git a/apps/web/src/hooks/use-location.js b/apps/web/src/hooks/use-location.js
index 416932977..d5a716189 100644
--- a/apps/web/src/hooks/use-location.js
+++ b/apps/web/src/hooks/use-location.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { useState, useEffect } = require("react");
const { getCurrentPath, NavigationEvents } = require("../navigation");
diff --git a/apps/web/src/hooks/use-media-query.js b/apps/web/src/hooks/use-media-query.js
index 79b0d66d0..eaa4a1814 100644
--- a/apps/web/src/hooks/use-media-query.js
+++ b/apps/web/src/hooks/use-media-query.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable react-hooks/rules-of-hooks */
import { useState, useEffect } from "react";
diff --git a/apps/web/src/hooks/use-menu.js b/apps/web/src/hooks/use-menu.js
index ea5e34310..09b4d5bb4 100644
--- a/apps/web/src/hooks/use-menu.js
+++ b/apps/web/src/hooks/use-menu.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create from "zustand";
import shallow from "zustand/shallow";
import { isUserPremium } from "./use-is-user-premium";
diff --git a/apps/web/src/hooks/use-mobile.js b/apps/web/src/hooks/use-mobile.js
index 790a270a5..61d65a51f 100644
--- a/apps/web/src/hooks/use-mobile.js
+++ b/apps/web/src/hooks/use-mobile.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import useMediaQuery from "./use-media-query";
const useMobile = () => useMediaQuery("(max-width: 480px)");
diff --git a/apps/web/src/hooks/use-navigate.js b/apps/web/src/hooks/use-navigate.js
index fdd65ade3..357fd2d7d 100644
--- a/apps/web/src/hooks/use-navigate.js
+++ b/apps/web/src/hooks/use-navigate.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const { useEffect } = require("react");
const { NavigationEvents } = require("../navigation");
diff --git a/apps/web/src/hooks/use-persistent-state.ts b/apps/web/src/hooks/use-persistent-state.ts
index e08938ae0..cbc9eadf9 100644
--- a/apps/web/src/hooks/use-persistent-state.ts
+++ b/apps/web/src/hooks/use-persistent-state.ts
@@ -1,8 +1,26 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import config from "../utils/config";
export function usePersistentState<T>(key: string, def: T) {
- let defState = config.get<T>(key, def);
+ const defState = config.get<T>(key, def);
const [value, setValue] = useState(defState);
useEffect(() => {
diff --git a/apps/web/src/hooks/use-routes.js b/apps/web/src/hooks/use-routes.js
index f13cd33cb..1fbccd288 100644
--- a/apps/web/src/hooks/use-routes.js
+++ b/apps/web/src/hooks/use-routes.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useLocation } from "wouter";
import makeMatcher from "wouter/matcher";
import { navigate, getHomeRoute } from "../navigation";
diff --git a/apps/web/src/hooks/use-session-state.ts b/apps/web/src/hooks/use-session-state.ts
index ee1a9ec1e..e295269ce 100644
--- a/apps/web/src/hooks/use-session-state.ts
+++ b/apps/web/src/hooks/use-session-state.ts
@@ -1,6 +1,26 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
-const memory: Record<string, any> = {};
+// eslint-disable-next-line no-var
+var memory: Record<string, unknown> = {};
+
export function useSessionState<T>(key: string, def: T) {
const [value, setValue] = useState(
memory[key] === undefined ? def : memory[key]
diff --git a/apps/web/src/hooks/use-slider.js b/apps/web/src/hooks/use-slider.js
index 8c186a2f8..145892ab8 100644
--- a/apps/web/src/hooks/use-slider.js
+++ b/apps/web/src/hooks/use-slider.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useMemo, useRef } from "react";
export default function useSlider(sliderId, { onSliding, onChange }) {
diff --git a/apps/web/src/hooks/use-status.ts b/apps/web/src/hooks/use-status.ts
index eb0a2c637..619be1cb6 100644
--- a/apps/web/src/hooks/use-status.ts
+++ b/apps/web/src/hooks/use-status.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create from "zustand";
import produce from "immer";
diff --git a/apps/web/src/hooks/use-system-theme.js b/apps/web/src/hooks/use-system-theme.js
index 850fe2ac9..13f0658ea 100644
--- a/apps/web/src/hooks/use-system-theme.js
+++ b/apps/web/src/hooks/use-system-theme.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EVENTS } from "@notesnook/desktop/events";
import { useEffect, useState } from "react";
import { AppEventManager } from "../common/app-events";
diff --git a/apps/web/src/hooks/use-tablet.js b/apps/web/src/hooks/use-tablet.js
index 7a9c302f9..5f8da7241 100644
--- a/apps/web/src/hooks/use-tablet.js
+++ b/apps/web/src/hooks/use-tablet.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import useMediaQuery from "./use-media-query";
const useTablet = () =>
diff --git a/apps/web/src/hooks/use-timer.ts b/apps/web/src/hooks/use-timer.ts
index 414d892f0..23f6789ce 100644
--- a/apps/web/src/hooks/use-timer.ts
+++ b/apps/web/src/hooks/use-timer.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useRef } from "react";
import { useSessionState } from "./use-session-state";
diff --git a/apps/web/src/hooks/use-zoom-factor.js b/apps/web/src/hooks/use-zoom-factor.js
index 9c2672cc8..2704a122f 100644
--- a/apps/web/src/hooks/use-zoom-factor.js
+++ b/apps/web/src/hooks/use-zoom-factor.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useState } from "react";
import setZoomFactor from "../commands/set-zoom-factor";
diff --git a/apps/web/src/index.tsx b/apps/web/src/index.tsx
index 3db27ab34..10c06502e 100644
--- a/apps/web/src/index.tsx
+++ b/apps/web/src/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "@notesnook/core/types";
import { EVENTS } from "@notesnook/desktop/events";
import { AppEventManager } from "./common/app-events";
@@ -7,33 +25,38 @@ import Config from "./utils/config";
import { isTesting } from "./utils/platform";
import { initalizeLogger, logger } from "./utils/logger";
import { Buffer } from "buffer";
+import { AuthProps } from "./views/auth";
global.Buffer = Buffer;
initalizeLogger();
if (process.env.REACT_APP_PLATFORM === "desktop") require("./commands");
-type Route = {
- component: () => Promise<{ default: (...props: any[]) => JSX.Element }>;
- props: Record<string, any>;
+type Route<TProps = null> = {
+ component: () => Promise<{
+ default: TProps extends null
+ ? () => JSX.Element
+ : (props: TProps) => JSX.Element;
+ }>;
+ props: TProps | null;
};
-type RouteWithPath = {
- route: Route;
+type RouteWithPath<T = null> = {
+ route: Route<T>;
path: Routes;
};
-type Routes =
- | "/account/recovery"
- | "/account/verified"
- | "/signup"
- | "/login"
- | "/sessionexpired"
- | "/recover"
- | "/mfa/code"
- | "/mfa/select"
- | "default";
-
-const routes: Record<Routes, Route> = {
+type Routes = keyof typeof routes;
+// | "/account/recovery"
+// | "/account/verified"
+// | "/signup"
+// | "/login"
+// | "/sessionexpired"
+// | "/recover"
+// | "/mfa/code"
+// | "/mfa/select"
+// | "default";
+
+const routes = {
"/account/recovery": {
component: () => import("./views/recovery"),
props: { route: "methods" }
@@ -66,8 +89,8 @@ const routes: Record<Routes, Route> = {
component: () => import("./views/auth"),
props: { route: "login" }
},
- default: { component: () => import("./app"), props: {} }
-};
+ default: { component: () => import("./app"), props: null }
+} as const;
const sessionExpiryExceptions: Routes[] = [
"/recover",
@@ -77,16 +100,16 @@ const sessionExpiryExceptions: Routes[] = [
const serviceWorkerWhitelist: Routes[] = ["default"];
-function getRoute(): RouteWithPath {
+function getRoute(): RouteWithPath<AuthProps> | RouteWithPath {
const path = getCurrentPath() as Routes;
logger.info(`Getting route for path: ${path}`);
const signup = redirectToRegistration(path);
const sessionExpired = isSessionExpired(path);
const fallback = fallbackRoute();
- const route: RouteWithPath | null = routes[path]
- ? { route: routes[path], path }
- : null;
+ const route = (
+ routes[path] ? { route: routes[path], path } : null
+ ) as RouteWithPath<AuthProps> | null;
return signup || sessionExpired || route || fallback;
}
@@ -95,7 +118,7 @@ function fallbackRoute(): RouteWithPath {
return { route: routes.default, path: "default" };
}
-function redirectToRegistration(path: Routes): RouteWithPath | null {
+function redirectToRegistration(path: Routes): RouteWithPath<AuthProps> | null {
if (!isTesting() && !shouldSkipInitiation() && !routes[path]) {
window.history.replaceState({}, "", makeURL("/signup", getCurrentHash()));
return { route: routes["/signup"], path: "/signup" };
@@ -103,7 +126,7 @@ function redirectToRegistration(path: Routes): RouteWithPath | null {
return null;
}
-function isSessionExpired(path: Routes): RouteWithPath | null {
+function isSessionExpired(path: Routes): RouteWithPath<AuthProps> | null {
const isSessionExpired = Config.get("sessionExpired", false);
if (isSessionExpired && !sessionExpiryExceptions.includes(path)) {
logger.info(`User session has expired. Routing to /sessionexpired`);
@@ -139,11 +162,15 @@ async function renderApp() {
logger.measure("app render");
const { default: Component } = await component();
- render(<Component {...props} />, document.getElementById("root"), () => {
- logger.measure("app render");
-
- document.getElementById("splash")?.remove();
- });
+ render(
+ <Component route={props?.route || "login"} />,
+ document.getElementById("root"),
+ () => {
+ logger.measure("app render");
+
+ document.getElementById("splash")?.remove();
+ }
+ );
}
async function initializeServiceWorker() {
diff --git a/apps/web/src/interfaces/fs.js b/apps/web/src/interfaces/fs.js
index 056d5d430..b404c3478 100644
--- a/apps/web/src/interfaces/fs.js
+++ b/apps/web/src/interfaces/fs.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "web-streams-polyfill/dist/ponyfill";
import localforage from "localforage";
import { xxhash64, createXXHash64 } from "hash-wasm";
@@ -122,6 +140,7 @@ async function hashStream(reader) {
const hasher = await createXXHash64();
hasher.init();
+ // eslint-disable-next-line no-constant-condition
while (true) {
const { value } = await reader.read();
if (!value) break;
@@ -204,7 +223,7 @@ async function uploadFile(filename, requestOptions) {
await fileHandle.addAdditionalData("uploadId", uploadId);
- function onUploadProgress(ev) {
+ const onUploadProgress = (ev) => {
reportProgress(
{
total: fileHandle.file.size + ABYTES,
@@ -215,7 +234,7 @@ async function uploadFile(filename, requestOptions) {
hash: filename
}
);
- }
+ };
for (let i = uploadedChunks.length; i < TOTAL_PARTS; ++i) {
const blob = await fileHandle.readChunks(
diff --git a/apps/web/src/interfaces/nncrypto.stub.ts b/apps/web/src/interfaces/nncrypto.stub.ts
index 6be88140d..a011818f8 100644
--- a/apps/web/src/interfaces/nncrypto.stub.ts
+++ b/apps/web/src/interfaces/nncrypto.stub.ts
@@ -1,5 +1,22 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { INNCrypto } from "@notesnook/crypto/dist/src/interfaces";
-// eslint-disable-next-line import/no-webpack-loader-syntax
import "worker-loader?filename=static/workers/nncrypto.worker.js!@notesnook/crypto-worker/dist/src/worker.js";
const WORKER_PATH = "/static/workers/nncrypto.worker.js";
@@ -15,7 +32,7 @@ async function loadNNCrypto() {
}
}
-var instance: INNCrypto | null = null;
+let instance: INNCrypto | null = null;
export function getNNCrypto(): Promise<INNCrypto> {
if (instance) return Promise.resolve(instance);
@@ -26,12 +43,13 @@ export function getNNCrypto(): Promise<INNCrypto> {
});
}
-var processing = false;
-var queue: Array<any> = [];
+let processing = false;
+type PromiseResolve = <T>(value: Awaited<T>) => void;
+const queue: Array<PromiseResolve> = [];
async function queueify<T>(action: () => Promise<T>): Promise<T> {
if (processing)
return new Promise((resolve) => {
- queue.push(resolve);
+ queue.push(resolve as PromiseResolve);
});
processing = true;
@@ -40,6 +58,7 @@ async function queueify<T>(action: () => Promise<T>): Promise<T> {
while (queue.length > 0) {
const resolve = queue.pop();
+ if (!resolve) continue;
resolve(result);
}
return result;
diff --git a/apps/web/src/interfaces/storage.ts b/apps/web/src/interfaces/storage.ts
index 84dad5962..898a31e58 100644
--- a/apps/web/src/interfaces/storage.ts
+++ b/apps/web/src/interfaces/storage.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import localforage from "localforage";
import { extendPrototype } from "localforage-getitems";
import * as MemoryDriver from "localforage-driver-memory";
@@ -58,13 +76,15 @@ export class NNStorage {
const crypto = await getNNCrypto();
const keyData = await crypto.exportKey(password, salt);
- if (this.isIndexedDBSupported() && window?.crypto?.subtle) {
+ if (this.isIndexedDBSupported() && window?.crypto?.subtle && keyData.key) {
const pbkdfKey = await derivePBKDF2Key(password);
await this.write(name, pbkdfKey);
- const cipheredKey = await aesEncrypt(pbkdfKey, keyData.key!);
+ const cipheredKey = await aesEncrypt(pbkdfKey, keyData.key);
await this.write(`${name}@_k`, cipheredKey);
- } else {
+ } else if (keyData.key) {
await this.write(`${name}@_k`, keyData.key);
+ } else {
+ throw new Error(`Invalid key.`);
}
}
@@ -121,8 +141,8 @@ export class NNStorage {
}
}
-let enc = new TextEncoder();
-let dec = new TextDecoder();
+const enc = new TextEncoder();
+const dec = new TextDecoder();
async function derivePBKDF2Key(password: string): Promise<CryptoKey> {
const key = await window.crypto.subtle.importKey(
@@ -133,7 +153,7 @@ async function derivePBKDF2Key(password: string): Promise<CryptoKey> {
["deriveKey"]
);
- let salt = window.crypto.getRandomValues(new Uint8Array(16));
+ const salt = window.crypto.getRandomValues(new Uint8Array(16));
return await window.crypto.subtle.deriveKey(
{
name: "PBKDF2",
@@ -152,7 +172,7 @@ async function aesEncrypt(
cryptoKey: CryptoKey,
data: string
): Promise<EncryptedKey> {
- let iv = window.crypto.getRandomValues(new Uint8Array(12));
+ const iv = window.crypto.getRandomValues(new Uint8Array(12));
const cipher = await window.crypto.subtle.encrypt(
{
diff --git a/apps/web/src/navigation/hash-routes.js b/apps/web/src/navigation/hash-routes.js
index b688346a0..9b6c2f43a 100644
--- a/apps/web/src/navigation/hash-routes.js
+++ b/apps/web/src/navigation/hash-routes.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Vault from "../common/vault";
import {
showBuyDialog,
diff --git a/apps/web/src/navigation/index.js b/apps/web/src/navigation/index.js
index 80a8c6919..21034ed1c 100644
--- a/apps/web/src/navigation/index.js
+++ b/apps/web/src/navigation/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useState } from "react";
import EventManager from "@notesnook/core/utils/event-manager";
import Config from "../utils/config";
diff --git a/apps/web/src/navigation/routes.js b/apps/web/src/navigation/routes.js
index 12e1a1c9a..b0a59ce1d 100644
--- a/apps/web/src/navigation/routes.js
+++ b/apps/web/src/navigation/routes.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { db } from "../common/db";
import Home from "../views/home";
import Notebooks from "../views/notebooks";
diff --git a/apps/web/src/re-exports/react-qrcode-logo.js b/apps/web/src/re-exports/react-qrcode-logo.js
index fbf023eb9..46d4dcab6 100644
--- a/apps/web/src/re-exports/react-qrcode-logo.js
+++ b/apps/web/src/re-exports/react-qrcode-logo.js
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export { QRCode as default } from "react-qrcode-logo";
diff --git a/apps/web/src/react-app-env.d.ts b/apps/web/src/react-app-env.d.ts
index 6431bc5fc..e96c95578 100644
--- a/apps/web/src/react-app-env.d.ts
+++ b/apps/web/src/react-app-env.d.ts
@@ -1 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/// <reference types="react-scripts" />
+
+const _ignore;
diff --git a/apps/web/src/service-worker-registration.js b/apps/web/src/service-worker-registration.js
index 15700f734..8f1546a68 100644
--- a/apps/web/src/service-worker-registration.js
+++ b/apps/web/src/service-worker-registration.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
// This optional code is used to register a service worker.
// register() is not called by default.
diff --git a/apps/web/src/service-worker.js b/apps/web/src/service-worker.js
index f77f99d06..de5938a21 100644
--- a/apps/web/src/service-worker.js
+++ b/apps/web/src/service-worker.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/* eslint-disable no-restricted-globals */
// This service worker can be customized!
@@ -82,13 +100,15 @@ self.addEventListener("message", (event) => {
self.skipWaiting();
break;
case "GET_VERSION":
- const VERSION = process.env.REACT_APP_VERSION;
- const HASH = process.env.REACT_APP_GIT_HASH;
- event.source.postMessage({
- type: data.type,
- version: VERSION,
- hash: HASH
- });
+ {
+ const VERSION = process.env.REACT_APP_VERSION;
+ const HASH = process.env.REACT_APP_GIT_HASH;
+ event.source.postMessage({
+ type: data.type,
+ version: VERSION,
+ hash: HASH
+ });
+ }
break;
default:
break;
diff --git a/apps/web/src/stores/app-store.js b/apps/web/src/stores/app-store.js
index 458f8d77d..ebe2cf612 100644
--- a/apps/web/src/stores/app-store.js
+++ b/apps/web/src/stores/app-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import { db } from "../common/db";
import { store as noteStore } from "./note-store";
diff --git a/apps/web/src/stores/attachment-store.js b/apps/web/src/stores/attachment-store.js
index 82051082e..0cc70541f 100644
--- a/apps/web/src/stores/attachment-store.js
+++ b/apps/web/src/stores/attachment-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import { db } from "../common/db";
import BaseStore from "./index";
diff --git a/apps/web/src/stores/editor-store.js b/apps/web/src/stores/editor-store.js
index f86d83e51..bfa2cae13 100644
--- a/apps/web/src/stores/editor-store.js
+++ b/apps/web/src/stores/editor-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import { store as noteStore } from "./note-store";
import { store as attachmentStore } from "./attachment-store";
diff --git a/apps/web/src/stores/index.js b/apps/web/src/stores/index.js
index b94a187e0..743f30725 100644
--- a/apps/web/src/stores/index.js
+++ b/apps/web/src/stores/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
class BaseStore {
static new(set, get) {
return new this(set, get);
diff --git a/apps/web/src/stores/monograph-store.js b/apps/web/src/stores/monograph-store.js
index 266b28f56..474f49acf 100644
--- a/apps/web/src/stores/monograph-store.js
+++ b/apps/web/src/stores/monograph-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import { db } from "../common/db";
import BaseStore from "./index";
diff --git a/apps/web/src/stores/note-store.js b/apps/web/src/stores/note-store.js
index fda57e8fa..3af3952ff 100644
--- a/apps/web/src/stores/note-store.js
+++ b/apps/web/src/stores/note-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { db } from "../common/db";
import createStore from "../common/store";
import { store as editorStore } from "./editor-store";
@@ -189,13 +207,14 @@ function notesFromContext(context) {
case "color":
notes = db.notes.colored(context.value);
break;
- case "topic":
+ case "topic": {
const notebook = db.notebooks.notebook(context?.value?.id);
if (!notebook) break;
const topic = notebook.topics?.topic(context?.value?.topic);
if (!topic) break;
notes = topic.all;
break;
+ }
case "favorite":
notes = db.notes.favorites;
break;
diff --git a/apps/web/src/stores/notebook-store.js b/apps/web/src/stores/notebook-store.js
index 388f72c7e..90500585f 100644
--- a/apps/web/src/stores/notebook-store.js
+++ b/apps/web/src/stores/notebook-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { db } from "../common/db";
import createStore from "../common/store";
import { store as appStore } from "./app-store";
diff --git a/apps/web/src/stores/search-store.js b/apps/web/src/stores/search-store.js
index b746e6e78..037bc90ab 100644
--- a/apps/web/src/stores/search-store.js
+++ b/apps/web/src/stores/search-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import { db } from "../common/db";
import BaseStore from "./index";
diff --git a/apps/web/src/stores/selection-store.js b/apps/web/src/stores/selection-store.js
index 476cf7576..1fd2e0983 100644
--- a/apps/web/src/stores/selection-store.js
+++ b/apps/web/src/stores/selection-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import BaseStore from "./index";
diff --git a/apps/web/src/stores/setting-store.js b/apps/web/src/stores/setting-store.js
index 4da8279c1..e5c289636 100644
--- a/apps/web/src/stores/setting-store.js
+++ b/apps/web/src/stores/setting-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import Config from "../utils/config";
import BaseStore from "./index";
diff --git a/apps/web/src/stores/tag-store.js b/apps/web/src/stores/tag-store.js
index 7d5260e42..9e581fabf 100644
--- a/apps/web/src/stores/tag-store.js
+++ b/apps/web/src/stores/tag-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import { db } from "../common/db";
import BaseStore from "./index";
diff --git a/apps/web/src/stores/theme-store.js b/apps/web/src/stores/theme-store.js
index d1f4afd32..79a6ffea2 100644
--- a/apps/web/src/stores/theme-store.js
+++ b/apps/web/src/stores/theme-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import BaseStore from "./index";
import Config from "../utils/config";
@@ -5,6 +23,9 @@ import changeAppTheme from "../commands/change-app-theme";
import { getDefaultAccentColor } from "@notesnook/theme";
class ThemeStore extends BaseStore {
+ /**
+ * @type {"dark" | "light"}
+ */
theme = Config.get("theme", "light");
accent = Config.get("accent", getDefaultAccentColor());
followSystemTheme = Config.get("followSystemTheme", false);
diff --git a/apps/web/src/stores/trash-store.js b/apps/web/src/stores/trash-store.js
index cd43f9eeb..b9174ac0b 100644
--- a/apps/web/src/stores/trash-store.js
+++ b/apps/web/src/stores/trash-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { db } from "../common/db";
import createStore from "../common/store";
import BaseStore from "./index";
diff --git a/apps/web/src/stores/user-store.js b/apps/web/src/stores/user-store.js
index 0d5441a23..5c9bba270 100644
--- a/apps/web/src/stores/user-store.js
+++ b/apps/web/src/stores/user-store.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import createStore from "../common/store";
import { db } from "../common/db";
import BaseStore from "./index";
@@ -71,7 +89,7 @@ class UserStore extends BaseStore {
});
config.clear();
EV.publish(EVENTS.appRefreshRequested);
- if (!!reason) {
+ if (reason) {
await showAccountLoggedOutNotice(reason);
}
});
diff --git a/apps/web/src/utils/analytics.ts b/apps/web/src/utils/analytics.ts
index 28d0ff50f..9da0b3b41 100644
--- a/apps/web/src/utils/analytics.ts
+++ b/apps/web/src/utils/analytics.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Config from "./config";
import { getPlatform } from "./platform";
import { appVersion } from "./version";
@@ -18,7 +36,7 @@ declare global {
export function loadTrackerScript() {
if (Config.get("telemetry") === "false") return;
- var script = document.createElement("script");
+ const script = document.createElement("script");
script.src = "/an.js";
script.async = true;
script.dataset.websiteId = "f16c07d9-c77b-4781-bfbd-f58e95640002";
@@ -28,7 +46,7 @@ export function loadTrackerScript() {
script.dataset.autoTrack = "false";
script.dataset.doNotTrack = "true";
script.dataset.hostUrl = "https://analytics.streetwriters.co";
- var firstScriptElement = document.getElementsByTagName("script")[0];
+ const firstScriptElement = document.getElementsByTagName("script")[0];
script.onload = function () {
trackVisit();
};
@@ -92,7 +110,7 @@ export function trackEvent(event: TrackerEvent, eventMessage?: string) {
else if (eventMessage) window.umami.trackEvent(eventMessage, event.name);
}
-export function trackVisit(url: string = "/") {
+export function trackVisit(url = "/") {
if (Config.get("telemetry") === "false") return;
const platform = getPlatform();
if (!window.umami || !platform) return;
diff --git a/apps/web/src/utils/color.js b/apps/web/src/utils/color.js
index dc5ee9803..fec1631b0 100644
--- a/apps/web/src/utils/color.js
+++ b/apps/web/src/utils/color.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
function hexToRGB(hex, alpha = 1) {
let parseString = hex;
if (hex.startsWith("#")) {
diff --git a/apps/web/src/utils/config.ts b/apps/web/src/utils/config.ts
index d171f9152..ef8f8ccc6 100644
--- a/apps/web/src/utils/config.ts
+++ b/apps/web/src/utils/config.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { tryParse } from "./parse";
function set<T>(key: string, value: T) {
@@ -15,8 +33,8 @@ function clear() {
window.localStorage.clear();
}
-function all(): Record<string, any> {
- const data: Record<string, any> = {};
+function all(): Record<string, unknown> {
+ const data: Record<string, unknown> = {};
for (let i = 0; i < window.localStorage.length; ++i) {
const key = window.localStorage.key(i);
if (!key) continue;
diff --git a/apps/web/src/utils/css.js b/apps/web/src/utils/css.js
index 1348647b0..d50d4eea5 100644
--- a/apps/web/src/utils/css.js
+++ b/apps/web/src/utils/css.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function removeCss(id) {
var link = document.getElementById(id);
link.remove();
diff --git a/apps/web/src/utils/debounce.ts b/apps/web/src/utils/debounce.ts
index 75af5eb01..687ab6a04 100644
--- a/apps/web/src/utils/debounce.ts
+++ b/apps/web/src/utils/debounce.ts
@@ -1,31 +1,49 @@
-export function debounce<F extends (...args: any) => any>(
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+export function debounce<F extends (...args: never[]) => void>(
func: F,
waitFor: number
) {
- let timeout: NodeJS.Timeout | null;
+ let timeout: number | null;
- const debounced = (...args: any) => {
+ const debounced = (...args: Parameters<F>) => {
if (timeout) clearTimeout(timeout);
- timeout = setTimeout(() => func(...args), waitFor);
+ timeout = setTimeout(() => func(...args), waitFor) as unknown as number;
};
- return debounced as (...args: Parameters<F>) => ReturnType<F>;
+ return debounced;
}
-export function debounceWithId<F extends (...args: any) => any>(
+export function debounceWithId<F extends (...args: never[]) => void>(
func: F,
waitFor: number
) {
- var timeout: NodeJS.Timeout | null = null;
- var debounceId: string | null = null;
+ let timeout: number | null;
+ let debounceId: string | null = null;
- const debounced = (id: string, ...args: any) => {
+ const debounced = (id: string, ...args: Parameters<F>) => {
if (timeout && id === debounceId) clearTimeout(timeout);
debounceId = id;
timeout = setTimeout(() => {
func(...args);
- }, waitFor);
+ }, waitFor) as unknown as number;
};
- return debounced as (id: string, ...args: Parameters<F>) => ReturnType<F>;
+ return debounced;
}
diff --git a/apps/web/src/utils/dimensions.js b/apps/web/src/utils/dimensions.js
index 86430a7b2..6d31b0c27 100644
--- a/apps/web/src/utils/dimensions.js
+++ b/apps/web/src/utils/dimensions.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
function isMobile() {
var match = window.matchMedia || window.msMatchMedia;
if (match) {
diff --git a/apps/web/src/utils/filename.js b/apps/web/src/utils/filename.js
index 0f75deee5..7f1cb5b4a 100644
--- a/apps/web/src/utils/filename.js
+++ b/apps/web/src/utils/filename.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/*jshint node:true*/
/**
diff --git a/apps/web/src/utils/importer.js b/apps/web/src/utils/importer.js
index 209f78abb..af4838622 100644
--- a/apps/web/src/utils/importer.js
+++ b/apps/web/src/utils/importer.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { unzipSync } from "fflate";
import { db } from "../common/db";
import FS from "../interfaces/fs";
diff --git a/apps/web/src/utils/keyboard.js b/apps/web/src/utils/keyboard.js
index 19fa1deeb..eed91845e 100644
--- a/apps/web/src/utils/keyboard.js
+++ b/apps/web/src/utils/keyboard.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import EventManager from "@notesnook/core/utils/event-manager";
const GlobalKeyboard = {};
diff --git a/apps/web/src/utils/logger.ts b/apps/web/src/utils/logger.ts
index 1899160e3..68e04b512 100644
--- a/apps/web/src/utils/logger.ts
+++ b/apps/web/src/utils/logger.ts
@@ -1,15 +1,34 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
initalize,
logger as _logger,
logManager
} from "@notesnook/core/logger";
+import { LogMessage } from "@notesnook/logger";
import FileSaver from "file-saver";
import { DatabasePersistence, NNStorage } from "../interfaces/storage";
import { zip } from "./zip";
-var logger: typeof _logger;
+let logger: typeof _logger;
function initalizeLogger(persistence: DatabasePersistence = "db") {
- initalize(new NNStorage("Logs", persistence) as any);
+ initalize(new NNStorage("Logs", persistence));
logger = _logger.scope("notesnook-web");
}
@@ -18,7 +37,9 @@ async function downloadLogs() {
const allLogs = await logManager.get();
const files = allLogs.map((log) => ({
filename: log.key,
- content: (log.logs as any[]).map((line) => JSON.stringify(line)).join("\n")
+ content: (log.logs as LogMessage[])
+ .map((line) => JSON.stringify(line))
+ .join("\n")
}));
const archive = await zip(files, "log");
FileSaver.saveAs(new Blob([archive.buffer]), "notesnook-logs.zip");
diff --git a/apps/web/src/utils/object.js b/apps/web/src/utils/object.js
index 10d9b5ceb..b8fa3deb2 100644
--- a/apps/web/src/utils/object.js
+++ b/apps/web/src/utils/object.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function objectMap(obj, fn) {
return Object.entries(obj).map(([k, v], i) => fn(k, v, i));
}
diff --git a/apps/web/src/utils/page-visibility.js b/apps/web/src/utils/page-visibility.js
index 82a2a160d..ae324efaf 100644
--- a/apps/web/src/utils/page-visibility.js
+++ b/apps/web/src/utils/page-visibility.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
var hidden, visibilityChange;
if (typeof document.hidden !== "undefined") {
// Opera 12.10 and Firefox 18 and later support
diff --git a/apps/web/src/utils/parse.js b/apps/web/src/utils/parse.js
index c96f17880..488a83066 100644
--- a/apps/web/src/utils/parse.js
+++ b/apps/web/src/utils/parse.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function tryParse(val) {
if (val === "undefined" || val === "null") return;
diff --git a/apps/web/src/utils/platform.js b/apps/web/src/utils/platform.js
index 2ceea0cf6..7393f2129 100644
--- a/apps/web/src/utils/platform.js
+++ b/apps/web/src/utils/platform.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function getPlatform() {
var userAgent = window.navigator.userAgent,
platform = window.navigator.platform,
diff --git a/apps/web/src/utils/random.js b/apps/web/src/utils/random.js
index 417c31b10..d57a38686 100644
--- a/apps/web/src/utils/random.js
+++ b/apps/web/src/utils/random.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
function getRandom(min, max) {
return Math.round(Math.random() * (max - min) + min);
}
diff --git a/apps/web/src/utils/string.js b/apps/web/src/utils/string.js
index 7849c97f1..dbeb77e51 100644
--- a/apps/web/src/utils/string.js
+++ b/apps/web/src/utils/string.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function toTitleCase(str) {
if (!str || !str[0]) {
return "";
diff --git a/apps/web/src/utils/toast.tsx b/apps/web/src/utils/toast.tsx
index 65ec70a69..73e648b43 100644
--- a/apps/web/src/utils/toast.tsx
+++ b/apps/web/src/utils/toast.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Button, Flex, Text } from "@streetwriters/rebass";
import ThemeProvider from "../components/theme-provider";
import { Error, Warn, Success } from "../components/icons";
@@ -15,7 +33,7 @@ function showToast(
type: ToastType,
message: string,
actions?: ToastAction[],
- hideAfter: number = 5000
+ hideAfter = 5000
): { hide: () => void } {
if (appstore.get().isFocusMode) return { hide: () => {} }; // TODO
diff --git a/apps/web/src/utils/version.ts b/apps/web/src/utils/version.ts
index e2cf31ff3..01d38c897 100644
--- a/apps/web/src/utils/version.ts
+++ b/apps/web/src/utils/version.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export type Platforms = "web" | "desktop";
export type AppVersion = typeof appVersion;
export const appVersion = {
diff --git a/apps/web/src/utils/zip.ts b/apps/web/src/utils/zip.ts
index 213178f28..1b7ea6b1a 100644
--- a/apps/web/src/utils/zip.ts
+++ b/apps/web/src/utils/zip.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Unzipped } from "fflate";
import { sanitizeFilename } from "./filename";
diff --git a/apps/web/src/views/auth.tsx b/apps/web/src/views/auth.tsx
index 9af47e041..0bbfff6c7 100644
--- a/apps/web/src/views/auth.tsx
+++ b/apps/web/src/views/auth.tsx
@@ -1,5 +1,23 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
-import { Button, Flex, Text } from "@streetwriters/rebass";
+import { BoxProps, Button, Flex, Text } from "@streetwriters/rebass";
import {
CheckCircle,
Loading,
@@ -89,7 +107,7 @@ type AuthRoutes =
| "recover"
| "mfa:code"
| "mfa:select";
-type AuthProps = { route: AuthRoutes };
+export type AuthProps = { route: AuthRoutes };
type AuthComponent<TRoute extends AuthRoutes> = (
props: BaseAuthComponentProps<TRoute>
@@ -316,7 +334,7 @@ function Signup(props: BaseAuthComponentProps<"signup">) {
loading={!isAppLoaded}
/>
<Text mt={4} variant="subBody" fontSize={13} textAlign="center">
- By pressing "Create account" button, you agree to our{" "}
+ By pressing {`"Create account" button, you agree to our`}{" "}
<Text
as="a"
color="primary"
@@ -408,7 +426,7 @@ function SessionExpiry(props: BaseAuthComponentProps<"sessionExpiry">) {
mt={2}
variant="anchor"
color="text"
- onClick={() => navigate("recover", { email: user!.email })}
+ onClick={() => user && navigate("recover", { email: user.email })}
>
Forgot password?
</Button>
@@ -539,7 +557,7 @@ function MFACode(props: BaseAuthComponentProps<"mfa:code">) {
async (selectedMethod: "sms" | "email", token: string) => {
setIsSending(true);
try {
- await db.mfa!.sendCode(selectedMethod, token);
+ await db.mfa?.sendCode(selectedMethod, token);
setEnabled(false);
} catch (e) {
const error = e as Error;
@@ -648,7 +666,7 @@ type MFAMethodType = AuthenticatorType | "recoveryCode";
type MFAMethod = {
type: MFAMethodType;
title: string;
- icon: (props: any) => JSX.Element;
+ icon: (props: BoxProps) => JSX.Element;
};
const MFAMethods: MFAMethod[] = [
{ type: "app", title: "Use an authenticator app", icon: MFAAuthenticator },
@@ -683,7 +701,7 @@ function MFASelector(props: BaseAuthComponentProps<"mfa:select">) {
title: "Logging you in",
subtitle: "Please wait while you are authenticated."
}}
- onSubmit={async (form) => {
+ onSubmit={async () => {
const selectedType = MFAMethods[selected];
formData.selectedMethod = selectedType.type;
navigate("mfa:code", formData);
@@ -925,7 +943,7 @@ async function login(
Config.set("sessionExpired", false);
openURL("/");
} catch (e) {
- const error = e as any;
+ const error = e as Error & { code?: string; data?: unknown };
if (error.code === "mfa_required") {
const { primaryMethod, phoneNumber, secondaryMethod, token } =
error.data as MFAErrorData;
diff --git a/apps/web/src/views/email-confirmed.js b/apps/web/src/views/email-confirmed.js
index c600de115..8b5ada4df 100644
--- a/apps/web/src/views/email-confirmed.js
+++ b/apps/web/src/views/email-confirmed.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "../app.css";
import { useEffect } from "react";
import { Flex, Text } from "@streetwriters/rebass";
@@ -96,7 +114,7 @@ const social = [
link: "https://reddit.com/r/Notesnook"
}
];
-function BlogPromoBanner(props) {
+function BlogPromoBanner() {
return (
<Flex flexDirection="column" justifyContent="center" alignItems="center">
<Text variant="heading" fontSize="1.2em" textAlign="center">
@@ -110,11 +128,12 @@ function BlogPromoBanner(props) {
mt={2}
sx={{ wordWrap: "break-word" }}
>
- Because where's the fun in nookin' alone?
+ {`Because where's the fun in nookin' alone?`}
</Text>
<Flex mt={5}>
{social.map((account) => (
<account.icon
+ key={account.title}
hoverColor={account.hoverColor}
title={account.title}
onClick={() => {
diff --git a/apps/web/src/views/home.js b/apps/web/src/views/home.js
index 95567a1e8..067906a1c 100644
--- a/apps/web/src/views/home.js
+++ b/apps/web/src/views/home.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { useEffect, useState } from "react";
import { useStore, store } from "../stores/note-store";
import ListContainer from "../components/list-container";
diff --git a/apps/web/src/views/notebooks.js b/apps/web/src/views/notebooks.js
index 14deccc03..0ae3f093f 100644
--- a/apps/web/src/views/notebooks.js
+++ b/apps/web/src/views/notebooks.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ListContainer from "../components/list-container";
import { useStore, store } from "../stores/notebook-store";
import NotebooksPlaceholder from "../components/placeholders/notebooks-placeholder";
diff --git a/apps/web/src/views/notes.js b/apps/web/src/views/notes.js
index 51e95138b..cfe35067b 100644
--- a/apps/web/src/views/notes.js
+++ b/apps/web/src/views/notes.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useState } from "react";
import ListContainer from "../components/list-container";
import { useStore as useNotesStore } from "../stores/note-store";
diff --git a/apps/web/src/views/recovery.tsx b/apps/web/src/views/recovery.tsx
index 18b3ec7fe..4f6fe9425 100644
--- a/apps/web/src/views/recovery.tsx
+++ b/apps/web/src/views/recovery.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useMemo, useRef, useState } from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
import { Error as ErrorIcon } from "../components/icons";
@@ -13,7 +31,7 @@ import { showRecoveryKeyDialog } from "../common/dialog-controller";
import Config from "../utils/config";
type RecoveryMethodType = "key" | "backup" | "reset";
-type RecoveryMethodsFormData = {};
+type RecoveryMethodsFormData = Record<string, unknown>;
type RecoveryKeyFormData = {
recoveryKey: string;
@@ -22,7 +40,7 @@ type RecoveryKeyFormData = {
type BackupFileFormData = {
backupFile: {
file: File;
- backup: any;
+ backup: Record<string, unknown>;
};
};
@@ -264,6 +282,7 @@ function RecoveryMethods(props: BaseRecoveryComponentProps<"methods">) {
>
{recoveryMethods.map((method, index) => (
<Button
+ key={method.testId}
data-test-id={method.testId}
type="submit"
variant={"secondary"}
@@ -333,7 +352,7 @@ function RecoveryKeyMethod(props: BaseRecoveryComponentProps<"method:key">) {
color="text"
onClick={() => navigate("methods")}
>
- Don't have your recovery key?
+ {`Don't have your recovery key?`}
</Button>
</RecoveryForm>
);
@@ -392,7 +411,7 @@ function BackupFileMethod(props: BaseRecoveryComponentProps<"method:backup">) {
color="text"
onClick={() => navigate("methods")}
>
- Don't have a backup file?
+ {`Don't have a backup file?`}
</Button>
</RecoveryForm>
);
diff --git a/apps/web/src/views/search.js b/apps/web/src/views/search.js
index 8e56302b4..f512c8b6e 100644
--- a/apps/web/src/views/search.js
+++ b/apps/web/src/views/search.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import ListContainer from "../components/list-container";
import SearchPlaceholder from "../components/placeholders/search-placeholder";
@@ -12,18 +30,20 @@ import { hardNavigate } from "../navigation";
async function typeToItems(type, context) {
switch (type) {
- case "notes":
+ case "notes": {
await db.notes.init();
if (!context) return ["notes", db.notes.all];
const notes = context.notes;
return ["notes", notes];
+ }
case "notebooks":
return ["notebooks", db.notebooks.all];
- case "topics":
+ case "topics": {
const notebookId = notebookstore.get().selectedNotebookId;
if (!notebookId) return ["topics", []];
const topics = db.notebooks.notebook(notebookId).topics.all;
return ["topics", topics];
+ }
case "tags":
return ["tags", db.tags.all];
case "trash":
@@ -68,28 +88,32 @@ function Search({ type }) {
case "notes":
if (!context) return "all notes";
switch (context.type) {
- case "topic":
+ case "topic": {
const notebook = db.notebooks.notebook(context.value.id);
const topic = notebook.topics.topic(context.value.topic);
return `notes of ${topic._topic.title} in ${notebook.title}`;
- case "tag":
+ }
+ case "tag": {
const tag = db.tags.all.find((tag) => tag.id === context.value);
return `notes in #${tag.title}`;
+ }
case "favorite":
return "favorite notes";
- case "color":
+ case "color": {
const color = db.colors.all.find((tag) => tag.id === context.value);
return `notes in color ${color.title}`;
+ }
default:
return;
}
case "notebooks":
return "all notebooks";
- case "topics":
+ case "topics": {
const notebookId = notebookstore.get().selectedNotebookId;
if (!notebookId) return "";
const notebook = db.notebooks.notebook(notebookId);
return `topics in ${notebook.title} notebook`;
+ }
case "tags":
return "all tags";
case "trash":
diff --git a/apps/web/src/views/settings.js b/apps/web/src/views/settings.js
index e645140e3..05f065e32 100644
--- a/apps/web/src/views/settings.js
+++ b/apps/web/src/views/settings.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useMemo, useState } from "react";
import { Button, Flex, Text } from "@streetwriters/rebass";
import * as Icon from "../components/icons";
@@ -100,7 +118,7 @@ const otherItems = [
}
];
-function Settings(props) {
+function Settings() {
const [groups, setGroups] = useState({
appearance: false,
editor: false,
diff --git a/apps/web/src/views/tags.js b/apps/web/src/views/tags.js
index e77ac8754..d71062636 100644
--- a/apps/web/src/views/tags.js
+++ b/apps/web/src/views/tags.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ListContainer from "../components/list-container";
import { useStore, store } from "../stores/tag-store";
import TagsPlaceholder from "../components/placeholders/tags-placeholder";
diff --git a/apps/web/src/views/topics.js b/apps/web/src/views/topics.js
index e703befbf..445668582 100644
--- a/apps/web/src/views/topics.js
+++ b/apps/web/src/views/topics.js
@@ -1,4 +1,22 @@
-import React, { useEffect, useState } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { useEffect, useState } from "react";
import ListContainer from "../components/list-container";
import { useStore as useNbStore } from "../stores/notebook-store";
import { useStore as useAppStore } from "../stores/app-store";
diff --git a/apps/web/src/views/trash.js b/apps/web/src/views/trash.js
index 84f6cc664..563379702 100644
--- a/apps/web/src/views/trash.js
+++ b/apps/web/src/views/trash.js
@@ -1,4 +1,21 @@
-import React from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import * as Icon from "../components/icons";
import ListContainer from "../components/list-container";
import { confirm } from "../common/dialog-controller";
diff --git a/package-lock.json b/package-lock.json
index 748bafa97..1f06ee3be 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -15,7 +15,9 @@
"eslint-config-react-hooks": "^1.0.0",
"eslint-plugin-detox": "^1.0.0",
"eslint-plugin-jest": "^26.8.7",
+ "eslint-plugin-license-header": "^0.6.0",
"eslint-plugin-react": "^7.31.0",
+ "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^8.0.1",
@@ -6221,6 +6223,24 @@
"semver": "bin/semver.js"
}
},
+ "node_modules/eslint-plugin-license-header": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-license-header/-/eslint-plugin-license-header-0.6.0.tgz",
+ "integrity": "sha512-IEywStBWaDBDMkogYoKUAdaOuomZ+YaQmdoSD2vHmXobekM+XuP6SWLlvwUUhIbdocn3MTlb5CUJ8E4VHz1c/w==",
+ "dev": true,
+ "dependencies": {
+ "requireindex": "^1.2.0"
+ }
+ },
+ "node_modules/eslint-plugin-license-header/node_modules/requireindex": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz",
+ "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.5"
+ }
+ },
"node_modules/eslint-plugin-react": {
"version": "7.31.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.0.tgz",
@@ -16793,6 +16813,23 @@
}
}
},
+ "eslint-plugin-license-header": {
+ "version": "0.6.0",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-license-header/-/eslint-plugin-license-header-0.6.0.tgz",
+ "integrity": "sha512-IEywStBWaDBDMkogYoKUAdaOuomZ+YaQmdoSD2vHmXobekM+XuP6SWLlvwUUhIbdocn3MTlb5CUJ8E4VHz1c/w==",
+ "dev": true,
+ "requires": {
+ "requireindex": "^1.2.0"
+ },
+ "dependencies": {
+ "requireindex": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz",
+ "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==",
+ "dev": true
+ }
+ }
+ },
"eslint-plugin-react": {
"version": "7.31.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.31.0.tgz",
diff --git a/package.json b/package.json
index 356510ee0..12a4d2034 100644
--- a/package.json
+++ b/package.json
@@ -26,7 +26,9 @@
"eslint-config-react-hooks": "^1.0.0",
"eslint-plugin-detox": "^1.0.0",
"eslint-plugin-jest": "^26.8.7",
+ "eslint-plugin-license-header": "^0.6.0",
"eslint-plugin-react": "^7.31.0",
+ "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^8.0.1",
diff --git a/packages/core/__e2e__/monographs.test.js b/packages/core/__e2e__/monographs.test.js
index 1ba215b74..a43f7aa42 100644
--- a/packages/core/__e2e__/monographs.test.js
+++ b/packages/core/__e2e__/monographs.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { databaseTest, noteTest, StorageInterface } from "../__tests__/utils";
const user = {
diff --git a/packages/core/__e2e__/offers.test.js b/packages/core/__e2e__/offers.test.js
index 4f705c494..904d98514 100644
--- a/packages/core/__e2e__/offers.test.js
+++ b/packages/core/__e2e__/offers.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import hosts from "../utils/constants";
import Offers from "../api/offers";
diff --git a/packages/core/__e2e__/token-manager.test.js b/packages/core/__e2e__/token-manager.test.js
index b2598ab13..96eb572cd 100644
--- a/packages/core/__e2e__/token-manager.test.js
+++ b/packages/core/__e2e__/token-manager.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import DB from "../api";
import StorageInterface from "../__mocks__/storage.mock";
diff --git a/packages/core/__e2e__/user-manager.test.js b/packages/core/__e2e__/user-manager.test.js
index 05502ecc7..8b4965065 100644
--- a/packages/core/__e2e__/user-manager.test.js
+++ b/packages/core/__e2e__/user-manager.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { databaseTest } from "../__tests__/utils";
const user = {
diff --git a/packages/core/__mocks__/fs.mock.js b/packages/core/__mocks__/fs.mock.js
index 4943dda87..833c1b7e7 100644
--- a/packages/core/__mocks__/fs.mock.js
+++ b/packages/core/__mocks__/fs.mock.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
var fs = {};
function hasItem(key) {
diff --git a/packages/core/__mocks__/node-storage.mock.js b/packages/core/__mocks__/node-storage.mock.js
index 686232028..f2d19c458 100644
--- a/packages/core/__mocks__/node-storage.mock.js
+++ b/packages/core/__mocks__/node-storage.mock.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { NNCrypto } from "@notesnook/crypto";
export class NodeStorageInterface {
diff --git a/packages/core/__mocks__/storage.mock.js b/packages/core/__mocks__/storage.mock.js
index 1c89b6da9..a0871ff3f 100644
--- a/packages/core/__mocks__/storage.mock.js
+++ b/packages/core/__mocks__/storage.mock.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
var storage = {};
async function read(key) {
diff --git a/packages/core/__tests__/backup.test.js b/packages/core/__tests__/backup.test.js
index f37ea38ac..64ebd22a8 100644
--- a/packages/core/__tests__/backup.test.js
+++ b/packages/core/__tests__/backup.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
StorageInterface,
databaseTest,
diff --git a/packages/core/__tests__/content.test.js b/packages/core/__tests__/content.test.js
index b546628ab..004fb3b9f 100644
--- a/packages/core/__tests__/content.test.js
+++ b/packages/core/__tests__/content.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { StorageInterface, databaseTest } from "./utils";
beforeEach(() => {
diff --git a/packages/core/__tests__/db.test.js b/packages/core/__tests__/db.test.js
index a2a792955..e5a05f312 100644
--- a/packages/core/__tests__/db.test.js
+++ b/packages/core/__tests__/db.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import DB from "../api";
import Constants from "../utils/constants";
import StorageInterface from "../__mocks__/storage.mock";
diff --git a/packages/core/__tests__/lookup.test.js b/packages/core/__tests__/lookup.test.js
index ced10147e..31247d4b3 100644
--- a/packages/core/__tests__/lookup.test.js
+++ b/packages/core/__tests__/lookup.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
StorageInterface,
noteTest,
diff --git a/packages/core/__tests__/note-history.test.js b/packages/core/__tests__/note-history.test.js
index 2e08d5e6b..6511ba16e 100644
--- a/packages/core/__tests__/note-history.test.js
+++ b/packages/core/__tests__/note-history.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { delay, noteTest, StorageInterface, TEST_NOTE } from "./utils";
beforeEach(async () => {
diff --git a/packages/core/__tests__/notebooks.test.js b/packages/core/__tests__/notebooks.test.js
index d01db6d26..c7bae1c2c 100644
--- a/packages/core/__tests__/notebooks.test.js
+++ b/packages/core/__tests__/notebooks.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
StorageInterface,
notebookTest,
diff --git a/packages/core/__tests__/notes.test.js b/packages/core/__tests__/notes.test.js
index 094948f8f..21e67abb8 100644
--- a/packages/core/__tests__/notes.test.js
+++ b/packages/core/__tests__/notes.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { groupArray } from "../utils/grouping";
import {
StorageInterface,
diff --git a/packages/core/__tests__/settings.test.js b/packages/core/__tests__/settings.test.js
index 50c2f6e9d..ce520430c 100644
--- a/packages/core/__tests__/settings.test.js
+++ b/packages/core/__tests__/settings.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { databaseTest, notebookTest, StorageInterface } from "./utils";
beforeEach(() => {
diff --git a/packages/core/__tests__/storage.test.js b/packages/core/__tests__/storage.test.js
index 0d93e18b3..b59375c37 100644
--- a/packages/core/__tests__/storage.test.js
+++ b/packages/core/__tests__/storage.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import StorageInterface from "../__mocks__/storage.mock";
import Storage from "../database/storage";
diff --git a/packages/core/__tests__/tags.test.js b/packages/core/__tests__/tags.test.js
index 4e0286f31..bba3f706e 100644
--- a/packages/core/__tests__/tags.test.js
+++ b/packages/core/__tests__/tags.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { noteTest, TEST_NOTE, StorageInterface } from "./utils";
beforeEach(async () => {
diff --git a/packages/core/__tests__/topics.test.js b/packages/core/__tests__/topics.test.js
index ab484c4a6..55b30cb44 100644
--- a/packages/core/__tests__/topics.test.js
+++ b/packages/core/__tests__/topics.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
delay,
notebookTest,
diff --git a/packages/core/__tests__/trash.test.js b/packages/core/__tests__/trash.test.js
index 3beac3d1f..92f95b69e 100644
--- a/packages/core/__tests__/trash.test.js
+++ b/packages/core/__tests__/trash.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import dayjs from "dayjs";
import {
StorageInterface,
diff --git a/packages/core/__tests__/utils.test.js b/packages/core/__tests__/utils.test.js
index ab4d156cf..b643958a6 100644
--- a/packages/core/__tests__/utils.test.js
+++ b/packages/core/__tests__/utils.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { groupArray } from "../utils/grouping";
test("group alphabetically", () => {
diff --git a/packages/core/__tests__/utils/index.js b/packages/core/__tests__/utils/index.js
index 47bfd00d8..d19aff766 100644
--- a/packages/core/__tests__/utils/index.js
+++ b/packages/core/__tests__/utils/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import DB from "../../api";
import StorageInterface from "../../__mocks__/storage.mock";
import dayjs from "dayjs";
diff --git a/packages/core/__tests__/vault.test.js b/packages/core/__tests__/vault.test.js
index 4a79dfe4c..a55592276 100644
--- a/packages/core/__tests__/vault.test.js
+++ b/packages/core/__tests__/vault.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { StorageInterface, databaseTest, noteTest, TEST_NOTE } from "./utils";
beforeEach(async () => {
diff --git a/packages/core/analyze-modules.js b/packages/core/analyze-modules.js
index 3e0821400..5f4dc3ece 100644
--- a/packages/core/analyze-modules.js
+++ b/packages/core/analyze-modules.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
diff --git a/packages/core/api/__tests__/debug.test.js b/packages/core/api/__tests__/debug.test.js
index 12a9e1369..6db75f8be 100644
--- a/packages/core/api/__tests__/debug.test.js
+++ b/packages/core/api/__tests__/debug.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Debug from "../debug";
import { noteTest, notebookTest, databaseTest } from "../../__tests__/utils";
import { enableFetchMocks, disableFetchMocks } from "jest-fetch-mock";
diff --git a/packages/core/api/__tests__/mfa-manager.test.js b/packages/core/api/__tests__/mfa-manager.test.js
index 39117e56c..a335f532e 100644
--- a/packages/core/api/__tests__/mfa-manager.test.js
+++ b/packages/core/api/__tests__/mfa-manager.test.js
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
test.todo("skipped test");
diff --git a/packages/core/api/__tests__/migrations.test.js b/packages/core/api/__tests__/migrations.test.js
index 39117e56c..a335f532e 100644
--- a/packages/core/api/__tests__/migrations.test.js
+++ b/packages/core/api/__tests__/migrations.test.js
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
test.todo("skipped test");
diff --git a/packages/core/api/__tests__/outbox.test.js b/packages/core/api/__tests__/outbox.test.js
index 39117e56c..a335f532e 100644
--- a/packages/core/api/__tests__/outbox.test.js
+++ b/packages/core/api/__tests__/outbox.test.js
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
test.todo("skipped test");
diff --git a/packages/core/api/__tests__/pricing.test.js b/packages/core/api/__tests__/pricing.test.js
index 428916cdc..a7d742486 100644
--- a/packages/core/api/__tests__/pricing.test.js
+++ b/packages/core/api/__tests__/pricing.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Pricing from "../pricing";
test.each(["monthly", "yearly", undefined])(`get %s price`, async (period) => {
diff --git a/packages/core/api/debug.js b/packages/core/api/debug.js
index 9d6b95bbb..2de4404cc 100644
--- a/packages/core/api/debug.js
+++ b/packages/core/api/debug.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import hosts from "../utils/constants";
export default class Debug {
diff --git a/packages/core/api/index.js b/packages/core/api/index.js
index 61f3b3bf4..b58c81945 100644
--- a/packages/core/api/index.js
+++ b/packages/core/api/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Notes from "../collections/notes";
import Storage from "../database/storage";
import FileStorage from "../database/fs";
diff --git a/packages/core/api/lookup.js b/packages/core/api/lookup.js
index d21ef2862..3874cc0de 100644
--- a/packages/core/api/lookup.js
+++ b/packages/core/api/lookup.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { filter, parse } from "liqe";
export default class Lookup {
diff --git a/packages/core/api/mfa-manager.js b/packages/core/api/mfa-manager.js
index 35a0ce028..2a08b6128 100644
--- a/packages/core/api/mfa-manager.js
+++ b/packages/core/api/mfa-manager.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import http from "../utils/http";
import constants from "../utils/constants";
import TokenManager from "./token-manager";
diff --git a/packages/core/api/migrations.js b/packages/core/api/migrations.js
index 47370d2ba..592fd0dd1 100644
--- a/packages/core/api/migrations.js
+++ b/packages/core/api/migrations.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { CURRENT_DATABASE_VERSION } from "../common";
import Migrator from "../database/migrator";
diff --git a/packages/core/api/monographs.js b/packages/core/api/monographs.js
index 5d27d05ff..be9eed27b 100644
--- a/packages/core/api/monographs.js
+++ b/packages/core/api/monographs.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import http from "../utils/http";
import Constants from "../utils/constants";
diff --git a/packages/core/api/offers.js b/packages/core/api/offers.js
index 5af4ce842..a8d8f0e81 100644
--- a/packages/core/api/offers.js
+++ b/packages/core/api/offers.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { CLIENT_ID } from "../common";
import hosts from "../utils/constants";
import http from "../utils/http";
diff --git a/packages/core/api/outbox.js b/packages/core/api/outbox.js
index dc3d20087..0808ad02c 100644
--- a/packages/core/api/outbox.js
+++ b/packages/core/api/outbox.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
class Outbox {
/**
*
diff --git a/packages/core/api/pricing.js b/packages/core/api/pricing.js
index 4ba962143..4e43c2d86 100644
--- a/packages/core/api/pricing.js
+++ b/packages/core/api/pricing.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import http from "../utils/http";
const BASE_URL = `https://notesnook.com/api/v1/prices`;
diff --git a/packages/core/api/session.js b/packages/core/api/session.js
index e6e9bb08b..7ffa9f142 100644
--- a/packages/core/api/session.js
+++ b/packages/core/api/session.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
class Session {
/**
*
diff --git a/packages/core/api/settings.js b/packages/core/api/settings.js
index fb0eff778..0fec5fb0d 100644
--- a/packages/core/api/settings.js
+++ b/packages/core/api/settings.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EV, EVENTS } from "../common";
import id from "../utils/id";
import "../types";
diff --git a/packages/core/api/sync/__tests__/collector.test.js b/packages/core/api/sync/__tests__/collector.test.js
index 28a3ed753..f75b572e3 100644
--- a/packages/core/api/sync/__tests__/collector.test.js
+++ b/packages/core/api/sync/__tests__/collector.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
databaseTest,
TEST_NOTE,
diff --git a/packages/core/api/sync/__tests__/sync.test.skip.js b/packages/core/api/sync/__tests__/sync.test.skip.js
index 14af825e6..e386ab5a0 100644
--- a/packages/core/api/sync/__tests__/sync.test.skip.js
+++ b/packages/core/api/sync/__tests__/sync.test.skip.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Database from "../../index";
import { NodeStorageInterface } from "../../../__mocks__/node-storage.mock";
import FS from "../../../__mocks__/fs.mock";
diff --git a/packages/core/api/sync/auto-sync.js b/packages/core/api/sync/auto-sync.js
index c251d0a55..5604f81bc 100644
--- a/packages/core/api/sync/auto-sync.js
+++ b/packages/core/api/sync/auto-sync.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { checkIsUserPremium, CHECK_IDS, EVENTS } from "../../common";
import { logger } from "../../logger";
diff --git a/packages/core/api/sync/collector.js b/packages/core/api/sync/collector.js
index 627968e4f..6a02394c4 100644
--- a/packages/core/api/sync/collector.js
+++ b/packages/core/api/sync/collector.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { CURRENT_DATABASE_VERSION } from "../../common";
import { logger } from "../../logger";
diff --git a/packages/core/api/sync/conflicts.js b/packages/core/api/sync/conflicts.js
index 46906f54f..de6fbb3dd 100644
--- a/packages/core/api/sync/conflicts.js
+++ b/packages/core/api/sync/conflicts.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
class Conflicts {
/**
*
diff --git a/packages/core/api/sync/index.js b/packages/core/api/sync/index.js
index 3b9b7799a..f0e31babc 100644
--- a/packages/core/api/sync/index.js
+++ b/packages/core/api/sync/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
EV,
EVENTS,
diff --git a/packages/core/api/sync/merger.js b/packages/core/api/sync/merger.js
index 08b911946..acad1b811 100644
--- a/packages/core/api/sync/merger.js
+++ b/packages/core/api/sync/merger.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { migrations } from "../../migrations";
import SparkMD5 from "spark-md5";
import setManipulator from "../../utils/set";
diff --git a/packages/core/api/sync/sync-queue.js b/packages/core/api/sync/sync-queue.js
index 42c6612a3..9b2c03757 100644
--- a/packages/core/api/sync/sync-queue.js
+++ b/packages/core/api/sync/sync-queue.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import set from "../../utils/set";
import { qclone } from "qclone";
import { logger } from "../../logger";
diff --git a/packages/core/api/sync/utils.js b/packages/core/api/sync/utils.js
index 6a7351c0b..b55d705fa 100644
--- a/packages/core/api/sync/utils.js
+++ b/packages/core/api/sync/utils.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
function areAllEmpty(obj) {
for (let key in obj) {
const value = obj[key];
diff --git a/packages/core/api/token-manager.js b/packages/core/api/token-manager.js
index a9a71062c..dcbb4301a 100644
--- a/packages/core/api/token-manager.js
+++ b/packages/core/api/token-manager.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import http from "../utils/http";
import constants from "../utils/constants";
import { EV, EVENTS } from "../common";
diff --git a/packages/core/api/user-manager.js b/packages/core/api/user-manager.js
index 2c09e461d..99e1e7550 100644
--- a/packages/core/api/user-manager.js
+++ b/packages/core/api/user-manager.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "../types";
import http from "../utils/http";
import constants from "../utils/constants";
diff --git a/packages/core/api/vault.js b/packages/core/api/vault.js
index c429813a3..f94b3818f 100644
--- a/packages/core/api/vault.js
+++ b/packages/core/api/vault.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { CHECK_IDS, EV, EVENTS, checkIsUserPremium } from "../common";
import { tinyToTiptap } from "../migrations";
diff --git a/packages/core/collections/attachments.js b/packages/core/collections/attachments.js
index 88a0802b7..59a129c30 100644
--- a/packages/core/collections/attachments.js
+++ b/packages/core/collections/attachments.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Collection from "./collection";
import getId from "../utils/id";
import { deleteItem, hasItem } from "../utils/array";
diff --git a/packages/core/collections/collection.js b/packages/core/collections/collection.js
index 1319dd766..d60b2d83f 100644
--- a/packages/core/collections/collection.js
+++ b/packages/core/collections/collection.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EV, EVENTS } from "../common";
import CachedCollection from "../database/cached-collection";
import IndexedCollection from "../database/indexed-collection";
diff --git a/packages/core/collections/content.js b/packages/core/collections/content.js
index 1c91c6162..342dea583 100644
--- a/packages/core/collections/content.js
+++ b/packages/core/collections/content.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Collection from "./collection";
import getId from "../utils/id";
import { getContentFromData } from "../content-types";
diff --git a/packages/core/collections/note-history.js b/packages/core/collections/note-history.js
index c9c8e57cd..9c1f9d29f 100644
--- a/packages/core/collections/note-history.js
+++ b/packages/core/collections/note-history.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { makeSessionContentId } from "../utils/id";
import Collection from "./collection";
import SessionContent from "./session-content";
diff --git a/packages/core/collections/notebooks.js b/packages/core/collections/notebooks.js
index b1472037e..6c47cf0ed 100644
--- a/packages/core/collections/notebooks.js
+++ b/packages/core/collections/notebooks.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Collection from "./collection";
import Notebook from "../models/notebook";
import getId from "../utils/id";
diff --git a/packages/core/collections/notes.js b/packages/core/collections/notes.js
index 833c712c1..e5d0de716 100644
--- a/packages/core/collections/notes.js
+++ b/packages/core/collections/notes.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Collection from "./collection";
import Note from "../models/note";
import getId from "../utils/id";
diff --git a/packages/core/collections/session-content.js b/packages/core/collections/session-content.js
index f05dc8dec..9fc29b319 100644
--- a/packages/core/collections/session-content.js
+++ b/packages/core/collections/session-content.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { compress, decompress } from "../utils/compression";
import { makeSessionContentId } from "../utils/id";
import Collection from "./collection";
diff --git a/packages/core/collections/tags.js b/packages/core/collections/tags.js
index 98c763be6..ecabbc6bf 100644
--- a/packages/core/collections/tags.js
+++ b/packages/core/collections/tags.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Collection from "./collection";
import { makeId } from "../utils/id";
import { deleteItems, hasItem } from "../utils/array";
diff --git a/packages/core/collections/topics.js b/packages/core/collections/topics.js
index 05cbb0f0b..3383b81de 100644
--- a/packages/core/collections/topics.js
+++ b/packages/core/collections/topics.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Topic from "../models/topic";
import { qclone } from "qclone";
import id from "../utils/id";
diff --git a/packages/core/collections/trash.js b/packages/core/collections/trash.js
index 553774b7d..ad707b755 100644
--- a/packages/core/collections/trash.js
+++ b/packages/core/collections/trash.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import dayjs from "dayjs";
export default class Trash {
diff --git a/packages/core/common.js b/packages/core/common.js
index 2336de5de..479db9f38 100644
--- a/packages/core/common.js
+++ b/packages/core/common.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import EventManager from "./utils/event-manager";
export const EV = new EventManager();
diff --git a/packages/core/content-types/__tests__/tiptap.test.js b/packages/core/content-types/__tests__/tiptap.test.js
index de7ab3357..57ba39aca 100644
--- a/packages/core/content-types/__tests__/tiptap.test.js
+++ b/packages/core/content-types/__tests__/tiptap.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { IMG_CONTENT, IMG_CONTENT_WITHOUT_HASH } from "../../__tests__/utils";
import { Tiptap } from "../tiptap";
diff --git a/packages/core/content-types/index.js b/packages/core/content-types/index.js
index 19c1e94ba..b1268ab54 100644
--- a/packages/core/content-types/index.js
+++ b/packages/core/content-types/index.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Tiptap } from "./tiptap";
export function getContentFromData(type, data) {
diff --git a/packages/core/content-types/tiptap.js b/packages/core/content-types/tiptap.js
index e9feb72f3..8d9a65f36 100644
--- a/packages/core/content-types/tiptap.js
+++ b/packages/core/content-types/tiptap.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import showdown from "showdown";
import dataurl from "../utils/dataurl";
import { getDummyDocument, parseHTML } from "../utils/html-parser";
diff --git a/packages/core/database/backup.js b/packages/core/database/backup.js
index 49685b45b..793004c3b 100644
--- a/packages/core/database/backup.js
+++ b/packages/core/database/backup.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Migrator from "./migrator.js";
import {
CHECK_IDS,
diff --git a/packages/core/database/cached-collection.js b/packages/core/database/cached-collection.js
index 70705f607..41c552758 100644
--- a/packages/core/database/cached-collection.js
+++ b/packages/core/database/cached-collection.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import IndexedCollection from "./indexed-collection";
import MapStub from "../utils/map";
diff --git a/packages/core/database/fs.js b/packages/core/database/fs.js
index 0403dd8c9..3fcbb209b 100644
--- a/packages/core/database/fs.js
+++ b/packages/core/database/fs.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import hosts from "../utils/constants";
import TokenManager from "../api/token-manager";
diff --git a/packages/core/database/indexed-collection.js b/packages/core/database/indexed-collection.js
index 1fabd3d10..ed3395c0f 100644
--- a/packages/core/database/indexed-collection.js
+++ b/packages/core/database/indexed-collection.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EVENTS } from "../common";
import Indexer from "./indexer";
diff --git a/packages/core/database/indexer.js b/packages/core/database/indexer.js
index 0b55fe326..4af925ec2 100644
--- a/packages/core/database/indexer.js
+++ b/packages/core/database/indexer.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Storage from "./storage";
export default class Indexer extends Storage {
diff --git a/packages/core/database/migrator.js b/packages/core/database/migrator.js
index f08fad240..de10b5adb 100644
--- a/packages/core/database/migrator.js
+++ b/packages/core/database/migrator.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { migrations } from "../migrations";
class Migrator {
diff --git a/packages/core/database/storage.js b/packages/core/database/storage.js
index e8c9478b5..268c39e40 100644
--- a/packages/core/database/storage.js
+++ b/packages/core/database/storage.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { randomBytes } from "../utils/random";
export default class Storage {
diff --git a/packages/core/jest.config.js b/packages/core/jest.config.js
index 1662e128a..f7a7be6a0 100644
--- a/packages/core/jest.config.js
+++ b/packages/core/jest.config.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
diff --git a/packages/core/jest.setup.js b/packages/core/jest.setup.js
index 0c2ab8340..a35f1fedc 100644
--- a/packages/core/jest.setup.js
+++ b/packages/core/jest.setup.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
var nodeCrypto = require("crypto");
var dotenv = require("dotenv");
const fetch = require("node-fetch");
diff --git a/packages/core/logger.js b/packages/core/logger.js
index cb092185e..cbb492e81 100644
--- a/packages/core/logger.js
+++ b/packages/core/logger.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
Logger,
combineReporters,
@@ -117,10 +135,6 @@ class DatabaseLogManager {
}
}
-/**
- *
- * @param {import("./database/storage").default} storage
- */
function initalize(storage) {
if (storage) {
let reporters = [new DatabaseLogReporter(storage)];
diff --git a/packages/core/migrations.js b/packages/core/migrations.js
index 57fc5df4e..328d0336c 100644
--- a/packages/core/migrations.js
+++ b/packages/core/migrations.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { parseHTML } from "./utils/html-parser";
import { decodeHTML5 } from "entities";
diff --git a/packages/core/models/note.js b/packages/core/models/note.js
index 9fbd5de6c..c9df82633 100644
--- a/packages/core/models/note.js
+++ b/packages/core/models/note.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import MarkdownBuilder from "../utils/templates/markdown/builder";
import HTMLBuilder from "../utils/templates/html/builder";
import TextBuilder from "../utils/templates/text/builder";
diff --git a/packages/core/models/notebook.js b/packages/core/models/notebook.js
index 4e9b81290..c4470ca2c 100644
--- a/packages/core/models/notebook.js
+++ b/packages/core/models/notebook.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Topics from "../collections/topics";
export default class Notebook {
diff --git a/packages/core/models/topic.js b/packages/core/models/topic.js
index 9423e69b8..b0129d246 100644
--- a/packages/core/models/topic.js
+++ b/packages/core/models/topic.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { qclone } from "qclone";
import { deleteItem, findById } from "../utils/array";
diff --git a/packages/core/types.js b/packages/core/types.js
index 352e50aca..caccaf7a1 100644
--- a/packages/core/types.js
+++ b/packages/core/types.js
@@ -1,3 +1,23 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+const _ignore = "";
+
/**
* @typedef {{
* groupBy: "abc" | "year" | "month" | "week" | "none" | undefined,
diff --git a/packages/core/utils/__tests__/compression.test.js b/packages/core/utils/__tests__/compression.test.js
index b712edffc..35b3989d8 100644
--- a/packages/core/utils/__tests__/compression.test.js
+++ b/packages/core/utils/__tests__/compression.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { TEST_NOTE } from "../../__tests__/utils";
import { compress, decompress } from "../compression";
diff --git a/packages/core/utils/__tests__/set.test.js b/packages/core/utils/__tests__/set.test.js
index 7ab681cc6..308886e06 100644
--- a/packages/core/utils/__tests__/set.test.js
+++ b/packages/core/utils/__tests__/set.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import Set from "../set";
test("union", () => {
diff --git a/packages/core/utils/array.js b/packages/core/utils/array.js
index 2dcbce74a..6336c67e6 100644
--- a/packages/core/utils/array.js
+++ b/packages/core/utils/array.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function findItemAndDelete(array, predicate) {
return deleteAtIndex(array, array.findIndex(predicate));
}
diff --git a/packages/core/utils/compression.js b/packages/core/utils/compression.js
index af64a51ff..7dc7be80e 100644
--- a/packages/core/utils/compression.js
+++ b/packages/core/utils/compression.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { decode, encode } from "base64-arraybuffer";
import { compressSync, decompressSync, strToU8, strFromU8 } from "fflate";
diff --git a/packages/core/utils/constants.js b/packages/core/utils/constants.js
index 8bf8bc516..42bc12d23 100644
--- a/packages/core/utils/constants.js
+++ b/packages/core/utils/constants.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { extractHostname } from "./hostname";
function isProduction() {
diff --git a/packages/core/utils/dataurl.js b/packages/core/utils/dataurl.js
index 384ea65a6..c1009e5ac 100644
--- a/packages/core/utils/dataurl.js
+++ b/packages/core/utils/dataurl.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const REGEX = /^data:(image\/.+);base64,(.+)/;
function toObject(dataurl) {
diff --git a/packages/core/utils/date.js b/packages/core/utils/date.js
index e7bf485ac..f83356000 100644
--- a/packages/core/utils/date.js
+++ b/packages/core/utils/date.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function getWeekGroupFromTimestamp(timestamp) {
const date = new Date(timestamp);
const { start, end } = getWeek(date);
diff --git a/packages/core/utils/event-manager.js b/packages/core/utils/event-manager.js
index a72932b51..0e0167e3f 100644
--- a/packages/core/utils/event-manager.js
+++ b/packages/core/utils/event-manager.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
class EventManager {
constructor() {
this._registry = new Map();
diff --git a/packages/core/utils/grouping.js b/packages/core/utils/grouping.js
index 9155930e0..f232b9e77 100644
--- a/packages/core/utils/grouping.js
+++ b/packages/core/utils/grouping.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "../types";
import { getWeekGroupFromTimestamp, MONTHS_FULL } from "./date";
diff --git a/packages/core/utils/hostname.js b/packages/core/utils/hostname.js
index f9f04de62..035981847 100644
--- a/packages/core/utils/hostname.js
+++ b/packages/core/utils/hostname.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function extractHostname(url) {
var hostname;
//find & remove protocol (http, ftp, etc.) and get hostname
diff --git a/packages/core/utils/html-parser.js b/packages/core/utils/html-parser.js
index f25c6dd80..a2bcd4f2d 100644
--- a/packages/core/utils/html-parser.js
+++ b/packages/core/utils/html-parser.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { decodeHTML5 } from "entities";
export const parseHTML = (input) =>
diff --git a/packages/core/utils/http.js b/packages/core/utils/http.js
index dac8cf682..f57eccbac 100644
--- a/packages/core/utils/http.js
+++ b/packages/core/utils/http.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EV, EVENTS } from "../common";
import { logger } from "../logger";
import { getServerNameFromHost } from "./constants";
diff --git a/packages/core/utils/id.js b/packages/core/utils/id.js
index dcf51578b..e2c8e54f4 100644
--- a/packages/core/utils/id.js
+++ b/packages/core/utils/id.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import SparkMD5 from "spark-md5";
import ObjectID from "./object-id";
diff --git a/packages/core/utils/map.js b/packages/core/utils/map.js
index f27cdcc03..7c9748386 100644
--- a/packages/core/utils/map.js
+++ b/packages/core/utils/map.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
var map = Map;
class MapStub {
override(replacement) {
diff --git a/packages/core/utils/object-id.js b/packages/core/utils/object-id.js
index 87ec09922..120354b90 100644
--- a/packages/core/utils/object-id.js
+++ b/packages/core/utils/object-id.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
// Copied from https://github.com/williamkapke/bson-objectid
const { randomInt } = require("./random");
diff --git a/packages/core/utils/random.js b/packages/core/utils/random.js
index 4a85fca1b..09f503983 100644
--- a/packages/core/utils/random.js
+++ b/packages/core/utils/random.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/**
*
* @param {number} size
diff --git a/packages/core/utils/set.js b/packages/core/utils/set.js
index 3bfdd87bf..ae95cc381 100644
--- a/packages/core/utils/set.js
+++ b/packages/core/utils/set.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
// SetManipulator MIT Licence © 2016 Edwin Monk-Fromont http://github.com/edmofro
// Based on setOps.js MIT License © 2014 James Abney http://github.com/jabney
diff --git a/packages/core/utils/templates/helper.js b/packages/core/utils/templates/helper.js
index d661d51de..584bd3f73 100644
--- a/packages/core/utils/templates/helper.js
+++ b/packages/core/utils/templates/helper.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { formatDate } from "../date";
function generateMetaTags(metadata, createMetaTag) {
diff --git a/packages/core/utils/templates/html/builder.js b/packages/core/utils/templates/html/builder.js
index 2a7f8eee2..492cc066b 100644
--- a/packages/core/utils/templates/html/builder.js
+++ b/packages/core/utils/templates/html/builder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { buildPage } from "../helper";
import HTMLTemplate from "./template";
diff --git a/packages/core/utils/templates/html/template.js b/packages/core/utils/templates/html/template.js
index 4b006efb2..cb2d0d0a3 100644
--- a/packages/core/utils/templates/html/template.js
+++ b/packages/core/utils/templates/html/template.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const template = `<!DOCTYPE html>
<html lang="en-US">
<head>
diff --git a/packages/core/utils/templates/markdown/builder.js b/packages/core/utils/templates/markdown/builder.js
index ecb98e42b..c83a6eb8d 100644
--- a/packages/core/utils/templates/markdown/builder.js
+++ b/packages/core/utils/templates/markdown/builder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { buildPage } from "../helper";
import MDTemplate from "./template";
diff --git a/packages/core/utils/templates/markdown/template.js b/packages/core/utils/templates/markdown/template.js
index 381ca063c..1f110dfa9 100644
--- a/packages/core/utils/templates/markdown/template.js
+++ b/packages/core/utils/templates/markdown/template.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const template = `# {{title}}
{{content}}
diff --git a/packages/core/utils/templates/text/builder.js b/packages/core/utils/templates/text/builder.js
index 3deb04635..c98a759cb 100644
--- a/packages/core/utils/templates/text/builder.js
+++ b/packages/core/utils/templates/text/builder.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { buildPage } from "../helper";
import TextTemplate from "./template";
diff --git a/packages/core/utils/templates/text/template.js b/packages/core/utils/templates/text/template.js
index a1d2e393e..b1e0439ad 100644
--- a/packages/core/utils/templates/text/template.js
+++ b/packages/core/utils/templates/text/template.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const template = `{{title}}
----------
diff --git a/packages/crypto-worker/README.md b/packages/crypto-worker/README.md
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/crypto-worker/index.ts b/packages/crypto-worker/index.ts
index d05c07101..889a4adbb 100644
--- a/packages/crypto-worker/index.ts
+++ b/packages/crypto-worker/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
SerializedKey,
Plaintext,
diff --git a/packages/crypto-worker/src/utils.ts b/packages/crypto-worker/src/utils.ts
index 71ae0a863..5d98890ac 100644
--- a/packages/crypto-worker/src/utils.ts
+++ b/packages/crypto-worker/src/utils.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
type Message<T> = {
type: string;
data?: T;
diff --git a/packages/crypto-worker/src/worker.ts b/packages/crypto-worker/src/worker.ts
index 26b4fa90d..0bd278d29 100644
--- a/packages/crypto-worker/src/worker.ts
+++ b/packages/crypto-worker/src/worker.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
Cipher,
OutputFormat,
diff --git a/packages/crypto-worker/src/workerstream.ts b/packages/crypto-worker/src/workerstream.ts
index 25c4a38f7..f36820de2 100644
--- a/packages/crypto-worker/src/workerstream.ts
+++ b/packages/crypto-worker/src/workerstream.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { IStreamable } from "@notesnook/crypto/dist/src/interfaces";
import { Chunk } from "@notesnook/crypto/dist/src/types";
import { sendEventWithResult } from "./utils";
diff --git a/packages/crypto/README.md b/packages/crypto/README.md
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/crypto/index.ts b/packages/crypto/index.ts
index 362fd39ec..05d162336 100644
--- a/packages/crypto/index.ts
+++ b/packages/crypto/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ready } from "libsodium-wrappers";
import Decryption from "./src/decryption";
import Encryption from "./src/encryption";
diff --git a/packages/crypto/src/decryption.ts b/packages/crypto/src/decryption.ts
index c57dce454..787e6e420 100644
--- a/packages/crypto/src/decryption.ts
+++ b/packages/crypto/src/decryption.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
crypto_aead_xchacha20poly1305_ietf_decrypt,
crypto_secretstream_xchacha20poly1305_init_pull,
diff --git a/packages/crypto/src/encryption.ts b/packages/crypto/src/encryption.ts
index b59749ac1..aa9a780bb 100644
--- a/packages/crypto/src/encryption.ts
+++ b/packages/crypto/src/encryption.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
crypto_aead_xchacha20poly1305_ietf_encrypt,
crypto_secretstream_xchacha20poly1305_init_push,
diff --git a/packages/crypto/src/interfaces.ts b/packages/crypto/src/interfaces.ts
index 9c817f64b..a89882a2c 100644
--- a/packages/crypto/src/interfaces.ts
+++ b/packages/crypto/src/interfaces.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
Cipher,
EncryptionKey,
diff --git a/packages/crypto/src/keyutils.ts b/packages/crypto/src/keyutils.ts
index 8795fac4c..44958a36c 100644
--- a/packages/crypto/src/keyutils.ts
+++ b/packages/crypto/src/keyutils.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
from_base64,
to_base64,
diff --git a/packages/crypto/src/password.ts b/packages/crypto/src/password.ts
index 5a283cd4b..ae3dea388 100644
--- a/packages/crypto/src/password.ts
+++ b/packages/crypto/src/password.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
crypto_generichash,
crypto_pwhash,
diff --git a/packages/crypto/src/types.ts b/packages/crypto/src/types.ts
index d894e5ecf..42e8ee9ff 100644
--- a/packages/crypto/src/types.ts
+++ b/packages/crypto/src/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { StringOutputFormat, Uint8ArrayOutputFormat } from "libsodium-wrappers";
export type OutputFormat = Uint8ArrayOutputFormat | StringOutputFormat;
diff --git a/packages/editor-mobile/src/App.test.js b/packages/editor-mobile/src/App.test.js
index 9382b9ad5..2d375412a 100644
--- a/packages/editor-mobile/src/App.test.js
+++ b/packages/editor-mobile/src/App.test.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { render, screen } from "@testing-library/react";
import App from "./App";
diff --git a/packages/editor-mobile/src/App.tsx b/packages/editor-mobile/src/App.tsx
index 605e15dd6..cc99c0051 100644
--- a/packages/editor-mobile/src/App.tsx
+++ b/packages/editor-mobile/src/App.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "./App.css";
import Tiptap from "./components/editor";
diff --git a/packages/editor-mobile/src/components/button.tsx b/packages/editor-mobile/src/components/button.tsx
index fdf92a7ae..3c42e1fba 100644
--- a/packages/editor-mobile/src/components/button.tsx
+++ b/packages/editor-mobile/src/components/button.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor } from "@notesnook/editor";
type ButtonType = {
diff --git a/packages/editor-mobile/src/components/editor.tsx b/packages/editor-mobile/src/components/editor.tsx
index b144d7924..f80b7d1c0 100644
--- a/packages/editor-mobile/src/components/editor.tsx
+++ b/packages/editor-mobile/src/components/editor.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
Editor,
PortalProvider,
diff --git a/packages/editor-mobile/src/components/header.tsx b/packages/editor-mobile/src/components/header.tsx
index 126f098ae..bb5b9a0c2 100644
--- a/packages/editor-mobile/src/components/header.tsx
+++ b/packages/editor-mobile/src/components/header.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ArrowBackIcon from "mdi-react/ArrowBackIcon";
import CloudUploadOutlineIcon from "mdi-react/CloudUploadOutlineIcon";
import CrownIcon from "mdi-react/CrownIcon";
diff --git a/packages/editor-mobile/src/components/statusbar.tsx b/packages/editor-mobile/src/components/statusbar.tsx
index 9cdbcf09e..f86283ead 100644
--- a/packages/editor-mobile/src/components/statusbar.tsx
+++ b/packages/editor-mobile/src/components/statusbar.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { RefObject, useEffect, useRef, useState } from "react";
function StatusBar({ container }: { container: RefObject<HTMLDivElement> }) {
diff --git a/packages/editor-mobile/src/components/tags.tsx b/packages/editor-mobile/src/components/tags.tsx
index b1a6b2a8e..9d6468bc6 100644
--- a/packages/editor-mobile/src/components/tags.tsx
+++ b/packages/editor-mobile/src/components/tags.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useRef, useState } from "react";
import { EventTypes } from "../utils";
import styles from "./styles.module.css";
diff --git a/packages/editor-mobile/src/components/title.tsx b/packages/editor-mobile/src/components/title.tsx
index 9c7461319..df6199632 100644
--- a/packages/editor-mobile/src/components/title.tsx
+++ b/packages/editor-mobile/src/components/title.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { RefObject, useEffect, useRef } from "react";
import { EditorController } from "../hooks/useEditorController";
diff --git a/packages/editor-mobile/src/hooks/useEditorController.ts b/packages/editor-mobile/src/hooks/useEditorController.ts
index 0d5f0d69f..b9d62818c 100644
--- a/packages/editor-mobile/src/hooks/useEditorController.ts
+++ b/packages/editor-mobile/src/hooks/useEditorController.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor } from "@notesnook/editor";
import {
MutableRefObject,
diff --git a/packages/editor-mobile/src/hooks/useSafeArea.ts b/packages/editor-mobile/src/hooks/useSafeArea.ts
index 99461b220..b4622ff66 100644
--- a/packages/editor-mobile/src/hooks/useSafeArea.ts
+++ b/packages/editor-mobile/src/hooks/useSafeArea.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useState } from "react";
const insetsStorage = localStorage.getItem("safeAreaInsets");
diff --git a/packages/editor-mobile/src/hooks/useSettings.ts b/packages/editor-mobile/src/hooks/useSettings.ts
index b0585055c..059c560ce 100644
--- a/packages/editor-mobile/src/hooks/useSettings.ts
+++ b/packages/editor-mobile/src/hooks/useSettings.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { getDefaultPresets } from "@notesnook/editor";
import { useState } from "react";
diff --git a/packages/editor-mobile/src/index.tsx b/packages/editor-mobile/src/index.tsx
index 14e760cd9..01558e687 100644
--- a/packages/editor-mobile/src/index.tsx
+++ b/packages/editor-mobile/src/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
diff --git a/packages/editor-mobile/src/react-app-env.d.ts b/packages/editor-mobile/src/react-app-env.d.ts
index 6431bc5fc..e96c95578 100644
--- a/packages/editor-mobile/src/react-app-env.d.ts
+++ b/packages/editor-mobile/src/react-app-env.d.ts
@@ -1 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/// <reference types="react-scripts" />
+
+const _ignore;
diff --git a/packages/editor-mobile/src/setupTests.js b/packages/editor-mobile/src/setupTests.js
index 1dd407a63..36eef6678 100644
--- a/packages/editor-mobile/src/setupTests.js
+++ b/packages/editor-mobile/src/setupTests.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
diff --git a/packages/editor-mobile/src/state/theme.tsx b/packages/editor-mobile/src/state/theme.tsx
index 0e341ec7e..00461a24b 100644
--- a/packages/editor-mobile/src/state/theme.tsx
+++ b/packages/editor-mobile/src/state/theme.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import create, { State } from "zustand";
import { injectCss, transform } from "../utils/css";
export type Colors = {
diff --git a/packages/editor-mobile/src/utils/css.js b/packages/editor-mobile/src/utils/css.js
index fffbbd806..8a4025612 100644
--- a/packages/editor-mobile/src/utils/css.js
+++ b/packages/editor-mobile/src/utils/css.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function removeCss(id) {
var link = document.getElementById(id);
link.remove();
diff --git a/packages/editor-mobile/src/utils/index.ts b/packages/editor-mobile/src/utils/index.ts
index 9967dbf39..fb99167cd 100644
--- a/packages/editor-mobile/src/utils/index.ts
+++ b/packages/editor-mobile/src/utils/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolbarGroupDefinition } from "@notesnook/editor";
import { Editor } from "@notesnook/editor";
import { Dispatch, MutableRefObject, RefObject, SetStateAction } from "react";
diff --git a/packages/editor/package.json b/packages/editor/package.json
index b95ee606f..e8f7bce1e 100644
--- a/packages/editor/package.json
+++ b/packages/editor/package.json
@@ -60,8 +60,6 @@
"@types/react": "17.0.2",
"@types/react-dom": "17.0.2",
"@types/react-modal": "^3.13.1",
- "@types/rebass": "^4.0.10",
- "@types/rebass__forms": "^4.0.6",
"@types/tinycolor2": "^1.4.3",
"framer-motion": "^4.1.17",
"isomorphic-fetch": "^3.0.0",
diff --git a/packages/editor/scripts/langen.js b/packages/editor/scripts/langen.js
index 7ddc57670..5f41071a6 100644
--- a/packages/editor/scripts/langen.js
+++ b/packages/editor/scripts/langen.js
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/**
* Quick & dirty script to download & transform all language details from
* the PrismJS repo.
diff --git a/packages/editor/src/components/action-sheet/index.tsx b/packages/editor/src/components/action-sheet/index.tsx
index d53332117..05791708f 100644
--- a/packages/editor/src/components/action-sheet/index.tsx
+++ b/packages/editor/src/components/action-sheet/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, {
PropsWithChildren,
useCallback,
@@ -105,7 +123,7 @@ export function ActionSheetPresenter(
transition: TRANSITION,
y: height + 100
});
- }, [animation, onClose, contentRef.current]);
+ }, [animation, onClose]);
const handleBackPress = useCallback(
(event: Event) => {
diff --git a/packages/editor/src/components/button.tsx b/packages/editor/src/components/button.tsx
index c728f92b2..f63b74b8b 100644
--- a/packages/editor/src/components/button.tsx
+++ b/packages/editor/src/components/button.tsx
@@ -1,4 +1,22 @@
-import { forwardRef, useCallback, useRef, ForwardedRef } from "react";
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { forwardRef, useRef, ForwardedRef } from "react";
import { useEffect } from "react";
import { Button as RebassButton, ButtonProps } from "@streetwriters/rebass";
@@ -17,6 +35,10 @@ const _Button = (
useEffect(() => {
if (!buttonRef.current) return;
+ function onMouseDown(e: MouseEvent) {
+ e.preventDefault();
+ }
+
buttonRef.current.addEventListener("mousedown", onMouseDown, {
passive: false,
capture: true
@@ -29,10 +51,6 @@ const _Button = (
};
}, []);
- const onMouseDown = useCallback((e: MouseEvent) => {
- e.preventDefault();
- }, []);
-
return (
<RebassButton
{...buttonProps}
diff --git a/packages/editor/src/components/inline-input/index.tsx b/packages/editor/src/components/inline-input/index.tsx
index fcbbaa15e..2ed073099 100644
--- a/packages/editor/src/components/inline-input/index.tsx
+++ b/packages/editor/src/components/inline-input/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Input, InputProps } from "@streetwriters/rebass-forms";
import { Flex, FlexProps, Text } from "@streetwriters/rebass";
diff --git a/packages/editor/src/components/menu/index.tsx b/packages/editor/src/components/menu/index.tsx
index aa9650a12..9e0927948 100644
--- a/packages/editor/src/components/menu/index.tsx
+++ b/packages/editor/src/components/menu/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useRef, useEffect, PropsWithChildren } from "react";
import { Box, Flex, FlexProps, Text } from "@streetwriters/rebass";
import { getPosition } from "../../utils/position";
diff --git a/packages/editor/src/components/menu/menu-button.tsx b/packages/editor/src/components/menu/menu-button.tsx
index 9eaaaf79e..8e46f4421 100644
--- a/packages/editor/src/components/menu/menu-button.tsx
+++ b/packages/editor/src/components/menu/menu-button.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useRef } from "react";
import { Flex, Text } from "@streetwriters/rebass";
import { Icon } from "../../toolbar/components/icon";
diff --git a/packages/editor/src/components/menu/menu-separator.tsx b/packages/editor/src/components/menu/menu-separator.tsx
index 6e1a9d729..b347269ac 100644
--- a/packages/editor/src/components/menu/menu-separator.tsx
+++ b/packages/editor/src/components/menu/menu-separator.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box } from "@streetwriters/rebass";
export function MenuSeparator() {
diff --git a/packages/editor/src/components/menu/types.ts b/packages/editor/src/components/menu/types.ts
index 03e8b94ae..dd4e32e36 100644
--- a/packages/editor/src/components/menu/types.ts
+++ b/packages/editor/src/components/menu/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SxStyleProp } from "@streetwriters/rebass";
import { IconNames } from "../../toolbar/icons";
diff --git a/packages/editor/src/components/menu/use-focus.ts b/packages/editor/src/components/menu/use-focus.ts
index 9cba826f4..52629d008 100644
--- a/packages/editor/src/components/menu/use-focus.ts
+++ b/packages/editor/src/components/menu/use-focus.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useEffect, useState } from "react";
import { MenuButton, MenuItem } from "./types";
@@ -79,7 +97,7 @@ export function useFocus(
return nextIndex;
});
},
- [items, isSubmenuOpen, moveItemIntoView, onAction]
+ [items, moveItemIntoView, isSubmenuOpen, onAction, onClose]
);
useEffect(() => {
diff --git a/packages/editor/src/components/popup-presenter/index.tsx b/packages/editor/src/components/popup-presenter/index.tsx
index 8388e8619..124a758e8 100644
--- a/packages/editor/src/components/popup-presenter/index.tsx
+++ b/packages/editor/src/components/popup-presenter/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useCallback, useRef, useEffect, PropsWithChildren } from "react";
import { Box } from "@streetwriters/rebass";
import { getPosition, PositionOptions } from "../../utils/position";
@@ -36,27 +54,27 @@ function _PopupPresenter(props: PropsWithChildren<PopupPresenterProps>) {
const contentRef = useRef<HTMLDivElement>();
const observerRef = useRef<ResizeObserver>();
- const repositionPopup = useCallback(() => {
+ const repositionPopup = useCallback((position: PositionOptions) => {
if (!contentRef.current || !position) return;
const popup = contentRef.current;
const popupPosition = getPosition(popup, position);
popup.style.top = popupPosition.top + "px";
popup.style.left = popupPosition.left + "px";
- }, [position]);
+ }, []);
useEffect(() => {
- repositionPopup();
- }, [position]);
+ repositionPopup(position);
+ }, [repositionPopup, position]);
useEffect(() => {
function onWindowResize() {
- repositionPopup();
+ repositionPopup(position);
}
window.addEventListener("resize", onWindowResize);
return () => {
window.removeEventListener("resize", onWindowResize);
};
- }, []);
+ }, [repositionPopup, position]);
const attachMoveHandlers = useCallback(() => {
if (!contentRef.current || !isOpen) return;
@@ -99,7 +117,7 @@ function _PopupPresenter(props: PropsWithChildren<PopupPresenterProps>) {
let oldHeight: number = popup.offsetHeight;
observerRef.current = new ResizeObserver(() => {
if (isMobile) {
- repositionPopup();
+ repositionPopup(position);
} else {
const { height, y } = popup.getBoundingClientRect();
const delta = height - oldHeight;
@@ -117,7 +135,7 @@ function _PopupPresenter(props: PropsWithChildren<PopupPresenterProps>) {
}
});
observerRef.current.observe(popup, { box: "border-box" });
- }, [isMobile]);
+ }, [repositionPopup, position, isMobile]);
return (
<Modal
@@ -136,7 +154,7 @@ function _PopupPresenter(props: PropsWithChildren<PopupPresenterProps>) {
portalClassName={"popup-presenter-portal"}
onAfterOpen={(obj) => {
if (!obj || !position) return;
- repositionPopup();
+ repositionPopup(position);
handleResize();
attachMoveHandlers();
@@ -244,7 +262,7 @@ export function PopupWrapper(props: PopupWrapperProps) {
if (!isPopupOpen) {
PopupRenderer.closePopup(id);
}
- }, [isPopupOpen]);
+ }, [id, isPopupOpen]);
return (
<PopupPresenter
@@ -274,7 +292,15 @@ export function PopupWrapper(props: PopupWrapperProps) {
);
});
}
- }, [PopupRenderer, isPopupOpen]);
+ }, [
+ PopupRenderer,
+ isPopupOpen,
+ closePopup,
+ id,
+ position,
+ presenterProps,
+ renderPopup
+ ]);
return null;
}
@@ -303,7 +329,7 @@ export function usePopupHandler(options: UsePopupHandlerOptions) {
useEffect(() => {
if (!isPopupOpen) onClosed?.();
- }, [isPopupOpen]);
+ }, [isPopupOpen, onClosed]);
useEffect(() => {
if (isPopupOpen) {
diff --git a/packages/editor/src/components/popup-presenter/popuprenderer.tsx b/packages/editor/src/components/popup-presenter/popuprenderer.tsx
index f95b2928a..ec9d16ad1 100644
--- a/packages/editor/src/components/popup-presenter/popuprenderer.tsx
+++ b/packages/editor/src/components/popup-presenter/popuprenderer.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { PropsWithChildren, useContext } from "react";
import { Editor } from "@tiptap/core";
diff --git a/packages/editor/src/components/resizer/index.tsx b/packages/editor/src/components/resizer/index.tsx
index b22687610..07f16c077 100644
--- a/packages/editor/src/components/resizer/index.tsx
+++ b/packages/editor/src/components/resizer/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SchemeColors } from "@notesnook/theme/dist/theme/colorscheme";
import { Resizable } from "re-resizable";
import { PropsWithChildren } from "react";
diff --git a/packages/editor/src/components/responsive/index.tsx b/packages/editor/src/components/responsive/index.tsx
index df9e884a4..d3ce05763 100644
--- a/packages/editor/src/components/responsive/index.tsx
+++ b/packages/editor/src/components/responsive/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { PropsWithChildren } from "react";
import { useIsMobile } from "../../toolbar/stores/toolbar-store";
import {
diff --git a/packages/editor/src/components/tabs/index.tsx b/packages/editor/src/components/tabs/index.tsx
index 2aaf75a52..59ad53d14 100644
--- a/packages/editor/src/components/tabs/index.tsx
+++ b/packages/editor/src/components/tabs/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { Children, PropsWithChildren, useMemo, useState } from "react";
import { Button, Flex, FlexProps } from "@streetwriters/rebass";
diff --git a/packages/editor/src/components/theme-provider/index.tsx b/packages/editor/src/components/theme-provider/index.tsx
index 6e543394c..e40d8502b 100644
--- a/packages/editor/src/components/theme-provider/index.tsx
+++ b/packages/editor/src/components/theme-provider/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react";
import { PropsWithChildren } from "react";
import { useTheme } from "../../toolbar/stores/toolbar-store";
diff --git a/packages/editor/src/extensions.ts b/packages/editor/src/extensions.ts
index d3f0f4c27..10f92f3a7 100644
--- a/packages/editor/src/extensions.ts
+++ b/packages/editor/src/extensions.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "@tiptap/extension-character-count";
import "@tiptap/extension-placeholder";
import "@tiptap/extension-underline";
diff --git a/packages/editor/src/extensions/attachment/attachment.ts b/packages/editor/src/extensions/attachment/attachment.ts
index 6b131186f..a0e9aba9a 100644
--- a/packages/editor/src/extensions/attachment/attachment.ts
+++ b/packages/editor/src/extensions/attachment/attachment.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Node, mergeAttributes, findChildren, Editor } from "@tiptap/core";
import { Attribute } from "@tiptap/core";
import { createSelectionBasedNodeView } from "../react";
diff --git a/packages/editor/src/extensions/attachment/component.tsx b/packages/editor/src/extensions/attachment/component.tsx
index 00a7e84d1..913a94eb1 100644
--- a/packages/editor/src/extensions/attachment/component.tsx
+++ b/packages/editor/src/extensions/attachment/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Text } from "@streetwriters/rebass";
import { AttachmentWithProgress } from "./attachment";
import { useRef } from "react";
diff --git a/packages/editor/src/extensions/attachment/index.ts b/packages/editor/src/extensions/attachment/index.ts
index 9f9f38860..9b3b17803 100644
--- a/packages/editor/src/extensions/attachment/index.ts
+++ b/packages/editor/src/extensions/attachment/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./attachment";
diff --git a/packages/editor/src/extensions/bullet-list/bullet-list.ts b/packages/editor/src/extensions/bullet-list/bullet-list.ts
index 88eb62f56..9127c3953 100644
--- a/packages/editor/src/extensions/bullet-list/bullet-list.ts
+++ b/packages/editor/src/extensions/bullet-list/bullet-list.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import TiptapBulletList from "@tiptap/extension-bullet-list";
export const BulletList = TiptapBulletList.extend({
diff --git a/packages/editor/src/extensions/bullet-list/index.ts b/packages/editor/src/extensions/bullet-list/index.ts
index f164090c5..811d1bfac 100644
--- a/packages/editor/src/extensions/bullet-list/index.ts
+++ b/packages/editor/src/extensions/bullet-list/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { BulletList } from "./bullet-list";
export * from "./bullet-list";
diff --git a/packages/editor/src/extensions/clipboard-text-serializer/index.ts b/packages/editor/src/extensions/clipboard-text-serializer/index.ts
index 25ad6efc0..8c0f94e32 100644
--- a/packages/editor/src/extensions/clipboard-text-serializer/index.ts
+++ b/packages/editor/src/extensions/clipboard-text-serializer/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Extension, TextSerializer } from "@tiptap/core";
import { Plugin, PluginKey } from "prosemirror-state";
import { Node as ProseMirrorNode, Schema, Slice } from "prosemirror-model";
diff --git a/packages/editor/src/extensions/code-block/code-block.ts b/packages/editor/src/extensions/code-block/code-block.ts
index 142147b38..cb90a8e5b 100644
--- a/packages/editor/src/extensions/code-block/code-block.ts
+++ b/packages/editor/src/extensions/code-block/code-block.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor, findParentNodeClosestToPos } from "@tiptap/core";
import { Node, textblockTypeInputRule, mergeAttributes } from "@tiptap/core";
import {
diff --git a/packages/editor/src/extensions/code-block/component.tsx b/packages/editor/src/extensions/code-block/component.tsx
index 6266cf494..bbb617d3b 100644
--- a/packages/editor/src/extensions/code-block/component.tsx
+++ b/packages/editor/src/extensions/code-block/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useRef, useState } from "react";
import { isLanguageLoaded, loadLanguage } from "./loader";
import { refractor } from "refractor/lib/core";
@@ -44,7 +62,7 @@ export function CodeblockComponent(
{ preventUpdate, addToHistory: false }
);
})();
- }, [language]);
+ }, [language, languageDefinition, updateAttributes]);
return (
<>
diff --git a/packages/editor/src/extensions/code-block/highlighter.ts b/packages/editor/src/extensions/code-block/highlighter.ts
index 4e2b55a37..2ffca7aad 100644
--- a/packages/editor/src/extensions/code-block/highlighter.ts
+++ b/packages/editor/src/extensions/code-block/highlighter.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Plugin, PluginKey } from "prosemirror-state";
import { Decoration, DecorationSet } from "prosemirror-view";
import {
diff --git a/packages/editor/src/extensions/code-block/index.ts b/packages/editor/src/extensions/code-block/index.ts
index 80ea37c7c..3b0ab8572 100644
--- a/packages/editor/src/extensions/code-block/index.ts
+++ b/packages/editor/src/extensions/code-block/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./code-block";
diff --git a/packages/editor/src/extensions/code-block/loader.ts b/packages/editor/src/extensions/code-block/loader.ts
index 8a349dc21..96d629e8e 100644
--- a/packages/editor/src/extensions/code-block/loader.ts
+++ b/packages/editor/src/extensions/code-block/loader.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Syntax } from "refractor";
const loadedLanguages: Record<string, Syntax | undefined> = {};
diff --git a/packages/editor/src/extensions/code-mark/code-mark.ts b/packages/editor/src/extensions/code-mark/code-mark.ts
index cf091d0f5..9706dfdfb 100644
--- a/packages/editor/src/extensions/code-mark/code-mark.ts
+++ b/packages/editor/src/extensions/code-mark/code-mark.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Extension } from "@tiptap/core";
import codemark from "prosemirror-codemark";
diff --git a/packages/editor/src/extensions/code-mark/index.ts b/packages/editor/src/extensions/code-mark/index.ts
index 8c4911b98..8ebbc9086 100644
--- a/packages/editor/src/extensions/code-mark/index.ts
+++ b/packages/editor/src/extensions/code-mark/index.ts
@@ -1,2 +1,20 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./code-mark";
export { Codemark as default } from "./code-mark";
diff --git a/packages/editor/src/extensions/date-time/date-time.ts b/packages/editor/src/extensions/date-time/date-time.ts
index 94fcb7872..177733a34 100644
--- a/packages/editor/src/extensions/date-time/date-time.ts
+++ b/packages/editor/src/extensions/date-time/date-time.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
Extension,
InputRule,
diff --git a/packages/editor/src/extensions/date-time/index.ts b/packages/editor/src/extensions/date-time/index.ts
index 92da0746f..ed28fb663 100644
--- a/packages/editor/src/extensions/date-time/index.ts
+++ b/packages/editor/src/extensions/date-time/index.ts
@@ -1,2 +1,20 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./date-time";
export { DateTime as default } from "./date-time";
diff --git a/packages/editor/src/extensions/embed/component.tsx b/packages/editor/src/extensions/embed/component.tsx
index f16ed93ed..b156bf6f7 100644
--- a/packages/editor/src/extensions/embed/component.tsx
+++ b/packages/editor/src/extensions/embed/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Flex } from "@streetwriters/rebass";
import { useRef, useState } from "react";
import { EmbedAlignmentOptions, EmbedAttributes } from "./embed";
diff --git a/packages/editor/src/extensions/embed/embed.ts b/packages/editor/src/extensions/embed/embed.ts
index 3319f4cad..8b8bfb09c 100644
--- a/packages/editor/src/extensions/embed/embed.ts
+++ b/packages/editor/src/extensions/embed/embed.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Node, mergeAttributes } from "@tiptap/core";
import { createSelectionBasedNodeView } from "../react";
import { EmbedComponent } from "./component";
diff --git a/packages/editor/src/extensions/embed/index.ts b/packages/editor/src/extensions/embed/index.ts
index 12b3c5295..a04f91ad6 100644
--- a/packages/editor/src/extensions/embed/index.ts
+++ b/packages/editor/src/extensions/embed/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./embed";
diff --git a/packages/editor/src/extensions/font-size/font-size.ts b/packages/editor/src/extensions/font-size/font-size.ts
index 9a979f049..9d694d49a 100644
--- a/packages/editor/src/extensions/font-size/font-size.ts
+++ b/packages/editor/src/extensions/font-size/font-size.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Extension } from "@tiptap/core";
import "@tiptap/extension-text-style";
diff --git a/packages/editor/src/extensions/font-size/index.ts b/packages/editor/src/extensions/font-size/index.ts
index 2882e207b..d107c61d8 100644
--- a/packages/editor/src/extensions/font-size/index.ts
+++ b/packages/editor/src/extensions/font-size/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { FontSize } from "./font-size";
export * from "./font-size";
diff --git a/packages/editor/src/extensions/highlight/highlight.ts b/packages/editor/src/extensions/highlight/highlight.ts
index b00519604..8660264ed 100644
--- a/packages/editor/src/extensions/highlight/highlight.ts
+++ b/packages/editor/src/extensions/highlight/highlight.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "@tiptap/extension-text-style";
import { Extension } from "@tiptap/core";
diff --git a/packages/editor/src/extensions/highlight/index.ts b/packages/editor/src/extensions/highlight/index.ts
index d90b37cc0..03e2ade2e 100644
--- a/packages/editor/src/extensions/highlight/index.ts
+++ b/packages/editor/src/extensions/highlight/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./highlight";
diff --git a/packages/editor/src/extensions/image/component.tsx b/packages/editor/src/extensions/image/component.tsx
index a56cdc788..de38ed68f 100644
--- a/packages/editor/src/extensions/image/component.tsx
+++ b/packages/editor/src/extensions/image/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Button, Flex, Image, Text } from "@streetwriters/rebass";
import { ImageAlignmentOptions, ImageAttributes } from "./image";
import { useEffect, useRef, useState } from "react";
@@ -29,26 +47,30 @@ export function ImageComponent(
const [error, setError] = useState<string>();
const [source, setSource] = useState<string>();
- useEffect(() => {
- (async () => {
- if (!src) return;
- try {
- if (isDataUrl(src)) setSource(await toBlobURL(src));
- else {
- const { url, size, blob, type } = await downloadImage(src);
- setSource(url);
- console.log(url, size, blob, type);
- editor.current?.commands.updateImage(
- { src },
- { src: await toDataURL(blob), size, type }
- );
+ useEffect(
+ () => {
+ (async () => {
+ if (!src) return;
+ try {
+ if (isDataUrl(src)) setSource(await toBlobURL(src));
+ else {
+ const { url, size, blob, type } = await downloadImage(src);
+ setSource(url);
+ console.log(url, size, blob, type);
+ editor.current?.commands.updateImage(
+ { src },
+ { src: await toDataURL(blob), size, type }
+ );
+ }
+ } catch (e) {
+ console.error(e);
+ if (e instanceof Error) setError(e.message);
}
- } catch (e) {
- console.error(e);
- if (e instanceof Error) setError(e.message);
- }
- })();
- }, [src, imageRef]);
+ })();
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [src, imageRef]
+ );
return (
<>
diff --git a/packages/editor/src/extensions/image/image.ts b/packages/editor/src/extensions/image/image.ts
index 2f3ac7f75..ffb5ff9a7 100644
--- a/packages/editor/src/extensions/image/image.ts
+++ b/packages/editor/src/extensions/image/image.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
Node,
nodeInputRule,
diff --git a/packages/editor/src/extensions/image/index.ts b/packages/editor/src/extensions/image/index.ts
index 0aa9b4bbd..fa6a7bbbf 100644
--- a/packages/editor/src/extensions/image/index.ts
+++ b/packages/editor/src/extensions/image/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./image";
diff --git a/packages/editor/src/extensions/keep-in-view/index.ts b/packages/editor/src/extensions/keep-in-view/index.ts
index 7d6036306..676deedbc 100644
--- a/packages/editor/src/extensions/keep-in-view/index.ts
+++ b/packages/editor/src/extensions/keep-in-view/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./keep-in-view";
diff --git a/packages/editor/src/extensions/keep-in-view/keep-in-view.ts b/packages/editor/src/extensions/keep-in-view/keep-in-view.ts
index 11c9b2234..10ef90a3f 100644
--- a/packages/editor/src/extensions/keep-in-view/keep-in-view.ts
+++ b/packages/editor/src/extensions/keep-in-view/keep-in-view.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor, Extension, posToDOMRect } from "@tiptap/core";
let onWindowResize: ((this: Window, ev: UIEvent) => void) | undefined =
diff --git a/packages/editor/src/extensions/list-item/commands.ts b/packages/editor/src/extensions/list-item/commands.ts
index ed3dac746..ad2556a86 100644
--- a/packages/editor/src/extensions/list-item/commands.ts
+++ b/packages/editor/src/extensions/list-item/commands.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EditorState } from "prosemirror-state";
import { NodeType } from "prosemirror-model";
import { findParentNodeOfType, hasParentNodeOfType } from "prosemirror-utils";
diff --git a/packages/editor/src/extensions/list-item/index.ts b/packages/editor/src/extensions/list-item/index.ts
index 24950c4f2..e5208c485 100644
--- a/packages/editor/src/extensions/list-item/index.ts
+++ b/packages/editor/src/extensions/list-item/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./list-item";
diff --git a/packages/editor/src/extensions/list-item/list-item.ts b/packages/editor/src/extensions/list-item/list-item.ts
index f691a3085..a6bec8488 100644
--- a/packages/editor/src/extensions/list-item/list-item.ts
+++ b/packages/editor/src/extensions/list-item/list-item.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ListItem as TiptapListItem } from "@tiptap/extension-list-item";
import { onBackspacePressed } from "./commands";
diff --git a/packages/editor/src/extensions/math/index.ts b/packages/editor/src/extensions/math/index.ts
index 1331fdb01..f7b006fb9 100644
--- a/packages/editor/src/extensions/math/index.ts
+++ b/packages/editor/src/extensions/math/index.ts
@@ -1,2 +1,20 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export { MathInline } from "./math-inline";
export { MathBlock } from "./math-block";
diff --git a/packages/editor/src/extensions/math/math-block.ts b/packages/editor/src/extensions/math/math-block.ts
index 7dd2b5303..22546bde3 100644
--- a/packages/editor/src/extensions/math/math-block.ts
+++ b/packages/editor/src/extensions/math/math-block.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Node, mergeAttributes } from "@tiptap/core";
import { insertMathNode } from "./plugin";
import { NodeSelection } from "prosemirror-state";
diff --git a/packages/editor/src/extensions/math/math-inline.ts b/packages/editor/src/extensions/math/math-inline.ts
index 98a7e6abb..782af57d0 100644
--- a/packages/editor/src/extensions/math/math-inline.ts
+++ b/packages/editor/src/extensions/math/math-inline.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Node, mergeAttributes } from "@tiptap/core";
import { mathPlugin } from "./plugin";
diff --git a/packages/editor/src/extensions/math/plugin/commands/collapse-math-node.ts b/packages/editor/src/extensions/math/plugin/commands/collapse-math-node.ts
index f49737709..0899d84a2 100644
--- a/packages/editor/src/extensions/math/plugin/commands/collapse-math-node.ts
+++ b/packages/editor/src/extensions/math/plugin/commands/collapse-math-node.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Command } from "prosemirror-state";
import { EditorState, TextSelection, Transaction } from "prosemirror-state";
import { EditorView } from "prosemirror-view";
diff --git a/packages/editor/src/extensions/math/plugin/commands/insert-math-node.ts b/packages/editor/src/extensions/math/plugin/commands/insert-math-node.ts
index 309cb879e..4b00754e8 100644
--- a/packages/editor/src/extensions/math/plugin/commands/insert-math-node.ts
+++ b/packages/editor/src/extensions/math/plugin/commands/insert-math-node.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Command } from "prosemirror-state";
import { NodeType } from "prosemirror-model";
import {
diff --git a/packages/editor/src/extensions/math/plugin/commands/move-cursor-cmd.ts b/packages/editor/src/extensions/math/plugin/commands/move-cursor-cmd.ts
index 20e3ed6e3..0c79307d0 100644
--- a/packages/editor/src/extensions/math/plugin/commands/move-cursor-cmd.ts
+++ b/packages/editor/src/extensions/math/plugin/commands/move-cursor-cmd.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Command } from "prosemirror-state";
import { EditorState, TextSelection, Transaction } from "prosemirror-state";
diff --git a/packages/editor/src/extensions/math/plugin/index.ts b/packages/editor/src/extensions/math/plugin/index.ts
index 71d85124d..33b51179c 100644
--- a/packages/editor/src/extensions/math/plugin/index.ts
+++ b/packages/editor/src/extensions/math/plugin/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/*---------------------------------------------------------
* Author: Benjamin R. Bray
* License: MIT (see LICENSE in project root for details)
diff --git a/packages/editor/src/extensions/math/plugin/math-node-view.ts b/packages/editor/src/extensions/math/plugin/math-node-view.ts
index 36423514c..76f117d7f 100644
--- a/packages/editor/src/extensions/math/plugin/math-node-view.ts
+++ b/packages/editor/src/extensions/math/plugin/math-node-view.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/*---------------------------------------------------------
* Author: Benjamin R. Bray
* License: MIT (see LICENSE in project root for details)
diff --git a/packages/editor/src/extensions/math/plugin/math-plugin.ts b/packages/editor/src/extensions/math/plugin/math-plugin.ts
index ac090710e..47b8c6a3e 100644
--- a/packages/editor/src/extensions/math/plugin/math-plugin.ts
+++ b/packages/editor/src/extensions/math/plugin/math-plugin.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/*---------------------------------------------------------
* Author: Benjamin R. Bray
* License: MIT (see LICENSE in project root for details)
diff --git a/packages/editor/src/extensions/math/plugin/plugins/math-backspace.ts b/packages/editor/src/extensions/math/plugin/plugins/math-backspace.ts
index 8945c5f8c..aec7b2ee2 100644
--- a/packages/editor/src/extensions/math/plugin/plugins/math-backspace.ts
+++ b/packages/editor/src/extensions/math/plugin/plugins/math-backspace.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { NodeSelection } from "prosemirror-state";
import { Command as ProseCommand } from "prosemirror-state";
diff --git a/packages/editor/src/extensions/math/plugin/plugins/math-paste-rules.ts b/packages/editor/src/extensions/math/plugin/plugins/math-paste-rules.ts
index 0703f1bd5..45780d064 100644
--- a/packages/editor/src/extensions/math/plugin/plugins/math-paste-rules.ts
+++ b/packages/editor/src/extensions/math/plugin/plugins/math-paste-rules.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/**
* Note that for some of the `ParseRule`s defined below,
* we define a `getAttrs` function, which, other than
diff --git a/packages/editor/src/extensions/math/plugin/plugins/math-select.ts b/packages/editor/src/extensions/math/plugin/plugins/math-select.ts
index 7c733f2b8..a960bfc5b 100644
--- a/packages/editor/src/extensions/math/plugin/plugins/math-select.ts
+++ b/packages/editor/src/extensions/math/plugin/plugins/math-select.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
/*---------------------------------------------------------
* Author: Benjamin R. Bray
* License: MIT (see LICENSE in project root for details)
diff --git a/packages/editor/src/extensions/math/plugin/renderers/katex.ts b/packages/editor/src/extensions/math/plugin/renderers/katex.ts
index f958cd434..dd91c9854 100644
--- a/packages/editor/src/extensions/math/plugin/renderers/katex.ts
+++ b/packages/editor/src/extensions/math/plugin/renderers/katex.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { MathRenderer } from "./types";
async function loadKatex() {
diff --git a/packages/editor/src/extensions/math/plugin/renderers/types.ts b/packages/editor/src/extensions/math/plugin/renderers/types.ts
index ffd5bf1c5..f513e5a08 100644
--- a/packages/editor/src/extensions/math/plugin/renderers/types.ts
+++ b/packages/editor/src/extensions/math/plugin/renderers/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export type MathRenderFn = (text: string, element: HTMLElement) => void;
export type MathRenderer = {
inline: MathRenderFn;
diff --git a/packages/editor/src/extensions/math/plugin/utils/text-serializer.ts b/packages/editor/src/extensions/math/plugin/utils/text-serializer.ts
index ab6c799db..b15d85add 100644
--- a/packages/editor/src/extensions/math/plugin/utils/text-serializer.ts
+++ b/packages/editor/src/extensions/math/plugin/utils/text-serializer.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
Node as ProseNode,
Mark,
diff --git a/packages/editor/src/extensions/math/plugin/utils/types.ts b/packages/editor/src/extensions/math/plugin/utils/types.ts
index f1ab69a1d..6e8158949 100644
--- a/packages/editor/src/extensions/math/plugin/utils/types.ts
+++ b/packages/editor/src/extensions/math/plugin/utils/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Schema, SchemaSpec } from "prosemirror-model";
////////////////////////////////////////////////////////////////////////////////
diff --git a/packages/editor/src/extensions/ordered-list/index.ts b/packages/editor/src/extensions/ordered-list/index.ts
index 7ef46798c..914261cf2 100644
--- a/packages/editor/src/extensions/ordered-list/index.ts
+++ b/packages/editor/src/extensions/ordered-list/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { OrderedList } from "./ordered-list";
export * from "./ordered-list";
diff --git a/packages/editor/src/extensions/ordered-list/ordered-list.ts b/packages/editor/src/extensions/ordered-list/ordered-list.ts
index aa089b55c..419b6d3f9 100644
--- a/packages/editor/src/extensions/ordered-list/ordered-list.ts
+++ b/packages/editor/src/extensions/ordered-list/ordered-list.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import TiptapOrderedList from "@tiptap/extension-ordered-list";
export const OrderedList = TiptapOrderedList.extend({
diff --git a/packages/editor/src/extensions/outline-list-item/component.tsx b/packages/editor/src/extensions/outline-list-item/component.tsx
index af9fa7611..e8099a39c 100644
--- a/packages/editor/src/extensions/outline-list-item/component.tsx
+++ b/packages/editor/src/extensions/outline-list-item/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Flex, Text } from "@streetwriters/rebass";
import { ReactNodeViewProps } from "../react";
import { Icon } from "../../toolbar/components/icon";
diff --git a/packages/editor/src/extensions/outline-list-item/index.ts b/packages/editor/src/extensions/outline-list-item/index.ts
index 1b1e56bc7..364d03cc9 100644
--- a/packages/editor/src/extensions/outline-list-item/index.ts
+++ b/packages/editor/src/extensions/outline-list-item/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./outline-list-item";
diff --git a/packages/editor/src/extensions/outline-list-item/outline-list-item.ts b/packages/editor/src/extensions/outline-list-item/outline-list-item.ts
index 5f1318075..3b8c021e2 100644
--- a/packages/editor/src/extensions/outline-list-item/outline-list-item.ts
+++ b/packages/editor/src/extensions/outline-list-item/outline-list-item.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Node, mergeAttributes, findChildren, Editor } from "@tiptap/core";
import { NodeType } from "prosemirror-model";
import { findParentNodeOfTypeClosestToPos } from "prosemirror-utils";
diff --git a/packages/editor/src/extensions/outline-list/component.tsx b/packages/editor/src/extensions/outline-list/component.tsx
index 4a306132b..4bd3e90aa 100644
--- a/packages/editor/src/extensions/outline-list/component.tsx
+++ b/packages/editor/src/extensions/outline-list/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Text } from "@streetwriters/rebass";
import { ReactNodeViewProps } from "../react";
import { useMemo } from "react";
@@ -13,7 +31,7 @@ export function OutlineListComponent(
const isNested = useMemo(() => {
const pos = editor.state.doc.resolve(getPos());
return pos.parent?.type.name === OutlineListItem.name;
- }, []);
+ }, [editor, getPos]);
return (
<>
diff --git a/packages/editor/src/extensions/outline-list/index.ts b/packages/editor/src/extensions/outline-list/index.ts
index 5aec1c8aa..ed8ecd8b8 100644
--- a/packages/editor/src/extensions/outline-list/index.ts
+++ b/packages/editor/src/extensions/outline-list/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./outline-list";
diff --git a/packages/editor/src/extensions/outline-list/outline-list.ts b/packages/editor/src/extensions/outline-list/outline-list.ts
index 0d259a1c2..b09d2626f 100644
--- a/packages/editor/src/extensions/outline-list/outline-list.ts
+++ b/packages/editor/src/extensions/outline-list/outline-list.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Node, mergeAttributes, wrappingInputRule } from "@tiptap/core";
import { createNodeView } from "../react";
import { OutlineListComponent } from "./component";
diff --git a/packages/editor/src/extensions/paragraph/index.ts b/packages/editor/src/extensions/paragraph/index.ts
index ed5fa62a0..73d9bc2eb 100644
--- a/packages/editor/src/extensions/paragraph/index.ts
+++ b/packages/editor/src/extensions/paragraph/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./paragraph";
diff --git a/packages/editor/src/extensions/paragraph/paragraph.ts b/packages/editor/src/extensions/paragraph/paragraph.ts
index 64c5febe5..3b6c449f5 100644
--- a/packages/editor/src/extensions/paragraph/paragraph.ts
+++ b/packages/editor/src/extensions/paragraph/paragraph.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor, mergeAttributes, Node } from "@tiptap/core";
import { NodeType } from "prosemirror-model";
diff --git a/packages/editor/src/extensions/react/event-dispatcher.ts b/packages/editor/src/extensions/react/event-dispatcher.ts
index 54a9b0c74..f06320487 100644
--- a/packages/editor/src/extensions/react/event-dispatcher.ts
+++ b/packages/editor/src/extensions/react/event-dispatcher.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { PluginKey } from "prosemirror-state";
export interface Listeners<T> {
diff --git a/packages/editor/src/extensions/react/index.ts b/packages/editor/src/extensions/react/index.ts
index db315768f..696acaa90 100644
--- a/packages/editor/src/extensions/react/index.ts
+++ b/packages/editor/src/extensions/react/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./react-node-view";
export * from "./types";
export * from "./react-portal-provider";
diff --git a/packages/editor/src/extensions/react/plugin.ts b/packages/editor/src/extensions/react/plugin.ts
index 954eb9ba6..4722a8774 100644
--- a/packages/editor/src/extensions/react/plugin.ts
+++ b/packages/editor/src/extensions/react/plugin.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Plugin, PluginKey } from "prosemirror-state";
import { EditorView } from "prosemirror-view";
import { Extension } from "@tiptap/core";
diff --git a/packages/editor/src/extensions/react/react-node-view.tsx b/packages/editor/src/extensions/react/react-node-view.tsx
index a7092d0da..ec075a169 100644
--- a/packages/editor/src/extensions/react/react-node-view.tsx
+++ b/packages/editor/src/extensions/react/react-node-view.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { SyntheticEvent } from "react";
import { NodeView, Decoration, DecorationSource } from "prosemirror-view";
import { Node as PMNode, Slice } from "prosemirror-model";
diff --git a/packages/editor/src/extensions/react/react-portal-provider.tsx b/packages/editor/src/extensions/react/react-portal-provider.tsx
index dda978a10..156e0f6c5 100644
--- a/packages/editor/src/extensions/react/react-portal-provider.tsx
+++ b/packages/editor/src/extensions/react/react-portal-provider.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React, { PropsWithChildren, useContext } from "react";
import {
createPortal,
diff --git a/packages/editor/src/extensions/react/selection-based-react-node-view.tsx b/packages/editor/src/extensions/react/selection-based-react-node-view.tsx
index d15e7f101..7ca629a9a 100644
--- a/packages/editor/src/extensions/react/selection-based-react-node-view.tsx
+++ b/packages/editor/src/extensions/react/selection-based-react-node-view.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { DecorationSet } from "prosemirror-view";
import { Node as PMNode } from "prosemirror-model";
diff --git a/packages/editor/src/extensions/react/types.ts b/packages/editor/src/extensions/react/types.ts
index 4f04a2bd5..7a9e3aa7d 100644
--- a/packages/editor/src/extensions/react/types.ts
+++ b/packages/editor/src/extensions/react/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor } from "../../types";
import { Node as PMNode, Attrs } from "prosemirror-model";
diff --git a/packages/editor/src/extensions/search-replace/index.ts b/packages/editor/src/extensions/search-replace/index.ts
index 8a016dad8..d29e8126f 100644
--- a/packages/editor/src/extensions/search-replace/index.ts
+++ b/packages/editor/src/extensions/search-replace/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./search-replace";
diff --git a/packages/editor/src/extensions/search-replace/search-replace.ts b/packages/editor/src/extensions/search-replace/search-replace.ts
index ae04d3d15..c3f6689ed 100644
--- a/packages/editor/src/extensions/search-replace/search-replace.ts
+++ b/packages/editor/src/extensions/search-replace/search-replace.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor, Extension } from "@tiptap/core";
import { Decoration, DecorationSet } from "prosemirror-view";
import {
diff --git a/packages/editor/src/extensions/selection-persist/index.ts b/packages/editor/src/extensions/selection-persist/index.ts
index 1bb64b085..a31aa1e05 100644
--- a/packages/editor/src/extensions/selection-persist/index.ts
+++ b/packages/editor/src/extensions/selection-persist/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./selection-persist";
diff --git a/packages/editor/src/extensions/selection-persist/selection-persist.ts b/packages/editor/src/extensions/selection-persist/selection-persist.ts
index 340b3abca..9e7ef5345 100644
--- a/packages/editor/src/extensions/selection-persist/selection-persist.ts
+++ b/packages/editor/src/extensions/selection-persist/selection-persist.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Extension } from "@tiptap/core";
import { Plugin, PluginKey } from "prosemirror-state";
import { Decoration, DecorationSet } from "prosemirror-view";
diff --git a/packages/editor/src/extensions/table-cell/index.ts b/packages/editor/src/extensions/table-cell/index.ts
index 512bb46bf..0c082d7dd 100644
--- a/packages/editor/src/extensions/table-cell/index.ts
+++ b/packages/editor/src/extensions/table-cell/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { TableCell } from "./table-cell";
export * from "./table-cell";
diff --git a/packages/editor/src/extensions/table-cell/table-cell.ts b/packages/editor/src/extensions/table-cell/table-cell.ts
index 8f21c182f..4de434bc5 100644
--- a/packages/editor/src/extensions/table-cell/table-cell.ts
+++ b/packages/editor/src/extensions/table-cell/table-cell.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import TiptapTableCell from "@tiptap/extension-table-cell";
import { Attribute } from "@tiptap/core";
diff --git a/packages/editor/src/extensions/table/actions.ts b/packages/editor/src/extensions/table/actions.ts
index a8c369f09..01778c721 100644
--- a/packages/editor/src/extensions/table/actions.ts
+++ b/packages/editor/src/extensions/table/actions.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor } from "@tiptap/core";
import { selectedRect, TableRect } from "@_ueberdosis/prosemirror-tables";
import { Transaction } from "prosemirror-state";
diff --git a/packages/editor/src/extensions/table/component.tsx b/packages/editor/src/extensions/table/component.tsx
index b0f00be71..3ef5a9fbf 100644
--- a/packages/editor/src/extensions/table/component.tsx
+++ b/packages/editor/src/extensions/table/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex } from "@streetwriters/rebass";
import {
SelectionBasedNodeView,
@@ -97,24 +115,28 @@ function TableRowToolbar(props: TableToolbarProps) {
const { editor } = props;
const rowToolsRef = useRef<HTMLDivElement>(null);
- useEffect(() => {
- if (!rowToolsRef.current) {
- return;
- }
-
- const currentRow = findSelectedDOMNode(editor, ["tableRow"]);
- if (!currentRow) return;
-
- const pos = getPosition(rowToolsRef.current, {
- location: "left",
- target: currentRow,
- align: "start",
- xOffset: -5,
- yOffset: -3
- });
- rowToolsRef.current.style.top = `${pos.top}px`;
- rowToolsRef.current.style.left = `${pos.left}px`;
- }, [editor.state.selection, rowToolsRef.current]);
+ useEffect(
+ () => {
+ if (!rowToolsRef.current) {
+ return;
+ }
+
+ const currentRow = findSelectedDOMNode(editor, ["tableRow"]);
+ if (!currentRow) return;
+
+ const pos = getPosition(rowToolsRef.current, {
+ location: "left",
+ target: currentRow,
+ align: "start",
+ xOffset: -5,
+ yOffset: -3
+ });
+ rowToolsRef.current.style.top = `${pos.top}px`;
+ rowToolsRef.current.style.left = `${pos.left}px`;
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [editor.state.selection]
+ );
return (
<Flex
@@ -151,29 +173,33 @@ function TableRowToolbar(props: TableToolbarProps) {
function TableColumnToolbar(props: TableToolbarProps) {
const { editor, table } = props;
const columnToolsRef = useRef<HTMLDivElement>(null);
- useEffect(() => {
- if (!columnToolsRef.current || !table) {
- return;
- }
-
- const currentCell = findSelectedDOMNode(editor, [
- "tableCell",
- "tableHeader"
- ]);
- if (!currentCell) return;
-
- // tableRef.current
- const pos = getPosition(columnToolsRef.current, {
- location: "top",
- align: "center",
- target: currentCell as HTMLElement,
- yAnchor: table,
- yOffset: 2
- });
-
- columnToolsRef.current.style.left = `${pos.left}px`;
- columnToolsRef.current.style.top = `${pos.top}px`;
- }, [editor.state.selection, columnToolsRef.current, table]);
+ useEffect(
+ () => {
+ if (!columnToolsRef.current || !table) {
+ return;
+ }
+
+ const currentCell = findSelectedDOMNode(editor, [
+ "tableCell",
+ "tableHeader"
+ ]);
+ if (!currentCell) return;
+
+ // tableRef.current
+ const pos = getPosition(columnToolsRef.current, {
+ location: "top",
+ align: "center",
+ target: currentCell as HTMLElement,
+ yAnchor: table,
+ yOffset: 2
+ });
+
+ columnToolsRef.current.style.left = `${pos.left}px`;
+ columnToolsRef.current.style.top = `${pos.top}px`;
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [editor.state.selection, table]
+ );
return (
<Flex
diff --git a/packages/editor/src/extensions/table/index.ts b/packages/editor/src/extensions/table/index.ts
index 0e948df9e..3afed81d4 100644
--- a/packages/editor/src/extensions/table/index.ts
+++ b/packages/editor/src/extensions/table/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./table";
diff --git a/packages/editor/src/extensions/table/table.ts b/packages/editor/src/extensions/table/table.ts
index c04e40e2d..8152d94fc 100644
--- a/packages/editor/src/extensions/table/table.ts
+++ b/packages/editor/src/extensions/table/table.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Table as TiptapTable, TableOptions } from "@tiptap/extension-table";
import { columnResizing, tableEditing } from "@_ueberdosis/prosemirror-tables";
import { Editor } from "../../types";
diff --git a/packages/editor/src/extensions/task-item/component.tsx b/packages/editor/src/extensions/task-item/component.tsx
index 67d00af4e..b17335722 100644
--- a/packages/editor/src/extensions/task-item/component.tsx
+++ b/packages/editor/src/extensions/task-item/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text } from "@streetwriters/rebass";
import { ReactNodeViewProps } from "../react";
import { Icon } from "../../toolbar/components/icon";
@@ -51,7 +69,7 @@ export function TaskItemComponent(
}
return true;
- }, [editor, getPos, checked]);
+ }, [editor, checked, updateAttributes, getPos]);
return (
<>
diff --git a/packages/editor/src/extensions/task-item/index.ts b/packages/editor/src/extensions/task-item/index.ts
index 3518ff3b2..300432439 100644
--- a/packages/editor/src/extensions/task-item/index.ts
+++ b/packages/editor/src/extensions/task-item/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./task-item";
diff --git a/packages/editor/src/extensions/task-item/task-item.ts b/packages/editor/src/extensions/task-item/task-item.ts
index 7eb6cfeee..e91979cd4 100644
--- a/packages/editor/src/extensions/task-item/task-item.ts
+++ b/packages/editor/src/extensions/task-item/task-item.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { mergeAttributes } from "@tiptap/core";
import { onBackspacePressed } from "../list-item/commands";
import { TaskItem } from "@tiptap/extension-task-item";
diff --git a/packages/editor/src/extensions/task-list/component.tsx b/packages/editor/src/extensions/task-list/component.tsx
index 71bf8b852..f0ee9fee3 100644
--- a/packages/editor/src/extensions/task-list/component.tsx
+++ b/packages/editor/src/extensions/task-list/component.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Flex, Text } from "@streetwriters/rebass";
import { ReactNodeViewProps } from "../react";
import { Node } from "prosemirror-model";
@@ -23,7 +41,7 @@ export function TaskListComponent(
const getParent = useCallback(() => {
const pos = editor.state.doc.resolve(getPos());
return findParentNodeOfTypeClosestToPos(pos, taskItemType);
- }, []);
+ }, [editor.state.doc, getPos, taskItemType]);
const isNested = useMemo(() => {
return !!getParent();
@@ -44,7 +62,7 @@ export function TaskListComponent(
tr.setNodeMarkup(pos, undefined, { checked: allChecked });
return true;
});
- }, [node, node.childCount]);
+ }, [editor.commands, editor.state.doc, getParent, node, node.childCount]);
useEffect(() => {
const children = findChildren(
diff --git a/packages/editor/src/extensions/task-list/index.ts b/packages/editor/src/extensions/task-list/index.ts
index 291e035cb..4eb625f3b 100644
--- a/packages/editor/src/extensions/task-list/index.ts
+++ b/packages/editor/src/extensions/task-list/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./task-list";
diff --git a/packages/editor/src/extensions/task-list/task-list.ts b/packages/editor/src/extensions/task-list/task-list.ts
index 3ac797f2f..c1b6c0ba8 100644
--- a/packages/editor/src/extensions/task-list/task-list.ts
+++ b/packages/editor/src/extensions/task-list/task-list.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { mergeAttributes } from "@tiptap/core";
import { TaskList } from "@tiptap/extension-task-list";
import { createNodeView } from "../react";
diff --git a/packages/editor/src/extensions/text-direction/index.ts b/packages/editor/src/extensions/text-direction/index.ts
index f2c9d7991..83f4688d4 100644
--- a/packages/editor/src/extensions/text-direction/index.ts
+++ b/packages/editor/src/extensions/text-direction/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { TextDirection } from "./text-direction";
export * from "./text-direction";
diff --git a/packages/editor/src/extensions/text-direction/text-direction.ts b/packages/editor/src/extensions/text-direction/text-direction.ts
index a43b75784..087edbcf6 100644
--- a/packages/editor/src/extensions/text-direction/text-direction.ts
+++ b/packages/editor/src/extensions/text-direction/text-direction.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Extension } from "@tiptap/core";
import "@tiptap/extension-text-style";
diff --git a/packages/editor/src/hooks/use-editor.ts b/packages/editor/src/hooks/use-editor.ts
index 7a5cce808..473523328 100644
--- a/packages/editor/src/hooks/use-editor.ts
+++ b/packages/editor/src/hooks/use-editor.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { EditorOptions } from "@tiptap/core";
import { DependencyList, useEffect, useRef, useState } from "react";
import { Editor } from "../types";
@@ -16,28 +34,32 @@ export const useEditor = (
const forceUpdate = useForceUpdate();
const editorRef = useRef<Editor | null>(editor);
- useEffect(() => {
- let isMounted = true;
+ useEffect(
+ () => {
+ let isMounted = true;
- const instance = new Editor(options);
+ const instance = new Editor(options);
- setEditor(instance);
+ setEditor(instance);
- instance.on("transaction", () => {
- requestAnimationFrame(() => {
+ instance.on("transaction", () => {
requestAnimationFrame(() => {
- if (isMounted) {
- forceUpdate();
- }
+ requestAnimationFrame(() => {
+ if (isMounted) {
+ forceUpdate();
+ }
+ });
});
});
- });
- return () => {
- instance.destroy();
- isMounted = false;
- };
- }, deps);
+ return () => {
+ instance.destroy();
+ isMounted = false;
+ };
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [...deps, forceUpdate, options]
+ );
useEffect(() => {
editorRef.current = editor;
@@ -73,7 +95,7 @@ export const useEditor = (
return () => {
editor?.view.dom.removeEventListener("dragenter", onDragEnter);
};
- }, [editor?.view.dom]);
+ }, [editor?.view.dom, editor?.view.dragging]);
return editor;
};
diff --git a/packages/editor/src/hooks/use-permission-handler.ts b/packages/editor/src/hooks/use-permission-handler.ts
index 2c2b922a4..a10238df4 100644
--- a/packages/editor/src/hooks/use-permission-handler.ts
+++ b/packages/editor/src/hooks/use-permission-handler.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { UnionCommands } from "@tiptap/core";
import { useEffect } from "react";
import { PermissionRequestEvent } from "../types";
diff --git a/packages/editor/src/hooks/use-ref-value.ts b/packages/editor/src/hooks/use-ref-value.ts
index d7f4ddff8..9a5f70246 100644
--- a/packages/editor/src/hooks/use-ref-value.ts
+++ b/packages/editor/src/hooks/use-ref-value.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useRef } from "react";
export function useRefValue<T>(value: T) {
diff --git a/packages/editor/src/index.ts b/packages/editor/src/index.ts
index 990c9ec40..6c748ab8d 100644
--- a/packages/editor/src/index.ts
+++ b/packages/editor/src/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import "./extensions";
import CharacterCount from "@tiptap/extension-character-count";
import Placeholder from "@tiptap/extension-placeholder";
@@ -88,7 +106,14 @@ const useTiptap = (
setIsMobile(isMobile || false);
setTheme(theme);
setIsKeyboardOpen(isKeyboardOpen || false);
- }, [isMobile, theme, isKeyboardOpen]);
+ }, [
+ isMobile,
+ theme,
+ isKeyboardOpen,
+ setIsMobile,
+ setTheme,
+ setIsKeyboardOpen
+ ]);
const defaultOptions = useMemo<Partial<EditorOptions>>(
() => ({
@@ -179,6 +204,8 @@ const useTiptap = (
injectCSS: false
}),
[
+ doubleSpacedLines,
+ isMobile,
onDownloadAttachment,
onOpenAttachmentPicker,
PortalProviderAPI,
diff --git a/packages/editor/src/toolbar/components/counter.tsx b/packages/editor/src/toolbar/components/counter.tsx
index 4320eac22..1183910e8 100644
--- a/packages/editor/src/toolbar/components/counter.tsx
+++ b/packages/editor/src/toolbar/components/counter.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { Flex } from "@streetwriters/rebass";
import { Button } from "../../components/button";
diff --git a/packages/editor/src/toolbar/components/dropdown.tsx b/packages/editor/src/toolbar/components/dropdown.tsx
index 654fa9739..7e7f42a85 100644
--- a/packages/editor/src/toolbar/components/dropdown.tsx
+++ b/packages/editor/src/toolbar/components/dropdown.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useRef, useState } from "react";
import { Text } from "@streetwriters/rebass";
import { Icon } from "./icon";
diff --git a/packages/editor/src/toolbar/components/icon.tsx b/packages/editor/src/toolbar/components/icon.tsx
index 02395b7db..a0ba05e6c 100644
--- a/packages/editor/src/toolbar/components/icon.tsx
+++ b/packages/editor/src/toolbar/components/icon.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import MDIIcon from "@mdi/react";
import { Theme } from "@notesnook/theme";
import { SchemeColors } from "@notesnook/theme/dist/theme/colorscheme";
diff --git a/packages/editor/src/toolbar/components/more-tools.tsx b/packages/editor/src/toolbar/components/more-tools.tsx
index e318f16c2..ab8ce0764 100644
--- a/packages/editor/src/toolbar/components/more-tools.tsx
+++ b/packages/editor/src/toolbar/components/more-tools.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useRef, useState } from "react";
import { PopupWrapper } from "../../components/popup-presenter";
import { ToolButton } from "../components/tool-button";
diff --git a/packages/editor/src/toolbar/components/popup.tsx b/packages/editor/src/toolbar/components/popup.tsx
index 0314c3dd8..96f42ae8b 100644
--- a/packages/editor/src/toolbar/components/popup.tsx
+++ b/packages/editor/src/toolbar/components/popup.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Button, Flex, Text } from "@streetwriters/rebass";
import { Icon } from "./icon";
import { Icons } from "../icons";
diff --git a/packages/editor/src/toolbar/components/split-button.tsx b/packages/editor/src/toolbar/components/split-button.tsx
index 48b3bb068..a5f459b61 100644
--- a/packages/editor/src/toolbar/components/split-button.tsx
+++ b/packages/editor/src/toolbar/components/split-button.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { PropsWithChildren, useRef } from "react";
import { Flex } from "@streetwriters/rebass";
import { Icons } from "../icons";
diff --git a/packages/editor/src/toolbar/components/tool-button.tsx b/packages/editor/src/toolbar/components/tool-button.tsx
index da1ba4b4d..f08287b40 100644
--- a/packages/editor/src/toolbar/components/tool-button.tsx
+++ b/packages/editor/src/toolbar/components/tool-button.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Theme } from "@notesnook/theme";
import { SchemeColors } from "@notesnook/theme/dist/theme/colorscheme";
import React from "react";
diff --git a/packages/editor/src/toolbar/components/toolbar-group.tsx b/packages/editor/src/toolbar/components/toolbar-group.tsx
index cc2fa15e3..877cf0c17 100644
--- a/packages/editor/src/toolbar/components/toolbar-group.tsx
+++ b/packages/editor/src/toolbar/components/toolbar-group.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolbarGroupDefinition, ToolButtonVariant } from "../types";
import { findTool } from "../tools";
import { Flex, FlexProps } from "@streetwriters/rebass";
diff --git a/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx b/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx
index 70ce4a440..5298cf7ef 100644
--- a/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx
+++ b/packages/editor/src/toolbar/floating-menus/hover-popup/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useEffect, useRef } from "react";
import { showPopup } from "../../../components/popup-presenter";
import { Editor } from "../../../types";
@@ -19,74 +37,78 @@ export function HoverPopupHandler(props: FloatingMenuProps) {
const hoverTimeoutId = useRef<number>();
const activePopup = useRef<{ element: HTMLElement; hide: () => void }>();
- useEffect(() => {
- function onMouseOver(e: MouseEvent) {
- if (
- !e.target ||
- !(e.target instanceof HTMLElement) ||
- e.target.classList.contains("ProseMirror")
- )
- return;
+ useEffect(
+ () => {
+ function onMouseOver(e: MouseEvent) {
+ if (
+ !e.target ||
+ !(e.target instanceof HTMLElement) ||
+ e.target.classList.contains("ProseMirror")
+ )
+ return;
- const element = e.target;
+ const element = e.target;
- if (activePopup.current) {
- const isOutsideEditor = !element.closest(".ProseMirror");
- const isInsidePopup = element.closest(".popup-presenter-portal");
- const isActiveElement = activePopup.current.element === element;
- if (isInsidePopup) return;
+ if (activePopup.current) {
+ const isOutsideEditor = !element.closest(".ProseMirror");
+ const isInsidePopup = element.closest(".popup-presenter-portal");
+ const isActiveElement = activePopup.current.element === element;
+ if (isInsidePopup) return;
- if (isOutsideEditor || !isActiveElement) {
- activePopup.current.hide();
- activePopup.current = undefined;
- return;
+ if (isOutsideEditor || !isActiveElement) {
+ activePopup.current.hide();
+ activePopup.current = undefined;
+ return;
+ }
}
- }
- clearTimeout(hoverTimeoutId.current);
+ clearTimeout(hoverTimeoutId.current);
- hoverTimeoutId.current = setTimeout(
- () => {
- const PopupHandler = handlers.find((h) => h.isActive(element));
- if (!PopupHandler || !editor.current) return;
+ hoverTimeoutId.current = setTimeout(
+ () => {
+ const PopupHandler = handlers.find((h) => h.isActive(element));
+ if (!PopupHandler || !editor.current) return;
- const { popup: Popup } = PopupHandler;
- const pos = editor.current.view.posAtDOM(element, 0);
- const node = editor.current.view.state.doc.nodeAt(pos);
+ const { popup: Popup } = PopupHandler;
+ const pos = editor.current.view.posAtDOM(element, 0);
+ const node = editor.current.view.state.doc.nodeAt(pos);
- if (!node) return;
+ if (!node) return;
- const hidePopup = showPopup({
- popup: () => (
- <Popup
- editor={editor}
- selectedNode={{
- node,
- from: pos,
- to: pos + node.nodeSize
- }}
- />
- ),
- blocking: false,
- focusOnRender: false,
- position: {
- target: element,
- align: "center",
- location: "top",
- isTargetAbsolute: true
- }
- });
- activePopup.current = { element, hide: hidePopup };
- },
- HOVER_TIMEOUT,
- {}
- );
- }
- window.addEventListener("mouseover", onMouseOver);
- return () => {
- window.removeEventListener("mouseover", onMouseOver);
- };
- }, []);
+ const hidePopup = showPopup({
+ popup: () => (
+ <Popup
+ editor={editor}
+ selectedNode={{
+ node,
+ from: pos,
+ to: pos + node.nodeSize
+ }}
+ />
+ ),
+ blocking: false,
+ focusOnRender: false,
+ position: {
+ target: element,
+ align: "center",
+ location: "top",
+ isTargetAbsolute: true
+ }
+ });
+ activePopup.current = { element, hide: hidePopup };
+ },
+ HOVER_TIMEOUT,
+ {}
+ );
+ }
+ window.addEventListener("mouseover", onMouseOver);
+ return () => {
+ window.removeEventListener("mouseover", onMouseOver);
+ };
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ []
+ );
return null;
}
diff --git a/packages/editor/src/toolbar/floating-menus/hover-popup/link.tsx b/packages/editor/src/toolbar/floating-menus/hover-popup/link.tsx
index 412054cd0..cd7186c6c 100644
--- a/packages/editor/src/toolbar/floating-menus/hover-popup/link.tsx
+++ b/packages/editor/src/toolbar/floating-menus/hover-popup/link.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolbarGroup } from "../../components/toolbar-group";
import { HoverPopupProps } from ".";
diff --git a/packages/editor/src/toolbar/floating-menus/index.tsx b/packages/editor/src/toolbar/floating-menus/index.tsx
index 31fc28193..ee2bcd40e 100644
--- a/packages/editor/src/toolbar/floating-menus/index.tsx
+++ b/packages/editor/src/toolbar/floating-menus/index.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { DesktopOnly } from "../../components/responsive";
import { HoverPopupHandler } from "./hover-popup";
import { SearchReplaceFloatingMenu } from "./search-replace";
diff --git a/packages/editor/src/toolbar/floating-menus/search-replace.tsx b/packages/editor/src/toolbar/floating-menus/search-replace.tsx
index ed4716acd..176a13e33 100644
--- a/packages/editor/src/toolbar/floating-menus/search-replace.tsx
+++ b/packages/editor/src/toolbar/floating-menus/search-replace.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SearchStorage } from "../../extensions/search-replace";
import { FloatingMenuProps } from "./types";
import { SearchReplacePopup } from "../popups/search-replace";
diff --git a/packages/editor/src/toolbar/floating-menus/types.ts b/packages/editor/src/toolbar/floating-menus/types.ts
index ff5a1d681..6215d0e32 100644
--- a/packages/editor/src/toolbar/floating-menus/types.ts
+++ b/packages/editor/src/toolbar/floating-menus/types.ts
@@ -1,2 +1,20 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor } from "../../types";
export type FloatingMenuProps = { editor: Editor };
diff --git a/packages/editor/src/toolbar/icons.ts b/packages/editor/src/toolbar/icons.ts
index 337f68cd8..dfd201bcf 100644
--- a/packages/editor/src/toolbar/icons.ts
+++ b/packages/editor/src/toolbar/icons.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import {
mdiAttachment,
mdiBorderHorizontal,
diff --git a/packages/editor/src/toolbar/index.ts b/packages/editor/src/toolbar/index.ts
index e0caeec4b..3c233d051 100644
--- a/packages/editor/src/toolbar/index.ts
+++ b/packages/editor/src/toolbar/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Toolbar } from "./toolbar";
export default Toolbar;
diff --git a/packages/editor/src/toolbar/popups/cell-properties.tsx b/packages/editor/src/toolbar/popups/cell-properties.tsx
index 3dd0c43e7..b76d62b42 100644
--- a/packages/editor/src/toolbar/popups/cell-properties.tsx
+++ b/packages/editor/src/toolbar/popups/cell-properties.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor } from "../../types";
import { Box } from "@streetwriters/rebass";
import { Tab, Tabs } from "../../components/tabs";
diff --git a/packages/editor/src/toolbar/popups/color-picker.tsx b/packages/editor/src/toolbar/popups/color-picker.tsx
index 5b8dd911a..c91427b40 100644
--- a/packages/editor/src/toolbar/popups/color-picker.tsx
+++ b/packages/editor/src/toolbar/popups/color-picker.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Flex, Text } from "@streetwriters/rebass";
import { Input } from "@streetwriters/rebass-forms";
import { Icon } from "../components/icon";
@@ -56,6 +74,7 @@ export function ColorPicker(props: ColorPickerProps) {
if (isPickerOpen) ref.current.focus({ preventScroll: true });
}, [isPickerOpen]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
const onColorChange = useCallback(
debounce((color: string) => {
onChange(color);
diff --git a/packages/editor/src/toolbar/popups/embed-popup.tsx b/packages/editor/src/toolbar/popups/embed-popup.tsx
index 6dba2cec2..dbdb3c35c 100644
--- a/packages/editor/src/toolbar/popups/embed-popup.tsx
+++ b/packages/editor/src/toolbar/popups/embed-popup.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex, Text } from "@streetwriters/rebass";
import { useCallback, useState } from "react";
import { Popup } from "../components/popup";
@@ -44,7 +62,7 @@ export function EmbedPopup(props: EmbedPopupProps) {
setHeight(size.height);
if (onSizeChanged) onSizeChanged(size);
},
- [width, height]
+ [height, width, onSizeChanged]
);
return (
diff --git a/packages/editor/src/toolbar/popups/image-properties.tsx b/packages/editor/src/toolbar/popups/image-properties.tsx
index d26d5621c..173253f9d 100644
--- a/packages/editor/src/toolbar/popups/image-properties.tsx
+++ b/packages/editor/src/toolbar/popups/image-properties.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Flex } from "@streetwriters/rebass";
import { useCallback } from "react";
import { Popup } from "../components/popup";
@@ -34,6 +52,7 @@ export function ImageProperties(props: ImagePropertiesProps) {
editor.current?.chain().setImageSize(size).run();
},
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[width, height]
);
diff --git a/packages/editor/src/toolbar/popups/image-upload.tsx b/packages/editor/src/toolbar/popups/image-upload.tsx
index 1078d1724..6cf9c64fb 100644
--- a/packages/editor/src/toolbar/popups/image-upload.tsx
+++ b/packages/editor/src/toolbar/popups/image-upload.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Input } from "@streetwriters/rebass-forms";
import { useState } from "react";
import { Flex, Text } from "@streetwriters/rebass";
diff --git a/packages/editor/src/toolbar/popups/link-popup.tsx b/packages/editor/src/toolbar/popups/link-popup.tsx
index 563b57003..3c0479391 100644
--- a/packages/editor/src/toolbar/popups/link-popup.tsx
+++ b/packages/editor/src/toolbar/popups/link-popup.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Input } from "@streetwriters/rebass-forms";
import { Flex } from "@streetwriters/rebass";
import { useRefValue } from "../../hooks/use-ref-value";
diff --git a/packages/editor/src/toolbar/popups/search-replace.tsx b/packages/editor/src/toolbar/popups/search-replace.tsx
index f2d10bdb0..16633be4c 100644
--- a/packages/editor/src/toolbar/popups/search-replace.tsx
+++ b/packages/editor/src/toolbar/popups/search-replace.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Input } from "@streetwriters/rebass-forms";
import { useCallback, useEffect, useRef, useState } from "react";
import { Flex, Text } from "@streetwriters/rebass";
@@ -21,12 +39,13 @@ export function SearchReplacePopup(props: SearchReplacePopupProps) {
const search = useCallback(
(term: string) => {
- editor.commands.search(term, {
+ editor.current?.commands.search(term, {
matchCase,
enableRegex,
matchWholeWord
});
},
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[matchCase, enableRegex, matchWholeWord]
);
diff --git a/packages/editor/src/toolbar/popups/table-popup.tsx b/packages/editor/src/toolbar/popups/table-popup.tsx
index 52387649e..271664192 100644
--- a/packages/editor/src/toolbar/popups/table-popup.tsx
+++ b/packages/editor/src/toolbar/popups/table-popup.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Box, Flex, Text } from "@streetwriters/rebass";
import { useEffect, useState } from "react";
import { Popup } from "../components/popup";
diff --git a/packages/editor/src/toolbar/stores/toolbar-store.ts b/packages/editor/src/toolbar/stores/toolbar-store.ts
index a7b3e5e3f..37591e815 100644
--- a/packages/editor/src/toolbar/stores/toolbar-store.ts
+++ b/packages/editor/src/toolbar/stores/toolbar-store.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Theme } from "@notesnook/theme";
import create from "zustand";
diff --git a/packages/editor/src/toolbar/tool-definitions.ts b/packages/editor/src/toolbar/tool-definitions.ts
index c897a9707..af9627672 100644
--- a/packages/editor/src/toolbar/tool-definitions.ts
+++ b/packages/editor/src/toolbar/tool-definitions.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolbarDefinition, ToolDefinition } from "./types";
import { ToolId } from "./tools";
diff --git a/packages/editor/src/toolbar/toolbar.tsx b/packages/editor/src/toolbar/toolbar.tsx
index 46b057849..7da4cc589 100644
--- a/packages/editor/src/toolbar/toolbar.tsx
+++ b/packages/editor/src/toolbar/toolbar.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Theme } from "@notesnook/theme";
import { Editor } from "../types";
import { Flex, FlexProps } from "@streetwriters/rebass";
@@ -47,7 +65,7 @@ export function Toolbar(props: ToolbarProps) {
useEffect(() => {
setToolbarLocation(location);
- }, [location]);
+ }, [location, setToolbarLocation]);
if (!editor) return null;
return (
diff --git a/packages/editor/src/toolbar/tools/alignment.tsx b/packages/editor/src/toolbar/tools/alignment.tsx
index 143ae4103..aed339086 100644
--- a/packages/editor/src/toolbar/tools/alignment.tsx
+++ b/packages/editor/src/toolbar/tools/alignment.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { ToolButton } from "../components/tool-button";
import { useRefValue } from "../../hooks/use-ref-value";
diff --git a/packages/editor/src/toolbar/tools/attachment.tsx b/packages/editor/src/toolbar/tools/attachment.tsx
index 3d9f113f5..f9bbcf655 100644
--- a/packages/editor/src/toolbar/tools/attachment.tsx
+++ b/packages/editor/src/toolbar/tools/attachment.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { ToolButton } from "../components/tool-button";
import { MoreTools } from "../components/more-tools";
diff --git a/packages/editor/src/toolbar/tools/block.tsx b/packages/editor/src/toolbar/tools/block.tsx
index 4cbb2a23a..6059cbcb3 100644
--- a/packages/editor/src/toolbar/tools/block.tsx
+++ b/packages/editor/src/toolbar/tools/block.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { Editor } from "../../types";
import { Icons } from "../icons";
@@ -19,20 +37,24 @@ export function InsertBlock(props: ToolProps) {
const toolbarLocation = useToolbarLocation();
const isMobile = useIsMobile();
- const menuItems = useMemo(() => {
- return [
- tasklist(editor),
- outlinelist(editor),
- horizontalRule(editor),
- codeblock(editor),
- mathblock(editor),
- blockquote(editor),
- image(editor, isMobile),
- attachment(editor),
- isMobile ? embedMobile(editor) : embedDesktop(editor),
- table(editor)
- ];
- }, [isMobile]);
+ const menuItems = useMemo(
+ () => {
+ return [
+ tasklist(editor),
+ outlinelist(editor),
+ horizontalRule(editor),
+ codeblock(editor),
+ mathblock(editor),
+ blockquote(editor),
+ image(editor, isMobile),
+ attachment(editor),
+ isMobile ? embedMobile(editor) : embedDesktop(editor),
+ table(editor)
+ ];
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [isMobile]
+ );
return (
<>
diff --git a/packages/editor/src/toolbar/tools/colors.tsx b/packages/editor/src/toolbar/tools/colors.tsx
index cb8e1d200..73393f4f8 100644
--- a/packages/editor/src/toolbar/tools/colors.tsx
+++ b/packages/editor/src/toolbar/tools/colors.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { useState } from "react";
import tinycolor from "tinycolor2";
import { PopupWrapper } from "../../components/popup-presenter";
diff --git a/packages/editor/src/toolbar/tools/embed.tsx b/packages/editor/src/toolbar/tools/embed.tsx
index cb556cc83..49da8bf54 100644
--- a/packages/editor/src/toolbar/tools/embed.tsx
+++ b/packages/editor/src/toolbar/tools/embed.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { ToolButton } from "../components/tool-button";
import { useMemo, useRef, useState } from "react";
@@ -81,7 +99,7 @@ export function EmbedProperties(props: ToolProps) {
const buttonRef = useRef<HTMLButtonElement>();
// TODO: improve perf by deferring this until user opens the popup
- const embedNode = useMemo(() => findSelectedNode(editor, "embed"), []);
+ const embedNode = useMemo(() => findSelectedNode(editor, "embed"), [editor]);
const embed = (embedNode?.attrs || {}) as Embed;
return (
diff --git a/packages/editor/src/toolbar/tools/font.tsx b/packages/editor/src/toolbar/tools/font.tsx
index fd8dc47ff..d5efde032 100644
--- a/packages/editor/src/toolbar/tools/font.tsx
+++ b/packages/editor/src/toolbar/tools/font.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { Editor } from "../../types";
import { Dropdown } from "../components/dropdown";
@@ -14,11 +32,11 @@ export function FontSize(props: ToolProps) {
const decreaseFontSize = useCallback(() => {
return Math.max(8, fontSizeAsNumber.current - 1);
- }, []);
+ }, [fontSizeAsNumber]);
const increaseFontSize = useCallback(() => {
return Math.min(120, fontSizeAsNumber.current + 1);
- }, []);
+ }, [fontSizeAsNumber]);
return (
<Counter
@@ -60,6 +78,7 @@ export function FontFamily(props: ToolProps) {
?.at(0) || "Sans-serif";
const items = useMemo(
() => toMenuItems(editor, currentFontFamily),
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[currentFontFamily]
);
diff --git a/packages/editor/src/toolbar/tools/headings.tsx b/packages/editor/src/toolbar/tools/headings.tsx
index e9bd8f05c..857be12e3 100644
--- a/packages/editor/src/toolbar/tools/headings.tsx
+++ b/packages/editor/src/toolbar/tools/headings.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { Editor } from "../../types";
import { Dropdown } from "../components/dropdown";
@@ -16,7 +34,8 @@ export function Headings(props: ToolProps) {
);
const items = useMemo(
() => toMenuItems(editor, toolbarLocation, currentHeadingLevel),
- [currentHeadingLevel]
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [currentHeadingLevel, toolbarLocation]
);
return (
diff --git a/packages/editor/src/toolbar/tools/image.tsx b/packages/editor/src/toolbar/tools/image.tsx
index b18d955af..bbb0ee873 100644
--- a/packages/editor/src/toolbar/tools/image.tsx
+++ b/packages/editor/src/toolbar/tools/image.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { ToolButton } from "../components/tool-button";
import { useRef, useState } from "react";
diff --git a/packages/editor/src/toolbar/tools/index.ts b/packages/editor/src/toolbar/tools/index.ts
index 13deafdc9..5ad5db5ba 100644
--- a/packages/editor/src/toolbar/tools/index.ts
+++ b/packages/editor/src/toolbar/tools/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import React from "react";
import { ToolProps } from "../types";
import {
diff --git a/packages/editor/src/toolbar/tools/inline.tsx b/packages/editor/src/toolbar/tools/inline.tsx
index 43011b96f..a6ac0db95 100644
--- a/packages/editor/src/toolbar/tools/inline.tsx
+++ b/packages/editor/src/toolbar/tools/inline.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { ToolButton } from "../components/tool-button";
import { useToolbarLocation } from "../stores/toolbar-store";
diff --git a/packages/editor/src/toolbar/tools/link.tsx b/packages/editor/src/toolbar/tools/link.tsx
index a82ae802e..d6dd9696f 100644
--- a/packages/editor/src/toolbar/tools/link.tsx
+++ b/packages/editor/src/toolbar/tools/link.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { ToolButton } from "../components/tool-button";
import { useCallback, useRef, useState } from "react";
@@ -31,27 +49,31 @@ export function AddLink(props: ToolProps) {
const isActive = props.editor.isActive("link");
- const onDone = useCallback((link: LinkDefinition) => {
- const { href, text, isImage } = link;
- if (!href) return;
+ const onDone = useCallback(
+ (link: LinkDefinition) => {
+ const { href, text, isImage } = link;
+ if (!href) return;
- let commandChain = editor.current?.chain().focus();
- if (!commandChain) return;
+ let commandChain = editor.current?.chain().focus();
+ if (!commandChain) return;
- const isSelection = !editor.current?.state.selection.empty;
+ const isSelection = !editor.current?.state.selection.empty;
- commandChain = commandChain
- .extendMarkRange("link")
- .toggleLink({ href, target: "_blank" });
- if (!isImage) commandChain = commandChain.insertContent(text || href);
+ commandChain = commandChain
+ .extendMarkRange("link")
+ .toggleLink({ href, target: "_blank" });
+ if (!isImage) commandChain = commandChain.insertContent(text || href);
- commandChain = commandChain.focus();
+ commandChain = commandChain.focus();
- if (!isSelection && !isImage)
- commandChain = commandChain.unsetMark("link").insertContent(" ");
+ if (!isSelection && !isImage)
+ commandChain = commandChain.unsetMark("link").insertContent(" ");
- commandChain.run();
- }, []);
+ commandChain.run();
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ []
+ );
if (isActive) return <EditLink {...props} icon={"linkEdit"} />;
return (
@@ -79,49 +101,57 @@ export function EditLink(props: ToolProps) {
_selectedNode || selectionToOffset(editor.state)
);
- const onDone = useCallback((link: LinkDefinition) => {
- const { href, text, isImage } = link;
- const { from, node, to } = selectedNode.current;
- if (!href || !editor.current || !node) return;
-
- const mark = findMark(node, "link");
- if (!mark) return;
-
- const selection = editor.current.state.selection;
-
- let commandChain = editor.current.chain();
-
- if (!isImage) {
- commandChain = commandChain.command(({ tr }) => {
- tr.removeMark(from, to, mark.type);
- tr.insertText(
- text || node.textContent,
- tr.mapping.map(from),
- tr.mapping.map(to)
- );
- tr.setSelection(
- TextSelection.create(tr.doc, tr.mapping.map(from), tr.mapping.map(to))
- );
- return true;
- });
- }
-
- commandChain
- .extendMarkRange("link")
- .toggleLink({ href, target: "_blank" })
- .command(({ tr }) => {
- tr.setSelection(
- TextSelection.create(
- tr.doc,
- tr.mapping.map(selection.from),
- tr.mapping.map(selection.to)
- )
- );
- return true;
- })
- .focus(undefined, { scrollIntoView: true })
- .run();
- }, []);
+ const onDone = useCallback(
+ (link: LinkDefinition) => {
+ const { href, text, isImage } = link;
+ const { from, node, to } = selectedNode.current;
+ if (!href || !editor.current || !node) return;
+
+ const mark = findMark(node, "link");
+ if (!mark) return;
+
+ const selection = editor.current.state.selection;
+
+ let commandChain = editor.current.chain();
+
+ if (!isImage) {
+ commandChain = commandChain.command(({ tr }) => {
+ tr.removeMark(from, to, mark.type);
+ tr.insertText(
+ text || node.textContent,
+ tr.mapping.map(from),
+ tr.mapping.map(to)
+ );
+ tr.setSelection(
+ TextSelection.create(
+ tr.doc,
+ tr.mapping.map(from),
+ tr.mapping.map(to)
+ )
+ );
+ return true;
+ });
+ }
+
+ commandChain
+ .extendMarkRange("link")
+ .toggleLink({ href, target: "_blank" })
+ .command(({ tr }) => {
+ tr.setSelection(
+ TextSelection.create(
+ tr.doc,
+ tr.mapping.map(selection.from),
+ tr.mapping.map(selection.to)
+ )
+ );
+ return true;
+ })
+ .focus(undefined, { scrollIntoView: true })
+ .run();
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ []
+ );
return (
<LinkTool
diff --git a/packages/editor/src/toolbar/tools/lists.tsx b/packages/editor/src/toolbar/tools/lists.tsx
index 233dc00c1..c1fd14ee1 100644
--- a/packages/editor/src/toolbar/tools/lists.tsx
+++ b/packages/editor/src/toolbar/tools/lists.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { Box, Button, Flex } from "@streetwriters/rebass";
import { IconNames } from "../icons";
@@ -103,6 +121,7 @@ export function NumberedList(props: ToolProps) {
const onClick = useCallback(
() => editor.current?.chain().focus().toggleOrderedList().run(),
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
@@ -136,6 +155,7 @@ export function BulletList(props: ToolProps) {
const { editor } = props;
const onClick = useCallback(
() => editor.current?.chain().focus().toggleBulletList().run(),
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
diff --git a/packages/editor/src/toolbar/tools/table.tsx b/packages/editor/src/toolbar/tools/table.tsx
index 971ac4982..3767462f7 100644
--- a/packages/editor/src/toolbar/tools/table.tsx
+++ b/packages/editor/src/toolbar/tools/table.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { Editor } from "../../types";
import { ToolButton } from "../components/tool-button";
@@ -57,6 +75,7 @@ export function RowProperties(props: ToolProps) {
moveRowDown(editor),
deleteRow(editor)
],
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
@@ -99,6 +118,7 @@ export function ColumnProperties(props: ToolProps) {
moveColumnRight(editor),
deleteColumn(editor)
],
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
@@ -147,6 +167,7 @@ export function TableProperties(props: ToolProps) {
{ type: "separator", key: "tableSeperator" },
deleteTable(editor)
],
+ // eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
diff --git a/packages/editor/src/toolbar/tools/text-direction.tsx b/packages/editor/src/toolbar/tools/text-direction.tsx
index eb3d60f78..72eef064f 100644
--- a/packages/editor/src/toolbar/tools/text-direction.tsx
+++ b/packages/editor/src/toolbar/tools/text-direction.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ToolProps } from "../types";
import { ToolButton } from "../components/tool-button";
import { IconNames } from "../icons";
diff --git a/packages/editor/src/toolbar/tools/utils.tsx b/packages/editor/src/toolbar/tools/utils.tsx
index e96fe9a99..415ef1dc4 100644
--- a/packages/editor/src/toolbar/tools/utils.tsx
+++ b/packages/editor/src/toolbar/tools/utils.tsx
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor } from "../../types";
import { MenuButton } from "../../components/menu/types";
import { ToolButton } from "../components/tool-button";
diff --git a/packages/editor/src/toolbar/types.ts b/packages/editor/src/toolbar/types.ts
index 653bcab87..50f829029 100644
--- a/packages/editor/src/toolbar/types.ts
+++ b/packages/editor/src/toolbar/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor } from "../types";
import { IconNames } from "./icons";
import { ToolId } from "./tools";
diff --git a/packages/editor/src/toolbar/utils/dom.ts b/packages/editor/src/toolbar/utils/dom.ts
index d3285e623..d6c70c442 100644
--- a/packages/editor/src/toolbar/utils/dom.ts
+++ b/packages/editor/src/toolbar/utils/dom.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function getToolbarElement() {
return (
(document.querySelector(".editor-toolbar") as HTMLElement) || undefined
diff --git a/packages/editor/src/toolbar/utils/prosemirror.ts b/packages/editor/src/toolbar/utils/prosemirror.ts
index c8ed5ff85..d3f6966eb 100644
--- a/packages/editor/src/toolbar/utils/prosemirror.ts
+++ b/packages/editor/src/toolbar/utils/prosemirror.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Editor, findParentNode } from "@tiptap/core";
import { Node as ProsemirrorNode, Mark } from "prosemirror-model";
import { EditorState } from "prosemirror-state";
diff --git a/packages/editor/src/types.ts b/packages/editor/src/types.ts
index 2dfe2cef1..1b05f291c 100644
--- a/packages/editor/src/types.ts
+++ b/packages/editor/src/types.ts
@@ -1,6 +1,24 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { UnionCommands, Editor as TiptapEditor } from "@tiptap/core";
-export type PermissionRequestEvent = CustomEvent<{ id: keyof UnionCommands }>
+export type PermissionRequestEvent = CustomEvent<{ id: keyof UnionCommands }>;
export class Editor extends TiptapEditor {
/**
diff --git a/packages/editor/src/utils/config.ts b/packages/editor/src/utils/config.ts
index 669a04908..93804dfa9 100644
--- a/packages/editor/src/utils/config.ts
+++ b/packages/editor/src/utils/config.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
function set<T>(key: string, value: T | null) {
if (!value) return window.localStorage.removeItem(key);
window.localStorage.setItem(key, JSON.stringify(value));
diff --git a/packages/editor/src/utils/debounce.ts b/packages/editor/src/utils/debounce.ts
index 23f5ac678..064ad2b49 100644
--- a/packages/editor/src/utils/debounce.ts
+++ b/packages/editor/src/utils/debounce.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function debounce<F extends (...args: never[]) => void>(
func: F,
waitFor: number
diff --git a/packages/editor/src/utils/downloader.ts b/packages/editor/src/utils/downloader.ts
index d529df74e..14473eb92 100644
--- a/packages/editor/src/utils/downloader.ts
+++ b/packages/editor/src/utils/downloader.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export async function downloadImage(url: string) {
const response = await fetch(url);
if (!response.ok) throw new Error(`invalid status code ${response.status}`);
diff --git a/packages/editor/src/utils/platform.ts b/packages/editor/src/utils/platform.ts
index c52f50c0d..6befc2d9f 100644
--- a/packages/editor/src/utils/platform.ts
+++ b/packages/editor/src/utils/platform.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function isiOS(): boolean {
return (
[
diff --git a/packages/editor/src/utils/position.ts b/packages/editor/src/utils/position.ts
index 154035bac..7533c7880 100644
--- a/packages/editor/src/utils/position.ts
+++ b/packages/editor/src/utils/position.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
type PositionData = {
x: number;
y: number;
diff --git a/packages/logger/README.md b/packages/logger/README.md
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts
index ddcebd649..d5aacac94 100644
--- a/packages/logger/src/index.ts
+++ b/packages/logger/src/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { consoleReporter } from "./reporters/console";
import { ILogReporter, LoggerConfig, LogLevel } from "./types";
diff --git a/packages/logger/src/reporters/console.ts b/packages/logger/src/reporters/console.ts
index 8344a9487..bb20a9b72 100644
--- a/packages/logger/src/reporters/console.ts
+++ b/packages/logger/src/reporters/console.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ILogReporter, LogLevel, LogMessage } from "../types";
export const consoleReporter: ILogReporter = {
diff --git a/packages/logger/src/reporters/index.ts b/packages/logger/src/reporters/index.ts
index bf4f5ebda..d4f78e214 100644
--- a/packages/logger/src/reporters/index.ts
+++ b/packages/logger/src/reporters/index.ts
@@ -1 +1,19 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./console";
diff --git a/packages/logger/src/types.ts b/packages/logger/src/types.ts
index 8583c0eed..4dd82bf7d 100644
--- a/packages/logger/src/types.ts
+++ b/packages/logger/src/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export interface ILogReporter {
write(message: LogMessage): void;
}
diff --git a/packages/streamable-fs/README.md b/packages/streamable-fs/README.md
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/streamable-fs/index.ts b/packages/streamable-fs/index.ts
index aa70563be..1492bd0ee 100644
--- a/packages/streamable-fs/index.ts
+++ b/packages/streamable-fs/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import localforage from "localforage";
import FileHandle from "./src/filehandle";
import { IStreamableFS } from "./src/interfaces";
diff --git a/packages/streamable-fs/src/filehandle.ts b/packages/streamable-fs/src/filehandle.ts
index df8a47a6a..cb897ad4c 100644
--- a/packages/streamable-fs/src/filehandle.ts
+++ b/packages/streamable-fs/src/filehandle.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import FileStreamSource from "./filestreamsource";
import { File } from "./types";
diff --git a/packages/streamable-fs/src/filestreamsource.ts b/packages/streamable-fs/src/filestreamsource.ts
index 5853dd506..3f9ca3607 100644
--- a/packages/streamable-fs/src/filestreamsource.ts
+++ b/packages/streamable-fs/src/filestreamsource.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { File } from "./types";
import { Chunk } from "@notesnook/crypto/dist/src/types";
diff --git a/packages/streamable-fs/src/interfaces.ts b/packages/streamable-fs/src/interfaces.ts
index e5a43dc99..8c69011a3 100644
--- a/packages/streamable-fs/src/interfaces.ts
+++ b/packages/streamable-fs/src/interfaces.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import FileHandle from "./filehandle";
export interface IStreamableFS {
diff --git a/packages/streamable-fs/src/types.ts b/packages/streamable-fs/src/types.ts
index 1f3ccf414..a2c543b5d 100644
--- a/packages/streamable-fs/src/types.ts
+++ b/packages/streamable-fs/src/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export type File = {
filename: string;
size: number;
diff --git a/packages/theme/README.md b/packages/theme/README.md
new file mode 100644
index 000000000..e69de29bb
diff --git a/packages/theme/src/css.ts b/packages/theme/src/css.ts
index 7bc4f5ce5..3d61b1c02 100644
--- a/packages/theme/src/css.ts
+++ b/packages/theme/src/css.ts
@@ -1,11 +1,29 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export function removeCss(id: string) {
- var link = document.getElementById(id);
+ const link = document.getElementById(id);
if (link) link.remove();
}
export function injectCssSrc(id: string, src: string) {
- var head = document.head;
- var link = document.createElement("link");
+ const head = document.head;
+ const link = document.createElement("link");
link.id = id;
link.type = "text/css";
@@ -16,24 +34,22 @@ export function injectCssSrc(id: string, src: string) {
}
export function injectCss(rules: string) {
- let variableCss = document.getElementById("variables");
- let head = document.getElementsByTagName("head")[0];
+ const variableCss = document.getElementById("variables");
+ const head = document.getElementsByTagName("head")[0];
if (variableCss) {
head.removeChild(variableCss);
}
- let css = document.createElement("style");
+ const css = document.createElement("style");
css.type = "text/css";
css.id = "variables";
- // Support for IE
- if ("styleSheet" in css) (css as any).styleSheet.cssText = rules;
// Support for the rest
- else css.appendChild(document.createTextNode(rules));
+ css.appendChild(document.createTextNode(rules));
head.insertBefore(css, getRootStylesheet());
}
function getRootStylesheet() {
- for (let sty of document.getElementsByTagName("style")) {
+ for (const sty of document.getElementsByTagName("style")) {
if (sty.innerHTML.includes("#root")) {
return sty;
}
@@ -42,7 +58,7 @@ function getRootStylesheet() {
}
export function changeSvgTheme(newAccent: string) {
- var nodes = document.querySelectorAll('*[fill="#0560ff"]');
- for (var n = 0; n < nodes.length; ++n)
+ const nodes = document.querySelectorAll('*[fill="#0560ff"]');
+ for (let n = 0; n < nodes.length; ++n)
nodes[n].setAttribute("fill", newAccent);
}
diff --git a/packages/theme/src/index.ts b/packages/theme/src/index.ts
index 9aec7ed78..4b9df5c8e 100644
--- a/packages/theme/src/index.ts
+++ b/packages/theme/src/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
export * from "./theme/accents";
export * from "./themeprovider";
export * from "./theme";
diff --git a/packages/theme/src/theme/accents.ts b/packages/theme/src/theme/accents.ts
index 6a7c87b93..c699dedfa 100644
--- a/packages/theme/src/theme/accents.ts
+++ b/packages/theme/src/theme/accents.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
const accents = {
orange: "#FF5722",
yellow: "#FFA000",
diff --git a/packages/theme/src/theme/colorscheme/dark.ts b/packages/theme/src/theme/colorscheme/dark.ts
index 68e999f5d..5ede05b44 100644
--- a/packages/theme/src/theme/colorscheme/dark.ts
+++ b/packages/theme/src/theme/colorscheme/dark.ts
@@ -1,6 +1,24 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import tinycolor from "tinycolor2";
import { SchemeColors } from ".";
-import { getStaticColors, StaticColors } from "./static";
+import { getStaticColors } from "./static";
export function getDarkScheme(accent: string): SchemeColors {
return {
diff --git a/packages/theme/src/theme/colorscheme/index.ts b/packages/theme/src/theme/colorscheme/index.ts
index 051f9a6d1..0b8556f31 100644
--- a/packages/theme/src/theme/colorscheme/index.ts
+++ b/packages/theme/src/theme/colorscheme/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { getDarkScheme } from "./dark";
import { getLightScheme } from "./light";
import { StaticColors } from "./static";
diff --git a/packages/theme/src/theme/colorscheme/light.ts b/packages/theme/src/theme/colorscheme/light.ts
index 648fcaa83..3afb07f83 100644
--- a/packages/theme/src/theme/colorscheme/light.ts
+++ b/packages/theme/src/theme/colorscheme/light.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import tinycolor from "tinycolor2";
import { SchemeColors } from ".";
import { getStaticColors } from "./static";
diff --git a/packages/theme/src/theme/colorscheme/static.ts b/packages/theme/src/theme/colorscheme/static.ts
index 4ac1b2c0f..a41cd0540 100644
--- a/packages/theme/src/theme/colorscheme/static.ts
+++ b/packages/theme/src/theme/colorscheme/static.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import tinycolor from "tinycolor2";
export type StaticColors = {
diff --git a/packages/theme/src/theme/font/fontsize.ts b/packages/theme/src/theme/font/fontsize.ts
index 5022cddb3..7ecd3e0f8 100644
--- a/packages/theme/src/theme/font/fontsize.ts
+++ b/packages/theme/src/theme/font/fontsize.ts
@@ -1,4 +1,22 @@
-export function getFontSizes(scale?: number): FontSizes {
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+export function getFontSizes(): FontSizes {
return {
heading: "1.5rem",
subheading: "1.2rem",
@@ -8,7 +26,7 @@ export function getFontSizes(scale?: number): FontSizes {
body: "0.8rem",
menu: "0.8rem",
subBody: "0.750rem",
- code: "0.9rem",
+ code: "0.9rem"
};
}
diff --git a/packages/theme/src/theme/font/index.ts b/packages/theme/src/theme/font/index.ts
index ba77f1d93..efc93d630 100644
--- a/packages/theme/src/theme/font/index.ts
+++ b/packages/theme/src/theme/font/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { FontSizes, getFontSizes } from "./fontsize";
const SANS_FONT_STACK = [
diff --git a/packages/theme/src/theme/index.ts b/packages/theme/src/theme/index.ts
index a6583ccfc..bd67f754a 100644
--- a/packages/theme/src/theme/index.ts
+++ b/packages/theme/src/theme/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { getColors, SchemeColors } from "./colorscheme";
import { variants } from "./variants";
import { FontConfig, getFontConfig } from "./font";
@@ -25,7 +43,7 @@ export type Theme = {
typeof variants;
class ThemeFactory {
- transform(type: Transformers, theme: any) {
+ transform(type: Transformers, theme: Theme) {
const factory = new TransformerFactory();
return factory.construct(type, theme);
}
diff --git a/packages/theme/src/theme/transformer/css.ts b/packages/theme/src/theme/transformer/css.ts
index c41fe2e02..6ad62c323 100644
--- a/packages/theme/src/theme/transformer/css.ts
+++ b/packages/theme/src/theme/transformer/css.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { Theme } from "..";
import { SchemeColors } from "../colorscheme";
diff --git a/packages/theme/src/theme/transformer/index.ts b/packages/theme/src/theme/transformer/index.ts
index 149a5af6f..8b921ffde 100644
--- a/packages/theme/src/theme/transformer/index.ts
+++ b/packages/theme/src/theme/transformer/index.ts
@@ -1,12 +1,31 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+import { Theme } from "..";
import css from "./css";
const transformers = {
- css: css,
+ css: css
};
export type Transformers = keyof typeof transformers;
export class TransformerFactory {
- construct(type: Transformers, theme: any) {
+ construct(type: Transformers, theme: Theme) {
return transformers[type](theme);
}
}
diff --git a/packages/theme/src/theme/types.ts b/packages/theme/src/theme/types.ts
index 968b61a11..735de59a8 100644
--- a/packages/theme/src/theme/types.ts
+++ b/packages/theme/src/theme/types.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { ColorSchemes } from "./colorscheme";
export type ThemeConfig = {
diff --git a/packages/theme/src/theme/variants/button.ts b/packages/theme/src/theme/variants/button.ts
index 95f5e4e31..28def3ce4 100644
--- a/packages/theme/src/theme/variants/button.ts
+++ b/packages/theme/src/theme/variants/button.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SxStyleProp } from "@streetwriters/rebass";
const defaultVariant: SxStyleProp = {
diff --git a/packages/theme/src/theme/variants/flex.ts b/packages/theme/src/theme/variants/flex.ts
index 9f5139040..c9c16a722 100644
--- a/packages/theme/src/theme/variants/flex.ts
+++ b/packages/theme/src/theme/variants/flex.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SxStyleProp } from "@streetwriters/rebass";
type FlexDirection = "row" | "column";
diff --git a/packages/theme/src/theme/variants/index.ts b/packages/theme/src/theme/variants/index.ts
index 5088b046d..b2ada5ddc 100644
--- a/packages/theme/src/theme/variants/index.ts
+++ b/packages/theme/src/theme/variants/index.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { buttonVariants } from "./button";
import { inputVariants } from "./input";
import { textVariants } from "./text";
diff --git a/packages/theme/src/theme/variants/input.ts b/packages/theme/src/theme/variants/input.ts
index 38675d2d7..ae0ab4f2d 100644
--- a/packages/theme/src/theme/variants/input.ts
+++ b/packages/theme/src/theme/variants/input.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SxStyleProp } from "@streetwriters/rebass";
const defaultVariant: SxStyleProp = {
diff --git a/packages/theme/src/theme/variants/text.ts b/packages/theme/src/theme/variants/text.ts
index 24228a16e..b87750598 100644
--- a/packages/theme/src/theme/variants/text.ts
+++ b/packages/theme/src/theme/variants/text.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import { SxStyleProp } from "@streetwriters/rebass";
const defaultVariant: SxStyleProp = {
diff --git a/packages/theme/src/themeprovider.ts b/packages/theme/src/themeprovider.ts
index 89c83fdd6..bca53d930 100644
--- a/packages/theme/src/themeprovider.ts
+++ b/packages/theme/src/themeprovider.ts
@@ -1,3 +1,21 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
import ThemeFactory from "./theme";
import { ThemeConfig } from "./theme/types";
import { injectCss } from "./css";
diff --git a/resources/license-header.js b/resources/license-header.js
new file mode 100644
index 000000000..053987d76
--- /dev/null
+++ b/resources/license-header.js
@@ -0,0 +1,17 @@
+/* This file is part of the Notesnook project (https://notesnook.com/)
+ *
+ * Copyright (C) 2022 Streetwriters (Private) Limited
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */