@translationstudio/translationstudio-strapi-extension 5.0.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,342 +1,7 @@
1
- If not specified otherwise, this license applies:
1
+ Copyright (c) I-D Media GmbH
2
2
 
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
4
 
4
- GNU GENERAL PUBLIC LICENSE
5
- Version 2, June 1991
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
6
 
7
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
8
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
9
- Everyone is permitted to copy and distribute verbatim copies
10
- of this license document, but changing it is not allowed.
11
-
12
- Preamble
13
-
14
- The licenses for most software are designed to take away your
15
- freedom to share and change it. By contrast, the GNU General Public
16
- License is intended to guarantee your freedom to share and change free
17
- software--to make sure the software is free for all its users. This
18
- General Public License applies to most of the Free Software
19
- Foundation's software and to any other program whose authors commit to
20
- using it. (Some other Free Software Foundation software is covered by
21
- the GNU Lesser General Public License instead.) You can apply it to
22
- your programs, too.
23
-
24
- When we speak of free software, we are referring to freedom, not
25
- price. Our General Public Licenses are designed to make sure that you
26
- have the freedom to distribute copies of free software (and charge for
27
- this service if you wish), that you receive source code or can get it
28
- if you want it, that you can change the software or use pieces of it
29
- in new free programs; and that you know you can do these things.
30
-
31
- To protect your rights, we need to make restrictions that forbid
32
- anyone to deny you these rights or to ask you to surrender the rights.
33
- These restrictions translate to certain responsibilities for you if you
34
- distribute copies of the software, or if you modify it.
35
-
36
- For example, if you distribute copies of such a program, whether
37
- gratis or for a fee, you must give the recipients all the rights that
38
- you have. You must make sure that they, too, receive or can get the
39
- source code. And you must show them these terms so they know their
40
- rights.
41
-
42
- We protect your rights with two steps: (1) copyright the software, and
43
- (2) offer you this license which gives you legal permission to copy,
44
- distribute and/or modify the software.
45
-
46
- Also, for each author's protection and ours, we want to make certain
47
- that everyone understands that there is no warranty for this free
48
- software. If the software is modified by someone else and passed on, we
49
- want its recipients to know that what they have is not the original, so
50
- that any problems introduced by others will not reflect on the original
51
- authors' reputations.
52
-
53
- Finally, any free program is threatened constantly by software
54
- patents. We wish to avoid the danger that redistributors of a free
55
- program will individually obtain patent licenses, in effect making the
56
- program proprietary. To prevent this, we have made it clear that any
57
- patent must be licensed for everyone's free use or not licensed at all.
58
-
59
- The precise terms and conditions for copying, distribution and
60
- modification follow.
61
-
62
- GNU GENERAL PUBLIC LICENSE
63
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
64
-
65
- 0. This License applies to any program or other work which contains
66
- a notice placed by the copyright holder saying it may be distributed
67
- under the terms of this General Public License. The "Program", below,
68
- refers to any such program or work, and a "work based on the Program"
69
- means either the Program or any derivative work under copyright law:
70
- that is to say, a work containing the Program or a portion of it,
71
- either verbatim or with modifications and/or translated into another
72
- language. (Hereinafter, translation is included without limitation in
73
- the term "modification".) Each licensee is addressed as "you".
74
-
75
- Activities other than copying, distribution and modification are not
76
- covered by this License; they are outside its scope. The act of
77
- running the Program is not restricted, and the output from the Program
78
- is covered only if its contents constitute a work based on the
79
- Program (independent of having been made by running the Program).
80
- Whether that is true depends on what the Program does.
81
-
82
- 1. You may copy and distribute verbatim copies of the Program's
83
- source code as you receive it, in any medium, provided that you
84
- conspicuously and appropriately publish on each copy an appropriate
85
- copyright notice and disclaimer of warranty; keep intact all the
86
- notices that refer to this License and to the absence of any warranty;
87
- and give any other recipients of the Program a copy of this License
88
- along with the Program.
89
-
90
- You may charge a fee for the physical act of transferring a copy, and
91
- you may at your option offer warranty protection in exchange for a fee.
92
-
93
- 2. You may modify your copy or copies of the Program or any portion
94
- of it, thus forming a work based on the Program, and copy and
95
- distribute such modifications or work under the terms of Section 1
96
- above, provided that you also meet all of these conditions:
97
-
98
- a) You must cause the modified files to carry prominent notices
99
- stating that you changed the files and the date of any change.
100
-
101
- b) You must cause any work that you distribute or publish, that in
102
- whole or in part contains or is derived from the Program or any
103
- part thereof, to be licensed as a whole at no charge to all third
104
- parties under the terms of this License.
105
-
106
- c) If the modified program normally reads commands interactively
107
- when run, you must cause it, when started running for such
108
- interactive use in the most ordinary way, to print or display an
109
- announcement including an appropriate copyright notice and a
110
- notice that there is no warranty (or else, saying that you provide
111
- a warranty) and that users may redistribute the program under
112
- these conditions, and telling the user how to view a copy of this
113
- License. (Exception: if the Program itself is interactive but
114
- does not normally print such an announcement, your work based on
115
- the Program is not required to print an announcement.)
116
-
117
- These requirements apply to the modified work as a whole. If
118
- identifiable sections of that work are not derived from the Program,
119
- and can be reasonably considered independent and separate works in
120
- themselves, then this License, and its terms, do not apply to those
121
- sections when you distribute them as separate works. But when you
122
- distribute the same sections as part of a whole which is a work based
123
- on the Program, the distribution of the whole must be on the terms of
124
- this License, whose permissions for other licensees extend to the
125
- entire whole, and thus to each and every part regardless of who wrote it.
126
-
127
- Thus, it is not the intent of this section to claim rights or contest
128
- your rights to work written entirely by you; rather, the intent is to
129
- exercise the right to control the distribution of derivative or
130
- collective works based on the Program.
131
-
132
- In addition, mere aggregation of another work not based on the Program
133
- with the Program (or with a work based on the Program) on a volume of
134
- a storage or distribution medium does not bring the other work under
135
- the scope of this License.
136
-
137
- 3. You may copy and distribute the Program (or a work based on it,
138
- under Section 2) in object code or executable form under the terms of
139
- Sections 1 and 2 above provided that you also do one of the following:
140
-
141
- a) Accompany it with the complete corresponding machine-readable
142
- source code, which must be distributed under the terms of Sections
143
- 1 and 2 above on a medium customarily used for software interchange; or,
144
-
145
- b) Accompany it with a written offer, valid for at least three
146
- years, to give any third party, for a charge no more than your
147
- cost of physically performing source distribution, a complete
148
- machine-readable copy of the corresponding source code, to be
149
- distributed under the terms of Sections 1 and 2 above on a medium
150
- customarily used for software interchange; or,
151
-
152
- c) Accompany it with the information you received as to the offer
153
- to distribute corresponding source code. (This alternative is
154
- allowed only for noncommercial distribution and only if you
155
- received the program in object code or executable form with such
156
- an offer, in accord with Subsection b above.)
157
-
158
- The source code for a work means the preferred form of the work for
159
- making modifications to it. For an executable work, complete source
160
- code means all the source code for all modules it contains, plus any
161
- associated interface definition files, plus the scripts used to
162
- control compilation and installation of the executable. However, as a
163
- special exception, the source code distributed need not include
164
- anything that is normally distributed (in either source or binary
165
- form) with the major components (compiler, kernel, and so on) of the
166
- operating system on which the executable runs, unless that component
167
- itself accompanies the executable.
168
-
169
- If distribution of executable or object code is made by offering
170
- access to copy from a designated place, then offering equivalent
171
- access to copy the source code from the same place counts as
172
- distribution of the source code, even though third parties are not
173
- compelled to copy the source along with the object code.
174
-
175
- 4. You may not copy, modify, sublicense, or distribute the Program
176
- except as expressly provided under this License. Any attempt
177
- otherwise to copy, modify, sublicense or distribute the Program is
178
- void, and will automatically terminate your rights under this License.
179
- However, parties who have received copies, or rights, from you under
180
- this License will not have their licenses terminated so long as such
181
- parties remain in full compliance.
182
-
183
- 5. You are not required to accept this License, since you have not
184
- signed it. However, nothing else grants you permission to modify or
185
- distribute the Program or its derivative works. These actions are
186
- prohibited by law if you do not accept this License. Therefore, by
187
- modifying or distributing the Program (or any work based on the
188
- Program), you indicate your acceptance of this License to do so, and
189
- all its terms and conditions for copying, distributing or modifying
190
- the Program or works based on it.
191
-
192
- 6. Each time you redistribute the Program (or any work based on the
193
- Program), the recipient automatically receives a license from the
194
- original licensor to copy, distribute or modify the Program subject to
195
- these terms and conditions. You may not impose any further
196
- restrictions on the recipients' exercise of the rights granted herein.
197
- You are not responsible for enforcing compliance by third parties to
198
- this License.
199
-
200
- 7. If, as a consequence of a court judgment or allegation of patent
201
- infringement or for any other reason (not limited to patent issues),
202
- conditions are imposed on you (whether by court order, agreement or
203
- otherwise) that contradict the conditions of this License, they do not
204
- excuse you from the conditions of this License. If you cannot
205
- distribute so as to satisfy simultaneously your obligations under this
206
- License and any other pertinent obligations, then as a consequence you
207
- may not distribute the Program at all. For example, if a patent
208
- license would not permit royalty-free redistribution of the Program by
209
- all those who receive copies directly or indirectly through you, then
210
- the only way you could satisfy both it and this License would be to
211
- refrain entirely from distribution of the Program.
212
-
213
- If any portion of this section is held invalid or unenforceable under
214
- any particular circumstance, the balance of the section is intended to
215
- apply and the section as a whole is intended to apply in other
216
- circumstances.
217
-
218
- It is not the purpose of this section to induce you to infringe any
219
- patents or other property right claims or to contest validity of any
220
- such claims; this section has the sole purpose of protecting the
221
- integrity of the free software distribution system, which is
222
- implemented by public license practices. Many people have made
223
- generous contributions to the wide range of software distributed
224
- through that system in reliance on consistent application of that
225
- system; it is up to the author/donor to decide if he or she is willing
226
- to distribute software through any other system and a licensee cannot
227
- impose that choice.
228
-
229
- This section is intended to make thoroughly clear what is believed to
230
- be a consequence of the rest of this License.
231
-
232
- 8. If the distribution and/or use of the Program is restricted in
233
- certain countries either by patents or by copyrighted interfaces, the
234
- original copyright holder who places the Program under this License
235
- may add an explicit geographical distribution limitation excluding
236
- those countries, so that distribution is permitted only in or among
237
- countries not thus excluded. In such case, this License incorporates
238
- the limitation as if written in the body of this License.
239
-
240
- 9. The Free Software Foundation may publish revised and/or new versions
241
- of the General Public License from time to time. Such new versions will
242
- be similar in spirit to the present version, but may differ in detail to
243
- address new problems or concerns.
244
-
245
- Each version is given a distinguishing version number. If the Program
246
- specifies a version number of this License which applies to it and "any
247
- later version", you have the option of following the terms and conditions
248
- either of that version or of any later version published by the Free
249
- Software Foundation. If the Program does not specify a version number of
250
- this License, you may choose any version ever published by the Free Software
251
- Foundation.
252
-
253
- 10. If you wish to incorporate parts of the Program into other free
254
- programs whose distribution conditions are different, write to the author
255
- to ask for permission. For software which is copyrighted by the Free
256
- Software Foundation, write to the Free Software Foundation; we sometimes
257
- make exceptions for this. Our decision will be guided by the two goals
258
- of preserving the free status of all derivatives of our free software and
259
- of promoting the sharing and reuse of software generally.
260
-
261
- NO WARRANTY
262
-
263
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
264
- FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
265
- OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
266
- PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
267
- OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
268
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
269
- TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
270
- PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
271
- REPAIR OR CORRECTION.
272
-
273
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
274
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
275
- REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
276
- INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
277
- OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
278
- TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
279
- YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
280
- PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
281
- POSSIBILITY OF SUCH DAMAGES.
282
-
283
- END OF TERMS AND CONDITIONS
284
-
285
- How to Apply These Terms to Your New Programs
286
-
287
- If you develop a new program, and you want it to be of the greatest
288
- possible use to the public, the best way to achieve this is to make it
289
- free software which everyone can redistribute and change under these terms.
290
-
291
- To do so, attach the following notices to the program. It is safest
292
- to attach them to the start of each source file to most effectively
293
- convey the exclusion of warranty; and each file should have at least
294
- the "copyright" line and a pointer to where the full notice is found.
295
-
296
- <one line to give the program's name and a brief idea of what it does.>
297
- Copyright (C) <year> <name of author>
298
-
299
- This program is free software; you can redistribute it and/or modify
300
- it under the terms of the GNU General Public License as published by
301
- the Free Software Foundation; either version 2 of the License, or
302
- (at your option) any later version.
303
-
304
- This program is distributed in the hope that it will be useful,
305
- but WITHOUT ANY WARRANTY; without even the implied warranty of
306
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
307
- GNU General Public License for more details.
308
-
309
- You should have received a copy of the GNU General Public License along
310
- with this program; if not, write to the Free Software Foundation, Inc.,
311
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
312
-
313
- Also add information on how to contact you by electronic and paper mail.
314
-
315
- If the program is interactive, make it output a short notice like this
316
- when it starts in an interactive mode:
317
-
318
- Gnomovision version 69, Copyright (C) year name of author
319
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
320
- This is free software, and you are welcome to redistribute it
321
- under certain conditions; type `show c' for details.
322
-
323
- The hypothetical commands `show w' and `show c' should show the appropriate
324
- parts of the General Public License. Of course, the commands you use may
325
- be called something other than `show w' and `show c'; they could even be
326
- mouse-clicks or menu items--whatever suits your program.
327
-
328
- You should also get your employer (if you work as a programmer) or your
329
- school, if any, to sign a "copyright disclaimer" for the program, if
330
- necessary. Here is a sample; alter the names:
331
-
332
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
333
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
334
-
335
- <signature of Ty Coon>, 1 April 1989
336
- Ty Coon, President of Vice
337
-
338
- This General Public License does not permit incorporating your program into
339
- proprietary programs. If your program is a subroutine library, you may
340
- consider it more useful to permit linking proprietary applications with the
341
- library. If this is what you want to do, use the GNU Lesser General
342
- Public License instead of this License.
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,20 +1,84 @@
1
1
  # translationstudio Strapi Extension
