Showing preview only (304K chars total). Download the full file or copy to clipboard to get everything.
Repository: klimeryk/recalendar.js
Branch: main
Commit: e2c5714f529b
Files: 114
Total size: 273.5 KB
Directory structure:
gitextract_cdadp12_/
├── .eslintrc.cjs
├── .github/
│ └── FUNDING.yml
├── .gitignore
├── .nvmrc
├── .prettierrc
├── LICENSE
├── README.md
├── SCREENSHOTS.md
├── TRANSLATIONS.md
├── create.html
├── package.json
├── public/
│ ├── faq.html
│ ├── features.html
│ ├── index.html
│ └── robots.txt
├── src/
│ ├── app.css
│ ├── components/
│ │ ├── external-link.jsx
│ │ ├── pdf-preview-card.jsx
│ │ ├── pdf-preview.jsx
│ │ └── pdf-progress.jsx
│ ├── config/
│ │ ├── dayjs.js
│ │ └── i18n.js
│ ├── configuration-form/
│ │ ├── configuration-selector.jsx
│ │ ├── items-list.jsx
│ │ ├── itinerary.jsx
│ │ ├── sortable-item.jsx
│ │ ├── sortable-itinerary-row.jsx
│ │ ├── special-dates.jsx
│ │ └── toggle-accordion-item.jsx
│ ├── configuration.jsx
│ ├── index.css
│ ├── index.jsx
│ ├── lib/
│ │ ├── attachments.js
│ │ ├── base64.js
│ │ ├── config-compat.js
│ │ ├── date.js
│ │ ├── device-utils.js
│ │ ├── id-utils.js
│ │ ├── itinerary-utils.js
│ │ ├── paths.js
│ │ ├── pdf.js
│ │ └── special-dates-utils.js
│ ├── loader.jsx
│ ├── locales/
│ │ ├── cs/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── da/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── de/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── en/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── es/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── fr/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── he/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── hr/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── hu/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── it/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── nb/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── nl/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── pl/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── pt-br/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── sl/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ ├── sv/
│ │ │ ├── app.json
│ │ │ ├── config.json
│ │ │ └── pdf.json
│ │ └── tr/
│ │ ├── app.json
│ │ ├── config.json
│ │ └── pdf.json
│ ├── navigation.jsx
│ ├── pdf/
│ │ ├── components/
│ │ │ ├── header.jsx
│ │ │ ├── itinerary.jsx
│ │ │ └── mini-calendar.jsx
│ │ ├── config.js
│ │ ├── lib/
│ │ │ ├── fonts.js
│ │ │ └── links.js
│ │ ├── pages/
│ │ │ ├── day.jsx
│ │ │ ├── last.jsx
│ │ │ ├── month-overview.jsx
│ │ │ ├── week-overview.jsx
│ │ │ ├── week-retrospective.jsx
│ │ │ └── year-overview.jsx
│ │ ├── recalendar.jsx
│ │ ├── styles.js
│ │ └── utils.js
│ └── worker/
│ └── pdf.worker.js
├── tsconfig.json
├── tsconfig.node.json
└── vite.config.ts
================================================
FILE CONTENTS
================================================
================================================
FILE: .eslintrc.cjs
================================================
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:react/recommended',
'plugin:import/recommended',
'prettier',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh', 'react'],
settings: {
'import/resolver': {
typescript: {
project: __dirname,
},
},
},
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'linebreak-style': ['error', 'unix'],
'semi': ['error', 'always'],
'array-bracket-spacing': ['error', 'always'],
'brace-style': ['error', '1tbs'],
'camelcase': 'error',
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': 'error',
'comma-style': 'error',
'computed-property-spacing': ['error', 'always'],
'constructor-super': 'error',
'consistent-return': 'off',
'curly': 'error',
'dot-notation': 'error',
'eqeqeq': ['error', 'allow-null'],
'eol-last': 'error',
'func-call-spacing': 'error',
'indent': ['error', 'tab', { 'SwitchCase': 1 }],
'jsx-quotes': ['error', 'prefer-double'],
'key-spacing': 'error',
'keyword-spacing': 'error',
'max-len': ['error', { 'code': 105 }],
'new-cap': ['error', { 'capIsNew': false, 'newIsCap': true }],
'no-cond-assign': 'error',
'no-const-assign': 'error',
'no-console': 'warn',
'no-debugger': 'error',
'no-dupe-args': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-duplicate-imports': 'error',
'no-else-return': 'error',
'no-empty': ['error', { 'allowEmptyCatch': true }],
'no-extra-semi': 'error',
'no-fallthrough': 'off',
'no-lonely-if': 'error',
'no-mixed-requires': 'off',
'no-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': ['error', { 'max': 1 }],
'no-multi-spaces': 'error',
'no-negated-in-lhs': 'error',
'no-nested-ternary': 'error',
'no-new': 'error',
'no-process-exit': 'error',
'no-prototype-builtins': 'off',
'no-redeclare': 'error',
'no-shadow': 'error',
'no-spaced-func': 'error',
'no-trailing-spaces': 'error',
'no-undef': 'error',
'no-underscore-dangle': 'off',
'no-unreachable': 'error',
'no-unused-vars': 'error',
'no-var': 'error',
'object-curly-spacing': ['error', 'always'],
'one-var': 'off',
'operator-linebreak': [
'error',
'after',
{
'overrides': {
'?': 'before',
':': 'before'
}
}
],
'padded-blocks': ['error', 'never'],
'prefer-const': 'error',
'quote-props': ['error', 'as-needed'],
'quotes': ['error', 'single', 'avoid-escape'],
'semi-spacing': 'error',
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': [
'error',
{
'anonymous': 'never',
'asyncArrow': 'always',
'named': 'never'
}
],
'space-in-parens': ['error', 'always'],
'space-infix-ops': ['error', { 'int32Hint': false }],
'space-unary-ops': [
'error',
{
'overrides': {
'!': true
}
}
],
'react/jsx-curly-spacing': [2, 'always'],
'react/jsx-no-duplicate-props': 2,
'react/jsx-no-target-blank': 2,
'react/jsx-no-undef': 2,
'react/jsx-tag-spacing': 2,
'react/jsx-uses-react': 2,
'react/jsx-uses-vars': 2,
'react/no-danger': 2,
'react/no-deprecated': 2,
'react/no-did-mount-set-state': 2,
'react/no-did-update-set-state': 2,
'react/no-is-mounted': 2,
'react/no-string-refs': 2,
'react/prefer-es6-class': 2,
'react/react-in-jsx-scope': 2,
'react-hooks/rules-of-hooks': 2,
'react-hooks/exhaustive-deps': 1,
'import/order': [
'error',
{
'groups': ['builtin', 'external', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
'alphabetize': {
'order': 'asc',
'caseInsensitive': true
}
}
]
},
}
================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms
github: [klimeryk]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: klimeryk
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
================================================
FILE: .gitignore
================================================
/node_modules
/dist
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
================================================
FILE: .nvmrc
================================================
18.*
================================================
FILE: .prettierrc
================================================
useTabs: true
tabWidth: 2
printWidth: 80
singleQuote: true
bracketSpacing: true
parenSpacing: true
jsxBracketSameLine: false
semi: true
================================================
FILE: LICENSE
================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 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 Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
================================================
FILE: README.md
================================================
# ReCalendar
### Highly customizable calendar for ReMarkable tablets
ReCalendar allows you to generate your own, personalized calendar right in your browser. You can view the live, production version at https://recalendar.me/.
It is the continuation of my previous efforts: https://github.com/klimeryk/recalendar. Although, basically all of the code had to be rewritten as I'm using a different PDF library, CSS engine, language, etc.
## Features
See https://recalendar.me/features for a full list with screenshots.
- Optimized for the [ReMarkable 2 tablet](https://remarkable.com/store/remarkable-2) (should work with version 1 as well) to use the full space available and minimize screen refreshes.
- No hacks needed - the generated PDF is a normal file, with links, etc. that you can simply upload normally to your tablet.
- Heavy use of links to allow quick and easy navigation.
- Lots of easy configuration options to tailor the calendar to your needs - plus access to the source code for even more advanced customization.
- Easily switch to any locale supported by PHP.
- Add extra pages to all or selected days of the week to suit your needs.
- Provide a list of special dates (anniversaries, birthdays, etc.) and let ReCalendar embed them into your personalized calendar - on monthly views, weekly overviews and finally, day entries.
- Track your habits monthly.
- Start the "year" on arbitrary month (can be useful for tracking academic years, etc.).
## Quickstart for developers/contributors
[Vite](https://vitejs.dev/) is used for development. Make sure you use `nvm` or a compatible solution to use the correct Node version.
```
nvm use
npm install
npm run dev
```
## Known issues
See the [FAQ](https://recalendar.me/faq) and [the open issues on GitHub](https://github.com/klimeryk/recalendar.js/issues).
## License
[GNU AGPLv3 License](https://github.com/klimeryk/recalendar.js/blob/main/LICENSE). In particular, this means that you can do what you want with this code, but *you have to publish your changes with the same license*. Please consider submitting a PR, if you have an idea for a great improvement! 🙏 My main motivation was to scratch my own itch, but as a result I might have missed your use case so I'm happy to hear how this project can be improved 🙇
================================================
FILE: SCREENSHOTS.md
================================================
<img width="460" alt="Screenshot 2021-12-28 at 19 21 53" src="https://user-images.githubusercontent.com/3392497/147599973-544bf9d9-f77f-4559-9e18-a278c1b4fe7d.png">
<img width="460" alt="Screenshot 2021-12-28 at 19 21 53" src="https://user-images.githubusercontent.com/3392497/147600349-77188ea9-5166-40ec-9213-5ed2989d3e0c.png">
<img width="460" alt="Screenshot 2021-12-28 at 19 21 53" src="https://user-images.githubusercontent.com/3392497/147600647-5547ea30-73ed-465a-bed6-b6ff88048652.png">
<img width="508" alt="Screenshot 2021-12-28 at 19 42 08" src="https://user-images.githubusercontent.com/3392497/147601485-fefb8ab1-6bb8-4e05-9502-b64c7198b5fa.png">
<img width="702" alt="Screenshot 2021-12-28 at 19 43 17" src="https://user-images.githubusercontent.com/3392497/147601560-915ea117-e689-4838-b064-68412a4fa464.png">
<img width="569" alt="Screenshot 2021-12-28 at 19 45 24" src="https://user-images.githubusercontent.com/3392497/147601689-9fb0999b-a1a5-485e-84aa-d0c2633d11dd.png">
<img width="741" alt="Screenshot 2021-12-28 at 19 46 30" src="https://user-images.githubusercontent.com/3392497/147601756-0998062f-d133-43b0-b643-98d925264b69.png">
<img width="741" alt="Screenshot 2021-12-28 at 19 47 29" src="https://user-images.githubusercontent.com/3392497/147601817-743f0ce0-488a-4744-bfcf-4f956e80ef53.png">
================================================
FILE: TRANSLATIONS.md
================================================
## How to translate ReCalendar to your language
### If you're not a developer
- Grab the `*.json` files from this folder: https://github.com/klimeryk/recalendar.js/tree/master/src/locales/en
- They contain the strings that need to be translated to your language.
- The format is simple: `"key": "value"`. Key should _not_ be translated, only `value`.
- [Check for existing issues for your language](https://github.com/klimeryk/recalendar.js/labels/language%20request) or open a new one and share the files there.
### For developers
- Copy the `en` folder from https://github.com/klimeryk/recalendar.js/tree/master/src/locales/ and rename it to the appropriate locale. It has to match the locale that [day.js](https://day.js.org/docs/en/i18n/i18n) supports. The list is available [here](https://github.com/iamkun/dayjs/tree/dev/src/locale).
- Translate the strings in each `*.json` file, as described in the above section.
- Add your language to [the English `app.json` file, `language` section](https://github.com/klimeryk/recalendar.js/blob/master/src/locales/en/app.json). Add it as you'd write it in _your_ language. See the existing examples there. So, for the Polish language I'd put `Polski`, _not_ `Polish`. This follows [best practices](https://ux.stackexchange.com/a/37025/45864) for language selectors.
- You should now be able to see the language in your local, development version.
- Check the console for any warnings or errors if the language is not visible or not working.
================================================
FILE: create.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="description"
content="Create your personalized calendar PDF for ReMarkable tablets"
/>
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ReCalendar - personalized calendar PDFs for ReMarkable tablets</title>
</head>
<body>
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app - but it's worth it! The PDF is generated in your browser, no data is sent to the server.</noscript>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
================================================
FILE: package.json
================================================
{
"name": "recalendar.js",
"private": true,
"version": "2.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@dnd-kit/core": "^6.1.0",
"@dnd-kit/sortable": "^8.0.0",
"@react-pdf/renderer": "^4.0.0",
"bootstrap": "^5.3.3",
"dayjs": "^1.11.11",
"file-saver": "^2.0.5",
"i18next": "^23.11.5",
"i18next-browser-languagedetector": "^8.0.0",
"ical.js": "^2.0.1",
"nanoid": "^5.0.7",
"pdf-lib": "^1.17.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-bootstrap": "^2.10.2",
"react-dom": "^18.2.0",
"react-i18next": "^14.1.2"
},
"devDependencies": {
"@types/node": "^20.14.5",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"prettier": "^3.3.2",
"typescript": "^5.2.2",
"vite": "^5.2.0",
"vite-plugin-i18next-loader": "^2.0.12"
}
}
================================================
FILE: public/faq.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<title>ReCalendar - Frequently Asked Questions</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="container-fluid">
<a href="/" class="navbar-brand">ReCalendar</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="navbarSupportedContent">
<div class="me-auto navbar-nav nav-pills">
<div class="nav-item">
<a href="/" class="nav-link">Home</a>
</div>
<div class="nav-item">
<a href="/create" class="nav-link">Create your calendar</a>
</div>
<div class="nav-item">
<a href="/features" aria-current="page" class="nav-link"
>Features</a
>
</div>
<div class="nav-item">
<a href="/faq" class="active nav-link">FAQ</a>
</div>
</div>
</div>
</div>
</nav>
<div class="mt-3 container">
<div class="row">
<div class="col">
<h4>FAQ</h4>
<ul>
<li>
<b>It's slow to generate the full calendar</b> It's a trade-off -
all the work is done in your browser (your data is safe with
you!), but the speed depends on your device. Make sure your
browser is up-to-date and maybe close some tabs ;) You most likely
will only need to generate the full calendar once a year, so I
think it's a fair trade-off.
</li>
<li>
<b>Do you support device X?</b> Not yet, but that's because I only
have a ReMarkable tablet! Please
<a
href="https://github.com/klimeryk/recalendar.js/issues/"
target="_blank"
rel="noopener noreferrer"
>open a new issue on GitHub</a
>
with the details of your device and I'll try to add support for
it.
</li>
<li>
<b>My language is not supported</b> Please
<a
href="https://github.com/klimeryk/recalendar.js/labels/language%20request"
target="_blank"
rel="noopener noreferrer"
>check on GitHub</a
>
if there's an open issue tracking your language. Upvote it to
record your interest. Or better yet -
<a
href="https://github.com/klimeryk/recalendar.js/blob/master/TRANSLATIONS.md"
target="_blank"
rel="noopener noreferrer"
>help translate it</a
>!
</li>
<li>
<b>Where do I report issues?</b> Please do it on the
<a
href="https://github.com/klimeryk/recalendar.js/"
target="_blank"
rel="noopener noreferrer"
>GitHub project</a
>.
</li>
</ul>
</div>
</div>
<div class="row">
<div class="col">
<footer class="mb-3">
<div class="text-muted text-center">
Created by
<a
href="https://klimer.eu/"
target="_blank"
rel="noopener noreferrer"
>Igor Klimer</a
>.
</div>
</footer>
</div>
</div>
</div>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"
></script>
</body>
</html>
================================================
FILE: public/features.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<title>ReCalendar - Features</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="container-fluid">
<a href="/" class="navbar-brand">ReCalendar</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse" id="navbarSupportedContent">
<div class="me-auto navbar-nav nav-pills">
<div class="nav-item">
<a href="/" class="nav-link">Home</a>
</div>
<div class="nav-item">
<a href="/create" class="nav-link">Create your calendar</a>
</div>
<div class="nav-item">
<a href="/features" aria-current="page" class="active nav-link"
>Features</a
>
</div>
<div class="nav-item">
<a href="/faq" class="nav-link">FAQ</a>
</div>
</div>
</div>
</div>
</nav>
<div class="my-3 container">
<div class="row-cols-1 row-cols-sm-2 row-cols-md-4 row">
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147599973-544bf9d9-f77f-4559-9e18-a278c1b4fe7d.png"
alt="ReCalendar on ReMarkable tablet"
/>
<div class="card-body">
<div class="card-title h5">Optimized for ReMarkable</div>
<p class="card-text">
Use the full space available. Minimize screen refreshes thanks
to a simple and stable layout.
</p>
</div>
</div>
</div>
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147600349-77188ea9-5166-40ec-9213-5ed2989d3e0c.png"
alt="ReCalendar PDF on ReMarkable tablet"
/>
<div class="card-body">
<div class="card-title h5">No hacks needed</div>
<p class="card-text">
The generated PDF is a normal file, with links, etc. that you
can simply upload normally to your tablet.
</p>
</div>
</div>
</div>
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147600647-5547ea30-73ed-465a-bed6-b6ff88048652.png"
alt="Open Source Initiative logo"
/>
<div class="card-body">
<div class="card-title h5">
Free, privacy-first and open-source
</div>
<p class="card-text">
This service will always be free. Your calendar data never is
sent to our servers. You can view the full source code.
</p>
</div>
</div>
</div>
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147601485-fefb8ab1-6bb8-4e05-9502-b64c7198b5fa.png"
alt="Links across ReCalendar"
/>
<div class="card-body">
<div class="card-title h5">
Links for quick and easy navigation
</div>
<p class="card-text">
Everything that could is automatically cross-linked. Quickly
move from the month overview, to the given week, specific date.
Each day has a mini calendar to quickly navigate throughout the
current month as well.
</p>
</div>
</div>
</div>
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147601560-915ea117-e689-4838-b064-68412a4fa464.png"
alt="Screenshot of the configurator"
/>
<div class="card-body">
<div class="card-title h5">Make it yours</div>
<p class="card-text">
Using the intuitive configurator, you can customize ReCalendar
exactly to your needs.
</p>
</div>
</div>
</div>
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147601689-9fb0999b-a1a5-485e-84aa-d0c2633d11dd.png"
alt="ReCalendar in Polish language"
/>
<div class="card-body">
<div class="card-title h5">Full internationalization support</div>
<p class="card-text">
Select a different first day of the week. Pick a different first
month of the calendar. Create the calendar in your language. If
your language is not supported, please
<a
href="https://github.com/klimeryk/recalendar.js/issues/"
target="_blank"
rel="noopener noreferrer"
>open a new issue on GitHub</a
>.
</p>
</div>
</div>
</div>
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147601756-0998062f-d133-43b0-b643-98d925264b69.png"
alt="Special dates in ReCalendar"
/>
<div class="card-body">
<div class="card-title h5">Special dates</div>
<p class="card-text">
Highlight special dates in your calendar - birthdays,
anniversaries, holidays and other celebrations. They'll
automatically appear in many place to make sure you won't forget
about them!
</p>
</div>
</div>
</div>
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147601817-743f0ce0-488a-4744-bfcf-4f956e80ef53.png"
alt="Monthly overview showing habits table"
/>
<div class="card-body">
<div class="card-title h5">Track monthly habits</div>
<p class="card-text">
Special section on the month overview allows you to track any
habits you'd like to maintain.
</p>
</div>
</div>
</div>
<div class="mt-3 col">
<div class="card h-100">
<img
class="card-img-top"
src="https://user-images.githubusercontent.com/3392497/147795770-dc23c263-0bd6-423c-a238-f6ab9b77d137.png"
alt="PDF icon"
/>
<div class="card-body">
<div class="card-title h5">Customizations stay with you</div>
<p class="card-text">
When you generate your ReCalendar, the customizations you've
made are embedded in the PDF. So next year (or whenever you
want!), you can simply upload the same PDF, ReCalendar will
detect and automatically apply the same customizations. Tweak
them, if needed, and you can quickly generate a new calendar to
your liking!
</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<footer class="mb-3">
<div class="text-muted text-center">
Created by
<a
href="https://klimer.eu/"
target="_blank"
rel="noopener noreferrer"
>Igor Klimer</a
>.
</div>
</footer>
</div>
</div>
</div>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"
></script>
</body>
</html>
================================================
FILE: public/index.html
================================================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Create your personalized calendar PDF for ReMarkable tablets"
/>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3"
crossorigin="anonymous"
/>
<title>
ReCalendar - personalized calendar PDFs for ReMarkable tablets
</title>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<div class="container-fluid">
<a href="/" class="navbar-brand">ReCalendar</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon" />
</button>
<div class="navbar-collapse collapse" id="navbarSupportedContent">
<div class="me-auto navbar-nav nav-pills">
<div class="nav-item">
<a href="/" class="active nav-link">Home</a>
</div>
<div class="nav-item">
<a href="/create" class="nav-link">Create your calendar</a>
</div>
<div class="nav-item">
<a href="/features" class="nav-link">Features</a>
</div>
<div class="nav-item">
<a href="/faq" class="nav-link">FAQ</a>
</div>
</div>
</div>
</div>
</nav>
<div class="mt-3 container">
<div class="row">
<div class="col">
<div class="bg-light p-5 rounded-3 my-3">
<h1 class="display-5">ReCalendar</h1>
<p class="lead">
Create your personalized calendar PDF for ReMarkable tablets
</p>
<p>
ReCalendar is an open-source and free calendar generator for
<a
href="https://remarkable.com/?ref=recalendar"
target="_blank"
rel="noopener noreferrer"
>ReMarkable tablets</a
>. Through its easy to use interface you can customize the
calendar to your needs and then generate the PDF - all within your
browser. No data is sent to the server - your privacy matters to
me.
</p>
<a
href="/create"
role="button"
tabindex="0"
class="btn btn-primary btn-lg"
>Create your own for free now!</a
>
</div>
</div>
</div>
<div class="row">
<div class="col-md">
<div class="bg-light p-5 rounded-3 my-3">
<h2>Features</h2>
<ul>
<li>
<b>Optimized for the ReMarkable tablet</b> - use the full space
available. No hacks needed - the generated file is a normal PDF,
just upload it to your tablet normally.
</li>
<li>
<b>Navigate easily using links</b> - jump through time using
hyperlinks automatically embedded in the PDF.
</li>
<li>
<b>Highly customizable using a modern, easy to use UI</b> - no
need for any hacks, just configure the calendar in your browser.
Don't like weekly retrospectives? Disable them. Want to have a
different itinerary on Thursday? Have at it. Need an extra page
after Monday meetings? No problem.
</li>
<li>
<b>Locale-specific options</b> - the calendar has robust
internationalization support. You can easily select the first
day of the week and switch language to one of the built-in ones.
</li>
</ul>
<a
href="/features"
role="button"
tabindex="0"
class="btn btn-secondary btn-lg"
>See all the features</a
>
</div>
</div>
<div class="col-md">
<div class="bg-light p-5 rounded-3 my-3">
<h3>Learn more about the project</h3>
<ul>
<li>
<a
href="https://github.com/klimeryk/recalendar.js/"
target="_blank"
rel="noopener noreferrer"
>View the source code on GitHub</a
>
</li>
<li>
<a
href="https://github.com/klimeryk/recalendar/"
target="_blank"
rel="noopener noreferrer"
>Previous version using PHP (and requiring programming
knowledge)</a
>
</li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="col">
<footer class="mb-3">
<div class="text-muted text-center">
Created by
<a
href="https://klimer.eu/"
target="_blank"
rel="noopener noreferrer"
>Igor Klimer</a
>.
</div>
</footer>
</div>
</div>
</div>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js"
integrity="sha384-QJHtvGhmr9XOIpI6YVutG+2QOK9T+ZnN4kzFN1RtK3zEFEIsxhlmWl5/YESvpZ13"
crossorigin="anonymous"
></script>
</body>
</html>
================================================
FILE: public/robots.txt
================================================
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
================================================
FILE: src/app.css
================================================
html,
body,
#root {
height: 100%;
}
.input-group > .date-field {
width: 160px;
}
.special-date {
min-width: 120px;
}
.refresh-button {
bottom: 0;
z-index: 1050;
}
.language-select {
min-width: 150px;
}
.form-label {
margin-bottom: 0;
margin-top: 0.5rem;
}
button:not(:disabled).grab-handle {
cursor: move;
padding-left: 0;
}
.flex-basis-fit-content {
flex-basis: fit-content !important;
}
================================================
FILE: src/components/external-link.jsx
================================================
import PropTypes from 'prop-types';
import React from 'react';
export default function ExternalLink( { url, children } ) {
return (
<a href={ url } target="_blank" rel="noopener noreferrer">
{children}
</a>
);
}
ExternalLink.propTypes = {
children: PropTypes.element,
url: PropTypes.string.isRequired,
};
================================================
FILE: src/components/pdf-preview-card.jsx
================================================
import PropTypes from 'prop-types';
import React from 'react';
import Button from 'react-bootstrap/Button';
import Spinner from 'react-bootstrap/Spinner';
import Stack from 'react-bootstrap/Stack';
import { withTranslation } from 'react-i18next';
import PdfPreview from '~/components/pdf-preview';
import PdfProgress from '~/components/pdf-progress';
class PdfPreviewCard extends React.PureComponent {
renderPdfPreview() {
const { blobUrl, isGeneratingPdf, isGeneratingPreview, onDownload, t } =
this.props;
return (
<Stack direction="vertical" className="h-100">
<PdfPreview blobUrl={ blobUrl } title={ t( 'preview.viewer-title' ) } />
<Stack
direction="vertical"
gap={ 2 }
className="py-3 position-sticky bg-body refresh-button"
>
<Button
variant="secondary"
disabled={ isGeneratingPreview || isGeneratingPdf }
onClick={ onDownload }
>
{isGeneratingPdf ? (
<>
<Spinner
as="span"
animation="border"
size="sm"
role="status"
aria-hidden="true"
className="me-1"
/>
{t( 'preview.generating.full' )}
</>
) : (
t( 'configuration.button.download' )
)}
</Button>
{isGeneratingPdf && (
<PdfProgress expectedTime={ this.props.expectedTime } />
)}
</Stack>
</Stack>
);
}
renderNoPreview() {
const { t, isGeneratingPreview } = this.props;
if ( isGeneratingPreview ) {
return (
<div className="h-100 d-flex align-items-center justify-content-center">
<Spinner
animation="border"
role="status"
size="sm"
className="me-1"
/>
{t( 'preview.generating.preview' )}
</div>
);
}
return (
<Stack
direction="vertical"
className="h-100 d-flex align-items-center justify-content-center text-center"
>
<p className="lead">{t( 'preview.empty.title' )}</p>
<p>{t( 'preview.empty.subtitle' )}</p>
</Stack>
);
}
render() {
const { blobUrl, isGeneratingPreview } = this.props;
if ( blobUrl && ! isGeneratingPreview ) {
return this.renderPdfPreview();
}
return this.renderNoPreview();
}
}
PdfPreviewCard.propTypes = {
blobUrl: PropTypes.string,
expectedTime: PropTypes.number.isRequired,
isGeneratingPdf: PropTypes.bool.isRequired,
isGeneratingPreview: PropTypes.bool.isRequired,
onDownload: PropTypes.func.isRequired,
t: PropTypes.func.isRequired,
};
export default withTranslation( 'app' )( PdfPreviewCard );
================================================
FILE: src/components/pdf-preview.jsx
================================================
import PropTypes from 'prop-types';
import React from 'react';
const PdfPreview = ( { blobUrl, title } ) => {
return <iframe title={ title } src={ blobUrl } width="100%" height="100%" />;
};
PdfPreview.propTypes = {
blobUrl: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
};
export default PdfPreview;
================================================
FILE: src/components/pdf-progress.jsx
================================================
import PropTypes from 'prop-types';
import React from 'react';
import ProgressBar from 'react-bootstrap/ProgressBar';
const UPDATE_INTERVAL = 700;
class PdfProgress extends React.Component {
state = {
elapsedTime: 0,
};
componentDidMount() {
this.intervalId = setInterval( this.updateProgress, UPDATE_INTERVAL );
}
componentWillUnmount() {
clearInterval( this.intervalId );
}
updateProgress = () => {
this.setState( { elapsedTime: this.state.elapsedTime + UPDATE_INTERVAL } );
};
render() {
const progress = 100 * ( this.state.elapsedTime / this.props.expectedTime );
return <ProgressBar animated now={ progress } />;
}
}
PdfProgress.propTypes = {
expectedTime: PropTypes.number.isRequired,
};
export default PdfProgress;
================================================
FILE: src/config/dayjs.js
================================================
import dayjs from 'dayjs/esm';
import advancedFormat from 'dayjs/esm/plugin/advancedFormat';
import customParseFormat from 'dayjs/esm/plugin/customParseFormat';
import isoWeek from 'dayjs/esm/plugin/isoWeek';
import localeData from 'dayjs/esm/plugin/localeData';
import objectSupport from 'dayjs/esm/plugin/objectSupport';
import updateLocale from 'dayjs/esm/plugin/updateLocale';
import utc from 'dayjs/esm/plugin/utc';
import weekday from 'dayjs/esm/plugin/weekday';
dayjs.extend( advancedFormat );
dayjs.extend( customParseFormat );
dayjs.extend( isoWeek );
dayjs.extend( localeData );
dayjs.extend( objectSupport );
dayjs.extend( updateLocale );
dayjs.extend( utc );
dayjs.extend( weekday );
================================================
FILE: src/config/i18n.js
================================================
import dayjs from 'dayjs/esm';
import dayjsLocales from 'dayjs/locale.json';
export function i18nConfiguration( namespaces ) {
return {
debug: import.meta.env.DEV,
fallbackLng: 'en',
load: 'currentOnly',
supportedLngs: dayjsLocales.map( ( ( { key } ) => key ) ),
ns: namespaces,
lowerCaseLng: true,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
};
}
export function getFullySupportedLocales() {
const locales = Object.keys( import.meta.glob( '../locales/**/app.json', { eager: true } ) )
.map( ( file ) => file.match( /locales\/(.+)\/app\.json$/ )[ 1 ] );
const uniqueLocales = [ ...new Set( locales ) ];
// Make sure that English is first on the list
uniqueLocales.splice( uniqueLocales.indexOf( 'en' ), 1 );
uniqueLocales.unshift( 'en' );
return uniqueLocales;
}
export function getPartiallySupportedLocales() {
const fullySupportedLocales = getFullySupportedLocales();
return dayjsLocales
.filter( ( { key } ) => ! fullySupportedLocales.includes( key ) )
.sort( ( languageA, languageB ) => languageA.name.localeCompare( languageB.name ) );
}
const DAYJS_LOCALES = import.meta.glob( '../../node_modules/dayjs/esm/locale/*.js', { eager: true } );
export function handleLanguageChange( newLanguage, firstDayOfWeek = 1 ) {
// Hacky workaround until https://github.com/vitejs/vite/issues/14102 is fixed
const localeData = DAYJS_LOCALES[ `../../node_modules/dayjs/esm/locale/${newLanguage}.js` ];
dayjs.locale( newLanguage, localeData.default, false );
dayjs.locale( newLanguage );
dayjs.updateLocale( newLanguage, {
weekStart: firstDayOfWeek,
} );
}
================================================
FILE: src/configuration-form/configuration-selector.jsx
================================================
import PropTypes from 'prop-types';
import React from 'react';
import Alert from 'react-bootstrap/Alert';
import Button from 'react-bootstrap/Button';
import ButtonGroup from 'react-bootstrap/ButtonGroup';
import Form from 'react-bootstrap/Form';
import OverlayTrigger from 'react-bootstrap/OverlayTrigger';
import Stack from 'react-bootstrap/Stack';
import Tooltip from 'react-bootstrap/Tooltip';
import { withTranslation } from 'react-i18next';
import { getJsonAttachment } from '~/lib/attachments';
import { convertConfigToCurrentVersion } from '~/lib/config-compat';
import {
ITINERARY_ITEM,
ITINERARY_LINES,
ITINERARY_NEW_PAGE,
} from '~/lib/itinerary-utils';
import PdfConfig, { CONFIG_FILE } from '~/pdf/config';
const STATUS_EMPTY = 'EMPTY';
const STATUS_LOADING = 'LOADING';
const STATUS_ERROR = 'ERROR';
const STATUS_SUCCESS = 'SUCCESS';
const TEMPLATE_BASIC = 'basic';
const TEMPLATE_ADVANCED = 'advanced';
const TEMPLATE_BLANK = 'blank';
const TEMPLATE_MINIMALISTIC = 'minimalistic';
class ConfigurationSelector extends React.Component {
state = {
status: STATUS_EMPTY,
};
getDefaultFirstDayOfWeek() {
const config = new PdfConfig();
return config.firstDayOfWeek;
}
handleTemplateSelect = ( event ) => {
const { t } = this.props;
const configOverrides = {};
let dayOfWeek = this.getDefaultFirstDayOfWeek();
switch ( event.target.dataset.template ) {
case TEMPLATE_BASIC:
// The default config
break;
case TEMPLATE_ADVANCED:
configOverrides.dayItineraries = [ ...Array( 7 ).keys() ].map( () => {
const itinerary = {
dayOfWeek,
items: this.generateAdvancedDayItems( dayOfWeek ),
isEnabled: true,
};
dayOfWeek = ++dayOfWeek % 7;
return itinerary;
} );
configOverrides.weekRetrospectiveItinerary = [
{
type: ITINERARY_ITEM,
value: t( 'templates.advanced.retrospective.wins', {
ns: 'config',
} ),
},
{ type: ITINERARY_LINES, value: 7 },
{
type: ITINERARY_ITEM,
value: t( 'templates.advanced.retrospective.discoveries', {
ns: 'config',
} ),
},
{ type: ITINERARY_LINES, value: 7 },
{
type: ITINERARY_ITEM,
value: t( 'templates.advanced.retrospective.fails', {
ns: 'config',
} ),
},
{ type: ITINERARY_LINES, value: 15 },
];
break;
case TEMPLATE_BLANK:
configOverrides.specialDates = [];
configOverrides.habits = [];
configOverrides.monthItinerary = [];
configOverrides.todos = [];
configOverrides.dayItineraries = [ ...Array( 7 ).keys() ].map( () => {
const itinerary = {
dayOfWeek,
items: [],
isEnabled: true,
};
dayOfWeek = ++dayOfWeek % 7;
return itinerary;
} );
configOverrides.weekRetrospectiveItinerary = [];
break;
case TEMPLATE_MINIMALISTIC:
configOverrides.specialDates = [];
configOverrides.habits = [];
configOverrides.isMonthOverviewEnabled = false;
configOverrides.monthItinerary = [];
configOverrides.isWeekOverviewEnabled = true;
configOverrides.todos = [];
configOverrides.dayItineraries = [ ...Array( 7 ).keys() ].map( () => {
const itinerary = {
dayOfWeek,
items: [],
isEnabled: false,
};
dayOfWeek = ++dayOfWeek % 7;
return itinerary;
} );
configOverrides.isWeekRetrospectiveEnabled = false;
configOverrides.weekRetrospectiveItinerary = [];
break;
default:
return;
}
const config = new PdfConfig( configOverrides );
this.props.onConfigChange( config );
};
generateAdvancedDayItems( dayOfWeek ) {
const items = [];
for ( let i = 8; i <= 20; i += 2 ) {
items.push( {
type: ITINERARY_ITEM,
value: i.toString().padStart( 2, 0 ) + ':00',
} );
items.push( { type: ITINERARY_LINES, value: 2 } );
}
items.push( { type: ITINERARY_LINES, value: 20 } );
if ( dayOfWeek === 1 ) {
items.push( { type: ITINERARY_NEW_PAGE, value: '' } );
items.push( {
type: ITINERARY_ITEM,
value: this.props.t( 'templates.advanced.day.monday', {
ns: 'config',
} ),
} );
items.push( { type: ITINERARY_LINES, value: 50 } );
}
return items;
}
handleFileChange = ( event ) => {
this.setState( {
status: STATUS_LOADING,
} );
const file = event.target.files[ 0 ];
const reader = new FileReader();
reader.onload = this.handleFileLoad;
reader.readAsArrayBuffer( file );
};
handleFileLoad = async ( event ) => {
const attachment = await getJsonAttachment(
event.target.result,
CONFIG_FILE,
);
if ( ! attachment ) {
this.setState( {
status: STATUS_ERROR,
} );
return;
}
this.setState( {
status: STATUS_SUCCESS,
} );
const newConfig = new PdfConfig( convertConfigToCurrentVersion( attachment ) );
this.props.onConfigChange( newConfig );
};
renderStatusMessage() {
const { t } = this.props;
switch ( this.state.status ) {
case STATUS_LOADING:
return (
<Alert variant="info" className="mt-2 mb-0">
{t( 'configuration.selector.upload.loading' )}
</Alert>
);
case STATUS_ERROR:
return (
<Alert variant="danger" className="mt-2 mb-0">
{t( 'configuration.selector.upload.error' )}
</Alert>
);
case STATUS_SUCCESS:
return (
<Alert variant="success" className="mt-2 mb-0">
{t( 'configuration.selector.upload.success' )}
</Alert>
);
case STATUS_EMPTY:
default:
return null;
}
}
renderButton = ( { template, style } ) => {
const { t } = this.props;
return (
<OverlayTrigger
key={ template }
placement="bottom"
overlay={
<Tooltip>
{t( `configuration.selector.template.${template}.description` )}
</Tooltip>
}
>
<Button
variant={ style }
data-template={ template }
onClick={ this.handleTemplateSelect }
>
{t( `configuration.selector.template.${template}.label` )}
</Button>
</OverlayTrigger>
);
};
render() {
const { t } = this.props;
return (
<Stack>
<Form.Label>{t( 'configuration.selector.template.label' )}</Form.Label>
<ButtonGroup aria-label="Config templates">
{[
{ template: TEMPLATE_BASIC, style: 'info' },
{ template: TEMPLATE_ADVANCED, style: 'primary' },
{ template: TEMPLATE_BLANK, style: 'blank' },
{ template: TEMPLATE_MINIMALISTIC, style: 'dark' },
].map( this.renderButton )}
</ButtonGroup>
<Form.Group controlId="configurationFile" className="mt-3">
<Form.Label>{t( 'configuration.selector.upload.label' )}</Form.Label>
<Form.Control
type="file"
accept=".pdf"
onChange={ this.handleFileChange }
/>
{this.renderStatusMessage()}
</Form.Group>
</Stack>
);
}
}
ConfigurationSelector.propTypes = {
onConfigChange: PropTypes.func.isRequired,
t: PropTypes.func.isRequired,
};
export default withTranslation( [ 'app', 'config' ] )( ConfigurationSelector );
================================================
FILE: src/configuration-form/items-list.jsx
================================================
import {
DndContext,
closestCenter,
KeyboardSensor,
PointerSensor,
useSensor,
useSensors,
} from '@dnd-kit/core';
import {
SortableContext,
sortableKeyboardCoordinates,
verticalListSortingStrategy,
} from '@dnd-kit/sortable';
import PropTypes from 'prop-types';
import React from 'react';
import Accordion from 'react-bootstrap/Accordion';
import Alert from 'react-bootstrap/Alert';
import Button from 'react-bootstrap/Button';
import Stack from 'react-bootstrap/Stack';
import { useTranslation } from 'react-i18next';
import SortableItem from './sortable-item';
function ItemsList( props ) {
const { t } = useTranslation( 'app' );
const sensors = useSensors(
useSensor( PointerSensor ),
useSensor( KeyboardSensor, {
coordinateGetter: sortableKeyboardCoordinates,
} ),
);
function handleDragEnd( event ) {
const oldId = event.active.id;
const newId = event.over.id;
if ( oldId !== newId ) {
props.onDragEnd( { oldId, newId, field } );
}
}
function renderItem( { id, value } ) {
const { field, onChange, onRemove } = props;
return (
<SortableItem
key={ id }
id={ id }
value={ value }
onChange={ onChange }
onRemove={ onRemove }
field={ field }
/>
);
}
const { items, field, onAdd, title } = props;
return (
<Accordion.Item eventKey={ field }>
<Accordion.Header>{title}</Accordion.Header>
<Accordion.Body>
<Stack gap={ 2 }>
<DndContext
sensors={ sensors }
collisionDetection={ closestCenter }
onDragEnd={ handleDragEnd }
>
<SortableContext
items={ items }
strategy={ verticalListSortingStrategy }
>
{items.map( renderItem )}
{items.length === 0 && (
<Alert variant="secondary" className="mb-0">
{t( 'configuration.items-list.empty' )}
</Alert>
)}
</SortableContext>
</DndContext>
</Stack>
<Stack direction="horizontal" className="mt-3">
<Button
variant="outline-secondary"
onClick={ onAdd }
data-field={ field }
>
{t( 'configuration.items-list.button.item' )}
</Button>
</Stack>
</Accordion.Body>
</Accordion.Item>
);
}
ItemsList.propTypes = {
field: PropTypes.string.isRequired,
items: PropTypes.array.isRequired,
onAdd: PropTypes.func.isRequired,
onChange: PropTypes.func.isRequired,
onDragEnd: PropTypes.func.isRequired,
onRemove: PropTypes.func.isRequired,
title: PropTypes.string.isRequired,
};
export default ItemsList;
================================================
FILE: src/configuration-form/itinerary.jsx
================================================
import {
DndContext,
closestCenter,
KeyboardSensor,
PointerSensor,
useSensor,
useSensors,
} from '@dnd-kit/core';
import {
SortableContext,
sortableKeyboardCoordinates,
verticalListSortingStrategy,
} from '@dnd-kit/sortable';
import PropTypes from 'prop-types';
import React from 'react';
import Alert from 'react-bootstrap/Alert';
import Button from 'react-bootstrap/Button';
import ButtonGroup from 'react-bootstrap/ButtonGroup';
import Stack from 'react-bootstrap/Stack';
import { useTranslation } from 'react-i18next';
import SortableItineraryRow from './sortable-itinerary-row';
import { ITINERARY_ITEM, ITINERARY_LINES, ITINERARY_NEW_PAGE } from '~/lib/itinerary-utils';
function Itinerary( props ) {
const { t } = useTranslation( 'app' );
function handleDragEnd( event ) {
const oldId = event.active.id;
const newId = event.over.id;
if ( oldId !== newId ) {
props.onDragEnd( { oldId, newId, field } );
}
}
function renderRow( { id, value, type } ) {
return (
<SortableItineraryRow
key={ id }
field={ props.field }
id={ id }
type={ type }
value={ value }
onChange={ props.onChange }
onRemove={ props.onRemove }
/>
);
}
const { field, itinerary, onAdd, onCopy } = props;
const sensors = useSensors(
useSensor( PointerSensor ),
useSensor( KeyboardSensor, {
coordinateGetter: sortableKeyboardCoordinates,
} ),
);
return (
<>
<Stack gap={ 2 }>
<DndContext
sensors={ sensors }
collisionDetection={ closestCenter }
onDragEnd={ handleDragEnd }
>
<SortableContext
items={ itinerary }
strategy={ verticalListSortingStrategy }
>
{itinerary.map( renderRow )}
{itinerary.length === 0 && (
<Alert variant="secondary" className="mb-0">
{t( 'configuration.itinerary.empty' )}
</Alert>
)}
</SortableContext>
</DndContext>
</Stack>
<Stack direction="horizontal" className="mt-3" gap={ 3 }>
<ButtonGroup>
<Button
variant="outline-secondary"
onClick={ onAdd }
data-type={ ITINERARY_ITEM }
data-field={ field }
>
{t( 'configuration.itinerary.button.item' )}
</Button>
<Button
variant="outline-secondary"
onClick={ onAdd }
data-type={ ITINERARY_LINES }
data-field={ field }
>
{t( 'configuration.itinerary.button.lines' )}
</Button>
<Button
variant="outline-secondary"
onClick={ onAdd }
data-type={ ITINERARY_NEW_PAGE }
data-field={ field }
>
{t( 'configuration.itinerary.button.page' )}
</Button>
</ButtonGroup>
</Stack>
{onCopy && (
<Button
variant="outline-danger"
className="mt-3"
onClick={ onCopy }
data-field={ field }
>
{t( 'configuration.itinerary.button.copy' )}
</Button>
)}
</>
);
}
Itinerary.propTypes = {
field: PropTypes.string.isRequired,
itinerary: PropTypes.array.isRequired,
onAdd: PropTypes.func.isRequired,
onChange: PropTypes.func.isRequired,
onCopy: PropTypes.func,
onDragEnd: PropTypes.func.isRequired,
onRemove: PropTypes.func.isRequired,
};
export default Itinerary;
================================================
FILE: src/configuration-form/sortable-item.jsx
================================================
import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import PropTypes from 'prop-types';
import React from 'react';
import Button from 'react-bootstrap/Button';
import FormControl from 'react-bootstrap/FormControl';
import InputGroup from 'react-bootstrap/InputGroup';
import { useTranslation } from 'react-i18next';
function SortableItem( props ) {
const { t } = useTranslation( 'app' );
const { id, value, field, onChange } = props;
const { attributes, listeners, setNodeRef, transform, transition } =
useSortable( { id } );
const style = {
transform: CSS.Transform.toString( transform ),
transition,
};
function renderRemoveButton() {
const { onRemove } = props;
return (
<Button
variant="outline-danger"
onClick={ onRemove }
data-id={ id }
data-field={ field }
>
{t( 'configuration.items-list.button.remove' )}
</Button>
);
}
return (
<div ref={ setNodeRef } style={ style }>
<InputGroup>
<Button
className="grab-handle"
variant="link"
{ ...attributes }
{ ...listeners }
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
className="bi bi-grip-vertical"
viewBox="0 0 16 16"
>
{/* eslint-disable-next-line max-len */}
<path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
</svg>
</Button>
<FormControl
placeholder={ t( 'configuration.items-list.placeholder' ) }
value={ value }
onChange={ onChange }
data-field={ field }
data-id={ id }
required
/>
{renderRemoveButton()}
</InputGroup>
</div>
);
}
SortableItem.propTypes = {
field: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
onRemove: PropTypes.func.isRequired,
value: PropTypes.string.isRequired,
};
export default SortableItem;
================================================
FILE: src/configuration-form/sortable-itinerary-row.jsx
================================================
import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import PropTypes from 'prop-types';
import React from 'react';
import Button from 'react-bootstrap/Button';
import FloatingLabel from 'react-bootstrap/FloatingLabel';
import FormControl from 'react-bootstrap/FormControl';
import InputGroup from 'react-bootstrap/InputGroup';
import { useTranslation } from 'react-i18next';
import {
ITINERARY_ITEM,
ITINERARY_LINES,
ITINERARY_NEW_PAGE,
} from '~/lib/itinerary-utils';
function SortableItineraryRow( props ) {
const { t } = useTranslation( 'app' );
const { id, type, value, field, onChange } = props;
const { attributes, listeners, setNodeRef, transform, transition } =
useSortable( { id } );
const style = {
transform: CSS.Transform.toString( transform ),
transition,
};
function renderItem() {
return (
<FormControl
placeholder={ t( 'configuration.itinerary.placeholder.item' ) }
value={ value }
onChange={ onChange }
data-id={ id }
data-type={ ITINERARY_ITEM }
data-field={ props.field }
required
/>
);
}
function renderNewPage() {
return (
<InputGroup.Text className="flex-grow-1">
{t( 'configuration.itinerary.placeholder.page' )}
</InputGroup.Text>
);
}
function renderLines() {
return (
<FloatingLabel
className="flex-grow-1"
controlId={ id }
label={ t( 'configuration.itinerary.placeholder.lines' ) }
>
<FormControl
placeholder={ t( 'configuration.itinerary.placeholder.lines' ) }
type="number"
min={ 1 }
max={ 50 }
value={ value }
onChange={ onChange }
data-id={ id }
data-type={ ITINERARY_LINES }
data-field={ field }
required
/>
</FloatingLabel>
);
}
function renderRemoveButton() {
return (
<Button
variant="outline-danger"
onClick={ props.onRemove }
data-id={ id }
data-field={ field }
>
{t( 'configuration.itinerary.button.remove' )}
</Button>
);
}
function renderRow() {
switch ( type ) {
case ITINERARY_ITEM:
return renderItem();
case ITINERARY_NEW_PAGE:
return renderNewPage();
case ITINERARY_LINES:
default:
return renderLines();
}
}
return (
<div ref={ setNodeRef } style={ style }>
<InputGroup>
<Button
className="grab-handle"
variant="link"
{ ...attributes }
{ ...listeners }
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
className="bi bi-grip-vertical"
viewBox="0 0 16 16"
>
{/* eslint-disable-next-line max-len */}
<path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
</svg>
</Button>
{renderRow()}
{renderRemoveButton()}
</InputGroup>
</div>
);
}
SortableItineraryRow.propTypes = {
field: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
onRemove: PropTypes.func.isRequired,
type: PropTypes.string.isRequired,
value: PropTypes.oneOfType( [
PropTypes.string,
PropTypes.number,
] ).isRequired,
};
export default SortableItineraryRow;
================================================
FILE: src/configuration-form/special-dates.jsx
================================================
import dayjs from 'dayjs/esm';
import ICAL from 'ical.js';
import PropTypes from 'prop-types';
import React from 'react';
import Accordion from 'react-bootstrap/Accordion';
import Alert from 'react-bootstrap/Alert';
import Badge from 'react-bootstrap/Badge';
import Button from 'react-bootstrap/Button';
import Form from 'react-bootstrap/Form';
import FormControl from 'react-bootstrap/FormControl';
import InputGroup from 'react-bootstrap/InputGroup';
import ListGroup from 'react-bootstrap/ListGroup';
import Stack from 'react-bootstrap/Stack';
import { withTranslation } from 'react-i18next';
import { DATE_FORMAT, HOLIDAY_DAY_TYPE, EVENT_DAY_TYPE } from '~/lib/special-dates-utils';
const STATUS_EMPTY = 'EMPTY';
const STATUS_LOADING = 'LOADING';
const STATUS_ERROR = 'ERROR';
const STATUS_SUCCESS = 'SUCCESS';
// Disable strict mode for ical.js to allow slightly invalid ics files.
ICAL.design.strict = false;
class SpecialDates extends React.Component {
state = {
date: '',
value: '',
type: EVENT_DAY_TYPE,
icalType: EVENT_DAY_TYPE,
status: STATUS_EMPTY,
};
onChange = ( event ) => {
const { field } = event.target.dataset;
this.setState( { [ field ]: event.target.value } );
};
onAddClick = ( event ) => {
const date = dayjs( this.state.date, 'YYYY-MM-DD' );
const key = date.format( DATE_FORMAT );
const { value, type } = this.state;
this.props.onAdd( { date: key, value, type } );
this.setState( { date: '', value: '' } );
};
onFileLoad = ( event ) => {
try {
const jcalData = ICAL.parse( event.target.result );
const vcalendar = new ICAL.Component( jcalData );
const vevents = vcalendar.getAllSubcomponents( 'vevent' );
vevents.forEach( ( vevent ) => {
const ev = new ICAL.Event( vevent );
const startDate = dayjs( ev.startDate.toJSDate() );
const value = ev.summary;
if ( ev.isRecurring() ) {
const iter = ev.iterator();
let next;
while ( ( next = iter.next() ) ) {
if ( next.year < this.props.year ) {
continue;
} else if ( next.year > this.props.year ) {
break;
}
const date = dayjs( next.toJSDate() );
const key = date.format( DATE_FORMAT );
this.props.onAdd( { date: key, value, type: this.state.icalType } );
}
} else if ( startDate.year() === this.props.year ) {
const key = startDate.format( DATE_FORMAT );
this.props.onAdd( { date: key, value, type: this.state.icalType } );
}
} );
this.setState( {
status: STATUS_SUCCESS,
} );
} catch ( error ) {
this.setState( {
status: STATUS_ERROR,
} );
}
};
onFileChange = ( event ) => {
this.setState( {
status: STATUS_LOADING,
} );
const file = event.target.files[ 0 ];
const reader = new FileReader();
reader.onload = this.onFileLoad;
reader.readAsText( file );
};
getGroupedItems() {
return this.props.items.reduce( ( itemsSoFar, item ) => {
if ( ! itemsSoFar[ item.date ] ) {
itemsSoFar[ item.date ] = [];
}
itemsSoFar[ item.date ].push( item );
return itemsSoFar;
}, {} );
}
renderItem( groupedItems ) {
const ItemGroup = ( key ) => {
const { t } = this.props;
const items = groupedItems[ key ];
const date = dayjs( key, DATE_FORMAT );
return (
<ListGroup.Item key={ key }>
<Stack direction="horizontal" gap={ 3 }>
<b className="special-date">{date.format( 'MMMM DD' )}</b>
<ListGroup variant="flush" className="w-100">
{items.map( ( { id, value, type }, index ) => (
<ListGroup.Item key={ id } className="ps-0 pe-0">
<Stack direction="horizontal" gap={ 3 }>
<span>
<strong>
{t( 'configuration.special-dates.type.' + type )}:{' '}
</strong>
{value}
</span>
{this.renderRemoveButton( id )}
</Stack>
</ListGroup.Item>
) )}
</ListGroup>
</Stack>
</ListGroup.Item>
);
};
return ItemGroup;
}
renderItems( groupedItems ) {
const keys = Object.keys( groupedItems ).sort();
return <ListGroup>{keys.map( this.renderItem( groupedItems ) )}</ListGroup>;
}
renderRemoveButton( id ) {
const { onRemove, t } = this.props;
return (
<Button
className="ms-auto"
variant="outline-danger"
onClick={ onRemove }
data-field="specialDates"
data-id={ id }
>
{t( 'configuration.special-dates.button.remove' )}
</Button>
);
}
renderStatusMessage() {
const { t } = this.props;
switch ( this.state.status ) {
case STATUS_LOADING:
return (
<Alert variant="info" className="mt-2 mb-0">
{t( 'configuration.special-dates.upload.loading' )}
</Alert>
);
case STATUS_ERROR:
return (
<Alert variant="danger" className="mt-2 mb-0">
{t( 'configuration.special-dates.upload.error' )}
</Alert>
);
case STATUS_SUCCESS:
return (
<Alert variant="success" className="mt-2 mb-0">
{t( 'configuration.special-dates.upload.success' )}
</Alert>
);
case STATUS_EMPTY:
default:
return null;
}
}
renderTypeSelect = ( field ) => {
const { t, [ field ]: value } = this.props;
return (
<Form.Select
className="flex-grow-0 flex-basis-fit-content"
value={ value }
data-field={ field }
onChange={ this.onChange }
aria-label="Default select example"
>
<option value={ EVENT_DAY_TYPE }>
{t( 'configuration.special-dates.type.' + EVENT_DAY_TYPE )}
</option>
<option value={ HOLIDAY_DAY_TYPE }>
{t( 'configuration.special-dates.type.' + HOLIDAY_DAY_TYPE )}
</option>
</Form.Select>
);
};
render() {
const { date, value } = this.state;
const { t } = this.props;
const groupedItems = this.getGroupedItems();
const numberOfItems = Object.keys( groupedItems ).length;
return (
<Accordion.Item eventKey="specialDates">
<Accordion.Header>
<Stack direction="horizontal" className="w-100">
{t( 'configuration.special-dates.title' )}
<Badge bg="info" className="ms-auto me-3">
{numberOfItems}
</Badge>
</Stack>
</Accordion.Header>
<Accordion.Body>
<p>{t( 'configuration.special-dates.description' )}</p>
<Stack gap={ 2 }>
{numberOfItems > 0 ? (
this.renderItems( groupedItems )
) : (
<Alert variant="secondary" className="mb-0">
{t( 'configuration.special-dates.empty' )}
</Alert>
)}
</Stack>
<Stack direction="horizontal" className="mt-3">
<InputGroup>
{this.renderTypeSelect( 'type' )}
<FormControl
className="flex-grow-0 date-field"
value={ date }
onChange={ this.onChange }
type="date"
data-field="date"
/>
<FormControl
placeholder={ t( 'configuration.special-dates.placeholder' ) }
value={ value }
onChange={ this.onChange }
data-field="value"
/>
<Button
variant="outline-secondary"
disabled={ ! date || ! value }
onClick={ this.onAddClick }
>
{t( 'configuration.special-dates.button.item' )}
</Button>
</InputGroup>
</Stack>
<Stack className="mt-3">
<Form.Label htmlFor="icsFile">
{t( 'configuration.special-dates.upload.label' )}
</Form.Label>
<Stack direction="horizontal" gap={ 2 }>
{this.renderTypeSelect( 'icalType' )}
<Form.Control
id="icsFile"
type="file"
accept=".ics"
onChange={ this.onFileChange }
/>
</Stack>
{this.renderStatusMessage()}
</Stack>
</Accordion.Body>
</Accordion.Item>
);
}
}
SpecialDates.propTypes = {
year: PropTypes.number.isRequired,
items: PropTypes.array.isRequired,
onAdd: PropTypes.func.isRequired,
onRemove: PropTypes.func.isRequired,
t: PropTypes.func.isRequired,
};
export default withTranslation( 'app' )( SpecialDates );
================================================
FILE: src/configuration-form/toggle-accordion-item.jsx
================================================
import PropTypes from 'prop-types';
import React from 'react';
import Accordion from 'react-bootstrap/Accordion';
import Badge from 'react-bootstrap/Badge';
import Stack from 'react-bootstrap/Stack';
import ToggleButton from 'react-bootstrap/ToggleButton';
import { withTranslation } from 'react-i18next';
function ToggleAccordionItem( { children, id, onToggle, t, title, toggledOn } ) {
const label = toggledOn
? t( 'configuration.toggle-form.enabled' )
: t( 'configuration.toggle-form.disabled' );
return (
<Accordion.Item eventKey={ id }>
<Accordion.Header>
<Stack direction="horizontal" className="w-100">
{title}
<Badge
bg={ toggledOn ? 'success' : 'secondary' }
className="ms-auto me-3"
>
{label}
</Badge>
</Stack>
</Accordion.Header>
<Accordion.Body>
<Stack>
<ToggleButton
className="mb-1"
id={ id }
type="checkbox"
variant={ toggledOn ? 'outline-success' : 'outline-secondary' }
checked={ toggledOn }
onChange={ onToggle }
>
{label}
</ToggleButton>
{children}
</Stack>
</Accordion.Body>
</Accordion.Item>
);
}
ToggleAccordionItem.propTypes = {
children: PropTypes.node.isRequired,
id: PropTypes.string.isRequired,
onToggle: PropTypes.func.isRequired,
title: PropTypes.string.isRequired,
t: PropTypes.func.isRequired,
toggledOn: PropTypes.bool.isRequired,
};
export default withTranslation( 'app' )( ToggleAccordionItem );
================================================
FILE: src/configuration.jsx
================================================
import { arrayMove } from '@dnd-kit/sortable';
import dayjs from 'dayjs/esm';
import { saveAs } from 'file-saver';
import i18n, { changeLanguage } from 'i18next';
import PropTypes from 'prop-types';
import React from 'react';
import Accordion from 'react-bootstrap/Accordion';
import Button from 'react-bootstrap/Button';
import Card from 'react-bootstrap/Card';
import Col from 'react-bootstrap/Col';
import Container from 'react-bootstrap/Container';
import Form from 'react-bootstrap/Form';
import InputGroup from 'react-bootstrap/InputGroup';
import ListGroup from 'react-bootstrap/ListGroup';
import Row from 'react-bootstrap/Row';
import Spinner from 'react-bootstrap/Spinner';
import Stack from 'react-bootstrap/Stack';
import { withTranslation } from 'react-i18next';
import PdfPreviewCard from '~/components/pdf-preview-card';
import PdfProgress from '~/components/pdf-progress';
import ConfigurationSelector from '~/configuration-form/configuration-selector';
import ItemsList from '~/configuration-form/items-list';
import Itinerary from '~/configuration-form/itinerary';
import SpecialDates from '~/configuration-form/special-dates';
import ToggleAccordionItem from '~/configuration-form/toggle-accordion-item';
import { getWeekdays } from '~/lib/date';
import { AVAILABLE_DEVICES, CUSTOM, getPageProperties } from '~/lib/device-utils';
import { byId, wrapWithId } from '~/lib/id-utils';
import PdfConfig, { hydrateFromObject } from '~/pdf/config';
import { AVAILABLE_FONTS } from '~/pdf/lib/fonts';
import 'bootstrap/dist/css/bootstrap.min.css';
import './app.css';
const DAY_ITINERARY_ID_PREFIX = 'day-itinerary-';
class Configuration extends React.PureComponent {
state = {
isGeneratingPdf: false,
isGeneratingPreview: false,
blobUrl: null,
lastPreviewTime: 10000,
lastFullTime: null,
...hydrateFromObject( this.props.initialState ),
};
constructor( props ) {
super( props );
this.pdfWorker = new Worker(
new URL( './worker/pdf.worker.js', import.meta.url ),
{ type: 'module' },
);
this.pdfWorker.onmessage = this.handlePdfWorkerMessage;
}
componentDidMount() {
i18n.on( 'languageChanged', this.handleLanguageChange );
}
componentWillUnmount() {
i18n.off( 'languageChanged', this.handleLanguageChange );
}
componentDidUpdate( prevProps, prevState ) {
if ( prevState.blobUrl && prevState.blobUrl !== this.state.blobUrl ) {
// Each refresh generates a new blob - and it will be kept in the memory
// until the window is refreshed/unloaded. To keep memory consumption low
// lets explicitly release the stale blob.
// See https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
URL.revokeObjectURL( prevState.blobUrl );
}
}
handleConfigChange = ( newConfig ) => {
this.setState( { ...hydrateFromObject( newConfig ) } );
changeLanguage( newConfig.language );
};
handleLanguageChange = () => {
dayjs.updateLocale( i18n.language, {
weekStart: this.state.firstDayOfWeek,
} );
};
handleFieldChange = ( event ) => {
let targetId = event.target.id;
let value =
event.target.type !== 'checkbox'
? event.target.value
: event.target.checked;
if ( event.target.type === 'number' || event.target.dataset.type === 'number' ) {
value = Number( value );
}
if ( targetId === 'resolutionX' || targetId === 'resolutionY' ) {
value = targetId === 'resolutionX'
? [ value, this.state.pageSize[ 1 ] ]
: [ this.state.pageSize[ 0 ], value ];
targetId = 'pageSize';
}
this.setState( { [ targetId ]: value } );
switch ( event.target.id ) {
case 'firstDayOfWeek':
this.handleFirstDayOfWeekChange( value );
break;
case 'device':
this.handleDeviceChange( value );
break;
}
};
handleDeviceChange = ( device ) => {
if ( device !== CUSTOM ) {
const { dpi, pageSize } = getPageProperties( device );
this.setState( { dpi, pageSize } );
return;
}
};
handleFirstDayOfWeekChange = ( newFirstDayOfWeek ) => {
dayjs.updateLocale( i18n.language, {
weekStart: newFirstDayOfWeek,
} );
const newFirstDayOfWeekIndex = this.state.dayItineraries.findIndex(
this.isDayOfWeek( newFirstDayOfWeek ),
);
if ( newFirstDayOfWeekIndex === -1 ) {
return;
}
const dayItinerariesReordered = [
...this.state.dayItineraries.slice( newFirstDayOfWeekIndex ),
...this.state.dayItineraries.slice( 0, newFirstDayOfWeekIndex ),
];
this.setState( { dayItineraries: dayItinerariesReordered } );
};
isDayOfWeek = ( dayOfWeek ) => {
return ( item ) => item.dayOfWeek === dayOfWeek;
};
handleToggle = ( event ) => {
this.setState( { [ event.target.id ]: event.target.checked } );
};
handleDayItineraryToggle = ( event ) => {
const id = Number( event.target.id.replace( DAY_ITINERARY_ID_PREFIX, '' ) );
const newItineraries = [ ...this.state.dayItineraries ];
newItineraries[ id ].isEnabled = event.target.checked;
this.setState( { dayItineraries: newItineraries } );
};
handleWeekendChange = ( event ) => {
const dayOfWeek = Number( event.target.dataset.index );
const newWeekendDays = [ ...this.state.weekendDays ];
const indexInArray = newWeekendDays.indexOf( dayOfWeek );
if ( event.target.checked ) {
if ( indexInArray === -1 ) {
newWeekendDays.push( dayOfWeek );
}
} else if ( indexInArray !== -1 ) {
newWeekendDays.splice( indexInArray, 1 );
}
this.setState( { weekendDays: newWeekendDays } );
};
handleDownload = ( event ) => {
this.setState( { isGeneratingPdf: true } );
this.generatePdf( false );
};
handleItemAdd = ( event ) => {
const field = event.target.dataset.field;
const newItems = [ ...this.state[ field ] ];
newItems.push( wrapWithId( '' ) );
this.setState( { [ field ]: newItems } );
};
handleItemChange = ( event ) => {
const field = event.target.dataset.field;
const newItems = [ ...this.state[ field ] ];
const index = this.state[ field ].findIndex( byId( event.target.dataset.id ) );
if ( index === -1 ) {
return;
}
newItems[ index ].value = event.target.value;
this.setState( { [ field ]: newItems } );
};
handleDragEnd = ( { oldId, newId, field } ) => {
const oldIndex = this.state[ field ].findIndex( byId( oldId ) );
const newIndex = this.state[ field ].findIndex( byId( newId ) );
if ( oldIndex === -1 || newIndex === -1 ) {
return;
}
const newItems = arrayMove( this.state[ field ], oldIndex, newIndex );
this.setState( { [ field ]: newItems } );
};
handleDayItineraryDragEnd = ( { oldId, newId, field } ) => {
const oldIndex = this.state.dayItineraries[ field ].items.findIndex(
byId( oldId ),
);
const newIndex = this.state.dayItineraries[ field ].items.findIndex(
byId( newId ),
);
if ( oldIndex === -1 || newIndex === -1 ) {
return;
}
const newItineraries = [ ...this.state.dayItineraries ];
newItineraries[ field ].items = arrayMove(
newItineraries[ field ].items,
oldIndex,
newIndex,
);
this.setState( { dayItineraries: newItineraries } );
};
handleItemRemove = ( event ) => {
const field = event.target.dataset.field;
const newItems = [ ...this.state[ field ] ];
const index = this.state[ field ].findIndex( byId( event.target.dataset.id ) );
if ( index === -1 ) {
return;
}
newItems.splice( index, 1 );
this.setState( { [ field ]: newItems } );
};
handleItineraryAdd = ( event ) => {
const field = event.target.dataset.field;
const newItinerary = [ ...this.state[ field ] ];
newItinerary.push(
wrapWithId( {
type: event.target.dataset.type,
value: '',
} ),
);
this.setState( { [ field ]: newItinerary } );
};
handleItineraryChange = ( event ) => {
const { field, id, type } = event.target.dataset;
const newItinerary = [ ...this.state[ field ] ];
const index = this.state[ field ].findIndex( byId( id ) );
if ( index === -1 ) {
return;
}
newItinerary[ index ] = {
id,
type,
value: type === 'lines' ? Number( event.target.value ) : event.target.value,
};
this.setState( { [ field ]: newItinerary } );
};
handleItineraryRemove = ( event ) => {
const field = event.target.dataset.field;
const newItineraries = [ ...this.state[ field ] ];
const index = this.state[ field ].findIndex( byId( event.target.dataset.id ) );
if ( index === -1 ) {
return;
}
newItineraries.splice( index, 1 );
this.setState( { [ field ]: newItineraries } );
};
handlePreview = ( event ) => {
event.preventDefault();
this.setState( { isGeneratingPreview: true } );
this.generatePdf( true );
};
generatePdf( isPreview ) {
this.startTime = new Date();
this.pdfWorker.postMessage( {
isPreview,
language: i18n.language,
...hydrateFromObject( this.state ),
} );
}
handlePdfWorkerMessage = ( { data: { blob } } ) => {
const shouldTriggerDownload = this.state.isGeneratingPdf;
if ( this.state.isGeneratingPreview ) {
const previewTime = new Date().getTime() - this.startTime.getTime();
this.setState( {
blobUrl: URL.createObjectURL( blob ),
lastPreviewTime: previewTime,
} );
}
this.setState( { isGeneratingPdf: false, isGeneratingPreview: false } );
if ( shouldTriggerDownload ) {
const fullTime = new Date().getTime() - this.startTime.getTime();
this.setState( { lastFullTime: fullTime } );
saveAs( blob, 'recalendar.pdf' );
}
};
handlePdfGeneration = ( { blob, url, loading, error } ) => {
const { t } = this.props;
return loading ? t( 'loading' ) : t( 'download-ready' );
};
handleDayItineraryChange = ( event ) => {
const newItineraries = [ ...this.state.dayItineraries ];
const { field, type } = event.target.dataset;
const index = this.state.dayItineraries[ field ].items.findIndex(
byId( event.target.dataset.id ),
);
newItineraries[ field ].items[ index ] = {
id: event.target.dataset.id,
type,
value: type === 'lines' ? Number( event.target.value ) : event.target.value,
};
this.setState( { dayItineraries: newItineraries } );
};
handleDayItineraryRemove = ( event ) => {
const field = event.target.dataset.field;
const newItineraries = [ ...this.state.dayItineraries ];
const index = this.state.dayItineraries[ field ].items.findIndex(
byId( event.target.dataset.id ),
);
if ( index === -1 ) {
return;
}
newItineraries[ field ].items.splice( index, 1 );
this.setState( { dayItineraries: newItineraries } );
};
handleDayItineraryCopy = ( event ) => {
const { field } = event.target.dataset;
const itemsToCopy = [ ...this.state.dayItineraries[ field ].items ];
const newItineraries = this.state.dayItineraries.map( ( itinerary ) => ( {
...itinerary,
items: [ ...itemsToCopy ],
isEnabled: this.state.dayItineraries[ field ].isEnabled,
} ) );
this.setState( { dayItineraries: newItineraries } );
};
handleDayItineraryAdd = ( event ) => {
const newItineraries = [ ...this.state.dayItineraries ];
const { field, type } = event.target.dataset;
newItineraries[ field ].items.push(
wrapWithId( {
type,
value: '',
} ),
);
this.setState( { dayItineraries: newItineraries } );
};
handleSpecialDateAdd = ( newSpecialDate ) => {
this.setState(
( prev ) => ( {
specialDates: [
...prev.specialDates,
wrapWithId( newSpecialDate ),
],
} ),
);
};
renderDevices() {
return AVAILABLE_DEVICES.map( ( device ) => (
<option key={ device } value={ device }>
{device}
</option>
) );
}
renderFonts() {
return AVAILABLE_FONTS.map( ( font ) => (
<option key={ font } value={ font }>
{font}
</option>
) );
}
renderMonths() {
return dayjs
.localeData()
.months()
.map( ( month, index ) => (
<option key={ index } value={ index }>
{month}
</option>
) );
}
renderDaysOfWeek() {
return getWeekdays( this.state.firstDayOfWeek ).map( ( { full, index } ) => (
<option key={ full } value={ index }>
{full}
</option>
) );
}
renderWeekendSelection() {
return getWeekdays( this.state.firstDayOfWeek ).map( ( { full, index } ) => (
<ListGroup.Item key={ full } value={ index }>
<Form.Check
id={ 'weekend-' + index }
type="checkbox"
label={ full }
data-index={ index }
checked={ this.state.weekendDays.includes( index ) }
onChange={ this.handleWeekendChange }
/>
</ListGroup.Item>
) );
}
renderDayItinerary = ( { full: dayOfWeek }, index ) => {
return (
<ToggleAccordionItem
key={ dayOfWeek }
id={ DAY_ITINERARY_ID_PREFIX + index }
title={ dayOfWeek }
onToggle={ this.handleDayItineraryToggle }
toggledOn={ this.state.dayItineraries[ index ].isEnabled }
>
<Itinerary
field={ index.toString() }
itinerary={ this.state.dayItineraries[ index ].items }
onAdd={ this.handleDayItineraryAdd }
onChange={ this.handleDayItineraryChange }
onDragEnd={ this.handleDayItineraryDragEnd }
onRemove={ this.handleDayItineraryRemove }
onCopy={ this.handleDayItineraryCopy }
/>
</ToggleAccordionItem>
);
};
renderConfigurationForm() {
const { t } = this.props;
const { device, isGeneratingPdf, isGeneratingPreview } = this.state;
const isCustomDevice = device === CUSTOM;
return (
<Form onSubmit={ this.handlePreview }>
<Accordion defaultActiveKey="start" className="my-3">
<Accordion.Item eventKey="start">
<Accordion.Header>
{t( 'configuration.selector.label' )}
</Accordion.Header>
<Accordion.Body>
<ConfigurationSelector onConfigChange={ this.handleConfigChange } />
</Accordion.Body>
</Accordion.Item>
<Accordion.Item eventKey="general">
<Accordion.Header>
{t( 'configuration.general.label' )}
</Accordion.Header>
<Accordion.Body>
<Form.Group controlId="device">
<Form.Label>{t( 'configuration.general.device' )}</Form.Label>
<Form.Select
value={ this.state.device }
onChange={ this.handleFieldChange }
>
{this.renderDevices()}
</Form.Select>
</Form.Group>
{isCustomDevice && <Form.Group controlId="dpi">
<Form.Label>{t( 'configuration.general.dpi' )}</Form.Label>
<Form.Control
type="number"
value={ this.state.dpi }
onChange={ this.handleFieldChange }
/>
</Form.Group>}
{isCustomDevice && <Form.Group>
<Form.Label htmlFor="resolutionX">
{t( 'configuration.general.resolution' )}
</Form.Label>
<InputGroup>
<Form.Control
id="resolutionX"
type="number"
value={ this.state.pageSize[ 0 ] }
onChange={ this.handleFieldChange }
/>
<InputGroup.Text>x</InputGroup.Text>
<Form.Control
id="resolutionY"
type="number"
value={ this.state.pageSize[ 1 ] }
onChange={ this.handleFieldChange }
/>
</InputGroup>
</Form.Group>}
<Form.Group controlId="fontFamily">
<Form.Label>{t( 'configuration.general.font' )}</Form.Label>
<Form.Select
value={ this.state.fontFamily }
onChange={ this.handleFieldChange }
>
{this.renderFonts()}
</Form.Select>
</Form.Group>
<Form.Group controlId="isLeftHanded" className="mt-2">
<Form.Check
label={ t( 'configuration.general.left-handed.label' ) }
type="checkbox"
checked={ this.state.isLeftHanded }
value={ this.state.isLeftHanded }
onChange={ this.handleFieldChange }
/>
<Form.Text className="text-muted">
{t( 'configuration.general.left-handed.description' )}
</Form.Text>
</Form.Group>
<Form.Group controlId="alwaysOnSidebar" className="mt-2">
<Form.Check
label={ t( 'configuration.general.sidebar.label' ) }
type="checkbox"
checked={ this.state.alwaysOnSidebar }
value={ this.state.alwaysOnSidebar }
onChange={ this.handleFieldChange }
/>
<Form.Text className="text-muted">
{t( 'configuration.general.sidebar.description' )}
</Form.Text>
</Form.Group>
<Form.Group controlId="year">
<Form.Label>{t( 'configuration.general.year' )}</Form.Label>
<Form.Control
type="number"
value={ this.state.year }
onChange={ this.handleFieldChange }
/>
</Form.Group>
<Form.Group controlId="month">
<Form.Label>
{t( 'configuration.general.starting-month.label' )}
</Form.Label>
<Form.Select
value={ this.state.month }
onChange={ this.handleFieldChange }
data-type="number"
>
{this.renderMonths()}
</Form.Select>
<Form.Text className="text-muted">
{t( 'configuration.general.starting-month.description' )}
</Form.Text>
</Form.Group>
<Form.Group controlId="firstDayOfWeek">
<Form.Label>
{t( 'configuration.general.first-day-of-week' )}
</Form.Label>
<Form.Select
value={ this.state.firstDayOfWeek }
onChange={ this.handleFieldChange }
data-type="number"
>
{this.renderDaysOfWeek()}
</Form.Select>
</Form.Group>
<Form.Group controlId="monthCount">
<Form.Label>
{t( 'configuration.general.month-count.label' )}
</Form.Label>
<Form.Control
type="number"
value={ this.state.monthCount }
onChange={ this.handleFieldChange }
min={ 1 }
max={ 12 }
/>
<Form.Text className="text-muted">
{t( 'configuration.general.month-count.description' )}
</Form.Text>
</Form.Group>
<Form.Label>{t( 'configuration.general.weekend' )}</Form.Label>
<ListGroup>{this.renderWeekendSelection()}</ListGroup>
</Accordion.Body>
</Accordion.Item>
<SpecialDates
year={ this.state.year }
items={ this.state.specialDates }
onAdd={ this.handleSpecialDateAdd }
onRemove={ this.handleItemRemove }
/>
<ToggleAccordionItem
id="isMonthOverviewEnabled"
title={ t( 'configuration.month.title' ) }
onToggle={ this.handleToggle }
toggledOn={ this.state.isMonthOverviewEnabled }
>
<p className="mb-0">{t( 'configuration.month.description' )}</p>
<Accordion className="mt-3" defaultActiveKey="habits">
<ItemsList
field="habits"
title={ t( 'configuration.month.habits.title' ) }
items={ this.state.habits }
onAdd={ this.handleItemAdd }
onChange={ this.handleItemChange }
onDragEnd={ this.handleDragEnd }
onRemove={ this.handleItemRemove }
/>
<Accordion.Item eventKey="monthItinerary">
<Accordion.Header>
{t( 'configuration.month.itinerary.title' )}
</Accordion.Header>
<Accordion.Body>
<Itinerary
field="monthItinerary"
itinerary={ this.state.monthItinerary }
onAdd={ this.handleItineraryAdd }
onChange={ this.handleItineraryChange }
onDragEnd={ this.handleDragEnd }
onRemove={ this.handleItineraryRemove }
/>
</Accordion.Body>
</Accordion.Item>
</Accordion>
</ToggleAccordionItem>
<ToggleAccordionItem
id="isWeekOverviewEnabled"
title={ t( 'configuration.week.title' ) }
onToggle={ this.handleToggle }
toggledOn={ this.state.isWeekOverviewEnabled }
>
<p className="mb-0">{t( 'configuration.week.description' )}</p>
<Accordion className="mt-3" defaultActiveKey="todos">
<ItemsList
field="todos"
title={ t( 'configuration.week.todos.title' ) }
items={ this.state.todos }
onAdd={ this.handleItemAdd }
onChange={ this.handleItemChange }
onDragEnd={ this.handleDragEnd }
onRemove={ this.handleItemRemove }
/>
</Accordion>
</ToggleAccordionItem>
<Accordion.Item eventKey="dayItineraries">
<Accordion.Header>{t( 'configuration.day.title' )}</Accordion.Header>
<Accordion.Body>
<Accordion defaultActiveKey="0">
{getWeekdays( this.state.firstDayOfWeek ).map( this.renderDayItinerary )}
</Accordion>
</Accordion.Body>
</Accordion.Item>
<ToggleAccordionItem
id="isWeekRetrospectiveEnabled"
title={ t( 'configuration.week.retrospective.title' ) }
onToggle={ this.handleToggle }
toggledOn={ this.state.isWeekRetrospectiveEnabled }
>
<p className="mb-0">
{t( 'configuration.week.retrospective.description' )}
</p>
<Accordion
className="mt-3"
defaultActiveKey="weekRetrospectiveItinerary"
>
<Accordion.Item eventKey="weekRetrospectiveItinerary">
<Accordion.Header>
{t( 'configuration.week.retrospective.itinerary.title' )}
</Accordion.Header>
<Accordion.Body>
<Itinerary
field="weekRetrospectiveItinerary"
itinerary={ this.state.weekRetrospectiveItinerary }
onAdd={ this.handleItineraryAdd }
onChange={ this.handleItineraryChange }
onDragEnd={ this.handleDragEnd }
onRemove={ this.handleItineraryRemove }
/>
</Accordion.Body>
</Accordion.Item>
</Accordion>
</ToggleAccordionItem>
</Accordion>
<Stack
direction="vertical"
gap={ 2 }
className="pt-3 position-sticky bg-body refresh-button"
>
<Button
variant="primary"
className="w-100"
disabled={ isGeneratingPreview || isGeneratingPdf }
type="submit"
>
{isGeneratingPreview ? (
<>
<Spinner
as="span"
animation="border"
size="sm"
role="status"
aria-hidden="true"
className="me-1"
/>
{t( 'configuration.button.generating' )}
</>
) : (
t( 'configuration.button.refresh' )
)}
</Button>
{isGeneratingPreview && (
<PdfProgress expectedTime={ this.state.lastPreviewTime } />
)}
<Form.Text className="text-muted pb-3">
{t( 'configuration.generation-description' )}
</Form.Text>
</Stack>
</Form>
);
}
render() {
const { t } = this.props;
return (
<Container className="h-100" fluid>
<Row className="h-100">
<Col>{this.renderConfigurationForm()}</Col>
<Col>
<div className="pt-3 pb-3 position-sticky top-0 vh-100">
<Card className="h-100">
<Card.Header>
{t( 'preview.title' )}{' '}
<small className="text-muted">{t( 'preview.subtitle' )}</small>
</Card.Header>
<Card.Body className="pb-0">
<PdfPreviewCard
blobUrl={ this.state.blobUrl }
expectedTime={
this.state.lastFullTime || 12 * this.state.lastPreviewTime
}
isGeneratingPdf={ this.state.isGeneratingPdf }
isGeneratingPreview={ this.state.isGeneratingPreview }
onDownload={ this.handleDownload }
/>
</Card.Body>
</Card>
</div>
</Col>
</Row>
</Container>
);
}
}
Configuration.propTypes = {
initialState: PropTypes.instanceOf( PdfConfig ).isRequired,
t: PropTypes.func.isRequired,
};
export default withTranslation( [ 'app' ] )( Configuration );
================================================
FILE: src/index.css
================================================
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
================================================
FILE: src/index.jsx
================================================
import i18n from 'i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import React from 'react';
import { createRoot } from 'react-dom/client';
import { initReactI18next } from 'react-i18next';
import resources from 'virtual:i18next-loader';
import '~/index.css';
import '~/config/dayjs';
import { handleLanguageChange, i18nConfiguration } from '~/config/i18n';
import Loader from '~/loader';
i18n.on( 'languageChanged', ( newLanguage ) => {
handleLanguageChange( newLanguage );
} );
i18n
.use( LanguageDetector )
.use( initReactI18next )
.init(
{ ...i18nConfiguration( [ 'app', 'pdf', 'config' ] ), resources },
);
const container = document.getElementById( 'root' );
const root = createRoot( container );
root.render(
<React.StrictMode>
<Loader />
</React.StrictMode>,
);
================================================
FILE: src/lib/attachments.js
================================================
import {
PDFDocument,
PDFName,
PDFDict,
PDFArray,
PDFStream,
decodePDFRawStream,
} from 'pdf-lib';
// https://github.com/Hopding/pdf-lib/issues/534#issuecomment-662756915
export async function getJsonAttachment( pdfData, attachmentName ) {
try {
const pdfDoc = await PDFDocument.load( pdfData, {
updateMetadata: false,
} );
if ( ! pdfDoc.catalog.has( PDFName.of( 'Names' ) ) ) {
return undefined;
}
const Names = pdfDoc.catalog.lookup( PDFName.of( 'Names' ), PDFDict );
if ( ! Names.has( PDFName.of( 'EmbeddedFiles' ) ) ) {
return undefined;
}
const EmbeddedFiles = Names.lookup( PDFName.of( 'EmbeddedFiles' ), PDFDict );
if ( ! EmbeddedFiles.has( PDFName.of( 'Names' ) ) ) {
return undefined;
}
const EFNames = EmbeddedFiles.lookup( PDFName.of( 'Names' ), PDFArray );
for ( let idx = 0, len = EFNames.size(); idx < len; idx += 2 ) {
const fileName = EFNames.lookup( idx ).decodeText();
if ( fileName !== attachmentName ) {
continue;
}
const fileSpec = EFNames.lookup( idx + 1, PDFDict );
const stream = fileSpec
.lookup( PDFName.of( 'EF' ), PDFDict )
.lookup( PDFName.of( 'F' ), PDFStream );
const data = decodePDFRawStream( stream ).decode();
return JSON.parse( new TextDecoder( 'utf-8' ).decode( data ) );
}
} catch ( exception ) {
return undefined;
}
return undefined;
}
================================================
FILE: src/lib/base64.js
================================================
// From https://developer.mozilla.org/en-US/docs/Glossary/Base64
export function utf8ToBase64( data ) {
return btoa(
encodeURIComponent( data ).replace( /%([0-9A-F]{2})/g, function( match, p1 ) {
return String.fromCharCode( '0x' + p1 );
} ),
);
}
================================================
FILE: src/lib/config-compat.js
================================================
import dayjs from 'dayjs/esm';
import {
DATE_FORMAT as SPECIAL_DATES_DATE_FORMAT,
EVENT_DAY_TYPE,
} from '~/lib/special-dates-utils';
import {
CONFIG_VERSION_1,
CONFIG_VERSION_2,
CONFIG_CURRENT_VERSION,
} from '~/pdf/config';
export function convertConfigToCurrentVersion( config ) {
switch ( config.version ) {
case CONFIG_VERSION_1:
return convertFromVersion2( convertFromVersion1( config ) );
case CONFIG_VERSION_2:
return convertFromVersion2( config );
case CONFIG_CURRENT_VERSION:
default:
return config;
}
}
function convertFromVersion1( config ) {
config.dayItineraries = config.dayItineraries.map( ( dayItinerary ) =>
Object.assign( { isEnabled: true }, dayItinerary ),
);
return config;
}
function convertFromVersion2( config ) {
const oldDateKeyFormat = 'DD-MM';
const newSpecialDates = [];
Object.keys( config.specialDates || {} ).forEach( ( dateKey ) => {
const newDateKey = dayjs( dateKey, oldDateKeyFormat ).format(
SPECIAL_DATES_DATE_FORMAT,
);
newSpecialDates.push(
...config.specialDates[ dateKey ].map( ( specialDate ) => ( {
date: newDateKey,
value: specialDate,
type: EVENT_DAY_TYPE,
} ) ),
);
} );
config.specialDates = newSpecialDates;
return config;
}
================================================
FILE: src/lib/date.js
================================================
import dayjs from 'dayjs/esm';
export function getWeekdays( firstDayOfWeek ) {
const weekdaysFull = dayjs.weekdays();
const weekdaysMin = dayjs.weekdaysMin();
const weekdaysShort = dayjs.weekdaysShort();
const weekdays = [ ...Array( 7 ).keys() ];
const weekdaysReordered = [
...weekdays.slice( firstDayOfWeek ),
...weekdays.slice( 0, firstDayOfWeek ),
];
return weekdaysReordered.map( ( indexOfDay ) => ( {
full: weekdaysFull[ indexOfDay ],
short: weekdaysShort[ indexOfDay ],
min: weekdaysMin[ indexOfDay ],
index: indexOfDay,
} ) );
}
export function getWeekendDays( weekendDayIndexes, firstDayOfWeek ) {
const weekendDays = [];
getWeekdays( firstDayOfWeek ).forEach( ( { index } ) => {
if ( weekendDayIndexes.includes( index ) ) {
weekendDays.push( index );
}
} );
return weekendDays;
}
export function getWeekNumber( day ) {
// As per ISO week specification, we need to check Thursday
// on a given week to figure out the accurate week number.
// https://en.wikipedia.org/wiki/ISO_week_date
return day.day( 4 ).isoWeek();
}
================================================
FILE: src/lib/device-utils.js
================================================
export const REMARKABLE = 'ReMarkable 1 & 2';
const REMARKABLE_PAPER_PRO = 'ReMarkable Paper Pro';
const SUPERNOTE_A5_X = 'Supernote A5 X';
export const CUSTOM = 'Custom';
export const AVAILABLE_DEVICES = [
REMARKABLE,
REMARKABLE_PAPER_PRO,
SUPERNOTE_A5_X,
CUSTOM,
];
export function getPageProperties( device ) {
switch ( device ) {
case REMARKABLE_PAPER_PRO:
return {
dpi: 229,
pageSize: [ 1620, 2160 ],
};
case SUPERNOTE_A5_X:
case REMARKABLE:
default:
return {
dpi: 226,
pageSize: [ 1404, 1872 ],
};
}
}
================================================
FILE: src/lib/id-utils.js
================================================
import { nanoid } from 'nanoid';
export function wrapWithId( value ) {
if ( Object.hasOwn( value, 'id' ) ) {
return value;
}
return {
id: nanoid(),
...( typeof value === 'object' ? value : { value } ),
};
}
export function byId( idToSearchFor ) {
return ( { id } ) => id === idToSearchFor;
}
================================================
FILE: src/lib/itinerary-utils.js
================================================
export const ITINERARY_ITEM = 'item';
export const ITINERARY_LINES = 'lines';
export const ITINERARY_NEW_PAGE = 'new_page';
================================================
FILE: src/lib/paths.js
================================================
export const RECALENDAR_JS_GITHUB =
'https://github.com/klimeryk/recalendar.js/';
export const RECALENDAR_PHP_GITHUB = 'https://github.com/klimeryk/recalendar/';
export const HOME_PATH = '/';
export const CONFIGURATOR_PATH = '/create';
export const FEATURES_PATH = '/features';
export const FAQ_PATH = '/faq';
================================================
FILE: src/lib/pdf.js
================================================
// Copied from react-pdf/blob/87abdd00e62287dccf89c8d260b18dc758482b31/packages/renderer/src/index.js
import FontStore from '@react-pdf/font';
import layoutDocument from '@react-pdf/layout';
import PDFDocument from '@react-pdf/pdfkit';
import renderPDF from '@react-pdf/render';
import { createRenderer } from '@react-pdf/renderer';
const fontStore = new FontStore();
// We must keep a single renderer instance, otherwise React will complain
let renderer;
// The pdf instance acts as an event emitter for DOM usage.
// We only want to trigger an update when PDF content changes
const events = {};
const pdf = ( initialValue, { attachments = [] } ) => {
const onChange = () => {
const listeners = events.change?.slice() || [];
for ( let i = 0; i < listeners.length; i += 1 ) {
listeners[ i ]();
}
};
const container = { type: 'ROOT', document: null };
renderer = renderer || createRenderer( { onChange } );
const mountNode = renderer.createContainer( container );
const updateContainer = ( doc ) => {
renderer.updateContainer( doc, mountNode, null );
};
if ( initialValue ) {
updateContainer( initialValue );
}
const render = async ( compress = true ) => {
const props = container.document.props || {};
const { pdfVersion, language, pageLayout, pageMode } = props;
const ctx = new PDFDocument( {
compress,
pdfVersion,
lang: language,
displayTitle: true,
autoFirstPage: false,
pageLayout,
pageMode,
} );
attachments.forEach( ( { src, options = {} } ) => {
ctx.file( src, options );
} );
const layout = await layoutDocument( container.document, fontStore );
return renderPDF( ctx, layout );
};
const callOnRender = ( params = {} ) => {
if ( container.document.props.onRender ) {
container.document.props.onRender( params );
}
};
const toBlob = async () => {
const chunks = [];
const instance = await render();
return new Promise( ( resolve, reject ) => {
instance.on( 'data', ( chunk ) => {
chunks.push(
chunk instanceof Uint8Array ? chunk : new Uint8Array( chunk ),
);
} );
instance.on( 'end', () => {
try {
const blob = new Blob( chunks, { type: 'application/pdf' } );
callOnRender( { blob } );
resolve( blob );
} catch ( error ) {
reject( error );
}
} );
} );
};
const toBuffer = async () => {
callOnRender();
return render();
};
/*
* TODO: remove this method in next major release. it is buggy
* see
* - https://github.com/diegomura/react-pdf/issues/2112
* - https://github.com/diegomura/react-pdf/issues/2095
*/
const toString = async () => {
let result = '';
const instance = await render( false );
return new Promise( ( resolve, reject ) => {
try {
instance.on( 'data', ( buffer ) => {
result += buffer;
} );
instance.on( 'end', () => {
callOnRender();
resolve( result );
} );
} catch ( error ) {
reject( error );
}
} );
};
const on = ( event, listener ) => {
if ( ! events[ event ] ) {
events[ event ] = [];
}
events[ event ].push( listener );
};
const removeListener = ( event, listener ) => {
if ( ! events[ event ] ) {
return;
}
const idx = events[ event ].indexOf( listener );
if ( idx > -1 ) {
events[ event ].splice( idx, 1 );
}
};
return {
on,
container,
toBlob,
toBuffer,
toString,
removeListener,
updateContainer,
};
};
const Font = fontStore;
export { Font, pdf };
================================================
FILE: src/lib/special-dates-utils.js
================================================
export const HOLIDAY_DAY_TYPE = 'holiday';
export const EVENT_DAY_TYPE = 'event';
export function isHoliday( { type } ) {
return type === HOLIDAY_DAY_TYPE;
}
export function isEvent( { type } ) {
return type === EVENT_DAY_TYPE;
}
export function findByDate( dateToSearchFor ) {
return ( { date } ) => date === dateToSearchFor;
}
export const DATE_FORMAT = 'MM-DD';
================================================
FILE: src/loader.jsx
================================================
import React from 'react';
import { withTranslation } from 'react-i18next';
import Configuration from '~/configuration';
import Navigation from '~/navigation';
import PdfConfig from '~/pdf/config';
class Loader extends React.Component {
componentDidMount() {
// eslint-disable-next-line react/no-did-mount-set-state
this.setState( { config: new PdfConfig() } );
}
render() {
if ( ! this.state || ! this.state.config ) {
return null;
}
return (
<>
<Navigation />
<Configuration initialState={ this.state.config } />
</>
);
}
}
export default withTranslation( [ 'app', 'config' ] )( Loader );
================================================
FILE: src/locales/cs/app.json
================================================
{
"loading": "Načítání...",
"download-ready": "Stáhnout!",
"navigation": {
"home": "Domů",
"configuration": "Vytvořit vlastní kalendář",
"features": "Funkce",
"faq": "FAQ"
},
"language": {
"label": "Jazyky",
"en": "English",
"pl": "Polski",
"fr": "Français",
"es": "Español",
"nb": "Norsk",
"da": "Dansk",
"cz": "Česky"
},
"configuration": {
"selector": {
"label": "Start",
"template": {
"label": "Začni výběrem předlohy:",
"basic": {
"label": "Základní",
"description": "Základní nastavení - dobrá na začátek."
},
"advanced": {
"label": "Pokročilá",
"description": "Rozšiřuje základní předlohu o individuální itineráře."
},
"blank": {
"label": "Jednoduchý",
"description": "Založena na základní předloze, ale je prázdnější."
},
"minimalistic": {
"label": "Minimalistická",
"description": "Nejjednodušší verze."
}
},
"upload": {
"label": "Nebo nahrajte předešlý kalendář pro načtení nastavení:",
"loading": "Načítání ze souboru PDF, prosím počkejte...",
"error": "Ze souboru nebylo možné načíst nastavení!",
"success": "Nastavení načteno z PDF - vítejte zpět!"
}
},
"general": {
"label": "Hlavní nastavení",
"font": "Font",
"year": "Rok",
"left-handed": {
"label": "Verze pro levou ruku",
"description": "Optimalizováno pro psaní levou rukou."
},
"sidebar": {
"label": "Nastavit permanentní odsazení pro lištu s nástroji",
"description": "Pokud preferujete vysunutou lištu s nástroji, tato možnost odsadí celý obsah kalendáře."
},
"starting-month": {
"label": "Počáteční měsíc",
"description": "První měsíc v generovaném kalendáři. Pro školní rok vyberte září."
},
"month-count": {
"label": "Počet měsíců",
"description": "Pro kolik měsíců se vygeneruje kalendář."
},
"first-day-of-week": "První den víkendu",
"weekend": "Víkend"
},
"button": {
"refresh": "Načíst náhled",
"download": "Generovat celý kalendář pro stažení",
"generating": "Generování, prosím čekejte..."
},
"itinerary": {
"empty": "Prázdný itinerář",
"placeholder": {
"lines": "Počet řádků",
"page": "Nová stránka"
},
"button": {
"copy": "Zkopírovat na ostatní dny",
"remove": "Odebrat",
"item": "Přidat položku",
"page": "Nová strana",
"lines": "Přidat prázdné řádky"
}
},
"items-list": {
"button": {
"item": "Přidat položku",
"remove": "Odebrat"
},
"empty": "Prázdný seznam",
"placeholder": "Položka"
},
"toggle-form": {
"enabled": "Povoleno",
"disabled": "Nepovoleno"
},
"month": {
"title": "Přehled měsíce",
"description": "Přehled měsíce je místo pro nastavení cílů pro následující měsíc a vytváření jiných plánů.",
"habits": {
"title": "Zvyky"
},
"itinerary": {
"title": "Itinerář"
}
},
"week": {
"title": "Přehled týdne",
"description": "Přehled týdne nabízí naplánování celého týdne.",
"todos": {
"title": "Úkoly"
},
"retrospective": {
"title": "Týdenní retrospektiva",
"description": "Týdenní retrospektiva je místo pro shrnutí minulého týdne.",
"itinerary": {
"title": "Itinerář"
}
}
},
"day": {
"title": "Dení itinerář"
},
"special-dates": {
"title": "Speciální dny",
"description": "Přidej své narozeniny, svátky a události.",
"empty": "Žádná data",
"placeholder": "Jaká je příležitost?",
"button": {
"item": "Přidat datum",
"remove": "Odebrat"
}
},
"generation-description": "Generování PDF probíhá ve vašem prohlížeči - data nejsou posílána na server!"
},
"preview": {
"title": "Náhled kalendáře",
"subtitle": "(pro náhled se generuje jen první měsíc)",
"viewer-title": "Náhled PDF",
"generating": {
"full": "Generování celého kalendáře - tato akce může trvat déle...",
"preview": "Generování náhledu, prosím čekejte - tato akce může trvat déle."
},
"empty": {
"title": "Vyplň nastavení pro vlasní kalendář",
"subtitle": "Zde se zoprazí náhled"
}
}
}
================================================
FILE: src/locales/cs/config.json
================================================
{
"habits": {
"example1": "Cvičení",
"example2": "Kniha",
"example3": "Koníček",
"example4": "Rande"
},
"templates": {
"advanced": {
"day": {
"monday": "Stránka navíc pro poznámky na pondělí"
},
"retrospective": {
"wins": "Úspěchy týdne",
"discoveries": "Nové objevy",
"fails": "Něco se nepovedlo?"
}
}
},
"month": {
"goal": "Hlavní cíl",
"notes": "Poznámky"
},
"todos": {
"example1": "Plány a výlety",
"example2": "Jiné úkoly"
},
"special-dates": {
"example1": "Speciální den 1",
"example2": "Speciální datum #2",
"example3": "Oslava",
"example4": "Jiná speciální událost delší než na jeden řádek",
"example5": "Pojďme přidat ještě jednu událost",
"example6": "Další významný den"
}
}
================================================
FILE: src/locales/cs/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "T#",
"retrospective": "Re"
},
"body": {
"retrospective": "R"
}
},
"page": {
"month": {
"habits": {
"title": "Zvyky"
}
},
"week": {
"title": "Týden"
},
"retrospective": {
"title": "Týdenní retrospektiva"
},
"last": {
"title": "Generováno <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "Tento soubor lze použít pro rychlé nastavení dalšího kalendáře."
}
}
}
================================================
FILE: src/locales/da/app.json
================================================
{
"loading": "indlæser...",
"download-ready": "Download nu!",
"navigation": {
"home": "Hjem",
"configuration": "Lav din egen kalender",
"features": "Egenskaber",
"faq": "FAQ"
},
"language": {
"label": "Sprog"
},
"configuration": {
"selector": {
"label": "Start",
"template": {
"label": "Start med at vælge en skabelon",
"basic": {
"label": "Simpel",
"description": "Standard indstillinger - et godt udgangspunkt"
},
"advanced": {
"label": "Avanceret",
"description": "Bygger ovenpå den simple skabelon ved at tilføje individuelle punkter pr dag"
},
"blank": {
"label": "Blank",
"description": "Som den Simple Template men unden nogen former for specielle datoer, TODOs osv"
},
"minimalistic": {
"label": "Minimalistisk",
"description": "Fjerner alt pånær den ugentlige oversigt"
}
},
"upload": {
"label": "Eller overfør en tidligere genereret ReCalendar PDF for at bruge dens konfiguration",
"loading": "Indlæser konfiguration fra PDF filen, Vent venligst...",
"error": "Kunne desværre ikke indlæse konfigurationen fra denne ReCalendar PDF - Er du sikker på at den er genereret på denne hjemmeside?",
"success": "Konfiguration indlæst fra PDF - velkommen tilbage!"
}
},
"general": {
"label": "Generelle indstillinger",
"year": "År",
"left-handed": {
"label": "Venstrehåndsversion",
"description": "Optimerer layout til brug af en venstrehåndet"
},
"starting-month": {
"label": "Start måned",
"description": "Den første måned i den genererede kalender. Vælg f.eks. september hvis du ønsker at den skal dække et skoleår i stedet for et kalenderår."
},
"month-count": {
"label": "Antal måneder",
"description": "Hvor mange måneder skal der være i den færdige kalender."
},
"first-day-of-week": "Første dag på ugen",
"weekend": "Weekend"
},
"button": {
"refresh": "Opdatér forhåndsvisning",
"download": "Generer den fulde kalendar og download",
"generating": "Genererer, vent venligst..."
},
"itinerary": {
"empty": "Tom plan",
"placeholder": {
"lines": "Antal linjer",
"page": "Skift til ny side"
},
"button": {
"copy": "Kopier dette punkt fra planen til alle andre dage også",
"remove": "Fjern",
"item": "Tilføj punkt til planen",
"page": "Start en ny side",
"lines": "Tilføj tomme linjer"
}
},
"items-list": {
"button": {
"item": "Tilføj punkt",
"remove": "Fjern"
},
"empty": "Tøm listen",
"placeholder": "Punkt"
},
"toggle-form": {
"enabled": "Slået til",
"disabled": "Slået fra"
},
"month": {
"title": "Månedsoversigt",
"description": "Månedsoversigten er stedet hvor du kan sætte dine mål for den kommende måned, holde styr på dine vaner og lægge planer.",
"habits": {
"title": "Vaner"
},
"itinerary": {
"title": "Plan"
}
},
"week": {
"title": "Ugeoversigt",
"description": "Ugeoversigten giver dig et overblik over ugen for at lette planlægningen",
"todos": {
"title": "Gøremål/TODOs"
},
"retrospective": {
"title": "Tilbageblik på ugen",
"description": "I tilbageblik på ugen kan du reflektere over hvordan den forgangne uge er gået - hvad der skete, hvordan det gik og hvad du kunne forbedre til næste uge?",
"itinerary": {
"title": "Plan"
}
}
},
"day": {
"title": "Dagsplan"
},
"special-dates": {
"title": "Specielle datoer",
"description": "Tilføj dine fødselsdage, fejringer, arrangementer, osv her for at få påmindelse om dem i din ugeoversigt og dagsoversigt når du kommer til dem.",
"empty": "Ingen datoer",
"placeholder": "Hvad er anledningen?",
"button": {
"item": "Tilføj dato",
"remove": "Fjern"
}
},
"generation-description": "PDF genereringen sker udelukkende i din browser - ingen data bliver sendt til vores servere!"
},
"preview": {
"title": "Kalender forhåndsvisning",
"subtitle": "(Kun første måned er vist i forhåndvisning)",
"viewer-title": "PDF forhåndsvisning",
"generating": {
"full": "Genererer fuld kalender - dette kan godt tage over et minut...",
"preview": "Genererer forhåndsvisning, vent venligst - detta kan tage et øjeblik."
},
"empty": {
"title": "Brug tilpasningsformen for at lave din egen personlige kalender",
"subtitle": "Her kommer forhåndsvisningen."
}
}
}
================================================
FILE: src/locales/da/config.json
================================================
{
"habits": {
"example1": "Træning",
"example2": "Bog",
"example3": "Hobby",
"example4": "Date Night"
},
"templates": {
"advanced": {
"day": {
"monday": "Ekstra side til yderligere mandagsnoter"
},
"retrospective": {
"wins": "Ugens opture",
"discoveries": "Nye ting jeg har lært",
"fails": "Hvad gik godt?"
}
}
},
"month": {
"goal": "Primære mål",
"notes": "Noter"
},
"todos": {
"example1": "Planlæg en tur",
"example2": "En anden TODO"
},
"special-dates": {
"example1": "Speciel dato 1",
"example2": "Speciel dato af en anden årsag",
"example3": "En anden fejring",
"example4": "En anden fejring hvor teksten er meget lang og fylder mere",
"example5": "Lad os tilføje et punkt mere",
"example6": "Kan ikke finde på flere ting at fejre"
}
}
================================================
FILE: src/locales/da/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "U#",
"retrospective": "TB"
},
"body": {
"retrospective": "T"
}
},
"page": {
"month": {
"habits": {
"title": "Vaner"
}
},
"week": {
"title": "Uge"
},
"retrospective": {
"title": "Tilbageblik for ugen"
},
"last": {
"title": "Genereret ved hjælp af <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "Du kan indlæse denne PDF igen for at få samme konfiguration hvis du ønsker hurtigt at generere en lignende kalender for det nye år!"
}
}
}
================================================
FILE: src/locales/de/app.json
================================================
{
"loading": "Lädt ...",
"download-ready": "Bereit zum Download!",
"navigation": {
"home": "Start",
"configuration": "Gestalte Deinen Kalender",
"features": "Funktionen",
"faq": "FAQ"
},
"language": {
"label": "Sprache",
"en": "Englisch",
"pl": "Polnisch",
"fr": "Französisch",
"es": "Spanisch",
"nb": "Norwegisch",
"da": "Dänisch",
"de": "Deutsch"
},
"configuration": {
"selector": {
"label": "Start",
"template": {
"label": "Wähle eine Vorlage aus:",
"basic": {
"label": "Basis",
"description": "Gut für den Anfang, einfache Voreinstellungen."
},
"advanced": {
"label": "Fortgeschritten",
"description": "Erweitert die Basis-Vorlage um Tagespläne."
},
"blank": {
"label": "Blanko",
"description": "Wie Basis, aber ohne die Beispiele für Gewohnheiten, Aufgaben, besondere Tage usw."
},
"minimalistic": {
"label": "Minimal",
"description": "Enthält lediglich die Wochenpläne."
}
},
"upload": {
"label": "Lade ein bereits erzeugtes ReCalendar-PDF hoch, um dessen Konfiguration zu verwenden:",
"loading": "Konfiguration aus PDF-Datei wird eingelesen, bitte warten...",
"error": "Ich kann in diesem PDF keine Konfigurationsdaten finden - stammt es wirklich von dieser Webseite?",
"success": "Konfiguration aus PDF geladen - Willkommen zurück!"
}
},
"general": {
"label": "Allgemeine Einstellungen",
"font": "Font",
"year": "Jahr",
"left-handed": {
"label": "Version für die Linke Hand",
"description": "Optimiert das Layout für die Benutzung mit der linken Hand."
},
"sidebar": {
"label": "Lasse die Seitenleiste frei",
"description": "Diese Option verhindert, dass der Kalenderinhalt von der Seitenleiste verdeckt wird, so dass die Seitenleiste immer offen bleiben kann."
},
"starting-month": {
"label": "Beginne mit dem Monat",
"description": "Der erste Monat des erzeugten Kalenders. Für einen Semesterkalender z.B. wähle den Oktober."
},
"month-count": {
"label": "Wieviele Monate",
"description": "Für wieviele Monate soll das Kalendarium erzeugt werden?"
},
"first-day-of-week": "Die Woche beginnt am",
"weekend": "Wochenende"
},
"button": {
"refresh": "Vorschau aktualisieren",
"download": "Vollständigen Kalender erzeugen und Download",
"generating": "Das Kalendarium wird erzeugt, bitte warten..."
},
"itinerary": {
"empty": "Leerer Plan",
"placeholder": {
"lines": "Anzahl der Zeilen",
"page": "Seitenumbruch"
},
"button": {
"copy": "Diesen Plan für alle Wochentage übernehmen.",
"remove": "Entfernen",
"item": "Neuer Planeintrag ",
"page": "Neue Seite anfangen",
"lines": "Leerzeilen hinzufügen"
}
},
"items-list": {
"button": {
"item": "Neuer Eintrag",
"remove": "Entfernen"
},
"empty": "Leere Liste",
"placeholder": "Eintrag"
},
"toggle-form": {
"enabled": "Ein",
"disabled": "Ausgeschaltet"
},
"month": {
"title": "Monatsübersicht",
"description": "Die Monatsübersicht ist der Ort für Monatsziele, Verfolgen von Gewohnheiten und andere Planungen.",
"habits": {
"title": "Routinen"
},
"itinerary": {
"title": "Plan"
}
},
"week": {
"title": "Wochenübersicht",
"description": "Die Wochenübersicht fasst zur übersichtlicheren Planung eine Woche zusammen.",
"todos": {
"title": "Aufgaben"
},
"retrospective": {
"title": "Wochenrückschau",
"description": "Die Wochenrückschau ist der Ort, um über die letzte Woche nachzudenken - wie es gelaufen ist, was du gelernt hast und was nächste Woche besser gemacht werden kann?",
"itinerary": {
"title": "Plan"
}
}
},
"day": {
"title": "Tagespläne"
},
"special-dates": {
"title": "Besondere Tage",
"description": "Trage hier Geburtstage, Feiertage, Events etc. ein. Sie werden in die Wochenübersichten und Tagespläne übernommen.",
"empty": "Keine Daten",
"placeholder": "Was gibt's besonderes?",
"button": {
"item": "Datum hinzufügen",
"remove": "Entfernen"
}
},
"generation-description": "Das PDF wird ausschließlich im Browser erzeugt, keine Daten landen auf unseren Servern!"
},
"preview": {
"title": "Vorschau des Kalendariums",
"subtitle": "(nur der erste Monat wird angezeigt)",
"viewer-title": "PDF Vorschau",
"generating": {
"full": "Das vollständige Kalendarium wird erzeugt - das könnte länger als eine Minute dauern...",
"preview": "Die Vorschau wird berechnet, bitte warten, das kann eine Minute dauern."
},
"empty": {
"title": "Mit den Optionen zur Konfiguration können Sie Ihren eigenen personalisierten Kalender erzeugen.",
"subtitle": "Hier wird die Vorschau angezeigt werden.."
}
}
}
================================================
FILE: src/locales/de/config.json
================================================
{
"habits": {
"example1": "Sport",
"example2": "Lesen",
"example3": "Hobby",
"example4": "Zeit für Zwei"
},
"templates": {
"advanced": {
"day": {
"monday": "Extraseite für zusätzliche Notizen am Montag"
},
"retrospective": {
"wins": "Erfolge der Woche",
"discoveries": "Neue Erkenntnisse",
"fails": "Was hat nicht geklappt?"
}
}
},
"month": {
"goal": "Wochenziel",
"notes": "Notizen"
},
"todos": {
"example1": "Plane eine Reise",
"example2": "noch eine Aufgabe"
},
"special-dates": {
"example1": "Besonderes Datum 1",
"example2": "Besonderes Datum aus Grund #2",
"example3": "Ein anderer Feiertag",
"example4": "Noch ein ziemlich langer Feiertag",
"example5": "Und noch ein Feiertag",
"example6": "Feiertag ohne bekannten Grund"
}
}
================================================
FILE: src/locales/de/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "W#",
"retrospective": "Re"
},
"body": {
"retrospective": "R"
}
},
"page": {
"month": {
"habits": {
"title": "Routinen"
}
},
"week": {
"title": "Woche"
},
"retrospective": {
"title": "Rückschau auf die Woche"
},
"last": {
"title": "Erzeugt mit <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "Sie können dieses PDF dort wieder hochladen, um mit denselben Konfiguratoinseinstellungen einen neuen Kalender für das nächste Jahr zu generieren!"
}
}
}
================================================
FILE: src/locales/en/app.json
================================================
{
"loading": "Loading...",
"download-ready": "Download now!",
"navigation": {
"home": "Home",
"configuration": "Create your calendar",
"features": "Features",
"faq": "FAQ"
},
"language": {
"label": "Language",
"full": "Fully translated languages",
"partial": "Only days of the week and months",
"en": "English",
"cs": "Čeština",
"da": "Dansk",
"de": "Deutsch",
"es": "Español",
"fr": "Français",
"he": "עברית",
"hr": "Hrvatski",
"hu": "Magyar",
"it": "Italiano",
"nb": "Norsk",
"nl": "Nederlands",
"pl": "Polski",
"pt-br": "Português (Brasil)",
"sl": "Slovenščina",
"sv": "Svenska",
"tr": "Türkçe"
},
"configuration": {
"selector": {
"label": "Start",
"template": {
"label": "Start by selecting a template:",
"basic": {
"label": "Basic",
"description": "Default settings - good starting point."
},
"advanced": {
"label": "Advanced",
"description": "Expands the Basic template by adding individual day itineraries."
},
"blank": {
"label": "Blank",
"description": "Based on Basic template, but with empty habits, TODOs, special dates, etc."
},
"minimalistic": {
"label": "Minimalistic",
"description": "Disables everything except weekly overviews."
}
},
"upload": {
"label": "Or upload previously generated ReCalendar PDF to use its config:",
"loading": "Reading config from PDF file, please wait...",
"error": "Was not able to load ReCalendar config from this PDF - are you sure it was generated using this website?",
"success": "Config loaded from PDF - welcome back!"
}
},
"general": {
"label": "General options",
"device": "Device",
"dpi": "DPI",
"resolution": "Resolution",
"font": "Font",
"year": "Year",
"left-handed": {
"label": "Left-handed version",
"description": "Optimizes the layout for left-handed use."
},
"sidebar": {
"label": "Leave permanent space for side toolbar",
"description": "If you prefer to keep the side toolbar always open, check this option to make sure the calendar's content will never be covered by it."
},
"starting-month": {
"label": "Starting month",
"description": "The first month in the generated calendar. Choose something like October if you want your calendar to cover a semester, instead of a calendar year."
},
"month-count": {
"label": "Number of months",
"description": "For how many months should the calendar be generated for."
},
"first-day-of-week": "First day of week",
"weekend": "Weekend"
},
"button": {
"refresh": "Refresh preview",
"download": "Generate full calendar and download",
"generating": "Generating, please wait..."
},
"itinerary": {
"empty": "Empty itinerary",
"placeholder": {
"lines": "Number of lines",
"page": "New page break",
"item": "Itinerary item"
},
"button": {
"copy": "Copy this itinerary to all other days",
"remove": "Remove",
"item": "Add itinerary item",
"page": "Start a new page",
"lines": "Add empty lines"
}
},
"items-list": {
"button": {
"item": "Add item",
"remove": "Remove"
},
"empty": "Empty list",
"placeholder": "Item"
},
"toggle-form": {
"enabled": "Enabled",
"disabled": "Disabled"
},
"month": {
"title": "Month overview",
"description": "The month overview is a place to set goals for the upcoming month, track habits and make other plans.",
"habits": {
"title": "Habits"
},
"itinerary": {
"title": "Itinerary"
}
},
"week": {
"title": "Week overview",
"description": "Week overview gives you a zoom out of the week to makes plans easier.",
"todos": {
"title": "TODOs"
},
"retrospective": {
"title": "Week retrospective",
"description": "Week retrospective is a place to reflect on the past week - how it went, what did you learn, what could you improve for next week?",
"itinerary": {
"title": "Itinerary"
}
}
},
"day": {
"title": "Day itineraries"
},
"special-dates": {
"title": "Special dates",
"description": "Add your birthdays, celebrations, events, etc. here to get reminders about them in weekly overviews and day pages as they approach.",
"empty": "No dates",
"placeholder": "What's the occasion?",
"upload": {
"label": "Import from .ics file:",
"loading": "Reading special dates from ICalendar file, please wait...",
"error": "Was not able to load some ICalendar events - try re-exporting the .ics file from your calendar app.",
"success": "Special dates loaded from ICalendar file."
},
"type": {
"event": "Event",
"holiday": "Holiday"
},
"button": {
"item": "Add date",
"remove": "Remove"
}
},
"generation-description": "PDF generation is done entirely in your browser - no data is sent to our servers!"
},
"preview": {
"title": "Calendar preview",
"subtitle": "(only first month is rendered for preview)",
"viewer-title": "PDF Preview",
"generating": {
"full": "Generating full calendar - this could take more than a minute...",
"preview": "Generating preview, please wait - it can take a minute."
},
"empty": {
"title": "Use the configuration form to create your personalized calendar.",
"subtitle": "The preview will appear here."
}
}
}
================================================
FILE: src/locales/en/config.json
================================================
{
"habits": {
"example1": "Exercise",
"example2": "Book",
"example3": "Hobby",
"example4": "Date night"
},
"templates": {
"advanced": {
"day": {
"monday": "Additional page for extra Monday notes"
},
"retrospective": {
"wins": "Wins of the week",
"discoveries": "New discoveries",
"fails": "What did not go well?"
}
}
},
"month": {
"goal": "Main goal",
"notes": "Notes"
},
"todos": {
"example1": "Plan a trip",
"example2": "Some other TODO"
},
"special-dates": {
"example1": "Special date 1",
"example2": "Special date for reason #2",
"example3": "Some other celebration",
"example4": "Some other other celebration that is very long",
"example5": "Let's add another one",
"example6": "Ran out of reasons celebration"
}
}
================================================
FILE: src/locales/en/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "W#",
"retrospective": "Re"
},
"body": {
"retrospective": "R"
}
},
"page": {
"month": {
"habits": {
"title": "Habits"
}
},
"week": {
"title": "Week"
},
"retrospective": {
"title": "Retrospective for week"
},
"last": {
"title": "Generated using <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "You can upload this PDF there again to load the same configuration that was used to create it and quickly generate a similar one for the new year!"
}
}
}
================================================
FILE: src/locales/es/app.json
================================================
{
"loading": "Cargando...",
"download-ready": "Descargar ahora!",
"navigation": {
"home": "Inicio",
"configuration": "Crear el calendario",
"features": "Características",
"faq": "FAQ"
},
"language": {
"label": "Idioma"
},
"configuration": {
"selector": {
"label": "Empezar",
"template": {
"label": "Empiece con una plantilla:",
"basic": {
"label": "Simple"
},
"advanced": {
"label": "Avanzada"
},
"blank": {
"label": "Vacía"
},
"minimalistic": {
"label": "Minimalista"
}
},
"upload": {
"label": "O cargue el PDF de ReCalendar generado previamente para usar su configuración:",
"loading": "Leyendo la configuración desde un archivo PDF... por favor, espere...",
"error": "No se pudo cargar la configuración de ReCalendar desde este PDF. ¿Está seguro de que se generó con este sitio?",
"success": "Configuración cargada desde el PDF - bienvenido de nuevo!"
}
},
"general": {
"label": "Opciones generales",
"year": "Año",
"starting-month": {
"label": "Mes de inicio",
"description": "El primer mes del calendario generado. Elija algo como octubre si desea que su calendario cubra un semestre, en lugar de un año."
},
"month-count": {
"label": "Cantidad de meses",
"description": "¿Cuántos meses quiere generar en su calendario?"
},
"first-day-of-week": "Primer día de la semana",
"weekend": "Weekend"
},
"button": {
"refresh": "Actualizar avance",
"download": "Genera el calendario completo y descarga",
"generating": "Generando, por favor espere..."
},
"itinerary": {
"empty": "Planificación vacía",
"placeholder": {
"lines": "Candida de líneas",
"page": "Nuevo salto de página"
},
"button": {
"remove": "Quitar",
"item": "Agregar un elemento de planificación",
"page": "Iniciar una nueva página",
"lines": "Agregar líneas"
}
},
"items-list": {
"button": {
"item": "Añadir un elemento",
"remove": "Quitar"
},
"empty": "Lista vacía",
"placeholder": "Elemento"
},
"toggle-form": {
"enabled": "Activado",
"disabled": "Desactivado"
},
"month": {
"title": "Resumen del mes",
"description": "El resumen del mes es un lugar para establecer objetivos para el próximo mes, realizar un seguimiento de los hábitos y hacer otros planes.",
"habits": {
"title": "Hábitos"
},
"itinerary": {
"title": "Planificación"
}
},
"week": {
"title": "Resumen de la semana",
"description": "El resumen de la semana le muestra una vista general de la semana para facilitar los planes.",
"todos": {
"title": "To-do list"
},
"retrospective": {
"title": "Retrospectiva de la semana",
"description": "La retrospectiva de la semana es un lugar para reflexionar sobre la semana pasada: ¿cómo fue, qué aprendio, que podría mejorar para la próxima semana?",
"itinerary": {
"title": "Planificación"
}
}
},
"day": {
"title": "Planificación diaria"
},
"special-dates": {
"title": "Fechas importantes",
"description": "Agregue sus cumpleaños, celebraciones, eventos, etc. Aquí puede recibir recordatorios sobre ellas en resúmenes semanales y páginas de días a medida que se acercan.",
"empty": "Sin fechas",
"placeholder": "¿Cuál es la ocasión?",
"button": {
"item": "Agregar fecha",
"remove": "Quitar"
}
},
"generation-description": "La generación de PDF se realiza completamente en su navegador, ¡no se envían datos a nuestros servidores!"
},
"preview": {
"title": "Vista previa del calendario",
"subtitle": "(solo se procesa el primer mes para la vista previa)",
"viewer-title": "Vista previa PDF",
"generating": {
"full": "Generando del calendario completo: esto podría llevar más de un minuto...",
"preview": "Generando la vista previa; espere, puede demorar un minuto."
},
"empty": {
"title": "Utilice el formulario de configuración para crear su calendario personalizado.",
"subtitle": "La vista previa aparecerá aquí."
}
}
}
================================================
FILE: src/locales/es/config.json
================================================
{
"habits": {
"example1": "Ejercicios",
"example2": "Libro",
"example3": "Afición",
"example4": "Noche de cita"
}
}
================================================
FILE: src/locales/es/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "S#",
"retrospective": "Re"
},
"body": {
"retrospective": "R"
}
},
"page": {
"month": {
"habits": {
"title": "Hábitos"
}
},
"week": {
"title": "Semana"
},
"retrospective": {
"title": "Retrospectiva por la semana"
},
"last": {
"title": "Generado usando <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "¡Puede cargar este PDF allí nuevamente para cargar la misma configuración que se usó para crearlo y generar rápidamente uno similar para el nuevo año!"
}
}
}
================================================
FILE: src/locales/fr/app.json
================================================
{
"loading": "Chargement en cours...",
"download-ready": "Téléchargez maintenant!",
"navigation": {
"home": "Accueil",
"configuration": "Créer son calendrier",
"features": "Caractéristiques",
"faq": "FAQ"
},
"language": {
"label": "Langue"
},
"configuration": {
"selector": {
"label": "Commencer",
"template": {
"label": "Commencez par sélectioner un modèle:",
"basic": {
"label": "Simple"
},
"advanced": {
"label": "Avancé"
},
"blank": {
"label": "Vide"
},
"minimalistic": {
"label": "Minimaliste"
}
},
"upload": {
"label": "Ou importez un PDF ReCalendar déjà généré pour utiliser sa configuration:",
"loading": "Configuration en cours, veuillez patienter...",
"error": "Échec de l'importation de la configuration du PDF ReCalendar. Êtes-vous sûr que le ficher a été généré sur ce site?",
"success": "Configuration importée - content de vous revoir!"
}
},
"general": {
"label": "Options générales",
"year": "Année",
"starting-month": {
"label": "Mois de départ",
"description": "Le premier mois dans le calendrier généré. Choisissez par example Octobre si vous désirez un calendrier pour un semestre plutôt qu'une année."
},
"month-count": {
"label": "Nombre de mois",
"description": "Combien de mois voulez-vous générer dans votre calendrier?"
},
"first-day-of-week": "Premier jour de la semaine",
"weekend": "Weekend"
},
"button": {
"refresh": "Actualiser l'aperçu",
"download": "Générer le calendrier complet et télécharger",
"generating": "Génération PDF en cours, veuillez patienter..."
},
"itinerary": {
"empty": "Planning vide",
"placeholder": {
"lines": "Nombre de lignes",
"page": "Nouveau saut de page"
},
"button": {
"remove": "Supprimer",
"item": "Ajouter un élément au planning",
"page": "Ouvrir une nouvelle page",
"lines": "Ajouter une ligne"
}
},
"items-list": {
"button": {
"item": "Ajouter un élément",
"remove": "Supprimer"
},
"empty": "Liste vide",
"placeholder": "Élément"
},
"toggle-form": {
"enabled": "Activé",
"disabled": "Désactivé"
},
"month": {
"title": "Aperçu du mois",
"description": "L'aperçu du mois est un endroit pour définir ses objectifs pour le mois à venir, suivre ses habitudes et planifier.",
"habits": {
"title": "Habitudes"
},
"itinerary": {
"title": "Planning"
}
},
"week": {
"title": "Aperçu de la semaine",
"description": "L'Aperçu de la semaine donne une vue générale de la semaine pour rendre la planification plus facile.",
"todos": {
"title": "To-do lists"
},
"retrospective": {
"title": "Rétrospective de la semaine",
"description": "La rétrospective de la semaine est un endroit pour prendre du recul sur la semaine passée - Comment s'est-t-elle passée, qu'avez-vous appris, que faire pour améliorer la semaine prochaine?",
"itinerary": {
"title": "Planning"
}
}
},
"day": {
"title": "Planning journalier"
},
"special-dates": {
"title": "Dates importantes",
"description": "Ajoutez des anniversaires, célébrations, évènements, etc. Ici, vous pouvez recevoir des rappels de ces dates dans l'aperçu de la semaine et les pages journalières.",
"empty": "Aucune date",
"placeholder": "Pour quelle occasion?",
"button": {
"item": "Ajouter une date",
"remove": "Supprimer"
}
},
"generation-description": "La génération de PDF se fait entièrement dans votre navigateur - aucune donnée n'est envoyée à nos serveurs!"
},
"preview": {
"title": "Aperçu du calendrier",
"subtitle": "(le premier mois seulement apparaît dans l'aperçu)",
"viewer-title": "Aperçu du PDF",
"generating": {
"full": "Génération du calendrier complet en cours - cela peut prendre plus d'une minute...",
"preview": "Génération de l'aperçu, veuillez patienter - cela peut prendre une minute."
},
"empty": {
"title": "Utilisez le formulaire de configuration pour créer votre calendrier personalisé.",
"subtitle": "L'aperçu s'affichera ici."
}
}
}
================================================
FILE: src/locales/fr/config.json
================================================
{
"habits": {
"example1": "Exercices",
"example2": "Livre",
"example3": "Loisir",
"example4": "Sortie en amoureux"
}
}
================================================
FILE: src/locales/fr/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "S#",
"retrospective": "Re"
},
"body": {
"retrospective": "R"
}
},
"page": {
"month": {
"habits": {
"title": "Habitudes"
}
},
"week": {
"title": "Semaine"
},
"retrospective": {
"title": "Retrospective de la semaine"
},
"last": {
"title": "Généré par <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "Vous pouvez importer ce PDF à nouveau pour obtenir la même configuration et créer rapidement un calendrier similaire pour la nouvelle année!"
}
}
}
================================================
FILE: src/locales/he/app.json
================================================
{
"loading": "טוען...",
"download-ready": "הורד עכשיו!",
"navigation": {
"home": "בית",
"configuration": "צור את היומן שלך",
"features": "מאפיינים",
"faq": "שאלות נפוצות"
},
"language": {
"label": "שפה",
"full": "שפות מתורגמות במלואן",
"partial": "רק ימים בשבוע וחודשים"
},
"configuration": {
"selector": {
"label": "התחל",
"template": {
"label": "התחל בבחירת תבנית:",
"basic": {
"label": "בסיסי",
"description": "הגדרות ברירת מחדל - נקודת התחלה טובה."
},
"advanced": {
"label": "מתקדם",
"description": "מרחיב את התבנית הבסיסית על ידי הוספת מסלולי טיול בודדים."
},
"blank": {
"label": "ריק",
"description": "מבוסס על תבנית בסיסית, אבל עם הרגלים ריקים, מטלות, תאריכים מיוחדים וכו'."
},
"minimalistic": {
"label": "מינימליסטי",
"description": "משבית הכל מלבד סקירות שבועיות."
}
},
"upload": {
"label": "או העלה את ReCalendar PDF שנוצר בעבר כדי להשתמש בתצורה שלו:",
"loading": "קורא תצורה מקובץ PDF, אנא המתן...",
"error": "לא הצליח לטעון את תצורת ReCalendar מ-PDF זה - האם אתה בטוח שהוא נוצר באמצעות אתר זה?",
"success": "התצורה נטענה מ-PDF - ברוך הבא!"
}
},
"general": {
"label": "אפשרויות כלליות",
"font": "גופן",
"year": "שנה",
"left-handed": {
"label": "גרסת-יד שמאל",
"description": "מייעל את הפריסה לשימוש ביד-שמאל."
},
"sidebar": {
"label": "השאר מקום קבוע לסרגל הכלים הצדדי",
"description": "אם אתה מעדיף להשאיר את סרגל הכלים הצדדי פתוח תמיד, סמן אפשרות זו כדי לוודא שתוכן היומן לעולם לא יכוסה בו."
},
"starting-month": {
"label": "תחילת החודש",
"description": "החודש הראשון בלוח השנה שנוצר. בחר משהו כמו אוקטובר אם אתה רוצה שהלוח שלך יכסה סמסטר, במקום שנה קלנדרית."
},
"month-count": {
"label": "מספר החודשים",
"description": "לכמה חודשים צריך להפיק את היומן."
},
"first-day-of-week": "יום הראשון בשבוע",
"weekend": "סוף שבוע"
},
"button": {
"refresh": "רענן תצוגה מקדימה",
"download": "צור לוח שנה מלא והורד",
"generating": "יוצר, אנא המתן..."
},
"itinerary": {
"empty": "מסלול ריק",
"placeholder": {
"lines": "מספר שורות",
"page": "מעבר עמוד חדש",
"item": "פריט מסלול"
},
"button": {
"copy": "העתק את המסלול הזה לכל שאר הימים",
"remove": "הסר",
"item": "הוסף פריט מסלול",
"page": "התחל דף חדש",
"lines": "הוסף שורות ריקות"
}
},
"items-list": {
"button": {
"item": "הוסף פריט",
"remove": "הסר"
},
"empty": "רשימה ריקה",
"placeholder": "פריט"
},
"toggle-form": {
"enabled": "מופעל",
"disabled": "מושבת"
},
"month": {
"title": "סקירת חודש",
"description": "סקירת החודש היא מקום להגדיר יעדים לחודש הקרוב, לעקוב אחר הרגלים ולתכנן תוכניות אחרות.",
"habits": {
"title": "הרגלים"
},
"itinerary": {
"title": "מסלול"
}
},
"week": {
"title": "סקירת שבוע",
"description": "סקירת שבוע נותנת לך הגדלה מהשבוע כדי להקל על התוכניות.",
"todos": {
"title": "מטלות"
},
"retrospective": {
"title": "רטרוספקטיבה של שבוע",
"description": "רטרוספקטיבה לשבוע היא מקום להרהר בשבוע האחרון - איך עבר, מה למדת, מה אפשר לשפר לשבוע הבא?",
"itinerary": {
"title": "מסלול"
}
}
},
"day": {
"title": "מסלולי יום"
},
"special-dates": {
"title": "תאריכים מיוחדים",
"description": "הוסף כאן את ימי ההולדת שלך, חגיגות, אירועים וכו' כדי לקבל תזכורות עליהם בסקירות שבועיות ובדפי יום כשהם מתקרבים.",
"empty": "אין תאריכים",
"placeholder": "מה האירוע?",
"upload": {
"label": "ייבוא מקובץ .ics:",
"loading": "קורא תאריכים מיוחדים מקובץ ICalendar, אנא המתן...",
"error": "לא הצליח לטעון חלק מאירועי ICalendar - נסה לייצא מחדש את קובץ ה-.ics מאפליקציית היומן שלך.",
"success": "תאריכים מיוחדים נטענים מקובץ ICalendar."
},
"type": {
"event": "אירוע",
"holiday": "חג"
},
"button": {
"item": "הוסף תאריך",
"remove": "הסר"
}
},
"generation-description": "הפקת PDF מתבצעת כולה בדפדפן שלך - לא נשלחים נתונים לשרתים שלנו!"
},
"preview": {
"title": "תצוגה מקדימה של לוח השנה",
"subtitle": "(רק החודש הראשון מוצג לתצוגה מקדימה)",
"viewer-title": "תצוגה מקדימה של PDF",
"generating": {
"full": "יצירת לוח שנה מלא - זה יכול לקחת יותר מדקה...",
"preview": "יוצר תצוגה מקדימה, אנא המתן - זה יכול לקחת דקה."
},
"empty": {
"title": "השתמש בטופס התצורה כדי ליצור את לוח השנה המותאם אישית שלך.",
"subtitle": "התצוגה המקדימה תופיע כאן."
}
}
}
================================================
FILE: src/locales/he/config.json
================================================
{
"habits": {
"example1": "אימונים",
"example2": "ספר",
"example3": "תחביב",
"example4": "לילה דייטים"
},
"templates": {
"advanced": {
"day": {
"monday": "עמוד נוסף להערות נוספות של יום שני"
},
"retrospective": {
"wins": "זכיות השבוע",
"discoveries": "תגליות חדשות",
"fails": "מה לא הלך טוב?"
}
}
},
"month": {
"goal": "המטרה העיקרית",
"notes": "הערות"
},
"todos": {
"example1": "לתכנן טיול",
"example2": "מטלות אחרות"
},
"special-dates": {
"example1": "תאריך מיוחד 1",
"example2": "תאריך מיוחד לסיבה מס' 2",
"example3": "איזו חגיגה אחרת",
"example4": "עוד חגיגה אחרת שהיא ארוכה מאוד",
"example5": "בואו נוסיף עוד אחד",
"example6": "נגמרו הסיבות לחגיגה"
}
}
================================================
FILE: src/locales/he/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "S#",
"retrospective": "Re"
},
"body": {
"retrospective": "R"
}
},
"page": {
"month": {
"habits": {
"title": "הרגלים"
}
},
"week": {
"title": "שבוע"
},
"retrospective": {
"title": "רטרוספקטיבה לשבוע"
},
"last": {
"title": "נוצר באמצעות <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "אתה יכול להעלות את ה-PDF הזה לשם שוב כדי לטעון את אותה תצורה ששימשה ליצירתו וליצור במהירות קובץ דומה לשנה החדשה!"
}
}
}
================================================
FILE: src/locales/hr/app.json
================================================
{
"loading": "Učitavanje...",
"download-ready": "Preuzmi sada!",
"navigation": {
"home": "Početna stranica",
"configuration": "Izradi svoj kalendar",
"features": "Značajke",
"faq": "Česta pitanja"
},
"language": {
"label": "Jezik",
"en": "English",
"pl": "Polski",
"fr": "Français",
"es": "Español",
"nb": "Norsk",
"da": "Dansk",
"hr": "Hrvatski"
},
"configuration": {
"selector": {
"label": "Početak",
"template": {
"label": "Započni odabirom predloška:",
"basic": {
"label": "Osnovni predložak",
"description": "Uobičajene postavke - dobra početna točka."
},
"advanced": {
"label": "Napredni predložak",
"description": "Proširuje Osnovi predložak dodavanjem rasporeda za svaki dan."
},
"blank": {
"label": "Prazno",
"description": "Temeljeno na Osnovnom predlošku, ali s praznim poljima za navike, listu s popisom obaveza, posebnim datumima itd."
},
"minimalistic": {
"label": "Minimalistično",
"description": "Onemogućuje sve osim tjednih pregleda."
}
},
"upload": {
"label": "Ili učitaj prethodno stvoreni ReCalendar PDF datoteku s već postojećom konfiguracijom:",
"loading": "Učitavanje konfiguracije iz PDF datoteke, molim pričekajte...",
"error": "Nije moguće učitati konfiguraciju iz ove PDF datoteke - jeste li sigurni da je PDF dokument izrađen putem ove stranice?",
"success": "Konfiguracija učitana iz PDF datoteke - dobrodošli natrag!"
}
},
"general": {
"label": "Uobičajene mogućnosti",
"font": "Font",
"year": "Godina",
"left-handed": {
"label": "Verzija za ljevake",
"description": "Optimizira izgled za osobe koje pišu lijevom rukom."
},
"sidebar": {
"label": "Ostavi trajni prostor za bočnu traku s alatima",
"description": "Ako želite da bočna traka s alatima bude uvijek otvorena, označite ovu opciju kako biste bili sigurni da sadržaj kalendara nikada neće biti prekriven njome."
},
"starting-month": {
"label": "Početni mjesec",
"description": "Prvi mjesec koji će se prikazati u izrađenom kalendaru. Odaberi nešto poput Listopada, ako želiš da kalendar pokrije npr. semestar, umjesto cijele godine."
},
"month-count": {
"label": "Broj mjeseci",
"description": "Broj mjeseci za bi ovaj kalendar trebao biti izrađen."
},
"first-day-of-week": "Početni dan u tjednu",
"weekend": "Vikend"
},
"button": {
"refresh": "Osvježi pregled",
"download": "Izradi cijeli kalendar i preuzmi",
"generating": "Izrada kalendara, molim pričekajte..."
},
"itinerary": {
"empty": "Prazan dnevni raspored",
"placeholder": {
"lines": "Broj linija",
"page": "Novi prekid stranice"
},
"button": {
"copy": "Kopirajte ovaj dnevni raspored na sve ostale dane",
"remove": "Ukloni",
"item": "Dodajte novu stavku dnevnom rasporedu",
"page": "Započni novu stranicu",
"lines": "Dodaj prazne retke"
}
},
"items-list": {
"button": {
"item": "Dodaj novu stavku",
"remove": "Ukloni"
},
"empty": "Prazan popis",
"placeholder": "Stavka"
},
"toggle-form": {
"enabled": "Omogućeno",
"disabled": "Onemogućeno"
},
"month": {
"title": "Mjesečni pregled",
"description": "Mjesečni pregled je mjesto na kojem se mogu definirati ciljevi za nadolazeći mjesec, postaviti navike i stvoriti ostali planovi.",
"habits": {
"title": "Navike"
},
"itinerary": {
"title": "Dnevni raspored"
}
},
"week": {
"title": "Tjedni pregled",
"description": "Tjedni pregled daje širi pregled tjedna za lakše planiranje.",
"todos": {
"title": "Popis obaveza"
},
"retrospective": {
"title": "Tjedna retrospektiva",
"description": "Tjedna retrospektiva je mjesto za razmišljanje o proteklom tjednu - kako je bilo, što ste naučili, što biste mogli poboljšati za sljedeći tjedan?",
"itinerary": {
"title": "Dnevni raspored"
}
}
},
"day": {
"title": "Zadaci dnevnog rasporeda"
},
"special-dates": {
"title": "Posebni datumi",
"description": "Ovdje dodajte Vaše posebne datume kao što su rođendani, obljetnice, proslave i druga događanja, kako bi dobili pravovremeni podsjetnik u tjednom pregledu i dnevnom rasporedu.",
"empty": "Bez datuma",
"placeholder": "Koja je prigoda?",
"button": {
"item": "Dodaj datume",
"remove": "Ukloni"
}
},
"generation-description": "Stvaranje PDF dokumenta odvija se isključivo u Vašem pregledniku - nikakvi podaci ne šalju se prema našim serverima!"
},
"preview": {
"title": "Pregled kalendara",
"subtitle": "(prikazuje se samo prvi mjesec kalendara)",
"viewer-title": "Pregled PDF dokumenta",
"generating": {
"full": "Stvaranje cijelog kalendara - ovo bi moglo potrajati duže od jedne minute...",
"preview": "Stvaranje pregleda kalendara, molim pričekajte - može potrajati nekoliko minuta."
},
"empty": {
"title": "Koristite konfiguraciju kako bi stvorili vlastiti personalizirani kalendar.",
"subtitle": "Pregled kalendara će se prikazati ovdje."
}
}
}
================================================
FILE: src/locales/hr/config.json
================================================
{
"habits": {
"example1": "Tjelovježba",
"example2": "Čitanje",
"example3": "Meditacija",
"example4": "Hobi"
},
"templates": {
"advanced": {
"day": {
"monday": "Dodatna stranica za bilješke ponedjeljkom"
},
"retrospective": {
"wins": "Pobjede ovog tjedna",
"discoveries": "Nova otkrića",
"fails": "Što bi moglo biti bolje?"
}
}
},
"month": {
"goal": "Glavni cilj",
"notes": "Bilješke"
},
"todos": {
"example1": "Isplaniraj putovanje",
"example2": "Neki drugi zadatak"
},
"special-dates": {
"example1": "Poseban datum",
"example2": "Još jedan poseban datumčić",
"example3": "Nekakva proslava",
"example4": "Još jedna proslava s jako dugačkim tekstom koji ide kroz više redova",
"example5": "Dodajmo još i rođendan moje mačke Lale",
"example6": "Možda imate ideju za još neki bitan blagdan? Božić!"
}
}
================================================
FILE: src/locales/hr/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "W#",
"retrospective": "Re"
},
"body": {
"retrospective": "R"
}
},
"page": {
"month": {
"habits": {
"title": "Navike"
}
},
"week": {
"title": "Tjedan"
},
"retrospective": {
"title": "Tjedna retrospektiva"
},
"last": {
"title": "Izrađeno korištenjem <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "Nožete ponovno učitati ovaj PDF dokument na navedenoj WEB stranici za učitavanje postojeće konfiguracije u svrhu bržeg i jednostavnijeg stvaranje novog kalendara za sljedeću godinu!"
}
}
}
================================================
FILE: src/locales/hu/app.json
================================================
{
"loading": "Betöltés...",
"download-ready": "Letöltés most!",
"navigation": {
"home": "Kezdőlap",
"configuration": "Hozd létre naptáradat",
"features": "Funkciók",
"faq": "GYIK"
},
"configuration": {
"selector": {
"label": "Kezdés",
"template": {
"label": "Sablon kiválasztása:",
"basic": {
"label": "Alap",
"description": "Alap beállítások - jó kiindulópont."
},
"advanced": {
"label": "Haladó",
"description": "A Haladó sablon kibővíti az Alap sablont egyedi tervekkel."
},
"blank": {
"label": "Üres",
"description": "Alap sablon, üres szokásokkal, teendőkkel, speciális dátumokkal, stb."
},
"minimalistic": {
"label": "Minimalista",
"description": "Minden kikapcsolva, csak heti áttekintéseket tartalmazza."
}
},
"upload": {
"label": "Vagy korábban generált ReCalendar PDF feltöltése, a benne lévő konfiguráció használatához:",
"loading": "PDF fájl konfiguráció olvasása, kérlek várj...",
"error": "Nem sikerült a ReCalendar konfigurációt beolvasni a PDF-ből - biztos, hogy ezen az oldalon generálódott?",
"success": "Beállítások beolvasva a PDF-ből - üdvözöljük újra!"
}
},
"general": {
"label": "Általános beállítások",
"font": "Betűtípus",
"year": "Év",
"left-handed": {
"label": "Balkezes verzió",
"description": "Az elrendezést balkezes használatra optimalizálja."
},
"sidebar": {
"label": "Hagyj helyet az oldalsáv számára",
"description": "Ha szereted az oldalsávot mindig nyitva tartani, jelöld be ezt az opciót, hogy biztosítsd, hogy a naptár tartalma soha ne legyen letakarva."
},
"starting-month": {
"label": "Kezdő hónap",
"description": "Az előállított naptár első hónapja. Válassz például szeptembert, ha tanítási évet szeretnél generálni, nem naptári évet."
},
"month-count": {
"label": "Hónapok száma",
"description": "Hány hónapra kell elkészíteni a naptárat."
},
"first-day-of-week": "Hét első napja",
"weekend": "Hétvége"
},
"button": {
"refresh": "Előnézet frissítése",
"download": "Teljes naptár generálása és letöltése",
"generating": "Generálás, kérlek várj..."
},
"itinerary": {
"empty": "Üres terv",
"placeholder": {
"lines": "Sorok száma",
"page": "Új oldaltörés",
"item": "Új terv"
},
"button": {
"copy": "Másold ezt a tervet az összes többi napra",
"remove": "Eltávolítás",
"item": "Új terv hozzáadása",
"page": "Új oldal indítása",
"lines": "Üres sorok hozzáadása"
}
},
"items-list": {
"button": {
"item": "Elem hozzáadása",
"remove": "Eltávolítás"
},
"empty": "Üres lista",
"placeholder": "Elem"
},
"toggle-form": {
"enabled": "Engedélyezve",
"disabled": "Letiltva"
},
"month": {
"title": "Hónap áttekintés",
"description": "A hónap áttekintés helyet ad a következő hónapok céljainak megadásához, szokások nyomon követéséhez és más tervek készítéséhez.",
"habits": {
"title": "Szokások"
},
"itinerary": {
"title": "Terv"
}
},
"week": {
"title": "Hét áttekintés",
"description": "A hét áttekintése lehetővé teszi a hét előretekintését, hogy megkönnyítse a tervek elkészítését.",
"todos": {
"title": "Teendők"
},
"retrospective": {
"title": "Heti visszatekintés",
"description": "A heti visszatekintés helyet ad a hét eseményeinek feldolgozásához - hogyan ment, mit tanultál, miben lehetnél jobb a következő héten?",
"itinerary": {
"title": "Terv"
}
}
},
"day": {
"title": "Napi Terv"
},
"special-dates": {
"title": "Különleges dátumok",
"description": "Add hozzá a születésnapjaidat, ünnepeidet, eseményeidet stb. ide, hogy emlékeztetőket kapj róluk a heti áttekintőkben és a napi oldalakon, ahogy közelednek.",
"empty": "Nincsenek dátumok",
"placeholder": "Mi az alkalom?",
"type": {
"event": "Esemény",
"holiday": "Ünnep"
},
"button": {
"item": "Dátum hozzáadása",
"remove": "Eltávolítás"
}
},
"generation-description": "A PDF generálása teljes egészében a böngésződben történik - nincs adat küldve a szervereinkre!"
},
"preview": {
"title": "Naptár előnézet",
"subtitle": "(csak az első hónap kerül megjelenítésre az előnézetben)",
"viewer-title": "PDF Előnézet",
"generating": {
"full": "Teljes naptár generálása - ez több mint egy percet is igénybe vehet...",
"preview": "Előnézet generálása, kérlek várj - ez eltarthat egy percig."
},
"empty": {
"title": "Használd a konfigurációs űrlapot, hogy létrehozd a saját testreszabott naptáradat.",
"subtitle": "Az előnézet itt fog megjelenni."
}
}
}
================================================
FILE: src/locales/hu/config.json
================================================
{
"habits": {
"example1": "Edzés",
"example2": "Könyv",
"example3": "Hobbi",
"example4": "Randevú"
},
"templates": {
"advanced": {
"day": {
"monday": "Extra hétfői jegyzetek hozzáadása"
},
"retrospective": {
"wins": "Heti sikerek",
"discoveries": "Új felfedezések",
"fails": "Mi nem sikerült jól?"
}
}
},
"month": {
"goal": "Fő cél",
"notes": "Jegyzetek"
},
"todos": {
"example1": "Utazás tervezése",
"example2": "Valamilyen más teendő"
},
"special-dates": {
"example1": "Különleges dátum 1",
"example2": "Különleges dátum 2",
"example3": "Valamilyen más ünnepség",
"example4": "Valami más egyéb ünnepség, ami nagyon hosszú",
"example5": "Adjunk hozzá még egyet",
"example6": "Elfogytak az okok ünnepség"
}
}
================================================
FILE: src/locales/hu/pdf.json
================================================
{
"calendar": {
"header": {
"week-number": "#",
"retrospective": "Vi"
},
"body": {
"retrospective": "V"
}
},
"page": {
"month": {
"habits": {
"title": "Szokások"
}
},
"week": {
"title": "Hét"
},
"retrospective": {
"title": "Heti visszatekintés"
},
"last": {
"title": "Generálva a következő weboldalon: <recalendar>https://recalendar.me/</recalendar>",
"subtitle": "Ez a PDF fájlt ismételten feltölthető az említett weboldalra, hogy betöltse a létrehozáskor használt konfigurációt, amivel létrehozható egy hasonló dokumentum a következő évre!"
}
}
}
================================================
FILE: src/locales/it/app.json
================================================
{
"loading": "Caricamento in corso...",
"download-ready": "Scarica ora!",
"navigation": {
"home": "Home",
"configuration": "Crea il tuo calendario",
"features": "Caratteristiche",
"faq": "FAQ"
},
"language": {
"label": "Lingua"
},
"configuration": {
"selector": {
"label": "Inizia",
"template": {
"label": "Seleziona un modello:",
"basic": {
"label": "Semplice",
"description": "Impostazioni predefinite - un buon punto da cui iniziare."
},
"advanced": {
"label": "Avanzato",
"description": "Espande il modello Semplice aggiungendo la Programmazione Giornaliera."
},
"blank": {
"label": "Vuoto",
"description": "Basato sul modello Semplice, ma con le sezioni Abitudini, Da Fare, Ricorrenze, ecc. vuote"
},
"minimalistic": {
"label": "Minimalista",
"description": "Disabilita tutto tranne le Panoramiche Settimanali."
}
},
"upload": {
"label": "Importare un PDF ReCalendar già generato per utilizzare la sua configurazione:",
"loading": "Configurazione in corso, attendere prego...",
"error": "Impossibile importare la configurazione del PDF ReCalendar. Sicuri che il file selezionato è stato generato su questo sito?",
"success": "Configurazione importata - bentornato!"
}
},
"general": {
"label": "Opzioni generali",
"font": "Tipo Carattere",
"year": "Anno",
"left-handed": {
"label": "Versione per mancini",
"description": "Ottimizza il layout per l'uso con la mano sinistra."
},
"sidebar": {
"label": "Lascia uno spazio permanente per la barra degli strumenti laterale",
"description": "Se si preferisce lasciare sempre aperta la barra degli strumenti laterale, selezionare questa opzione per assicurarsi che il contenuto del calendario non ne sia mai coperto."
},
"starting-month": {
"label": "Mese di partenza",
"description": "Il primo mese del calendario generato. Ad esempio, scegliendo luglio si può creare un calendario che copra un semestre piuttosto che un anno."
},
"month-count": {
"label": "Numero di mesi",
"description": "Quanti mesi volete generare nel vostro calendario?"
},
"first-day-of-week": "Primo giorno della settimana",
"weekend": "Fine-settimana"
},
"button": {
"refresh": "Aggiornare l'anteprima",
"download": "Generare il calendario completo e scaricare",
"generating": "Generazione del file PDF in corso, attendere prego..."
},
"itinerary": {
"empty": "Programmazione vuota",
"placeholder": {
"lines": "Numero di linee",
"page": "Nuova interruzione di pagina"
},
"button": {
"copy": "Copiare questa programmazione a tutti gli altri giorni",
"remove": "Rimuovere",
"item": "Aggiungere un elemento",
"page": "Aprire una nuova pagina",
"lines": "Aggiungere una linea"
}
},
"items-list": {
"button": {
"item": "Aggiungere un elemento",
"remove": "Rimuovere"
},
"empty": "Lista vuota",
"placeholder": "Elemento"
},
"toggle-form": {
"enabled": "Abilitato",
"disabled": "Disabilitato"
},
"month": {
"title": "Panoramica Mensile",
"description": "La panoramica Mensile è un luogo in cui fissare obiettivi per il prossimo mese, tenere traccia delle abitudini e pianificare le attività.",
"habits": {
"title": "Abitudini"
},
"itinerary": {
"title": "Pianificazione"
}
},
"week": {
"title": "Panoramica Settimanale",
"description": "La Panoramica Settimanale consente di semplificare la pianificazione delle attività settimanali.",
"todos": {
"title": "Liste di cose da fare"
},
"retrospective": {
"title": "Retrospettiva della Settimana",
"description": "La Retrospettiva della Settimana è un luogo in cui fare un passo indietro rispetto alla settimana appena trascorsa: com'è andata, cosa si è imparato, cosa si può fare per migliorare la prossima settimana?",
"itinerary": {
"title": "Pianificazione"
}
}
},
"day": {
"title": "Programma Giornaliero"
},
"special-dates": {
"title": "Ricorrenze",
"description": "Aggiungendo compleanni, celebrazioni, eventi, ecc. è possibile ricevere il promemoria di queste date nella panoramica settimanale e nelle pagine giornaliere.",
"empty": "Nessuna data",
"placeholder": "Per quale ricorrenza?",
"button": {
"item": "Aggiungere una data",
"remove": "Rimuovere"
}
},
"generation-description": "La generazione del PDF è fatta interamente nel browser locale: nessun dato è inviato a server esterni!"
},
"preview": {
"title": "Anteprima del Calendario",
"subtitle": "(solo il primo mese è mostrato nell'anteprima)",
"viewer-title": "Anteprima del PDF",
"generating": {
"full": "Generazione del calendario completo in corso - l'operazione potrebbe richiedere più di un minuto...",
"preview": "Generazione dell'anteprima in corso, attendi: l'operazione potrebbe richiedere circa un minuto."
},
"empty": {
"title": "Utilizzare il form di configurazione per personalizzare il calendario.",
"subtitle": "L'anteprima apparirà qui."
}
}
}
================================================
FILE: src/locales/it/config.json
================================================
{
"habits": {
"example1": "Esercizio",
"example2": "Libro",
"example3": "Hobby",
"example4": "Appuntamento"
},
"templates": {
"advanced": {
"day": {
"monday": "Pagina aggiuntiva del lunedì per le note extra"
},
"retrospective": {
"wins": "Risultati della settimana",
"discoveries": "Nuove Scoperte",
"fails": "Cosa non è andato bene?"
}
}
},
"month": {
"goal": "Obiettivi Principali",
"notes": "Note"
},
"todos": {
"example1": "Pianificare un viaggio",
"example2": "Altre cose da fare"
},
"special-dates": {
"example1": "Ricorrenza #1",
"example2": "Ricorrenza #2",
"example3": "Altra celebrazione",
"example4": "Altra celebrazione che è molto lunga",
"example5": "Varie",
"example6": "Esauriti i motivi per una celebrazione"
}
}
================================================
FILE: src/locales/it/pdf.json
===============
gitextract_cdadp12_/ ├── .eslintrc.cjs ├── .github/ │ └── FUNDING.yml ├── .gitignore ├── .nvmrc ├── .prettierrc ├── LICENSE ├── README.md ├── SCREENSHOTS.md ├── TRANSLATIONS.md ├── create.html ├── package.json ├── public/ │ ├── faq.html │ ├── features.html │ ├── index.html │ └── robots.txt ├── src/ │ ├── app.css │ ├── components/ │ │ ├── external-link.jsx │ │ ├── pdf-preview-card.jsx │ │ ├── pdf-preview.jsx │ │ └── pdf-progress.jsx │ ├── config/ │ │ ├── dayjs.js │ │ └── i18n.js │ ├── configuration-form/ │ │ ├── configuration-selector.jsx │ │ ├── items-list.jsx │ │ ├── itinerary.jsx │ │ ├── sortable-item.jsx │ │ ├── sortable-itinerary-row.jsx │ │ ├── special-dates.jsx │ │ └── toggle-accordion-item.jsx │ ├── configuration.jsx │ ├── index.css │ ├── index.jsx │ ├── lib/ │ │ ├── attachments.js │ │ ├── base64.js │ │ ├── config-compat.js │ │ ├── date.js │ │ ├── device-utils.js │ │ ├── id-utils.js │ │ ├── itinerary-utils.js │ │ ├── paths.js │ │ ├── pdf.js │ │ └── special-dates-utils.js │ ├── loader.jsx │ ├── locales/ │ │ ├── cs/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── da/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── de/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── en/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── es/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── fr/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── he/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── hr/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── hu/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── it/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── nb/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── nl/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── pl/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── pt-br/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── sl/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ ├── sv/ │ │ │ ├── app.json │ │ │ ├── config.json │ │ │ └── pdf.json │ │ └── tr/ │ │ ├── app.json │ │ ├── config.json │ │ └── pdf.json │ ├── navigation.jsx │ ├── pdf/ │ │ ├── components/ │ │ │ ├── header.jsx │ │ │ ├── itinerary.jsx │ │ │ └── mini-calendar.jsx │ │ ├── config.js │ │ ├── lib/ │ │ │ ├── fonts.js │ │ │ └── links.js │ │ ├── pages/ │ │ │ ├── day.jsx │ │ │ ├── last.jsx │ │ │ ├── month-overview.jsx │ │ │ ├── week-overview.jsx │ │ │ ├── week-retrospective.jsx │ │ │ └── year-overview.jsx │ │ ├── recalendar.jsx │ │ ├── styles.js │ │ └── utils.js │ └── worker/ │ └── pdf.worker.js ├── tsconfig.json ├── tsconfig.node.json └── vite.config.ts
SYMBOL INDEX (171 symbols across 39 files)
FILE: src/components/external-link.jsx
function ExternalLink (line 4) | function ExternalLink( { url, children } ) {
FILE: src/components/pdf-preview-card.jsx
class PdfPreviewCard (line 11) | class PdfPreviewCard extends React.PureComponent {
method renderPdfPreview (line 12) | renderPdfPreview() {
method renderNoPreview (line 52) | renderNoPreview() {
method render (line 79) | render() {
FILE: src/components/pdf-progress.jsx
constant UPDATE_INTERVAL (line 5) | const UPDATE_INTERVAL = 700;
class PdfProgress (line 7) | class PdfProgress extends React.Component {
method componentDidMount (line 12) | componentDidMount() {
method componentWillUnmount (line 16) | componentWillUnmount() {
method render (line 24) | render() {
FILE: src/config/i18n.js
function i18nConfiguration (line 4) | function i18nConfiguration( namespaces ) {
function getFullySupportedLocales (line 18) | function getFullySupportedLocales() {
function getPartiallySupportedLocales (line 30) | function getPartiallySupportedLocales() {
constant DAYJS_LOCALES (line 37) | const DAYJS_LOCALES = import.meta.glob( '../../node_modules/dayjs/esm/lo...
function handleLanguageChange (line 39) | function handleLanguageChange( newLanguage, firstDayOfWeek = 1 ) {
FILE: src/configuration-form/configuration-selector.jsx
constant STATUS_EMPTY (line 21) | const STATUS_EMPTY = 'EMPTY';
constant STATUS_LOADING (line 22) | const STATUS_LOADING = 'LOADING';
constant STATUS_ERROR (line 23) | const STATUS_ERROR = 'ERROR';
constant STATUS_SUCCESS (line 24) | const STATUS_SUCCESS = 'SUCCESS';
constant TEMPLATE_BASIC (line 26) | const TEMPLATE_BASIC = 'basic';
constant TEMPLATE_ADVANCED (line 27) | const TEMPLATE_ADVANCED = 'advanced';
constant TEMPLATE_BLANK (line 28) | const TEMPLATE_BLANK = 'blank';
constant TEMPLATE_MINIMALISTIC (line 29) | const TEMPLATE_MINIMALISTIC = 'minimalistic';
class ConfigurationSelector (line 31) | class ConfigurationSelector extends React.Component {
method getDefaultFirstDayOfWeek (line 36) | getDefaultFirstDayOfWeek() {
method generateAdvancedDayItems (line 132) | generateAdvancedDayItems( dayOfWeek ) {
method renderStatusMessage (line 191) | renderStatusMessage() {
method render (line 245) | render() {
FILE: src/configuration-form/items-list.jsx
function ItemsList (line 24) | function ItemsList( props ) {
FILE: src/configuration-form/itinerary.jsx
function Itinerary (line 25) | function Itinerary( props ) {
FILE: src/configuration-form/sortable-item.jsx
function SortableItem (line 10) | function SortableItem( props ) {
FILE: src/configuration-form/sortable-itinerary-row.jsx
function SortableItineraryRow (line 17) | function SortableItineraryRow( props ) {
FILE: src/configuration-form/special-dates.jsx
constant STATUS_EMPTY (line 18) | const STATUS_EMPTY = 'EMPTY';
constant STATUS_LOADING (line 19) | const STATUS_LOADING = 'LOADING';
constant STATUS_ERROR (line 20) | const STATUS_ERROR = 'ERROR';
constant STATUS_SUCCESS (line 21) | const STATUS_SUCCESS = 'SUCCESS';
class SpecialDates (line 26) | class SpecialDates extends React.Component {
method getGroupedItems (line 98) | getGroupedItems() {
method renderItem (line 108) | renderItem( groupedItems ) {
method renderItems (line 139) | renderItems( groupedItems ) {
method renderRemoveButton (line 144) | renderRemoveButton( id ) {
method renderStatusMessage (line 159) | renderStatusMessage() {
method render (line 211) | render() {
FILE: src/configuration-form/toggle-accordion-item.jsx
function ToggleAccordionItem (line 9) | function ToggleAccordionItem( { children, id, onToggle, t, title, toggle...
FILE: src/configuration.jsx
constant DAY_ITINERARY_ID_PREFIX (line 36) | const DAY_ITINERARY_ID_PREFIX = 'day-itinerary-';
class Configuration (line 38) | class Configuration extends React.PureComponent {
method constructor (line 48) | constructor( props ) {
method componentDidMount (line 58) | componentDidMount() {
method componentWillUnmount (line 62) | componentWillUnmount() {
method componentDidUpdate (line 66) | componentDidUpdate( prevProps, prevState ) {
method generatePdf (line 284) | generatePdf( isPreview ) {
method renderDevices (line 376) | renderDevices() {
method renderFonts (line 384) | renderFonts() {
method renderMonths (line 392) | renderMonths() {
method renderDaysOfWeek (line 403) | renderDaysOfWeek() {
method renderWeekendSelection (line 411) | renderWeekendSelection() {
method renderConfigurationForm (line 448) | renderConfigurationForm() {
method render (line 728) | render() {
FILE: src/lib/attachments.js
function getJsonAttachment (line 11) | async function getJsonAttachment( pdfData, attachmentName ) {
FILE: src/lib/base64.js
function utf8ToBase64 (line 3) | function utf8ToBase64( data ) {
FILE: src/lib/config-compat.js
function convertConfigToCurrentVersion (line 13) | function convertConfigToCurrentVersion( config ) {
function convertFromVersion1 (line 27) | function convertFromVersion1( config ) {
function convertFromVersion2 (line 34) | function convertFromVersion2( config ) {
FILE: src/lib/date.js
function getWeekdays (line 3) | function getWeekdays( firstDayOfWeek ) {
function getWeekendDays (line 22) | function getWeekendDays( weekendDayIndexes, firstDayOfWeek ) {
function getWeekNumber (line 33) | function getWeekNumber( day ) {
FILE: src/lib/device-utils.js
constant REMARKABLE (line 1) | const REMARKABLE = 'ReMarkable 1 & 2';
constant REMARKABLE_PAPER_PRO (line 2) | const REMARKABLE_PAPER_PRO = 'ReMarkable Paper Pro';
constant SUPERNOTE_A5_X (line 3) | const SUPERNOTE_A5_X = 'Supernote A5 X';
constant CUSTOM (line 4) | const CUSTOM = 'Custom';
constant AVAILABLE_DEVICES (line 6) | const AVAILABLE_DEVICES = [
function getPageProperties (line 13) | function getPageProperties( device ) {
FILE: src/lib/id-utils.js
function wrapWithId (line 3) | function wrapWithId( value ) {
function byId (line 13) | function byId( idToSearchFor ) {
FILE: src/lib/itinerary-utils.js
constant ITINERARY_ITEM (line 1) | const ITINERARY_ITEM = 'item';
constant ITINERARY_LINES (line 2) | const ITINERARY_LINES = 'lines';
constant ITINERARY_NEW_PAGE (line 3) | const ITINERARY_NEW_PAGE = 'new_page';
FILE: src/lib/paths.js
constant RECALENDAR_JS_GITHUB (line 1) | const RECALENDAR_JS_GITHUB =
constant RECALENDAR_PHP_GITHUB (line 3) | const RECALENDAR_PHP_GITHUB = 'https://github.com/klimeryk/recalendar/';
constant HOME_PATH (line 5) | const HOME_PATH = '/';
constant CONFIGURATOR_PATH (line 6) | const CONFIGURATOR_PATH = '/create';
constant FEATURES_PATH (line 7) | const FEATURES_PATH = '/features';
constant FAQ_PATH (line 8) | const FAQ_PATH = '/faq';
FILE: src/lib/special-dates-utils.js
constant HOLIDAY_DAY_TYPE (line 1) | const HOLIDAY_DAY_TYPE = 'holiday';
constant EVENT_DAY_TYPE (line 2) | const EVENT_DAY_TYPE = 'event';
function isHoliday (line 4) | function isHoliday( { type } ) {
function isEvent (line 7) | function isEvent( { type } ) {
function findByDate (line 11) | function findByDate( dateToSearchFor ) {
constant DATE_FORMAT (line 15) | const DATE_FORMAT = 'MM-DD';
FILE: src/loader.jsx
class Loader (line 8) | class Loader extends React.Component {
method componentDidMount (line 9) | componentDidMount() {
method render (line 14) | render() {
FILE: src/navigation.jsx
class Navigation (line 19) | class Navigation extends React.Component {
method componentDidMount (line 24) | componentDidMount() {
method componentWillUnmount (line 28) | componentWillUnmount() {
method render (line 57) | render() {
FILE: src/pdf/components/header.jsx
class Header (line 5) | class Header extends React.PureComponent {
method constructor (line 6) | constructor( props ) {
method renderSpecialItems (line 85) | renderSpecialItems() {
method render (line 101) | render() {
FILE: src/pdf/components/itinerary.jsx
class Itinerary (line 7) | class Itinerary extends React.PureComponent {
method renderItem (line 30) | renderItem( text, index ) {
method renderLines (line 38) | renderLines( count ) {
method render (line 47) | render() {
FILE: src/pdf/components/mini-calendar.jsx
constant HIGHLIGHT_WEEK (line 23) | const HIGHLIGHT_WEEK = 'HIGHLIGHT_WEEK';
constant HIGHLIGHT_DAY (line 24) | const HIGHLIGHT_DAY = 'HIGHLIGHT_DAY';
constant HIGHLIGHT_NONE (line 25) | const HIGHLIGHT_NONE = 'HIGHLIGHT_NONE';
class MiniCalendar (line 27) | class MiniCalendar extends React.Component {
method renderMonthName (line 117) | renderMonthName() {
method renderWeekdayNames (line 144) | renderWeekdayNames() {
method renderMonth (line 183) | renderMonth() {
method renderWeek (line 195) | renderWeek( week ) {
method render (line 281) | render() {
FILE: src/pdf/config.js
constant CONFIG_FIELDS (line 13) | const CONFIG_FIELDS = [
constant CONFIG_FILE (line 36) | const CONFIG_FILE = 'config.json';
constant CONFIG_VERSION_1 (line 37) | const CONFIG_VERSION_1 = 'v1';
constant CONFIG_VERSION_2 (line 38) | const CONFIG_VERSION_2 = 'v2';
constant CONFIG_VERSION_3 (line 39) | const CONFIG_VERSION_3 = 'v3';
constant CONFIG_CURRENT_VERSION (line 40) | const CONFIG_CURRENT_VERSION = CONFIG_VERSION_3;
function hydrateFromObject (line 42) | function hydrateFromObject( object ) {
class PdfConfig (line 52) | class PdfConfig {
method constructor (line 53) | constructor( configOverrides = {} ) {
method ensureUniqueIds (line 154) | ensureUniqueIds() {
FILE: src/pdf/lib/fonts.js
function generateFontDefinition (line 1) | function generateFontDefinition( font ) {
constant ARIMO (line 20) | const ARIMO = 'Arimo';
constant LATO (line 21) | const LATO = 'Lato';
constant MONTSERRAT (line 22) | const MONTSERRAT = 'Montserrat';
constant SOURCE_SERIF_PRO (line 23) | const SOURCE_SERIF_PRO = 'SourceSerifPro';
constant AVAILABLE_FONTS (line 24) | const AVAILABLE_FONTS = [ ARIMO, LATO, MONTSERRAT, SOURCE_SERIF_PRO ];
constant FONT_DEFINITIONS (line 26) | const FONT_DEFINITIONS = {
function getFontDefinition (line 33) | function getFontDefinition( font ) {
FILE: src/pdf/lib/links.js
function dayPageLink (line 1) | function dayPageLink( date, config ) {
function nextDayPageLink (line 20) | function nextDayPageLink( date, config ) {
function previousDayPageLink (line 25) | function previousDayPageLink( date, config ) {
function findEnabledDayPageLink (line 30) | function findEnabledDayPageLink( date, config, step ) {
function findDayOfWeek (line 46) | function findDayOfWeek( needle ) {
function monthOverviewLink (line 50) | function monthOverviewLink( date, config ) {
function weekOverviewLink (line 69) | function weekOverviewLink( date, config ) {
function weekRetrospectiveLink (line 86) | function weekRetrospectiveLink( date ) {
function yearOverviewLink (line 90) | function yearOverviewLink() {
FILE: src/pdf/pages/day.jsx
class DayPage (line 23) | class DayPage extends React.Component {
method render (line 36) | render() {
FILE: src/pdf/pages/last.jsx
class LastPage (line 9) | class LastPage extends React.Component {
method render (line 33) | render() {
FILE: src/pdf/pages/month-overview.jsx
class MonthOverviewPage (line 15) | class MonthOverviewPage extends React.Component {
method constructor (line 16) | constructor( props ) {
method renderHabitsTable (line 123) | renderHabitsTable() {
method renderHabitsHeader (line 137) | renderHabitsHeader() {
method renderDay (line 159) | renderDay( day ) {
method renderHabitSquares (line 183) | renderHabitSquares() {
method render (line 207) | render() {
FILE: src/pdf/pages/week-overview.jsx
class WeekOverviewPage (line 19) | class WeekOverviewPage extends React.Component {
method getNameOfWeek (line 72) | getNameOfWeek() {
method renderDays (line 79) | renderDays() {
method renderDay (line 94) | renderDay( day ) {
method renderTodos (line 125) | renderTodos() {
method render (line 137) | render() {
FILE: src/pdf/pages/week-retrospective.jsx
class WeekRetrospectivePage (line 16) | class WeekRetrospectivePage extends React.Component {
method getNameOfWeek (line 21) | getNameOfWeek() {
method render (line 28) | render() {
FILE: src/pdf/pages/year-overview.jsx
class YearOverviewPage (line 10) | class YearOverviewPage extends React.Component {
method renderCalendars (line 24) | renderCalendars() {
method render (line 45) | render() {
FILE: src/pdf/recalendar.jsx
class RecalendarPdf (line 14) | class RecalendarPdf extends React.Component {
method renderWeek (line 25) | renderWeek( startOfWeek ) {
method renderCalendar (line 58) | renderCalendar() {
method render (line 92) | render() {
FILE: src/pdf/styles.js
function pageStyle (line 1) | function pageStyle( { alwaysOnSidebar, isLeftHanded } ) {
FILE: src/pdf/utils.js
function splitItemsByPages (line 3) | function splitItemsByPages( items ) {
FILE: src/worker/pdf.worker.js
function encodeConfig (line 36) | function encodeConfig( data ) {
function hyphenationCallback (line 47) | function hyphenationCallback( word ) {
Condensed preview — 114 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (334K chars).
[
{
"path": ".eslintrc.cjs",
"chars": 4179,
"preview": "module.exports = {\n root: true,\n env: { browser: true, es2020: true },\n extends: [\n 'eslint:recommended',\n 'plu"
},
{
"path": ".github/FUNDING.yml",
"chars": 706,
"preview": "# These are supported funding model platforms\n\ngithub: [klimeryk]\npatreon: # Replace with a single Patreon username\nopen"
},
{
"path": ".gitignore",
"chars": 159,
"preview": "/node_modules\n\n/dist\n\n# misc\n.DS_Store\n.env.local\n.env.development.local\n.env.test.local\n.env.production.local\n\nnpm-debu"
},
{
"path": ".nvmrc",
"chars": 5,
"preview": "18.*\n"
},
{
"path": ".prettierrc",
"chars": 136,
"preview": "useTabs: true\ntabWidth: 2\nprintWidth: 80\nsingleQuote: true\nbracketSpacing: true\nparenSpacing: true\njsxBracketSameLine: f"
},
{
"path": "LICENSE",
"chars": 34523,
"preview": " GNU AFFERO GENERAL PUBLIC LICENSE\n Version 3, 19 November 2007\n\n Copyright (C)"
},
{
"path": "README.md",
"chars": 2299,
"preview": "# ReCalendar\n### Highly customizable calendar for ReMarkable tablets\n\nReCalendar allows you to generate your own, person"
},
{
"path": "SCREENSHOTS.md",
"chars": 1320,
"preview": "<img width=\"460\" alt=\"Screenshot 2021-12-28 at 19 21 53\" src=\"https://user-images.githubusercontent.com/3392497/14759997"
},
{
"path": "TRANSLATIONS.md",
"chars": 1501,
"preview": "## How to translate ReCalendar to your language\n\n### If you're not a developer\n\n - Grab the `*.json` files from this fol"
},
{
"path": "create.html",
"chars": 682,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta\n name=\"description\"\n cont"
},
{
"path": "package.json",
"chars": 1488,
"preview": "{\n \"name\": \"recalendar.js\",\n \"private\": true,\n \"version\": \"2.0.0\",\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"vit"
},
{
"path": "public/faq.html",
"chars": 3808,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width,"
},
{
"path": "public/features.html",
"chars": 7845,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width,"
},
{
"path": "public/index.html",
"chars": 4971,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"utf-8\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width,"
},
{
"path": "public/robots.txt",
"chars": 67,
"preview": "# https://www.robotstxt.org/robotstxt.html\nUser-agent: *\nDisallow:\n"
},
{
"path": "src/app.css",
"chars": 407,
"preview": "html,\nbody,\n#root {\n\theight: 100%;\n}\n\n.input-group > .date-field {\n\twidth: 160px;\n}\n\n.special-date {\n\tmin-width: 120px;\n"
},
{
"path": "src/components/external-link.jsx",
"chars": 318,
"preview": "import PropTypes from 'prop-types';\nimport React from 'react';\n\nexport default function ExternalLink( { url, children } "
},
{
"path": "src/components/pdf-preview-card.jsx",
"chars": 2511,
"preview": "import PropTypes from 'prop-types';\nimport React from 'react';\nimport Button from 'react-bootstrap/Button';\nimport Spinn"
},
{
"path": "src/components/pdf-preview.jsx",
"chars": 326,
"preview": "import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst PdfPreview = ( { blobUrl, title } ) => {\n\treturn <"
},
{
"path": "src/components/pdf-progress.jsx",
"chars": 753,
"preview": "import PropTypes from 'prop-types';\nimport React from 'react';\nimport ProgressBar from 'react-bootstrap/ProgressBar';\n\nc"
},
{
"path": "src/config/dayjs.js",
"chars": 697,
"preview": "import dayjs from 'dayjs/esm';\nimport advancedFormat from 'dayjs/esm/plugin/advancedFormat';\nimport customParseFormat fr"
},
{
"path": "src/config/i18n.js",
"chars": 1641,
"preview": "import dayjs from 'dayjs/esm';\nimport dayjsLocales from 'dayjs/locale.json';\n\nexport function i18nConfiguration( namespa"
},
{
"path": "src/configuration-form/configuration-selector.jsx",
"chars": 6962,
"preview": "import PropTypes from 'prop-types';\nimport React from 'react';\nimport Alert from 'react-bootstrap/Alert';\nimport Button "
},
{
"path": "src/configuration-form/items-list.jsx",
"chars": 2494,
"preview": "import {\n\tDndContext,\n\tclosestCenter,\n\tKeyboardSensor,\n\tPointerSensor,\n\tuseSensor,\n\tuseSensors,\n} from '@dnd-kit/core';\n"
},
{
"path": "src/configuration-form/itinerary.jsx",
"chars": 3164,
"preview": "import {\n\tDndContext,\n\tclosestCenter,\n\tKeyboardSensor,\n\tPointerSensor,\n\tuseSensor,\n\tuseSensors,\n} from '@dnd-kit/core';\n"
},
{
"path": "src/configuration-form/sortable-item.jsx",
"chars": 2210,
"preview": "import { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport PropTypes from 'prop-t"
},
{
"path": "src/configuration-form/sortable-itinerary-row.jsx",
"chars": 3436,
"preview": "import { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\nimport PropTypes from 'prop-t"
},
{
"path": "src/configuration-form/special-dates.jsx",
"chars": 7910,
"preview": "import dayjs from 'dayjs/esm';\nimport ICAL from 'ical.js';\nimport PropTypes from 'prop-types';\nimport React from 'react'"
},
{
"path": "src/configuration-form/toggle-accordion-item.jsx",
"chars": 1478,
"preview": "import PropTypes from 'prop-types';\nimport React from 'react';\nimport Accordion from 'react-bootstrap/Accordion';\nimport"
},
{
"path": "src/configuration.jsx",
"chars": 23424,
"preview": "import { arrayMove } from '@dnd-kit/sortable';\nimport dayjs from 'dayjs/esm';\nimport { saveAs } from 'file-saver';\nimpor"
},
{
"path": "src/index.css",
"chars": 366,
"preview": "body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Can"
},
{
"path": "src/index.jsx",
"chars": 813,
"preview": "import i18n from 'i18next';\nimport LanguageDetector from 'i18next-browser-languagedetector';\nimport React from 'react';\n"
},
{
"path": "src/lib/attachments.js",
"chars": 1365,
"preview": "import {\n\tPDFDocument,\n\tPDFName,\n\tPDFDict,\n\tPDFArray,\n\tPDFStream,\n\tdecodePDFRawStream,\n} from 'pdf-lib';\n\n// https://git"
},
{
"path": "src/lib/base64.js",
"chars": 257,
"preview": "// From https://developer.mozilla.org/en-US/docs/Glossary/Base64\n\nexport function utf8ToBase64( data ) {\n\treturn btoa(\n\t"
},
{
"path": "src/lib/config-compat.js",
"chars": 1245,
"preview": "import dayjs from 'dayjs/esm';\n\nimport {\n\tDATE_FORMAT as SPECIAL_DATES_DATE_FORMAT,\n\tEVENT_DAY_TYPE,\n} from '~/lib/speci"
},
{
"path": "src/lib/date.js",
"chars": 1069,
"preview": "import dayjs from 'dayjs/esm';\n\nexport function getWeekdays( firstDayOfWeek ) {\n\tconst weekdaysFull = dayjs.weekdays();\n"
},
{
"path": "src/lib/device-utils.js",
"chars": 553,
"preview": "export const REMARKABLE = 'ReMarkable 1 & 2';\nconst REMARKABLE_PAPER_PRO = 'ReMarkable Paper Pro';\nconst SUPERNOTE_A5_X "
},
{
"path": "src/lib/id-utils.js",
"chars": 305,
"preview": "import { nanoid } from 'nanoid';\n\nexport function wrapWithId( value ) {\n\tif ( Object.hasOwn( value, 'id' ) ) {\n\t\treturn "
},
{
"path": "src/lib/itinerary-utils.js",
"chars": 124,
"preview": "export const ITINERARY_ITEM = 'item';\nexport const ITINERARY_LINES = 'lines';\nexport const ITINERARY_NEW_PAGE = 'new_pag"
},
{
"path": "src/lib/paths.js",
"chars": 312,
"preview": "export const RECALENDAR_JS_GITHUB =\n\t'https://github.com/klimeryk/recalendar.js/';\nexport const RECALENDAR_PHP_GITHUB = "
},
{
"path": "src/lib/pdf.js",
"chars": 3462,
"preview": "// Copied from react-pdf/blob/87abdd00e62287dccf89c8d260b18dc758482b31/packages/renderer/src/index.js\n\nimport FontStore "
},
{
"path": "src/lib/special-dates-utils.js",
"chars": 371,
"preview": "export const HOLIDAY_DAY_TYPE = 'holiday';\nexport const EVENT_DAY_TYPE = 'event';\n\nexport function isHoliday( { type } )"
},
{
"path": "src/loader.jsx",
"chars": 629,
"preview": "import React from 'react';\nimport { withTranslation } from 'react-i18next';\n\nimport Configuration from '~/configuration'"
},
{
"path": "src/locales/cs/app.json",
"chars": 4254,
"preview": "{\r\n\t\"loading\": \"Načítání...\",\r\n\t\"download-ready\": \"Stáhnout!\",\r\n\t\"navigation\": {\r\n\t\t\"home\": \"Domů\",\r\n\t\t\"configuration\": "
},
{
"path": "src/locales/cs/config.json",
"chars": 790,
"preview": "{\r\n\t\"habits\": {\r\n\t\t\"example1\": \"Cvičení\",\r\n\t\t\"example2\": \"Kniha\",\r\n\t\t\"example3\": \"Koníček\",\r\n\t\t\"example4\": \"Rande\"\r\n\t},\r"
},
{
"path": "src/locales/cs/pdf.json",
"chars": 500,
"preview": "{\r\n\t\"calendar\": {\r\n\t\t\"header\": {\r\n\t\t\t\"week-number\": \"T#\",\r\n\t\t\t\"retrospective\": \"Re\"\r\n\t\t},\r\n\t\t\"body\": {\r\n\t\t\t\"retrospectiv"
},
{
"path": "src/locales/da/app.json",
"chars": 4426,
"preview": "{\n\t\"loading\": \"indlæser...\",\n\t\"download-ready\": \"Download nu!\",\n\t\"navigation\": {\n\t\t\"home\": \"Hjem\",\n\t\t\"configuration\": \"L"
},
{
"path": "src/locales/da/config.json",
"chars": 881,
"preview": "{\n \"habits\": {\n \"example1\": \"Træning\",\n \"example2\": \"Bog\",\n \"example3\": \"Hobby\",\n \"example4\": \"Date Night\"\n"
},
{
"path": "src/locales/da/pdf.json",
"chars": 610,
"preview": "{\n \"calendar\": {\n \"header\": {\n \"week-number\": \"U#\",\n \"retrospective\": \"TB\"\n },\n \"body\": {\n \"ret"
},
{
"path": "src/locales/de/app.json",
"chars": 4804,
"preview": "{\n\t\"loading\": \"Lädt ...\",\n\t\"download-ready\": \"Bereit zum Download!\",\n\t\"navigation\": {\n\t\t\"home\": \"Start\",\n\t\t\"configuratio"
},
{
"path": "src/locales/de/config.json",
"chars": 803,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Sport\",\n\t\t\"example2\": \"Lesen\",\n\t\t\"example3\": \"Hobby\",\n\t\t\"example4\": \"Zeit für Zwei\"\n\t},\n\t\""
},
{
"path": "src/locales/de/pdf.json",
"chars": 566,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"W#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/en/app.json",
"chars": 5374,
"preview": "{\n\t\"loading\": \"Loading...\",\n\t\"download-ready\": \"Download now!\",\n\t\"navigation\": {\n\t\t\"home\": \"Home\",\n\t\t\"configuration\": \"C"
},
{
"path": "src/locales/en/config.json",
"chars": 790,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Exercise\",\n\t\t\"example2\": \"Book\",\n\t\t\"example3\": \"Hobby\",\n\t\t\"example4\": \"Date night\"\n\t},\n\t\"t"
},
{
"path": "src/locales/en/pdf.json",
"chars": 563,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"W#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/es/app.json",
"chars": 4079,
"preview": "{\n\t\"loading\": \"Cargando...\",\n\t\"download-ready\": \"Descargar ahora!\",\n\t\"navigation\": {\n\t\t\"home\": \"Inicio\",\n\t\t\"configuratio"
},
{
"path": "src/locales/es/config.json",
"chars": 126,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Ejercicios\",\n\t\t\"example2\": \"Libro\",\n\t\t\"example3\": \"Afición\",\n\t\t\"example4\": \"Noche de cita\""
},
{
"path": "src/locales/es/pdf.json",
"chars": 575,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"S#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/fr/app.json",
"chars": 4147,
"preview": "{\n\t\"loading\": \"Chargement en cours...\",\n\t\"download-ready\": \"Téléchargez maintenant!\",\n\t\"navigation\": {\n\t\t\"home\": \"Accuei"
},
{
"path": "src/locales/fr/config.json",
"chars": 129,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Exercices\",\n\t\t\"example2\": \"Livre\",\n\t\t\"example3\": \"Loisir\",\n\t\t\"example4\": \"Sortie en amoure"
},
{
"path": "src/locales/fr/pdf.json",
"chars": 563,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"S#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/he/app.json",
"chars": 4474,
"preview": "{\n\t\"loading\": \"טוען...\",\n\t\"download-ready\": \"הורד עכשיו!\",\n\t\"navigation\": {\n\t\t\"home\": \"בית\",\n\t\t\"configuration\": \"צור את "
},
{
"path": "src/locales/he/config.json",
"chars": 728,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"אימונים\",\n\t\t\"example2\": \"ספר\",\n\t\t\"example3\": \"תחביב\",\n\t\t\"example4\": \"לילה דייטים\"\n\t},\n\t\"te"
},
{
"path": "src/locales/he/pdf.json",
"chars": 521,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"S#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/hr/app.json",
"chars": 5091,
"preview": "{\n\t\"loading\": \"Učitavanje...\",\n\t\"download-ready\": \"Preuzmi sada!\",\n\t\"navigation\": {\n\t\t\"home\": \"Početna stranica\",\n\t\t\"con"
},
{
"path": "src/locales/hr/config.json",
"chars": 871,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Tjelovježba\",\n\t\t\"example2\": \"Čitanje\",\n\t\t\"example3\": \"Meditacija\",\n\t\t\"example4\": \"Hobi\"\n\t}"
},
{
"path": "src/locales/hr/pdf.json",
"chars": 603,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"W#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/hu/app.json",
"chars": 4690,
"preview": "{\n\t\"loading\": \"Betöltés...\",\n\t\"download-ready\": \"Letöltés most!\",\n\t\"navigation\": {\n\t\t\"home\": \"Kezdőlap\",\n\t\t\"configuratio"
},
{
"path": "src/locales/hu/config.json",
"chars": 778,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Edzés\",\n\t\t\"example2\": \"Könyv\",\n\t\t\"example3\": \"Hobbi\",\n\t\t\"example4\": \"Randevú\"\n\t},\n\t\"templa"
},
{
"path": "src/locales/hu/pdf.json",
"chars": 607,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"#\",\n\t\t\t\"retrospective\": \"Vi\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"V\"\n"
},
{
"path": "src/locales/it/app.json",
"chars": 5133,
"preview": "{\n\t\"loading\": \"Caricamento in corso...\",\n\t\"download-ready\": \"Scarica ora!\",\n\t\"navigation\": {\n\t\t\"home\": \"Home\",\n\t\t\"config"
},
{
"path": "src/locales/it/config.json",
"chars": 800,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Esercizio\",\n\t\t\"example2\": \"Libro\",\n\t\t\"example3\": \"Hobby\",\n\t\t\"example4\": \"Appuntamento\"\n\t},"
},
{
"path": "src/locales/it/pdf.json",
"chars": 589,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"S#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/nb/app.json",
"chars": 3773,
"preview": "{\n\t\"loading\": \"Laster...\",\n\t\"download-ready\": \"Last ned nå!\",\n\t\"navigation\": {\n\t\t\"home\": \"Hjem\",\n\t\t\"configuration\": \"Lag"
},
{
"path": "src/locales/nb/config.json",
"chars": 116,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Trening\",\n\t\t\"example2\": \"Bok\",\n\t\t\"example3\": \"Hobby\",\n\t\t\"example4\": \"Stevnemøte\"\n\t}\n}\n"
},
{
"path": "src/locales/nb/pdf.json",
"chars": 557,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"Uke#\",\n\t\t\t\"retrospective\": \"FU\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \""
},
{
"path": "src/locales/nl/app.json",
"chars": 4879,
"preview": "{\n\t\"loading\": \"Laden...\",\n\t\"download-ready\": \"Nu downloaden!\",\n\t\"navigation\": {\n\t\t\"home\": \"Start\",\n\t\t\"configuration\": \"M"
},
{
"path": "src/locales/nl/config.json",
"chars": 814,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Sporten\",\n\t\t\"example2\": \"Lezen\",\n\t\t\"example3\": \"Hobbyen\",\n\t\t\"example4\": \"Avond uit\"\n\t},\n\t\""
},
{
"path": "src/locales/nl/pdf.json",
"chars": 557,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"W#\",\n\t\t\t\"retrospective\": \"Tb\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"T\""
},
{
"path": "src/locales/pl/app.json",
"chars": 4817,
"preview": "{\n\t\"loading\": \"Generowanie...\",\n\t\"download-ready\": \"Pobierz teraz!\",\n\t\"navigation\": {\n\t\t\"home\": \"Strona główna\",\n\t\t\"conf"
},
{
"path": "src/locales/pl/config.json",
"chars": 877,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Ćwiczenia\",\n\t\t\"example2\": \"Książka\",\n\t\t\"example3\": \"Hobby\",\n\t\t\"example4\": \"Randka\"\n\t},\n\t\"t"
},
{
"path": "src/locales/pl/pdf.json",
"chars": 600,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"T#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/pt-br/app.json",
"chars": 4814,
"preview": "{\n\t\"loading\": \"Carregando...\",\n\t\"download-ready\": \"Download pronto!\",\n\t\"navigation\": {\n\t\t\"home\": \"Início\",\n\t\t\"configurat"
},
{
"path": "src/locales/pt-br/config.json",
"chars": 839,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Exercício\",\n\t\t\"example2\": \"Livro\",\n\t\t\"example3\": \"Hobby\",\n\t\t\"example4\": \"Encontro\"\n\t},\n\t\"t"
},
{
"path": "src/locales/pt-br/pdf.json",
"chars": 601,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"S#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/sl/app.json",
"chars": 4651,
"preview": "{\r\n\t\"loading\": \"Pripravljam...\",\r\n\t\"download-ready\": \"Prenesi!\",\r\n\t\"navigation\": {\r\n\t\t\"home\": \"Domov\",\r\n\t\t\"configuration"
},
{
"path": "src/locales/sl/config.json",
"chars": 794,
"preview": "{\r\n\t\"habits\": {\r\n\t\t\"example1\": \"Vaja\",\r\n\t\t\"example2\": \"Knjiga\",\r\n\t\t\"example3\": \"Opravilo\",\r\n\t\t\"example4\": \"Zmenek\"\r\n\t},\r"
},
{
"path": "src/locales/sl/pdf.json",
"chars": 500,
"preview": "{\r\n\t\"calendar\": {\r\n\t\t\"header\": {\r\n\t\t\t\"week-number\": \"#\",\r\n\t\t\t\"retrospective\": \"TP\"\r\n\t\t},\r\n\t\t\"body\": {\r\n\t\t\t\"retrospective"
},
{
"path": "src/locales/sv/app.json",
"chars": 4683,
"preview": "{\n\t\"loading\": \"Laddar...\",\n\t\"download-ready\": \"Ladda ner nu!\",\n\t\"navigation\": {\n\t\t\"home\": \"Hem\",\n\t\t\"configuration\": \"Ska"
},
{
"path": "src/locales/sv/config.json",
"chars": 752,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Träning\",\n\t\t\"example2\": \"Böcker\",\n\t\t\"example3\": \"Träning\",\n\t\t\"example4\": \"Sömn\"\n\t},\n\t\"temp"
},
{
"path": "src/locales/sv/pdf.json",
"chars": 564,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"V#\",\n\t\t\t\"retrospective\": \"Re\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"R\""
},
{
"path": "src/locales/tr/app.json",
"chars": 4710,
"preview": "{\n\t\"loading\": \"Yükleniyor...\",\n\t\"download-ready\": \"Şimdi indir!\",\n\t\"navigation\": {\n\t\t\"home\": \"Ana Sayfa\",\n\t\t\"configurati"
},
{
"path": "src/locales/tr/config.json",
"chars": 760,
"preview": "{\n\t\"habits\": {\n\t\t\"example1\": \"Egzersiz\",\n\t\t\"example2\": \"Kitap\",\n\t\t\"example3\": \"Hobi\",\n\t\t\"example4\": \"Eş zamanlı gece\"\n\t}"
},
{
"path": "src/locales/tr/pdf.json",
"chars": 520,
"preview": "{\n\t\"calendar\": {\n\t\t\"header\": {\n\t\t\t\"week-number\": \"H#\",\n\t\t\t\"retrospective\": \"G\"\n\t\t},\n\t\t\"body\": {\n\t\t\t\"retrospective\": \"G\"\n"
},
{
"path": "src/navigation.jsx",
"chars": 3133,
"preview": "import i18n, { changeLanguage } from 'i18next';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport Co"
},
{
"path": "src/pdf/components/header.jsx",
"chars": 3463,
"preview": "import { Text, View, StyleSheet, Link } from '@react-pdf/renderer';\nimport PropTypes from 'prop-types';\nimport React fro"
},
{
"path": "src/pdf/components/itinerary.jsx",
"chars": 1122,
"preview": "import { StyleSheet, Text } from '@react-pdf/renderer';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\n"
},
{
"path": "src/pdf/components/mini-calendar.jsx",
"chars": 6952,
"preview": "import { Text, View, StyleSheet, Link } from '@react-pdf/renderer';\nimport dayjs from 'dayjs/esm';\nimport PropTypes from"
},
{
"path": "src/pdf/config.js",
"chars": 4047,
"preview": "import dayjs from 'dayjs/esm';\nimport { t } from 'i18next';\n\nimport { REMARKABLE, getPageProperties } from '~/lib/device"
},
{
"path": "src/pdf/lib/fonts.js",
"chars": 920,
"preview": "function generateFontDefinition( font ) {\n\tconst fontPath = `/fonts/${font}/${font}`;\n\treturn {\n\t\t[ font ]: {\n\t\t\tfamily:"
},
{
"path": "src/pdf/lib/links.js",
"chars": 2299,
"preview": "export function dayPageLink( date, config ) {\n\tconst dayLink = findEnabledDayPageLink( date, config, 1 );\n\tif ( dayLink "
},
{
"path": "src/pdf/pages/day.jsx",
"chars": 2417,
"preview": "import { Page, View, StyleSheet } from '@react-pdf/renderer';\nimport dayjs from 'dayjs/esm';\nimport PropTypes from 'prop"
},
{
"path": "src/pdf/pages/last.jsx",
"chars": 1392,
"preview": "import { Page, Text, View, Link, StyleSheet } from '@react-pdf/renderer';\nimport PropTypes from 'prop-types';\nimport Rea"
},
{
"path": "src/pdf/pages/month-overview.jsx",
"chars": 6303,
"preview": "import { Page, Text, View, StyleSheet, Link } from '@react-pdf/renderer';\nimport dayjs from 'dayjs/esm';\nimport PropType"
},
{
"path": "src/pdf/pages/week-overview.jsx",
"chars": 4382,
"preview": "import { Page, Text, View, StyleSheet, Link } from '@react-pdf/renderer';\nimport dayjs from 'dayjs/esm';\nimport PropType"
},
{
"path": "src/pdf/pages/week-retrospective.jsx",
"chars": 2521,
"preview": "import { Page, View, StyleSheet } from '@react-pdf/renderer';\nimport dayjs from 'dayjs/esm';\nimport PropTypes from 'prop"
},
{
"path": "src/pdf/pages/year-overview.jsx",
"chars": 1611,
"preview": "import { Page, Text, View, StyleSheet } from '@react-pdf/renderer';\nimport dayjs from 'dayjs/esm';\nimport PropTypes from"
},
{
"path": "src/pdf/recalendar.jsx",
"chars": 2784,
"preview": "import { Document, StyleSheet } from '@react-pdf/renderer';\nimport dayjs from 'dayjs/esm';\nimport PropTypes from 'prop-t"
},
{
"path": "src/pdf/styles.js",
"chars": 368,
"preview": "export function pageStyle( { alwaysOnSidebar, isLeftHanded } ) {\n\treturn {\n\t\tflex: 1,\n\t\twidth: '100%',\n\t\theight: '100%',"
},
{
"path": "src/pdf/utils.js",
"chars": 464,
"preview": "import { ITINERARY_NEW_PAGE } from '~/lib/itinerary-utils';\n\nexport function splitItemsByPages( items ) {\n\tconst pages ="
},
{
"path": "src/worker/pdf.worker.js",
"chars": 2056,
"preview": "/* eslint-disable no-restricted-globals */\nimport i18n, { changeLanguage } from 'i18next';\nimport LanguageDetector from "
},
{
"path": "tsconfig.json",
"chars": 671,
"preview": "{\n \"compilerOptions\": {\n \"target\": \"ES2020\",\n \"useDefineForClassFields\": true,\n \"lib\": [\"ES2020\", \"DOM\", \"DOM."
},
{
"path": "tsconfig.node.json",
"chars": 233,
"preview": "{\n \"compilerOptions\": {\n \"composite\": true,\n \"skipLibCheck\": true,\n \"module\": \"ESNext\",\n \"moduleResolution\""
},
{
"path": "vite.config.ts",
"chars": 617,
"preview": "import path from 'path';\n\nimport react from '@vitejs/plugin-react';\nimport { defineConfig } from 'vite';\nimport i18nextL"
}
]
About this extraction
This page contains the full source code of the klimeryk/recalendar.js GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 114 files (273.5 KB), approximately 84.7k tokens, and a symbol index with 171 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.