2
2
 
3
+ translationstudio brings enterprise translation management automation to Strapi. Use translationstudio to send translations to your favourite translation provider, either machine translation services or translation agencies.
4
+
5
+ > [!NOTE]
6
+ > You will need a translationstudio subscription to use this plugin. Different plans, including a free plan, are available at https://translationstudio.tech
7
+
8
+ ## Features
9
+
10
+ - ✅ Full automation to increase efficiency and time to market
11
+ - ✅ Easy to use interface
12
+ - ✅ Dashboard to stay up to date with recent translation processes
13
+ - ✅ Connect to industry standard translation service providers
14
+ - ✅ Choose between immediate or quote-based translation requests for translation management
15
+
16
+ ...and much more
17
+
3
18
  ## Installation
4
19
 
5
- Install this plugin via
20
+ Install this plugin to Strapi via
6
21
 
7
22
  ```bash
8
23
  npm i @translationstudio/translationstudio-strapi-extension
9
24
  ```
10
25
 
26
+ Once installed, you will see two new icons in your administration panel:
27
+
28
+ ![Administration panel](README-files/strapi-icons.png)
29
+
11
30
  ## Configuration
12
31
 
13
- Once the plugin is installed, navigate to the extension's configuration entry in Strapi's admin panel
32
+ Once the plugin is installed, navigate to `translationstudio settings` in Strapi's admin panel.
33
+
34
+ ### Setting up translation options
35
+
36
+ 1. Generate your access token and save it for later use
37
+ 2. Access your account.translationstudio.tech Strapi configuration and set the URL for translationstudio to reach your Strapi instance
38
+ 3. Assign your access token. This will authorize translationstudio to "talk" to Strapi.
39
+ 4. Verify the connection and fetch available languages
40
+ 5. Create a license and save it for later use.
41
+ 6. Click on save
42
+
43
+ > [!TIP]
44
+ > If you have not yet configured your translation service providers, now is the tine.
45
+
46
+ Finally, create translation options for your editors and save your changes again.
47
+
48
+ ### Finalizing your Strapi configuration
49
+
50
+ On the `translationstudio settings` page, paste your translationstudio license created earlier and click on save.
51
+
52
+
53
+ > [!TIP]
54
+ > translationstudio is ready to use.
14
55
 
15
- Generate your access token and add it to your account.translationstudio.tech Strapi configuration
56
+ ## Using translationstudio
57
+
58
+ ### Translate an entry
59
+
60
+ When editing an entry, a translationstudio panel will be available at the right. Choose your translation options and initiate a translation request after you have completed editing.
61
+
62
+ ![Entry translation](README-files/strapi-entry.png)
63
+
64
+ ### Dashboard
65
+
66
+ You can access your translationstudio dashboard to
67
+
68
+ 1. Access your translation history
69
+ 2. Translate multiple entries
70
+
71
+ To translate multiple entries, select `Translate multiple entries`, choose your content type and select the entries you wish to translate. The `translate` button at the lower right opens a translation request popup for you to choose your action.
72
+
73
+ #### 1. Choose entries to be translated
74
+ ![Choose entry](README-files/strapi-dashboard-2.png)
75
+
76
+ #### 2. Choose your options
77
+
78
+ ![Choose entry](README-files/strapi-dashboard-3.png)
79
+
80
+ ![Choose entry](README-files/strapi-dashboard-4.png)
16
81
 
17
- Add your translationstudio license (account.translationstudio.tech) and click on save
18
82
 
19
83
  ## Development
20
84
 
@@ -33,3 +97,12 @@ Follow these steps:
33
97
  2. run `npm run build`
34
98
  3. run `npm publish --access public`
35
99
 
100
+ ## Resources
101
+
102
+ * [translationstudio.tech](https://translationstudio.tech)
103
+ * [account.translationstudio.tech](https://account.translationstudio.tech)
104
+ * [idmedia.com](https://idmedia.com)
105
+
106
+ ## License
107
+
108
+ See the [LICENSE](LICENSE) file for licensing information
@@ -5,7 +5,7 @@ const admin = require("@strapi/strapi/admin");
5
5
  const reactRouterDom = require("react-router-dom");
6
6
  const designSystem = require("@strapi/design-system");
7
7
  const react = require("react");
8
- const index = require("./index-CgX-X1nF.js");
8
+ const index = require("./index-BzroXx76.js");
9
9
  const apiService = {
10
10
  async loadLicense(get) {
11
11
  try {
@@ -40,25 +40,6 @@ const styles = {
40
40
  width: "90%",
41
41
  display: "inline-block"
42
42
  },
43
- button: {
44
- backgroundColor: "#e94642",
45
- border: "none",
46
- paddingTop: "0.6em",
47
- paddingBottom: "0.6em"
48
- },
49
- tab: {
50
- color: "#e94642",
51
- cursor: "pointer",
52
- textDecoration: "none",
53
- fontSize: "18px",
54
- fontWeight: "600"
55
- },
56
- activeTab: {
57
- textDecoration: "underline"
58
- },
59
- inactiveTab: {
60
- opacity: 0.7
61
- },
62
43
  alert: {
63
44
  position: "fixed",
64
45
  top: "10%",
@@ -3,7 +3,7 @@ import { getFetchClient, Page } from "@strapi/strapi/admin";
3
3
  import { Routes, Route } from "react-router-dom";
4
4
  import { Main, Box, Alert, Grid, Typography, Badge, TextInput, Switch, Button } from "@strapi/design-system";
5
5
  import { useState, useCallback, useEffect } from "react";
6
- import { T as TranslationstudioLogo } from "./index-DKeIuEy_.mjs";
6
+ import { T as TranslationstudioLogo } from "./index-N4BoG1Y0.mjs";
7
7
  const apiService = {
8
8
  async loadLicense(get) {
9
9
  try {
@@ -38,25 +38,6 @@ const styles = {
38
38
  width: "90%",
39
39
  display: "inline-block"
40
40
  },
41
- button: {
42
- backgroundColor: "#e94642",
43
- border: "none",
44
- paddingTop: "0.6em",
45
- paddingBottom: "0.6em"
46
- },
47
- tab: {
48
- color: "#e94642",
49
- cursor: "pointer",
50
- textDecoration: "none",
51
- fontSize: "18px",
52
- fontWeight: "600"
53
- },
54
- activeTab: {
55
- textDecoration: "underline"
56
- },
57
- inactiveTab: {
58
- opacity: 0.7
59
- },
60
41
  alert: {
61
42
  position: "fixed",
62
43
  top: "10%",
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const designSystem = require("@strapi/design-system");
5
5
  const react = require("react");
6
6
  const admin = require("@strapi/strapi/admin");
7
- const index = require("./index-CgX-X1nF.js");
7
+ const index = require("./index-BzroXx76.js");
8
8
  const icons = require("@strapi/icons");
9
9
  const getSearchableText = (item) => {
10
10
  return `${item["project-name"]} ${item["element-name"]} ${item["element-uid"]} ${item.targetLanguages.join(" ")} ${item.combinedStatus.text}`.toLowerCase();
@@ -2,8 +2,8 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { Modal, Typography, Button, Box, Alert, TextInput, Table, Thead, Tr, Th, Tbody, Td, Badge, SimpleMenu, IconButton, MenuItem, Radio, Checkbox, DatePicker, ProgressBar, Main, Grid, Flex } from "@strapi/design-system";
3
3
  import { useState, useEffect, useMemo } from "react";
4
4
  import { getFetchClient } from "@strapi/strapi/admin";
5
- import { g as getThemeColors, G as GetStatusColor, a as GetStatusText, f as formatDate, b as getStoredEmail, c as getSubmitLabel, s as setStoredEmail, v as validateDueDate, d as createEntryUid, e as determineEntryName, h as createTranslationPayload, i as createSuccessMessage, j as createErrorMessage, k as createGeneralErrorMessage, T as TranslationstudioLogo, l as handleHistoryResponse, m as groupHistoryData } from "./index-DKeIuEy_.mjs";
6
- import { Trash, More, Bell, PaperPlane, Earth } from "@strapi/icons";
5
+ import { g as getThemeColors, G as GetStatusText, a as GetStatusColor, f as formatDate, b as getStoredEmail, c as getSubmitLabel, v as validateDueDate, s as setStoredEmail, d as createEntryUid, e as determineEntryName, h as createTranslationPayload, i as createSuccessMessage, j as createErrorMessage, k as createGeneralErrorMessage, l as handleHistoryResponse, m as groupHistoryData, T as TranslationstudioLogo } from "./index-N4BoG1Y0.mjs";
6
+ import { Trash, Bell, More, PaperPlane, Earth } from "@strapi/icons";
7
7
  const getSearchableText = (item) => {
8
8
  return `${item["project-name"]} ${item["element-name"]} ${item["element-uid"]} ${item.targetLanguages.join(" ")} ${item.combinedStatus.text}`.toLowerCase();
9
9
  };
@@ -750,7 +750,7 @@ const index = {
750
750
  defaultMessage: "translationstudio Settings"
751
751
  },
752
752
  Component: async () => {
753
- const { App } = await Promise.resolve().then(() => require("./App-CDI8iUHL.js"));
753
+ const { App } = await Promise.resolve().then(() => require("./App-B119L8TA.js"));
754
754
  return App;
755
755
  }
756
756
  });
@@ -762,7 +762,7 @@ const index = {
762
762
  defaultMessage: "translationstudio Dashboard"
763
763
  },
764
764
  Component: async () => {
765
- const { HistoryPage } = await Promise.resolve().then(() => require("./HistoryPage-VqkbaIHn.js"));
765
+ const { HistoryPage } = await Promise.resolve().then(() => require("./HistoryPage-9-Q74Q5W.js"));
766
766
  return HistoryPage;
767
767
  }
768
768
  });
@@ -749,7 +749,7 @@ const index = {
749
749
  defaultMessage: "translationstudio Settings"
750
750
  },
751
751
  Component: async () => {
752
- const { App } = await import("./App-Dw8LkiAx.mjs");
752
+ const { App } = await import("./App-b1KenBa5.mjs");
753
753
  return App;
754
754
  }
755
755
  });
@@ -761,7 +761,7 @@ const index = {
761
761
  defaultMessage: "translationstudio Dashboard"
762
762
  },
763
763
  Component: async () => {
764
- const { HistoryPage } = await import("./HistoryPage-Do_yIUdx.mjs");
764
+ const { HistoryPage } = await import("./HistoryPage-B6uDZ2wx.mjs");
765
765
  return HistoryPage;
766
766
  }
767
767
  });
@@ -797,9 +797,9 @@ const index = {
797
797
  }
798
798
  };
799
799
  export {
800
- GetStatusColor as G,
800
+ GetStatusText as G,
801
801
  TranslationstudioLogo as T,
802
- GetStatusText as a,
802
+ GetStatusColor as a,
803
803
  getStoredEmail as b,
804
804
  getSubmitLabel as c,
805
805
  createEntryUid$1 as d,
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-CgX-X1nF.js");
2
+ const index = require("../_chunks/index-BzroXx76.js");
3
3
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { n } from "../_chunks/index-DKeIuEy_.mjs";
1
+ import { n } from "../_chunks/index-N4BoG1Y0.mjs";
2
2
  export {
3
3
  n as default
4
4
  };
@@ -474,16 +474,16 @@ function formatText(child) {
474
474
  }
475
475
  return text;
476
476
  }
477
- const Logger$4 = {
477
+ const Logger$3 = {
478
478
  log: typeof strapi !== "undefined" ? strapi.log : console,
479
- info: (val) => Logger$4.log.info(val),
480
- warn: (val) => Logger$4.log.warn(val),
481
- error: (val) => Logger$4.log.error(val),
482
- debug: (val) => Logger$4.log.debug(val)
479
+ info: (val) => Logger$3.log.info(val),
480
+ warn: (val) => Logger$3.log.warn(val),
481
+ error: (val) => Logger$3.log.error(val),
482
+ debug: (val) => Logger$3.log.debug(val)
483
483
  };
484
484
  async function processComponent(fieldName, value, componentSchema, schemata) {
485
485
  const contentFields = [];
486
- Logger$4.info("Processing dynamic field " + fieldName);
486
+ Logger$3.info("Processing dynamic field " + fieldName);
487
487
  if (!componentSchema || !componentSchema.attributes)
488
488
  return [];
489
489
  const schemaAttributes = componentSchema.attributes || {};
@@ -560,12 +560,12 @@ const processComponentFields = async (componentData, schema, parentField, schema
560
560
  }
561
561
  return contentFields;
562
562
  };
563
- const Logger$3 = {
563
+ const Logger$2 = {
564
564
  log: typeof strapi !== "undefined" ? strapi.log : console,
565
- info: (val) => Logger$3.log.info(val),
566
- warn: (val) => Logger$3.log.warn(val),
567
- error: (val) => Logger$3.log.error(val),
568
- debug: (val) => Logger$3.log.debug(val)
565
+ info: (val) => Logger$2.log.info(val),
566
+ warn: (val) => Logger$2.log.warn(val),
567
+ error: (val) => Logger$2.log.error(val),
568
+ debug: (val) => Logger$2.log.debug(val)
569
569
  };
570
570
  const DEFAULT_FIELDS$1 = /* @__PURE__ */ new Set([
571
571
  "id",
@@ -641,11 +641,11 @@ const processEntryFields = async (entry, schemaData, _locale) => {
641
641
  continue;
642
642
  const fieldSchema = schema[key];
643
643
  if (!fieldSchema || !IsLocalisedField(fieldSchema)) {
644
- Logger$3.debug("SKipping non-local field " + key);
644
+ Logger$2.debug("SKipping non-local field " + key);
645
645
  continue;
646
646
  }
647
647
  if (isSimpleTranslatableField(fieldSchema)) {
648
- Logger$3.debug("Processing simple field " + key);
648
+ Logger$2.debug("Processing simple field " + key);
649
649
  const translatedField = processRegularField(key, value, fieldSchema);
650
650
  contentFields.push(translatedField);
651
651
  continue;
@@ -653,7 +653,7 @@ const processEntryFields = async (entry, schemaData, _locale) => {
653
653
  const zoneInfo = isDynamicZone(fieldSchema, value);
654
654
  if (zoneInfo.isZone) {
655
655
  if (zoneInfo.hasContent) {
656
- Logger$3.debug("Processing dynamic zone field " + key);
656
+ Logger$2.debug("Processing dynamic zone field " + key);
657
657
  const zoneFields = await processDynamicZone(key, value, schemaData.components);
658
658
  contentFields.push(...zoneFields);
659
659
  staticContent[key] = value;
@@ -667,7 +667,7 @@ const processEntryFields = async (entry, schemaData, _locale) => {
667
667
  staticContent[key] = value;
668
668
  }
669
669
  }
670
- Logger$3.info("Process completed");
670
+ Logger$2.info("Process completed");
671
671
  return {
672
672
  fields: contentFields,
673
673
  keep: staticContent
@@ -688,12 +688,12 @@ const isComponent = (fieldSchema) => {
688
688
  hasContent: true
689
689
  };
690
690
  };
691
- const Logger$2 = {
691
+ const Logger$1 = {
692
692
  log: typeof strapi !== "undefined" ? strapi.log : console,
693
- info: (val) => Logger$2.log.info(val),
694
- warn: (val) => Logger$2.log.warn(val),
695
- error: (val) => Logger$2.log.error(val),
696
- debug: (val) => Logger$2.log.debug(val)
693
+ info: (val) => Logger$1.log.info(val),
694
+ warn: (val) => Logger$1.log.warn(val),
695
+ error: (val) => Logger$1.log.error(val),
696
+ debug: (val) => Logger$1.log.debug(val)
697
697
  };
698
698
  const DEFAULT_FIELDS = [
699
699
  "id",
@@ -737,26 +737,26 @@ function appendMissingFields(data, sourceEntry, targetSchema, targetEntry) {
737
737
  if (nullFields.length === 0)
738
738
  return;
739
739
  let count = 0;
740
- Logger$2.info("Adding missing fields to new locale: " + nullFields.join(", "));
740
+ Logger$1.info("Adding missing fields to new locale: " + nullFields.join(", "));
741
741
  for (let field of nullFields) {
742
742
  if (data[field]) {
743
- Logger$2.info("Field already present: " + field);
743
+ Logger$1.info("Field already present: " + field);
744
744
  continue;
745
745
  }
746
746
  if (!sourceEntry[field]) {
747
- Logger$2.info("No valid source langauge field value for " + field + " - skipping it.");
747
+ Logger$1.info("No valid source langauge field value for " + field + " - skipping it.");
748
748
  continue;
749
749
  }
750
750
  if (!targetSchema.entry.attributes[field]) {
751
- Logger$2.warn("Schema does not contain field " + field);
751
+ Logger$1.warn("Schema does not contain field " + field);
752
752
  continue;
753
753
  }
754
- Logger$2.info("Adding missing field and value for " + field);
754
+ Logger$1.info("Adding missing field and value for " + field);
755
755
  data[field] = sourceEntry[field];
756
756
  count++;
757
757
  }
758
758
  if (count > 0)
759
- Logger$2.info(count + " missing fields added.");
759
+ Logger$1.info(count + " missing fields added.");
760
760
  }
761
761
  async function updateEntry(contentTypeID, entryID, targetLocale, data) {
762
762
  strapi.log.info("Updating target entry " + contentTypeID + "::" + entryID + " in locale " + targetLocale);
@@ -960,12 +960,12 @@ function htmlToJson(html) {
960
960
  }
961
961
  return blocks;
962
962
  }
963
- const Logger$1 = {
963
+ const Logger = {
964
964
  log: typeof strapi !== "undefined" ? strapi.log : console,
965
- info: (val) => Logger$1.log.info(val),
966
- warn: (val) => Logger$1.log.warn(val),
967
- error: (val) => Logger$1.log.error(val),
968
- debug: (val) => Logger$1.log.debug(val)
965
+ info: (val) => Logger.log.info(val),
966
+ warn: (val) => Logger.log.warn(val),
967
+ error: (val) => Logger.log.error(val),
968
+ debug: (val) => Logger.log.debug(val)
969
969
  };
970
970
  const removeComponentIds = function(elem) {
971
971
  const list = Array.isArray(elem) ? elem : [elem];
@@ -991,32 +991,32 @@ function replaceDynamicZones(strapiEntry, replacableFields) {
991
991
  }
992
992
  }
993
993
  if (fields.length > 0)
994
- Logger$1.info(fields.length + " dynamic fields/components replaced for later merge: " + fields.join(", "));
994
+ Logger.info(fields.length + " dynamic fields/components replaced for later merge: " + fields.join(", "));
995
995
  return fields;
996
996
  }
997
997
  const mergeValue = function(field, translatable, targetSchema, map) {
998
998
  if (translatable.translatableValue.length === 0)
999
999
  return false;
1000
1000
  if (targetSchema.attributes[field] === void 0) {
1001
- Logger$1.info("Field " + field + " does not exist in schema. Skipping it");
1002
- Logger$1.info(targetSchema);
1001
+ Logger.info("Field " + field + " does not exist in schema. Skipping it");
1002
+ Logger.info(targetSchema);
1003
1003
  return false;
1004
1004
  }
1005
1005
  if (translatable.translatableValue[0] === "") {
1006
- Logger$1.info("Skipping empty translated content for field " + field);
1006
+ Logger.info("Skipping empty translated content for field " + field);
1007
1007
  return false;
1008
1008
  }
1009
1009
  if (translatable.realType === "blocks") {
1010
- Logger$1.info("Merge block field " + field);
1010
+ Logger.info("Merge block field " + field);
1011
1011
  map[field] = htmlToJson(translatable.translatableValue[0] || "");
1012
1012
  return true;
1013
1013
  }
1014
1014
  if (translatable.type === "text") {
1015
- Logger$1.info("Merge text field " + field);
1015
+ Logger.info("Merge text field " + field);
1016
1016
  map[field] = translatable.translatableValue[0];
1017
1017
  return true;
1018
1018
  }
1019
- Logger$1.warn("Did not process " + field);
1019
+ Logger.warn("Did not process " + field);
1020
1020
  return false;
1021
1021
  };
1022
1022
  const mergeSimpleFields = function(translatables, existingEntry, targetSchema, map) {
@@ -1027,7 +1027,7 @@ const mergeSimpleFields = function(translatables, existingEntry, targetSchema, m
1027
1027
  count++;
1028
1028
  }
1029
1029
  if (count > 0) {
1030
- Logger$1.info("Updated " + count + " simple text fields");
1030
+ Logger.info("Updated " + count + " simple text fields");
1031
1031
  return true;
1032
1032
  }
1033
1033
  return false;
@@ -1038,7 +1038,7 @@ const buildMapOfUuids = function(existingEntry, schemaMap, map) {
1038
1038
  const componentName = existingEntry["__component"] ?? "";
1039
1039
  const schema = componentName && schemaMap.components[componentName] ? schemaMap.components[componentName] : null;
1040
1040
  if (componentName && !schema)
1041
- Logger$1.warn("Cannot find component schema " + componentName);
1041
+ Logger.warn("Cannot find component schema " + componentName);
1042
1042
  for (const key of Object.keys(existingEntry)) {
1043
1043
  if (key === "__component")
1044
1044
  continue;
@@ -1060,23 +1060,23 @@ const buildMapOfUuids = function(existingEntry, schemaMap, map) {
1060
1060
  }
1061
1061
  if (existingEntry["__tsuid"]) {
1062
1062
  delete existingEntry["__tsuid"];
1063
- Logger$1.info("Removed cusom property __tsuid");
1063
+ Logger.info("Removed cusom property __tsuid");
1064
1064
  }
1065
1065
  return map;
1066
1066
  };
1067
1067
  const mergeDynamicZones = function(translatables, schemaMap, existingEntry) {
1068
1068
  if (translatables.length === 0) {
1069
- Logger$1.info("Skipping merging of dynamic zones, because none are present.");
1069
+ Logger.info("Skipping merging of dynamic zones, because none are present.");
1070
1070
  return;
1071
1071
  }
1072
1072
  const map = {};
1073
1073
  buildMapOfUuids(existingEntry, schemaMap, map);
1074
1074
  const mapSize = Object.keys(map).length;
1075
1075
  if (mapSize === 0) {
1076
- Logger$1.warn("Could not create a uuid map");
1076
+ Logger.warn("Could not create a uuid map");
1077
1077
  return false;
1078
1078
  }
1079
- Logger$1.info("Built uuid map with " + mapSize + " entry(s)");
1079
+ Logger.info("Built uuid map with " + mapSize + " entry(s)");
1080
1080
  let count = 0;
1081
1081
  for (const translatable of translatables) {
1082
1082
  if (!translatable.uuid)
@@ -1087,14 +1087,14 @@ const mergeDynamicZones = function(translatables, schemaMap, existingEntry) {
1087
1087
  const entry = map[uuid];
1088
1088
  const schema = entry.schema;
1089
1089
  if (!schema) {
1090
- Logger$1.warn("Cannot find schema by uuid #" + uuid);
1090
+ Logger.warn("Cannot find schema by uuid #" + uuid);
1091
1091
  continue;
1092
1092
  }
1093
1093
  if (mergeValue(translatable.field, translatable, schema, entry.entry))
1094
1094
  count++;
1095
1095
  }
1096
1096
  if (count > 0) {
1097
- Logger$1.info("Updated " + count + " entries in dynamic zones/content blocks");
1097
+ Logger.info("Updated " + count + " entries in dynamic zones/content blocks");
1098
1098
  return true;
1099
1099
  }
1100
1100
  return false;
@@ -1109,7 +1109,7 @@ function prepareImportData(translatables, keepData, existingEntry, targetSchema)
1109
1109
  vsFields.forEach((field) => result[field] = existingEntry[field]);
1110
1110
  otherUpdated = true;
1111
1111
  } else
1112
- Logger$1.warn("Could not merge dynamic fields");
1112
+ Logger.warn("Could not merge dynamic fields");
1113
1113
  }
1114
1114
  if (simpleUpdated || otherUpdated)
1115
1115
  return result;
@@ -1118,13 +1118,9 @@ function prepareImportData(translatables, keepData, existingEntry, targetSchema)
1118
1118
  }
1119
1119
  const TRANSLATIONTUDIO_URL = "https://strapi.translationstudio.tech";
1120
1120
  const APP_NAME = "translationstudio";
1121
- const Logger = {
1122
- log: typeof strapi !== "undefined" ? strapi.log : console,
1123
- info: (val) => Logger.log.info(val),
1124
- warn: (val) => Logger.log.warn(val),
1125
- error: (val) => Logger.log.error(val),
1126
- debug: (val) => Logger.log.debug(val)
1127
- };
1121
+ ({
1122
+ log: typeof strapi !== "undefined" ? strapi.log : console
1123
+ });
1128
1124
  const service = ({ strapi: strapi2 }) => {
1129
1125
  const pluginStore = strapi2.store({
1130
1126
  type: "plugin",
@@ -455,16 +455,16 @@ function formatText(child) {
455
455
  }
456
456
  return text;
457
457
  }
458
- const Logger$4 = {
458
+ const Logger$3 = {
459
459
  log: typeof strapi !== "undefined" ? strapi.log : console,
460
- info: (val) => Logger$4.log.info(val),
461
- warn: (val) => Logger$4.log.warn(val),
462
- error: (val) => Logger$4.log.error(val),
463
- debug: (val) => Logger$4.log.debug(val)
460
+ info: (val) => Logger$3.log.info(val),
461
+ warn: (val) => Logger$3.log.warn(val),
462
+ error: (val) => Logger$3.log.error(val),
463
+ debug: (val) => Logger$3.log.debug(val)
464
464
  };
465
465
  async function processComponent(fieldName, value, componentSchema, schemata) {
466
466
  const contentFields = [];
467
- Logger$4.info("Processing dynamic field " + fieldName);
467
+ Logger$3.info("Processing dynamic field " + fieldName);
468
468
  if (!componentSchema || !componentSchema.attributes)
469
469
  return [];
470
470
  const schemaAttributes = componentSchema.attributes || {};
@@ -541,12 +541,12 @@ const processComponentFields = async (componentData, schema, parentField, schema
541
541
  }
542
542
  return contentFields;
543
543
  };
544
- const Logger$3 = {
544
+ const Logger$2 = {
545
545
  log: typeof strapi !== "undefined" ? strapi.log : console,
546
- info: (val) => Logger$3.log.info(val),
547
- warn: (val) => Logger$3.log.warn(val),
548
- error: (val) => Logger$3.log.error(val),
549
- debug: (val) => Logger$3.log.debug(val)
546
+ info: (val) => Logger$2.log.info(val),
547
+ warn: (val) => Logger$2.log.warn(val),
548
+ error: (val) => Logger$2.log.error(val),
549
+ debug: (val) => Logger$2.log.debug(val)
550
550
  };
551
551
  const DEFAULT_FIELDS$1 = /* @__PURE__ */ new Set([
552
552
  "id",
@@ -622,11 +622,11 @@ const processEntryFields = async (entry, schemaData, _locale) => {
622
622
  continue;
623
623
  const fieldSchema = schema[key];
624
624
  if (!fieldSchema || !IsLocalisedField(fieldSchema)) {
625
- Logger$3.debug("SKipping non-local field " + key);
625
+ Logger$2.debug("SKipping non-local field " + key);
626
626
  continue;
627
627
  }
628
628
  if (isSimpleTranslatableField(fieldSchema)) {
629
- Logger$3.debug("Processing simple field " + key);
629
+ Logger$2.debug("Processing simple field " + key);
630
630
  const translatedField = processRegularField(key, value, fieldSchema);
631
631
  contentFields.push(translatedField);
632
632
  continue;
@@ -634,7 +634,7 @@ const processEntryFields = async (entry, schemaData, _locale) => {
634
634
  const zoneInfo = isDynamicZone(fieldSchema, value);
635
635
  if (zoneInfo.isZone) {
636
636
  if (zoneInfo.hasContent) {
637
- Logger$3.debug("Processing dynamic zone field " + key);
637
+ Logger$2.debug("Processing dynamic zone field " + key);
638
638
  const zoneFields = await processDynamicZone(key, value, schemaData.components);
639
639
  contentFields.push(...zoneFields);
640
640
  staticContent[key] = value;
@@ -648,7 +648,7 @@ const processEntryFields = async (entry, schemaData, _locale) => {
648
648
  staticContent[key] = value;
649
649
  }
650
650
  }
651
- Logger$3.info("Process completed");
651
+ Logger$2.info("Process completed");
652
652
  return {
653
653
  fields: contentFields,
654
654
  keep: staticContent
@@ -669,12 +669,12 @@ const isComponent = (fieldSchema) => {
669
669
  hasContent: true
670
670
  };
671
671
  };
672
- const Logger$2 = {
672
+ const Logger$1 = {
673
673
  log: typeof strapi !== "undefined" ? strapi.log : console,
674
- info: (val) => Logger$2.log.info(val),
675
- warn: (val) => Logger$2.log.warn(val),
676
- error: (val) => Logger$2.log.error(val),
677
- debug: (val) => Logger$2.log.debug(val)
674
+ info: (val) => Logger$1.log.info(val),
675
+ warn: (val) => Logger$1.log.warn(val),
676
+ error: (val) => Logger$1.log.error(val),
677
+ debug: (val) => Logger$1.log.debug(val)
678
678
  };
679
679
  const DEFAULT_FIELDS = [
680
680
  "id",
@@ -718,26 +718,26 @@ function appendMissingFields(data, sourceEntry, targetSchema, targetEntry) {
718
718
  if (nullFields.length === 0)
719
719
  return;
720
720
  let count = 0;
721
- Logger$2.info("Adding missing fields to new locale: " + nullFields.join(", "));
721
+ Logger$1.info("Adding missing fields to new locale: " + nullFields.join(", "));
722
722
  for (let field of nullFields) {
723
723
  if (data[field]) {
724
- Logger$2.info("Field already present: " + field);
724
+ Logger$1.info("Field already present: " + field);
725
725
  continue;
726
726
  }
727
727
  if (!sourceEntry[field]) {
728
- Logger$2.info("No valid source langauge field value for " + field + " - skipping it.");
728
+ Logger$1.info("No valid source langauge field value for " + field + " - skipping it.");
729
729
  continue;
730
730
  }
731
731
  if (!targetSchema.entry.attributes[field]) {
732
- Logger$2.warn("Schema does not contain field " + field);
732
+ Logger$1.warn("Schema does not contain field " + field);
733
733
  continue;
734
734
  }
735
- Logger$2.info("Adding missing field and value for " + field);
735
+ Logger$1.info("Adding missing field and value for " + field);
736
736
  data[field] = sourceEntry[field];
737
737
  count++;
738
738
  }
739
739
  if (count > 0)
740
- Logger$2.info(count + " missing fields added.");
740
+ Logger$1.info(count + " missing fields added.");
741
741
  }
742
742
  async function updateEntry(contentTypeID, entryID, targetLocale, data) {
743
743
  strapi.log.info("Updating target entry " + contentTypeID + "::" + entryID + " in locale " + targetLocale);
@@ -941,12 +941,12 @@ function htmlToJson(html) {
941
941
  }
942
942
  return blocks;
943
943
  }
944
- const Logger$1 = {
944
+ const Logger = {
945
945
  log: typeof strapi !== "undefined" ? strapi.log : console,
946
- info: (val) => Logger$1.log.info(val),
947
- warn: (val) => Logger$1.log.warn(val),
948
- error: (val) => Logger$1.log.error(val),
949
- debug: (val) => Logger$1.log.debug(val)
946
+ info: (val) => Logger.log.info(val),
947
+ warn: (val) => Logger.log.warn(val),
948
+ error: (val) => Logger.log.error(val),
949
+ debug: (val) => Logger.log.debug(val)
950
950
  };
951
951
  const removeComponentIds = function(elem) {
952
952
  const list = Array.isArray(elem) ? elem : [elem];
@@ -972,32 +972,32 @@ function replaceDynamicZones(strapiEntry, replacableFields) {
972
972
  }
973
973
  }
974
974
  if (fields.length > 0)
975
- Logger$1.info(fields.length + " dynamic fields/components replaced for later merge: " + fields.join(", "));
975
+ Logger.info(fields.length + " dynamic fields/components replaced for later merge: " + fields.join(", "));
976
976
  return fields;
977
977
  }
978
978
  const mergeValue = function(field, translatable, targetSchema, map) {
979
979
  if (translatable.translatableValue.length === 0)
980
980
  return false;
981
981
  if (targetSchema.attributes[field] === void 0) {
982
- Logger$1.info("Field " + field + " does not exist in schema. Skipping it");
983
- Logger$1.info(targetSchema);
982
+ Logger.info("Field " + field + " does not exist in schema. Skipping it");
983
+ Logger.info(targetSchema);
984
984
  return false;
985
985
  }
986
986
  if (translatable.translatableValue[0] === "") {
987
- Logger$1.info("Skipping empty translated content for field " + field);
987
+ Logger.info("Skipping empty translated content for field " + field);
988
988
  return false;
989
989
  }
990
990
  if (translatable.realType === "blocks") {
991
- Logger$1.info("Merge block field " + field);
991
+ Logger.info("Merge block field " + field);
992
992
  map[field] = htmlToJson(translatable.translatableValue[0] || "");
993
993
  return true;
994
994
  }
995
995
  if (translatable.type === "text") {
996
- Logger$1.info("Merge text field " + field);
996
+ Logger.info("Merge text field " + field);
997
997
  map[field] = translatable.translatableValue[0];
998
998
  return true;
999
999
  }
1000
- Logger$1.warn("Did not process " + field);
1000
+ Logger.warn("Did not process " + field);
1001
1001
  return false;
1002
1002
  };
1003
1003
  const mergeSimpleFields = function(translatables, existingEntry, targetSchema, map) {
@@ -1008,7 +1008,7 @@ const mergeSimpleFields = function(translatables, existingEntry, targetSchema, m
1008
1008
  count++;
1009
1009
  }
1010
1010
  if (count > 0) {
1011
- Logger$1.info("Updated " + count + " simple text fields");
1011
+ Logger.info("Updated " + count + " simple text fields");
1012
1012
  return true;
1013
1013
  }
1014
1014
  return false;
@@ -1019,7 +1019,7 @@ const buildMapOfUuids = function(existingEntry, schemaMap, map) {
1019
1019
  const componentName = existingEntry["__component"] ?? "";
1020
1020
  const schema = componentName && schemaMap.components[componentName] ? schemaMap.components[componentName] : null;
1021
1021
  if (componentName && !schema)
1022
- Logger$1.warn("Cannot find component schema " + componentName);
1022
+ Logger.warn("Cannot find component schema " + componentName);
1023
1023
  for (const key of Object.keys(existingEntry)) {
1024
1024
  if (key === "__component")
1025
1025
  continue;
@@ -1041,23 +1041,23 @@ const buildMapOfUuids = function(existingEntry, schemaMap, map) {
1041
1041
  }
1042
1042
  if (existingEntry["__tsuid"]) {
1043
1043
  delete existingEntry["__tsuid"];
1044
- Logger$1.info("Removed cusom property __tsuid");
1044
+ Logger.info("Removed cusom property __tsuid");
1045
1045
  }
1046
1046
  return map;
1047
1047
  };
1048
1048
  const mergeDynamicZones = function(translatables, schemaMap, existingEntry) {
1049
1049
  if (translatables.length === 0) {
1050
- Logger$1.info("Skipping merging of dynamic zones, because none are present.");
1050
+ Logger.info("Skipping merging of dynamic zones, because none are present.");
1051
1051
  return;
1052
1052
  }
1053
1053
  const map = {};
1054
1054
  buildMapOfUuids(existingEntry, schemaMap, map);
1055
1055
  const mapSize = Object.keys(map).length;
1056
1056
  if (mapSize === 0) {
1057
- Logger$1.warn("Could not create a uuid map");
1057
+ Logger.warn("Could not create a uuid map");
1058
1058
  return false;
1059
1059
  }
1060
- Logger$1.info("Built uuid map with " + mapSize + " entry(s)");
1060
+ Logger.info("Built uuid map with " + mapSize + " entry(s)");
1061
1061
  let count = 0;
1062
1062
  for (const translatable of translatables) {
1063
1063
  if (!translatable.uuid)
@@ -1068,14 +1068,14 @@ const mergeDynamicZones = function(translatables, schemaMap, existingEntry) {
1068
1068
  const entry = map[uuid];
1069
1069
  const schema = entry.schema;
1070
1070
  if (!schema) {
1071
- Logger$1.warn("Cannot find schema by uuid #" + uuid);
1071
+ Logger.warn("Cannot find schema by uuid #" + uuid);
1072
1072
  continue;
1073
1073
  }
1074
1074
  if (mergeValue(translatable.field, translatable, schema, entry.entry))
1075
1075
  count++;
1076
1076
  }
1077
1077
  if (count > 0) {
1078
- Logger$1.info("Updated " + count + " entries in dynamic zones/content blocks");
1078
+ Logger.info("Updated " + count + " entries in dynamic zones/content blocks");
1079
1079
  return true;
1080
1080
  }
1081
1081
  return false;
@@ -1090,7 +1090,7 @@ function prepareImportData(translatables, keepData, existingEntry, targetSchema)
1090
1090
  vsFields.forEach((field) => result[field] = existingEntry[field]);
1091
1091
  otherUpdated = true;
1092
1092
  } else
1093
- Logger$1.warn("Could not merge dynamic fields");
1093
+ Logger.warn("Could not merge dynamic fields");
1094
1094
  }
1095
1095
  if (simpleUpdated || otherUpdated)
1096
1096
  return result;
@@ -1099,13 +1099,9 @@ function prepareImportData(translatables, keepData, existingEntry, targetSchema)
1099
1099
  }
1100
1100
  const TRANSLATIONTUDIO_URL = "https://strapi.translationstudio.tech";
1101
1101
  const APP_NAME = "translationstudio";
1102
- const Logger = {
1103
- log: typeof strapi !== "undefined" ? strapi.log : console,
1104
- info: (val) => Logger.log.info(val),
1105
- warn: (val) => Logger.log.warn(val),
1106
- error: (val) => Logger.log.error(val),
1107
- debug: (val) => Logger.log.debug(val)
1108
- };
1102
+ ({
1103
+ log: typeof strapi !== "undefined" ? strapi.log : console
1104
+ });
1109
1105
  const service = ({ strapi: strapi2 }) => {
1110
1106
  const pluginStore = strapi2.store({
1111
1107
  type: "plugin",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@translationstudio/translationstudio-strapi-extension",
3
3
  "description": "translationstudio extension for strapi",
4
- "license": "GPL-2.0-only",
4
+ "license": "MIT",
5
5
  "author": "Duncan Leininger <duncan.leininger@idmedia.com>",
6
6
  "contributors": [
7
7
  {
@@ -10,7 +10,7 @@
10
10
  }
11
11
  ],
12
12
  "homepage": "https://translationstudio.tech",
13
- "version": "5.0.1",
13
+ "version": "6.0.0",
14
14
  "keywords": [
15
15
  "translationstudio",
16
16
  "strapi",