@localazy/strapi-plugin 1.0.11 → 1.1.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.
Files changed (42) hide show
  1. package/dist/_chunks/{FetchIdentity-BB5V79aG.js → FetchIdentity-DfV1OWMB.js} +1 -1
  2. package/dist/_chunks/{FetchIdentity-CkL7UYRt.mjs → FetchIdentity-lkoWjYjn.mjs} +1 -1
  3. package/dist/_chunks/{LanguagesSelector-DDjJ90sz.js → LanguagesSelector-BmWfSZq6.js} +2 -2
  4. package/dist/_chunks/{LanguagesSelector-BUSLrXE9.mjs → LanguagesSelector-vSZvVGUT.mjs} +2 -2
  5. package/dist/_chunks/{LocalazyApp-BzcT9jmq.js → LocalazyApp-BUfYt7UL.js} +10 -13
  6. package/dist/_chunks/{LocalazyApp-H3kYTy7p.mjs → LocalazyApp-st8mwIbM.mjs} +10 -13
  7. package/dist/_chunks/{LocalazyContentTransferSetup-rrXuAqRA.js → LocalazyContentTransferSetup-BjLBgqFO.js} +3 -3
  8. package/dist/_chunks/{LocalazyContentTransferSetup-BrLho135.mjs → LocalazyContentTransferSetup-D2YvBYs_.mjs} +3 -3
  9. package/dist/_chunks/{LocalazyGlobalSettings-NhjPAqfZ.mjs → LocalazyGlobalSettings-DHCU2_RH.mjs} +4 -4
  10. package/dist/_chunks/{LocalazyGlobalSettings-Dj93M25t.js → LocalazyGlobalSettings-Do5tOyhB.js} +4 -4
  11. package/dist/_chunks/{LocalazyPanel-C1r8FU9w.js → LocalazyPanel-BDxUI_RH.js} +1 -1
  12. package/dist/_chunks/{LocalazyPanel-DokDDR0T.mjs → LocalazyPanel-CulgT97p.mjs} +1 -1
  13. package/dist/_chunks/{LocalazyStatusColumn-CaAL-caH.mjs → LocalazyStatusColumn-DoTWD2eL.mjs} +1 -1
  14. package/dist/_chunks/{LocalazyStatusColumn-D50ZkXY-.js → LocalazyStatusColumn-Dpwoc5Ig.js} +1 -1
  15. package/dist/_chunks/{RequireLocalazyAuth-C9qzj01C.js → RequireLocalazyAuth-BzM7C6Yw.js} +2 -2
  16. package/dist/_chunks/{RequireLocalazyAuth-c-nP7C0A.mjs → RequireLocalazyAuth-CqHrZ1Ah.mjs} +2 -2
  17. package/dist/_chunks/{entry-exclusion-service-0Ul5AWi-.js → entry-exclusion-service-Cvu8PQUI.js} +1 -1
  18. package/dist/_chunks/{entry-exclusion-service-Db6jzNVM.mjs → entry-exclusion-service-DWFMKgkA.mjs} +1 -1
  19. package/dist/_chunks/{has-model-changed-VkgGfN-6.mjs → has-model-changed-CWdMNRB1.mjs} +2 -2
  20. package/dist/_chunks/{has-model-changed-CmZh9bwD.js → has-model-changed-D1f6is8z.js} +2 -2
  21. package/dist/_chunks/{index-CaHacyle.js → index-BgPI2yQD.js} +7 -7
  22. package/dist/_chunks/{index-C_svJuLd.mjs → index-CtvR-R3c.mjs} +7 -7
  23. package/dist/_chunks/{strapi-api-base-DJi1gdZT.js → strapi-api-base-CN6q5tPh.js} +1 -1
  24. package/dist/_chunks/{strapi-api-base-BTpukPev.mjs → strapi-api-base-CturxOqD.mjs} +1 -1
  25. package/dist/admin/index.js +1 -1
  26. package/dist/admin/index.mjs +1 -1
  27. package/dist/admin/src/modules/@common/services/product-analytics-service.d.ts +1 -0
  28. package/dist/server/index.js +127 -17
  29. package/dist/server/index.mjs +127 -17
  30. package/dist/server/src/controllers/index.d.ts +4 -4
  31. package/dist/server/src/controllers/localazy-auth-controller.d.ts +1 -1
  32. package/dist/server/src/controllers/localazy-project-controller.d.ts +1 -1
  33. package/dist/server/src/controllers/localazy-user-controller.d.ts +1 -1
  34. package/dist/server/src/controllers/plugin-settings-controller.d.ts +1 -1
  35. package/dist/server/src/core/index.d.ts +1 -0
  36. package/dist/server/src/destroy.d.ts +1 -1
  37. package/dist/server/src/index.d.ts +6 -5
  38. package/dist/server/src/services/index.d.ts +1 -0
  39. package/dist/server/src/services/strapi-service.d.ts +1 -0
  40. package/dist/server/src/utils/get-character-limits-metadata.d.ts +13 -0
  41. package/dist/server/src/utils/get-picked-flatten-keys-for-hook-entry.d.ts +3 -1
  42. package/package.json +5 -4
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const strapiApiBase = require("./strapi-api-base-DJi1gdZT.js");
2
+ const strapiApiBase = require("./strapi-api-base-CN6q5tPh.js");
3
3
  const React = require("react");
4
4
  const jsxRuntime = require("react/jsx-runtime");
5
5
  const emptyIdentity = {
@@ -1,4 +1,4 @@
1
- import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-BTpukPev.mjs";
1
+ import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-CturxOqD.mjs";
2
2
  import { useState, useMemo, createContext, useContext, useEffect } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  const emptyIdentity = {
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
- const strapiApiBase = require("./strapi-api-base-DJi1gdZT.js");
2
+ const strapiApiBase = require("./strapi-api-base-CN6q5tPh.js");
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const FetchIdentity = require("./FetchIdentity-BB5V79aG.js");
5
+ const FetchIdentity = require("./FetchIdentity-DfV1OWMB.js");
6
6
  const index = require("./index-BSNW1ypR.js");
7
7
  const useTranslation = require("./useTranslation-BdIl-aLe.js");
8
8
  const strapiApiInstance = strapiApiBase.createStrapiApiAxiosInstance();
@@ -1,7 +1,7 @@
1
- import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-BTpukPev.mjs";
1
+ import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-CturxOqD.mjs";
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { useState, useEffect } from "react";
4
- import { c as cloneDeep } from "./FetchIdentity-CkL7UYRt.mjs";
4
+ import { c as cloneDeep } from "./FetchIdentity-lkoWjYjn.mjs";
5
5
  import { F as Field, M as MultiSelect, b as MultiSelectOption } from "./index-BIHAiJnE.mjs";
6
6
  import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
7
7
  const strapiApiInstance = createStrapiApiAxiosInstance();
@@ -4,15 +4,15 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const reactRouterDom = require("react-router-dom");
5
5
  const index$1 = require("./index-BSNW1ypR.js");
6
6
  const React = require("react");
7
- const FetchIdentity = require("./FetchIdentity-BB5V79aG.js");
8
- const index = require("./index-CaHacyle.js");
7
+ const FetchIdentity = require("./FetchIdentity-DfV1OWMB.js");
8
+ const index = require("./index-BgPI2yQD.js");
9
9
  const useTranslation = require("./useTranslation-BdIl-aLe.js");
10
10
  const _commonjsHelpers = require("./_commonjsHelpers-Bc2YnDe1.js");
11
- const strapiApiBase = require("./strapi-api-base-DJi1gdZT.js");
12
- const LanguagesSelector = require("./LanguagesSelector-DDjJ90sz.js");
11
+ const strapiApiBase = require("./strapi-api-base-CN6q5tPh.js");
12
+ const LanguagesSelector = require("./LanguagesSelector-BmWfSZq6.js");
13
13
  const admin = require("@strapi/strapi/admin");
14
14
  require("./i18n-DaBjUC3Y.js");
15
- const hasModelChanged = require("./has-model-changed-CmZh9bwD.js");
15
+ const hasModelChanged = require("./has-model-changed-D1f6is8z.js");
16
16
  var PLUGIN_ROUTES = /* @__PURE__ */ ((PLUGIN_ROUTES2) => {
17
17
  PLUGIN_ROUTES2["ROOT"] = "";
18
18
  PLUGIN_ROUTES2["LOGIN"] = "login";
@@ -1356,13 +1356,14 @@ class ProductAnalyticsService {
1356
1356
  }
1357
1357
  }
1358
1358
  static async buildData(event, project, params) {
1359
- const { version } = await PluginService.getPluginVersion();
1359
+ const { version, versionStrapi } = await PluginService.getPluginVersion();
1360
1360
  return {
1361
1361
  event,
1362
1362
  data: {
1363
1363
  "Project Id": project.id,
1364
1364
  "Project Name": project.name,
1365
1365
  version,
1366
+ versionStrapi,
1366
1367
  ...params
1367
1368
  }
1368
1369
  };
@@ -5188,10 +5189,8 @@ const Download = (props) => {
5188
5189
  setshowDownloadFinishedModal(true);
5189
5190
  try {
5190
5191
  const cursor = await FetchIdentity.PluginSettingsService.getSyncCursor();
5191
- setHasSyncCursor(
5192
- cursor?.processedKeys !== void 0 && Object.keys(cursor.processedKeys).length > 0
5193
- );
5194
- } catch (_e) {
5192
+ setHasSyncCursor(cursor?.processedKeys !== void 0 && Object.keys(cursor.processedKeys).length > 0);
5193
+ } catch {
5195
5194
  }
5196
5195
  });
5197
5196
  ProductAnalyticsService.trackDownloadToStrapi(identity.user.id, identity.project, {
@@ -5210,9 +5209,7 @@ const Download = (props) => {
5210
5209
  ]);
5211
5210
  setModelChanged(modelChangedResult);
5212
5211
  setLocalesIncompatible(!localesCompatibleResult);
5213
- setHasSyncCursor(
5214
- syncCursor?.processedKeys !== void 0 && Object.keys(syncCursor.processedKeys).length > 0
5215
- );
5212
+ setHasSyncCursor(syncCursor?.processedKeys !== void 0 && Object.keys(syncCursor.processedKeys).length > 0);
5216
5213
  const projectLanguagesWithoutDefaultLanguage = project?.languages?.filter((language) => language.id !== project.sourceLanguage) || [];
5217
5214
  setProjectLanguages(projectLanguagesWithoutDefaultLanguage);
5218
5215
  setFormModel(globalSettings);
@@ -2,15 +2,15 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { useNavigate, useLocation, NavLink, Routes, Route } from "react-router-dom";
3
3
  import { i as ForwardRef$2H, j as ForwardRef$d, k as ForwardRef$3P, c as Flex, L as Loader, B as Button, e as Box, T as Typography, l as Link, m as SubNav, n as SubNavHeader, o as SubNavSections, p as SubNavSection, q as SubNavLink, r as ForwardRef$L, G as Grid, D as Divider, s as darkTheme, t as lightTheme, A as Alert, u as Dialog, v as DesignSystemProvider } from "./index-BIHAiJnE.mjs";
4
4
  import { useState, useEffect } from "react";
5
- import { u as useLocalazyIdentity, v as LocalazyUserService, w as emptyIdentity, P as PluginSettingsService, c as cloneDeep, s as set, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-CkL7UYRt.mjs";
6
- import { P as PLUGIN_ID } from "./index-C_svJuLd.mjs";
5
+ import { u as useLocalazyIdentity, v as LocalazyUserService, w as emptyIdentity, P as PluginSettingsService, c as cloneDeep, s as set, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-lkoWjYjn.mjs";
6
+ import { P as PLUGIN_ID } from "./index-CtvR-R3c.mjs";
7
7
  import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
8
8
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-DWwsNxpa.mjs";
9
- import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-BTpukPev.mjs";
10
- import { P as ProjectService, L as LanguagesSelector } from "./LanguagesSelector-BUSLrXE9.mjs";
9
+ import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-CturxOqD.mjs";
10
+ import { P as ProjectService, L as LanguagesSelector } from "./LanguagesSelector-vSZvVGUT.mjs";
11
11
  import { Layouts, Page } from "@strapi/strapi/admin";
12
12
  import "./i18n-Bga-GG_Z.mjs";
13
- import { h as hasModelChanged } from "./has-model-changed-VkgGfN-6.mjs";
13
+ import { h as hasModelChanged } from "./has-model-changed-CWdMNRB1.mjs";
14
14
  var PLUGIN_ROUTES = /* @__PURE__ */ ((PLUGIN_ROUTES2) => {
15
15
  PLUGIN_ROUTES2["ROOT"] = "";
16
16
  PLUGIN_ROUTES2["LOGIN"] = "login";
@@ -1354,13 +1354,14 @@ class ProductAnalyticsService {
1354
1354
  }
1355
1355
  }
1356
1356
  static async buildData(event, project, params) {
1357
- const { version } = await PluginService.getPluginVersion();
1357
+ const { version, versionStrapi } = await PluginService.getPluginVersion();
1358
1358
  return {
1359
1359
  event,
1360
1360
  data: {
1361
1361
  "Project Id": project.id,
1362
1362
  "Project Name": project.name,
1363
1363
  version,
1364
+ versionStrapi,
1364
1365
  ...params
1365
1366
  }
1366
1367
  };
@@ -5186,10 +5187,8 @@ const Download = (props) => {
5186
5187
  setshowDownloadFinishedModal(true);
5187
5188
  try {
5188
5189
  const cursor = await PluginSettingsService.getSyncCursor();
5189
- setHasSyncCursor(
5190
- cursor?.processedKeys !== void 0 && Object.keys(cursor.processedKeys).length > 0
5191
- );
5192
- } catch (_e) {
5190
+ setHasSyncCursor(cursor?.processedKeys !== void 0 && Object.keys(cursor.processedKeys).length > 0);
5191
+ } catch {
5193
5192
  }
5194
5193
  });
5195
5194
  ProductAnalyticsService.trackDownloadToStrapi(identity.user.id, identity.project, {
@@ -5208,9 +5207,7 @@ const Download = (props) => {
5208
5207
  ]);
5209
5208
  setModelChanged(modelChangedResult);
5210
5209
  setLocalesIncompatible(!localesCompatibleResult);
5211
- setHasSyncCursor(
5212
- syncCursor?.processedKeys !== void 0 && Object.keys(syncCursor.processedKeys).length > 0
5213
- );
5210
+ setHasSyncCursor(syncCursor?.processedKeys !== void 0 && Object.keys(syncCursor.processedKeys).length > 0);
5214
5211
  const projectLanguagesWithoutDefaultLanguage = project?.languages?.filter((language) => language.id !== project.sourceLanguage) || [];
5215
5212
  setProjectLanguages(projectLanguagesWithoutDefaultLanguage);
5216
5213
  setFormModel(globalSettings);
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const RequireLocalazyAuth = require("./RequireLocalazyAuth-C9qzj01C.js");
6
- const FetchIdentity = require("./FetchIdentity-BB5V79aG.js");
5
+ const RequireLocalazyAuth = require("./RequireLocalazyAuth-BzM7C6Yw.js");
6
+ const FetchIdentity = require("./FetchIdentity-DfV1OWMB.js");
7
7
  const admin = require("@strapi/strapi/admin");
8
8
  const index = require("./index-BSNW1ypR.js");
9
- const hasModelChanged = require("./has-model-changed-CmZh9bwD.js");
9
+ const hasModelChanged = require("./has-model-changed-D1f6is8z.js");
10
10
  const useTranslation = require("./useTranslation-BdIl-aLe.js");
11
11
  const styled = require("styled-components");
12
12
  const index$1 = require("./index-1he9s_bs.js");
@@ -1,10 +1,10 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { forwardRef, useState, useEffect } from "react";
3
- import { i as isEqual, R as RequireLocalazyAuth } from "./RequireLocalazyAuth-c-nP7C0A.mjs";
4
- import { s as set, m as keys, n as isArrayLike, o as arrayEach, k as isArray, p as isObject, P as PluginSettingsService, c as cloneDeep, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-CkL7UYRt.mjs";
3
+ import { i as isEqual, R as RequireLocalazyAuth } from "./RequireLocalazyAuth-CqHrZ1Ah.mjs";
4
+ import { s as set, m as keys, n as isArrayLike, o as arrayEach, k as isArray, p as isObject, P as PluginSettingsService, c as cloneDeep, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-lkoWjYjn.mjs";
5
5
  import { Layouts } from "@strapi/strapi/admin";
6
6
  import { C as CheckboxImpl, e as Box, g as Accordion, c as Flex, h as SwitchImpl, T as Typography, B as Button, d as ForwardRef$4z, A as Alert, D as Divider } from "./index-BIHAiJnE.mjs";
7
- import { S as SUPPORTED_CONTENT_TYPE_FIELDS, a as SUPPORTED_CUSTOM_FIELD_PLUGINS, g as getContentTransferSetupKeysSets, b as get, f as findModelValueByKey, c as StrapiModelService, d as getModelsTree, h as hasModelChanged } from "./has-model-changed-VkgGfN-6.mjs";
7
+ import { S as SUPPORTED_CONTENT_TYPE_FIELDS, a as SUPPORTED_CUSTOM_FIELD_PLUGINS, g as getContentTransferSetupKeysSets, b as get, f as findModelValueByKey, c as StrapiModelService, d as getModelsTree, h as hasModelChanged } from "./has-model-changed-CWdMNRB1.mjs";
8
8
  import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
9
9
  import styled from "styled-components";
10
10
  import { Trans } from "./index-BIbKC7-V.mjs";
@@ -1,11 +1,11 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
- import { P as PluginSettingsService$1, c as cloneDeep, s as set, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-CkL7UYRt.mjs";
3
+ import { P as PluginSettingsService$1, c as cloneDeep, s as set, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-lkoWjYjn.mjs";
4
4
  import { Layouts } from "@strapi/strapi/admin";
5
5
  import { c as Flex, B as Button, d as ForwardRef$4z, e as Box, A as Alert, T as Typography, F as Field, a as Toggle, M as MultiSelect, b as MultiSelectOption, D as Divider, S as SingleSelect, f as SingleSelectOption } from "./index-BIHAiJnE.mjs";
6
- import { i as isEqual, R as RequireLocalazyAuth } from "./RequireLocalazyAuth-c-nP7C0A.mjs";
7
- import { L as LanguagesSelector, P as ProjectService } from "./LanguagesSelector-BUSLrXE9.mjs";
8
- import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-BTpukPev.mjs";
6
+ import { i as isEqual, R as RequireLocalazyAuth } from "./RequireLocalazyAuth-CqHrZ1Ah.mjs";
7
+ import { L as LanguagesSelector, P as ProjectService } from "./LanguagesSelector-vSZvVGUT.mjs";
8
+ import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-CturxOqD.mjs";
9
9
  import "./i18n-Bga-GG_Z.mjs";
10
10
  import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
11
11
  class PluginSettingsService {
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const FetchIdentity = require("./FetchIdentity-BB5V79aG.js");
5
+ const FetchIdentity = require("./FetchIdentity-DfV1OWMB.js");
6
6
  const admin = require("@strapi/strapi/admin");
7
7
  const index = require("./index-BSNW1ypR.js");
8
- const RequireLocalazyAuth = require("./RequireLocalazyAuth-C9qzj01C.js");
9
- const LanguagesSelector = require("./LanguagesSelector-DDjJ90sz.js");
10
- const strapiApiBase = require("./strapi-api-base-DJi1gdZT.js");
8
+ const RequireLocalazyAuth = require("./RequireLocalazyAuth-BzM7C6Yw.js");
9
+ const LanguagesSelector = require("./LanguagesSelector-BmWfSZq6.js");
10
+ const strapiApiBase = require("./strapi-api-base-CN6q5tPh.js");
11
11
  require("./i18n-DaBjUC3Y.js");
12
12
  const useTranslation = require("./useTranslation-BdIl-aLe.js");
13
13
  class PluginSettingsService {
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const reactRouterDom = require("react-router-dom");
6
6
  const index = require("./index-BSNW1ypR.js");
7
- const entryExclusionService = require("./entry-exclusion-service-0Ul5AWi-.js");
7
+ const entryExclusionService = require("./entry-exclusion-service-Cvu8PQUI.js");
8
8
  require("./i18n-DaBjUC3Y.js");
9
9
  const useTranslation = require("./useTranslation-BdIl-aLe.js");
10
10
  const LocalazyPanel = () => {
@@ -2,7 +2,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
3
  import { useLocation } from "react-router-dom";
4
4
  import { T as Typography, a as Toggle } from "./index-BIHAiJnE.mjs";
5
- import EntryExclusionService from "./entry-exclusion-service-Db6jzNVM.mjs";
5
+ import EntryExclusionService from "./entry-exclusion-service-DWFMKgkA.mjs";
6
6
  import "./i18n-Bga-GG_Z.mjs";
7
7
  import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
8
8
  const LocalazyPanel = () => {
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { useState, useEffect } from "react";
3
- import EntryExclusionService from "./entry-exclusion-service-Db6jzNVM.mjs";
3
+ import EntryExclusionService from "./entry-exclusion-service-DWFMKgkA.mjs";
4
4
  import "./i18n-Bga-GG_Z.mjs";
5
5
  import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
6
6
  const LocalazyStatusColumn = ({ data, model }) => {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
- const entryExclusionService = require("./entry-exclusion-service-0Ul5AWi-.js");
5
+ const entryExclusionService = require("./entry-exclusion-service-Cvu8PQUI.js");
6
6
  require("./i18n-DaBjUC3Y.js");
7
7
  const useTranslation = require("./useTranslation-BdIl-aLe.js");
8
8
  const LocalazyStatusColumn = ({ data, model }) => {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
- const FetchIdentity = require("./FetchIdentity-BB5V79aG.js");
2
+ const FetchIdentity = require("./FetchIdentity-DfV1OWMB.js");
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
- const index$1 = require("./index-CaHacyle.js");
4
+ const index$1 = require("./index-BgPI2yQD.js");
5
5
  const index = require("./index-BSNW1ypR.js");
6
6
  const admin = require("@strapi/strapi/admin");
7
7
  require("./i18n-DaBjUC3Y.js");
@@ -1,6 +1,6 @@
1
- import { S as SetCache, a as cacheHas, b as Symbol$1, e as eq, U as Uint8Array, d as setToArray, g as getAllKeys, f as getTag, i as isBuffer, h as Stack, j as isTypedArray, k as isArray, l as isObjectLike, u as useLocalazyIdentity } from "./FetchIdentity-CkL7UYRt.mjs";
1
+ import { S as SetCache, a as cacheHas, b as Symbol$1, e as eq, U as Uint8Array, d as setToArray, g as getAllKeys, f as getTag, i as isBuffer, h as Stack, j as isTypedArray, k as isArray, l as isObjectLike, u as useLocalazyIdentity } from "./FetchIdentity-lkoWjYjn.mjs";
2
2
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
3
- import { P as PLUGIN_ID } from "./index-C_svJuLd.mjs";
3
+ import { P as PLUGIN_ID } from "./index-CtvR-R3c.mjs";
4
4
  import { e as Box, T as Typography } from "./index-BIHAiJnE.mjs";
5
5
  import { Layouts } from "@strapi/strapi/admin";
6
6
  import "./i18n-Bga-GG_Z.mjs";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const strapiApiBase = require("./strapi-api-base-DJi1gdZT.js");
3
+ const strapiApiBase = require("./strapi-api-base-CN6q5tPh.js");
4
4
  const BASE_PATH = "/entry-exclusion";
5
5
  const axiosInstance = strapiApiBase.createStrapiApiAxiosInstance();
6
6
  class EntryExclusionService {
@@ -1,4 +1,4 @@
1
- import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-BTpukPev.mjs";
1
+ import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-CturxOqD.mjs";
2
2
  const BASE_PATH = "/entry-exclusion";
3
3
  const axiosInstance = createStrapiApiAxiosInstance();
4
4
  class EntryExclusionService {
@@ -1,5 +1,5 @@
1
- import { q as castPath, t as toKey, r as Set, d as setToArray, S as SetCache, a as cacheHas, P as PluginSettingsService } from "./FetchIdentity-CkL7UYRt.mjs";
2
- import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-BTpukPev.mjs";
1
+ import { q as castPath, t as toKey, r as Set, d as setToArray, S as SetCache, a as cacheHas, P as PluginSettingsService } from "./FetchIdentity-lkoWjYjn.mjs";
2
+ import { c as createStrapiApiAxiosInstance } from "./strapi-api-base-CturxOqD.mjs";
3
3
  import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-DWwsNxpa.mjs";
4
4
  function baseGet(object, path) {
5
5
  path = castPath(path, object);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- const FetchIdentity = require("./FetchIdentity-BB5V79aG.js");
3
- const strapiApiBase = require("./strapi-api-base-DJi1gdZT.js");
2
+ const FetchIdentity = require("./FetchIdentity-DfV1OWMB.js");
3
+ const strapiApiBase = require("./strapi-api-base-CN6q5tPh.js");
4
4
  const _commonjsHelpers = require("./_commonjsHelpers-Bc2YnDe1.js");
5
5
  function baseGet(object, path) {
6
6
  path = FetchIdentity.castPath(path, object);
@@ -83,13 +83,13 @@ const index = {
83
83
  try {
84
84
  const contentManagerPlugin = app.getPlugin("content-manager");
85
85
  if (contentManagerPlugin?.apis?.addEditViewSidePanel) {
86
- const { default: LocalazyPanel } = await Promise.resolve().then(() => require("./LocalazyPanel-C1r8FU9w.js"));
86
+ const { default: LocalazyPanel } = await Promise.resolve().then(() => require("./LocalazyPanel-BDxUI_RH.js"));
87
87
  const apis = contentManagerPlugin.apis;
88
88
  apis.addEditViewSidePanel([LocalazyPanel]);
89
89
  } else {
90
90
  console.warn('Localazy Plugin: Content Manager "addEditViewSidePanel" API not available');
91
91
  }
92
- const { default: LocalazyStatusColumn } = await Promise.resolve().then(() => require("./LocalazyStatusColumn-D50ZkXY-.js"));
92
+ const { default: LocalazyStatusColumn } = await Promise.resolve().then(() => require("./LocalazyStatusColumn-Dpwoc5Ig.js"));
93
93
  app.registerHook("Admin/CM/pages/ListView/inject-column-in-table", (params) => {
94
94
  try {
95
95
  console.log("Localazy: Hook called with params:", params);
@@ -137,7 +137,7 @@ const index = {
137
137
  type: "info",
138
138
  message: t("plugin_settings.bulk_action_updating_entries")
139
139
  });
140
- const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-0Ul5AWi-.js"));
140
+ const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-Cvu8PQUI.js"));
141
141
  const documentIds = documents.map((doc) => doc.documentId);
142
142
  await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, true);
143
143
  toggleNotification({
@@ -168,7 +168,7 @@ const index = {
168
168
  type: "info",
169
169
  message: t("plugin_settings.bulk_action_updating_entries")
170
170
  });
171
- const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-0Ul5AWi-.js"));
171
+ const { default: EntryExclusionService } = await Promise.resolve().then(() => require("./entry-exclusion-service-Cvu8PQUI.js"));
172
172
  const documentIds = documents.map((doc) => doc.documentId);
173
173
  await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, false);
174
174
  toggleNotification({
@@ -204,7 +204,7 @@ const addMenuLink = (app) => {
204
204
  id: `${PLUGIN_ID}.name`,
205
205
  defaultMessage: "Localazy"
206
206
  },
207
- Component: () => Promise.resolve().then(() => require("./LocalazyApp-BzcT9jmq.js"))
207
+ Component: () => Promise.resolve().then(() => require("./LocalazyApp-BUfYt7UL.js"))
208
208
  });
209
209
  };
210
210
  const addSettingsSection = (app) => {
@@ -225,7 +225,7 @@ const addSettingsSection = (app) => {
225
225
  defaultMessage: "Localazy Settings"
226
226
  },
227
227
  to: `${PLUGIN_ID}/global-settings`,
228
- Component: () => Promise.resolve().then(() => require("./LocalazyGlobalSettings-Dj93M25t.js")),
228
+ Component: () => Promise.resolve().then(() => require("./LocalazyGlobalSettings-Do5tOyhB.js")),
229
229
  permissions: []
230
230
  },
231
231
  // Content Transfer Setup
@@ -236,7 +236,7 @@ const addSettingsSection = (app) => {
236
236
  defaultMessage: "Content Transfer Setup"
237
237
  },
238
238
  to: `${PLUGIN_ID}/content-transfer-setup`,
239
- Component: () => Promise.resolve().then(() => require("./LocalazyContentTransferSetup-rrXuAqRA.js")),
239
+ Component: () => Promise.resolve().then(() => require("./LocalazyContentTransferSetup-BjLBgqFO.js")),
240
240
  permissions: []
241
241
  }
242
242
  ]
@@ -58,13 +58,13 @@ const index = {
58
58
  try {
59
59
  const contentManagerPlugin = app.getPlugin("content-manager");
60
60
  if (contentManagerPlugin?.apis?.addEditViewSidePanel) {
61
- const { default: LocalazyPanel } = await import("./LocalazyPanel-DokDDR0T.mjs");
61
+ const { default: LocalazyPanel } = await import("./LocalazyPanel-CulgT97p.mjs");
62
62
  const apis = contentManagerPlugin.apis;
63
63
  apis.addEditViewSidePanel([LocalazyPanel]);
64
64
  } else {
65
65
  console.warn('Localazy Plugin: Content Manager "addEditViewSidePanel" API not available');
66
66
  }
67
- const { default: LocalazyStatusColumn } = await import("./LocalazyStatusColumn-CaAL-caH.mjs");
67
+ const { default: LocalazyStatusColumn } = await import("./LocalazyStatusColumn-DoTWD2eL.mjs");
68
68
  app.registerHook("Admin/CM/pages/ListView/inject-column-in-table", (params) => {
69
69
  try {
70
70
  console.log("Localazy: Hook called with params:", params);
@@ -112,7 +112,7 @@ const index = {
112
112
  type: "info",
113
113
  message: t("plugin_settings.bulk_action_updating_entries")
114
114
  });
115
- const { default: EntryExclusionService } = await import("./entry-exclusion-service-Db6jzNVM.mjs");
115
+ const { default: EntryExclusionService } = await import("./entry-exclusion-service-DWFMKgkA.mjs");
116
116
  const documentIds = documents.map((doc) => doc.documentId);
117
117
  await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, true);
118
118
  toggleNotification({
@@ -143,7 +143,7 @@ const index = {
143
143
  type: "info",
144
144
  message: t("plugin_settings.bulk_action_updating_entries")
145
145
  });
146
- const { default: EntryExclusionService } = await import("./entry-exclusion-service-Db6jzNVM.mjs");
146
+ const { default: EntryExclusionService } = await import("./entry-exclusion-service-DWFMKgkA.mjs");
147
147
  const documentIds = documents.map((doc) => doc.documentId);
148
148
  await EntryExclusionService.setMultipleEntriesExclusion(model, documentIds, false);
149
149
  toggleNotification({
@@ -179,7 +179,7 @@ const addMenuLink = (app) => {
179
179
  id: `${PLUGIN_ID}.name`,
180
180
  defaultMessage: "Localazy"
181
181
  },
182
- Component: () => import("./LocalazyApp-H3kYTy7p.mjs")
182
+ Component: () => import("./LocalazyApp-st8mwIbM.mjs")
183
183
  });
184
184
  };
185
185
  const addSettingsSection = (app) => {
@@ -200,7 +200,7 @@ const addSettingsSection = (app) => {
200
200
  defaultMessage: "Localazy Settings"
201
201
  },
202
202
  to: `${PLUGIN_ID}/global-settings`,
203
- Component: () => import("./LocalazyGlobalSettings-NhjPAqfZ.mjs"),
203
+ Component: () => import("./LocalazyGlobalSettings-DHCU2_RH.mjs"),
204
204
  permissions: []
205
205
  },
206
206
  // Content Transfer Setup
@@ -211,7 +211,7 @@ const addSettingsSection = (app) => {
211
211
  defaultMessage: "Content Transfer Setup"
212
212
  },
213
213
  to: `${PLUGIN_ID}/content-transfer-setup`,
214
- Component: () => import("./LocalazyContentTransferSetup-BrLho135.mjs"),
214
+ Component: () => import("./LocalazyContentTransferSetup-D2YvBYs_.mjs"),
215
215
  permissions: []
216
216
  }
217
217
  ]
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const index = require("./index-CaHacyle.js");
2
+ const index = require("./index-BgPI2yQD.js");
3
3
  function bind(fn, thisArg) {
4
4
  return function wrap() {
5
5
  return fn.apply(thisArg, arguments);
@@ -1,4 +1,4 @@
1
- import { P as PLUGIN_ID } from "./index-C_svJuLd.mjs";
1
+ import { P as PLUGIN_ID } from "./index-CtvR-R3c.mjs";
2
2
  function bind(fn, thisArg) {
3
3
  return function wrap() {
4
4
  return fn.apply(thisArg, arguments);
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-CaHacyle.js");
2
+ const index = require("../_chunks/index-BgPI2yQD.js");
3
3
  require("react");
4
4
  module.exports = index.index;
@@ -1,4 +1,4 @@
1
- import { i } from "../_chunks/index-C_svJuLd.mjs";
1
+ import { i } from "../_chunks/index-CtvR-R3c.mjs";
2
2
  import "react";
3
3
  export {
4
4
  i as default
@@ -9,6 +9,7 @@ export default class ProductAnalyticsService {
9
9
  'Project Id': any;
10
10
  'Project Name': any;
11
11
  version: any;
12
+ versionStrapi: any;
12
13
  };
13
14
  }>;
14
15
  }
@@ -20532,7 +20532,7 @@ var distExports = dist$1.exports;
20532
20532
  const io = /* @__PURE__ */ getDefaultExportFromCjs(distExports);
20533
20533
  const { Server: Server2, Namespace, Socket: Socket3 } = io;
20534
20534
  const name = "@localazy/strapi-plugin";
20535
- const version = "1.0.11";
20535
+ const version = "1.1.0";
20536
20536
  const description = "The official Strapi Plugin by Localazy.";
20537
20537
  const keywords = [
20538
20538
  "strapi",
@@ -20593,11 +20593,12 @@ const scripts = {
20593
20593
  "test:server": "jest --config server/jest.config.ts",
20594
20594
  "test:server:coverage": "jest --config server/jest.config.ts --coverage",
20595
20595
  "test:server:watch": "jest --config server/jest.config.ts --watch",
20596
- "test:ts:back": "run -T tsc -p server/tsconfig.json",
20597
- "test:ts:front": "run -T tsc -p admin/tsconfig.json",
20596
+ "test:ts:back": "tsc -p server/tsconfig.json --noEmit",
20597
+ "test:ts:front": "tsc -p admin/tsconfig.json --noEmit",
20598
20598
  verify: "strapi-plugin verify",
20599
20599
  watch: "strapi-plugin watch",
20600
- "watch:link": "strapi-plugin watch:link"
20600
+ "watch:link": "strapi-plugin watch:link",
20601
+ prepare: "husky"
20601
20602
  };
20602
20603
  const dependencies = {
20603
20604
  shelljs: "^0.8.5",
@@ -20729,7 +20730,7 @@ const bootstrap = ({ strapi: strapi2 }) => {
20729
20730
  });
20730
20731
  }
20731
20732
  };
20732
- const destroy = ({ strapi: strapi2 }) => {
20733
+ const destroy = ({ strapi: _strapi }) => {
20733
20734
  };
20734
20735
  const isoStrapiToLocalazy = (isoStrapi) => {
20735
20736
  if (!isoStrapi) {
@@ -21887,6 +21888,100 @@ const pickEntries = (flatten, pickPaths) => {
21887
21888
  });
21888
21889
  return pickedEntries;
21889
21890
  };
21891
+ const getCharacterLimitsMetadata = (flattenedContent, modelUid) => {
21892
+ const metadata = {};
21893
+ const model = strapi.contentTypes[modelUid] || strapi.components[modelUid];
21894
+ if (!model) {
21895
+ return metadata;
21896
+ }
21897
+ for (const flatKey of Object.keys(flattenedContent)) {
21898
+ const maxLength = resolveMaxLength(flatKey, modelUid, model);
21899
+ if (maxLength != null) {
21900
+ metadata[`@meta:${flatKey}`] = { limit: maxLength };
21901
+ }
21902
+ }
21903
+ return metadata;
21904
+ };
21905
+ const resolveMaxLength = (flatKey, modelUid, model) => {
21906
+ if (!flatKey.startsWith(`${modelUid}[`)) {
21907
+ return void 0;
21908
+ }
21909
+ const afterUid = flatKey.substring(modelUid.length);
21910
+ const closingBracket = afterUid.indexOf("]");
21911
+ if (closingBracket === -1) {
21912
+ return void 0;
21913
+ }
21914
+ const withoutDocId = afterUid.substring(closingBracket + 2);
21915
+ if (!withoutDocId) {
21916
+ return void 0;
21917
+ }
21918
+ const allParts = withoutDocId.split(".");
21919
+ const fieldPath = parseFieldPath(allParts);
21920
+ if (fieldPath.length === 0) {
21921
+ return void 0;
21922
+ }
21923
+ return walkSchemaForMaxLength(fieldPath, model);
21924
+ };
21925
+ const parseFieldPath = (parts) => {
21926
+ const segments = [];
21927
+ let i2 = 0;
21928
+ while (i2 < parts.length) {
21929
+ const part = parts[i2];
21930
+ const dynamicZoneMatch = part.match(/^([^[]+)\[(\d+);(.+)$/);
21931
+ if (dynamicZoneMatch) {
21932
+ let componentName = dynamicZoneMatch[3];
21933
+ i2++;
21934
+ while (i2 < parts.length && !parts[i2].includes("]")) {
21935
+ componentName += "." + parts[i2];
21936
+ i2++;
21937
+ }
21938
+ if (i2 < parts.length && parts[i2].includes("]")) {
21939
+ componentName += "." + parts[i2].replace("]", "");
21940
+ i2++;
21941
+ }
21942
+ segments.push({ name: dynamicZoneMatch[1], dynamicZoneComponent: componentName });
21943
+ continue;
21944
+ }
21945
+ const bracketMatch = part.match(/^([^[]+)\[/);
21946
+ if (bracketMatch) {
21947
+ segments.push({ name: bracketMatch[1] });
21948
+ i2++;
21949
+ continue;
21950
+ }
21951
+ segments.push({ name: part });
21952
+ i2++;
21953
+ }
21954
+ return segments;
21955
+ };
21956
+ const walkSchemaForMaxLength = (fieldPath, model) => {
21957
+ let currentModel = model;
21958
+ for (let i2 = 0; i2 < fieldPath.length; i2++) {
21959
+ const segment = fieldPath[i2];
21960
+ const attribute = currentModel?.attributes?.[segment.name];
21961
+ if (!attribute) {
21962
+ return void 0;
21963
+ }
21964
+ if (i2 === fieldPath.length - 1) {
21965
+ return attribute.maxLength;
21966
+ }
21967
+ if (attribute.type === "component" && attribute.component) {
21968
+ currentModel = strapi.components[attribute.component];
21969
+ if (!currentModel) {
21970
+ return void 0;
21971
+ }
21972
+ continue;
21973
+ }
21974
+ if (attribute.type === "dynamiczone" && segment.dynamicZoneComponent) {
21975
+ currentModel = strapi.components[segment.dynamicZoneComponent];
21976
+ if (!currentModel) {
21977
+ return void 0;
21978
+ }
21979
+ continue;
21980
+ }
21981
+ return void 0;
21982
+ }
21983
+ return void 0;
21984
+ };
21890
21985
  const getMainKeysOfNestedArrayObjects = (array) => {
21891
21986
  return array.map((item) => Reflect.ownKeys(item)[0]);
21892
21987
  };
@@ -22159,8 +22254,13 @@ const getPickedFlattenKeysForHookEntry = async (params) => {
22159
22254
  };
22160
22255
  }
22161
22256
  const pickedFlatten = pickEntries(flatten, pickPathsWithUid);
22257
+ const characterLimitsMetadata = getCharacterLimitsMetadata(pickedFlatten, modelUid);
22258
+ const pickedFlattenWithMetadata = {
22259
+ ...pickedFlatten,
22260
+ ...characterLimitsMetadata
22261
+ };
22162
22262
  return {
22163
- pickedFlatten,
22263
+ pickedFlatten: pickedFlattenWithMetadata,
22164
22264
  eventEntryLocale,
22165
22265
  projectSourceLanguageCode
22166
22266
  };
@@ -23982,7 +24082,7 @@ const register = ({ strapi: strapi2 }) => {
23982
24082
  });
23983
24083
  };
23984
24084
  const contentTypes = {};
23985
- const LocalazyUserController = ({ strapi: strapi2 }) => ({
24085
+ const LocalazyUserController = ({ strapi: _strapi }) => ({
23986
24086
  async getUser(ctx) {
23987
24087
  ctx.body = await getLocalazyUserService().getUser();
23988
24088
  },
@@ -24080,7 +24180,7 @@ const LocalazyGenericConnectorClientFactory = async () => {
24080
24180
  });
24081
24181
  return api;
24082
24182
  };
24083
- const LocalazyAuthController = ({ strapi: strapi2 }) => ({
24183
+ const LocalazyAuthController = ({ strapi: _strapi }) => ({
24084
24184
  async generateKeys(ctx) {
24085
24185
  const GenericConnectorApi = await LocalazyGenericConnectorClientFactory();
24086
24186
  ctx.body = await GenericConnectorApi.public.keys();
@@ -24107,11 +24207,12 @@ const StrapiController = ({ strapi: strapi2 }) => ({
24107
24207
  },
24108
24208
  async getPluginVersion(ctx) {
24109
24209
  ctx.body = {
24110
- version: await getStrapiService().getPluginVersion()
24210
+ version: await getStrapiService().getPluginVersion(),
24211
+ versionStrapi: getStrapiService().getStrapiVersion()
24111
24212
  };
24112
24213
  }
24113
24214
  });
24114
- const LocalazyProjectController = ({ strapi: strapi2 }) => ({
24215
+ const LocalazyProjectController = ({ strapi: _strapi }) => ({
24115
24216
  async getConnectedProject(ctx) {
24116
24217
  const LocalazyUserService2 = getLocalazyUserService();
24117
24218
  const LocalazyPubAPIService2 = getLocalazyPubAPIService();
@@ -24120,7 +24221,7 @@ const LocalazyProjectController = ({ strapi: strapi2 }) => ({
24120
24221
  ctx.body = project;
24121
24222
  }
24122
24223
  });
24123
- const PluginSettingsController = ({ strapi: strapi2 }) => ({
24224
+ const PluginSettingsController = ({ strapi: _strapi }) => ({
24124
24225
  async getContentTransferSetup(ctx) {
24125
24226
  ctx.body = await getPluginSettingsService().getContentTransferSetup();
24126
24227
  },
@@ -24698,6 +24799,9 @@ const StrapiService = ({ strapi: strapi2 }) => ({
24698
24799
  },
24699
24800
  async getPluginVersion() {
24700
24801
  return await Promise.resolve().then(() => _package$1).then((module2) => module2.version);
24802
+ },
24803
+ getStrapiVersion() {
24804
+ return strapi2.config.get("info.strapi");
24701
24805
  }
24702
24806
  });
24703
24807
  const LocalazyPubAPIService = ({ strapi: strapi2 }) => ({
@@ -24908,6 +25012,11 @@ const LocalazyTransferUploadService = ({ strapi: strapi2 }) => ({
24908
25012
  ...pickedFlatten
24909
25013
  };
24910
25014
  });
25015
+ const characterLimitsMetadata = getCharacterLimitsMetadata(pickedFlattenStrapiContent, modelUid);
25016
+ pickedFlattenStrapiContent = {
25017
+ ...pickedFlattenStrapiContent,
25018
+ ...characterLimitsMetadata
25019
+ };
24911
25020
  }
24912
25021
  const strapiDefaultLocaleCode = await StrapiI18nService2.getDefaultLocaleCode();
24913
25022
  const localazyLocaleCode = strapiDefaultLocaleCode ? isoStrapiToLocalazy(strapiDefaultLocaleCode) : config.default.LOCALAZY_DEFAULT_LOCALE;
@@ -25596,9 +25705,7 @@ const LocalazyTransferDownloadService = ({ strapi: strapi2 }) => ({
25596
25705
  locDownloadPLevel: 6
25597
25706
  });
25598
25707
  if (isEmpty(baseEntry)) {
25599
- strapi2.log.info(
25600
- `Source language entry ${uid}[${documentId}] does not exist anymore, skipping...`
25601
- );
25708
+ strapi2.log.info(`Source language entry ${uid}[${documentId}] does not exist anymore, skipping...`);
25602
25709
  await markKeysProcessed(sourceKeys);
25603
25710
  continue;
25604
25711
  }
@@ -25610,7 +25717,7 @@ const LocalazyTransferDownloadService = ({ strapi: strapi2 }) => ({
25610
25717
  const localazySearchUrl = `${user.project.url}/source-language?search=${uid}[${documentId}]`;
25611
25718
  if (isEmpty(currentLanguageLocalizedEntry)) {
25612
25719
  try {
25613
- const createdEntry = await StrapiLocalazyI18nService2.createEntry(
25720
+ await StrapiLocalazyI18nService2.createEntry(
25614
25721
  uid,
25615
25722
  strapiContentTypesModels,
25616
25723
  translatedModel,
@@ -25638,7 +25745,7 @@ const LocalazyTransferDownloadService = ({ strapi: strapi2 }) => ({
25638
25745
  } else {
25639
25746
  try {
25640
25747
  const localizedDocumentId = currentLanguageLocalizedEntry.documentId;
25641
- const updatedEntry = await StrapiLocalazyI18nService2.updateEntry(
25748
+ await StrapiLocalazyI18nService2.updateEntry(
25642
25749
  uid,
25643
25750
  localizedDocumentId,
25644
25751
  strapiContentTypesModels,
@@ -25675,7 +25782,10 @@ const LocalazyTransferDownloadService = ({ strapi: strapi2 }) => ({
25675
25782
  }
25676
25783
  }
25677
25784
  }
25678
- const totalProcessedKeys = Object.values(processedKeys).reduce((sum, langKeys) => sum + Object.keys(langKeys).length, 0);
25785
+ const totalProcessedKeys = Object.values(processedKeys).reduce(
25786
+ (sum, langKeys) => sum + Object.keys(langKeys).length,
25787
+ 0
25788
+ );
25679
25789
  strapi2.log.info(
25680
25790
  `Download finished. Tracked ${totalProcessedKeys} processed keys across ${Object.keys(processedKeys).length} languages.`
25681
25791
  );
@@ -20519,7 +20519,7 @@ var distExports = dist$1.exports;
20519
20519
  const io = /* @__PURE__ */ getDefaultExportFromCjs(distExports);
20520
20520
  const { Server: Server2, Namespace, Socket: Socket3 } = io;
20521
20521
  const name = "@localazy/strapi-plugin";
20522
- const version = "1.0.11";
20522
+ const version = "1.1.0";
20523
20523
  const description = "The official Strapi Plugin by Localazy.";
20524
20524
  const keywords = [
20525
20525
  "strapi",
@@ -20580,11 +20580,12 @@ const scripts = {
20580
20580
  "test:server": "jest --config server/jest.config.ts",
20581
20581
  "test:server:coverage": "jest --config server/jest.config.ts --coverage",
20582
20582
  "test:server:watch": "jest --config server/jest.config.ts --watch",
20583
- "test:ts:back": "run -T tsc -p server/tsconfig.json",
20584
- "test:ts:front": "run -T tsc -p admin/tsconfig.json",
20583
+ "test:ts:back": "tsc -p server/tsconfig.json --noEmit",
20584
+ "test:ts:front": "tsc -p admin/tsconfig.json --noEmit",
20585
20585
  verify: "strapi-plugin verify",
20586
20586
  watch: "strapi-plugin watch",
20587
- "watch:link": "strapi-plugin watch:link"
20587
+ "watch:link": "strapi-plugin watch:link",
20588
+ prepare: "husky"
20588
20589
  };
20589
20590
  const dependencies = {
20590
20591
  shelljs: "^0.8.5",
@@ -20716,7 +20717,7 @@ const bootstrap = ({ strapi: strapi2 }) => {
20716
20717
  });
20717
20718
  }
20718
20719
  };
20719
- const destroy = ({ strapi: strapi2 }) => {
20720
+ const destroy = ({ strapi: _strapi }) => {
20720
20721
  };
20721
20722
  const isoStrapiToLocalazy = (isoStrapi) => {
20722
20723
  if (!isoStrapi) {
@@ -21874,6 +21875,100 @@ const pickEntries = (flatten, pickPaths) => {
21874
21875
  });
21875
21876
  return pickedEntries;
21876
21877
  };
21878
+ const getCharacterLimitsMetadata = (flattenedContent, modelUid) => {
21879
+ const metadata = {};
21880
+ const model = strapi.contentTypes[modelUid] || strapi.components[modelUid];
21881
+ if (!model) {
21882
+ return metadata;
21883
+ }
21884
+ for (const flatKey of Object.keys(flattenedContent)) {
21885
+ const maxLength = resolveMaxLength(flatKey, modelUid, model);
21886
+ if (maxLength != null) {
21887
+ metadata[`@meta:${flatKey}`] = { limit: maxLength };
21888
+ }
21889
+ }
21890
+ return metadata;
21891
+ };
21892
+ const resolveMaxLength = (flatKey, modelUid, model) => {
21893
+ if (!flatKey.startsWith(`${modelUid}[`)) {
21894
+ return void 0;
21895
+ }
21896
+ const afterUid = flatKey.substring(modelUid.length);
21897
+ const closingBracket = afterUid.indexOf("]");
21898
+ if (closingBracket === -1) {
21899
+ return void 0;
21900
+ }
21901
+ const withoutDocId = afterUid.substring(closingBracket + 2);
21902
+ if (!withoutDocId) {
21903
+ return void 0;
21904
+ }
21905
+ const allParts = withoutDocId.split(".");
21906
+ const fieldPath = parseFieldPath(allParts);
21907
+ if (fieldPath.length === 0) {
21908
+ return void 0;
21909
+ }
21910
+ return walkSchemaForMaxLength(fieldPath, model);
21911
+ };
21912
+ const parseFieldPath = (parts) => {
21913
+ const segments = [];
21914
+ let i2 = 0;
21915
+ while (i2 < parts.length) {
21916
+ const part = parts[i2];
21917
+ const dynamicZoneMatch = part.match(/^([^[]+)\[(\d+);(.+)$/);
21918
+ if (dynamicZoneMatch) {
21919
+ let componentName = dynamicZoneMatch[3];
21920
+ i2++;
21921
+ while (i2 < parts.length && !parts[i2].includes("]")) {
21922
+ componentName += "." + parts[i2];
21923
+ i2++;
21924
+ }
21925
+ if (i2 < parts.length && parts[i2].includes("]")) {
21926
+ componentName += "." + parts[i2].replace("]", "");
21927
+ i2++;
21928
+ }
21929
+ segments.push({ name: dynamicZoneMatch[1], dynamicZoneComponent: componentName });
21930
+ continue;
21931
+ }
21932
+ const bracketMatch = part.match(/^([^[]+)\[/);
21933
+ if (bracketMatch) {
21934
+ segments.push({ name: bracketMatch[1] });
21935
+ i2++;
21936
+ continue;
21937
+ }
21938
+ segments.push({ name: part });
21939
+ i2++;
21940
+ }
21941
+ return segments;
21942
+ };
21943
+ const walkSchemaForMaxLength = (fieldPath, model) => {
21944
+ let currentModel = model;
21945
+ for (let i2 = 0; i2 < fieldPath.length; i2++) {
21946
+ const segment = fieldPath[i2];
21947
+ const attribute = currentModel?.attributes?.[segment.name];
21948
+ if (!attribute) {
21949
+ return void 0;
21950
+ }
21951
+ if (i2 === fieldPath.length - 1) {
21952
+ return attribute.maxLength;
21953
+ }
21954
+ if (attribute.type === "component" && attribute.component) {
21955
+ currentModel = strapi.components[attribute.component];
21956
+ if (!currentModel) {
21957
+ return void 0;
21958
+ }
21959
+ continue;
21960
+ }
21961
+ if (attribute.type === "dynamiczone" && segment.dynamicZoneComponent) {
21962
+ currentModel = strapi.components[segment.dynamicZoneComponent];
21963
+ if (!currentModel) {
21964
+ return void 0;
21965
+ }
21966
+ continue;
21967
+ }
21968
+ return void 0;
21969
+ }
21970
+ return void 0;
21971
+ };
21877
21972
  const getMainKeysOfNestedArrayObjects = (array) => {
21878
21973
  return array.map((item) => Reflect.ownKeys(item)[0]);
21879
21974
  };
@@ -22146,8 +22241,13 @@ const getPickedFlattenKeysForHookEntry = async (params) => {
22146
22241
  };
22147
22242
  }
22148
22243
  const pickedFlatten = pickEntries(flatten, pickPathsWithUid);
22244
+ const characterLimitsMetadata = getCharacterLimitsMetadata(pickedFlatten, modelUid);
22245
+ const pickedFlattenWithMetadata = {
22246
+ ...pickedFlatten,
22247
+ ...characterLimitsMetadata
22248
+ };
22149
22249
  return {
22150
- pickedFlatten,
22250
+ pickedFlatten: pickedFlattenWithMetadata,
22151
22251
  eventEntryLocale,
22152
22252
  projectSourceLanguageCode
22153
22253
  };
@@ -23969,7 +24069,7 @@ const register = ({ strapi: strapi2 }) => {
23969
24069
  });
23970
24070
  };
23971
24071
  const contentTypes = {};
23972
- const LocalazyUserController = ({ strapi: strapi2 }) => ({
24072
+ const LocalazyUserController = ({ strapi: _strapi }) => ({
23973
24073
  async getUser(ctx) {
23974
24074
  ctx.body = await getLocalazyUserService().getUser();
23975
24075
  },
@@ -24067,7 +24167,7 @@ const LocalazyGenericConnectorClientFactory = async () => {
24067
24167
  });
24068
24168
  return api;
24069
24169
  };
24070
- const LocalazyAuthController = ({ strapi: strapi2 }) => ({
24170
+ const LocalazyAuthController = ({ strapi: _strapi }) => ({
24071
24171
  async generateKeys(ctx) {
24072
24172
  const GenericConnectorApi = await LocalazyGenericConnectorClientFactory();
24073
24173
  ctx.body = await GenericConnectorApi.public.keys();
@@ -24094,11 +24194,12 @@ const StrapiController = ({ strapi: strapi2 }) => ({
24094
24194
  },
24095
24195
  async getPluginVersion(ctx) {
24096
24196
  ctx.body = {
24097
- version: await getStrapiService().getPluginVersion()
24197
+ version: await getStrapiService().getPluginVersion(),
24198
+ versionStrapi: getStrapiService().getStrapiVersion()
24098
24199
  };
24099
24200
  }
24100
24201
  });
24101
- const LocalazyProjectController = ({ strapi: strapi2 }) => ({
24202
+ const LocalazyProjectController = ({ strapi: _strapi }) => ({
24102
24203
  async getConnectedProject(ctx) {
24103
24204
  const LocalazyUserService2 = getLocalazyUserService();
24104
24205
  const LocalazyPubAPIService2 = getLocalazyPubAPIService();
@@ -24107,7 +24208,7 @@ const LocalazyProjectController = ({ strapi: strapi2 }) => ({
24107
24208
  ctx.body = project;
24108
24209
  }
24109
24210
  });
24110
- const PluginSettingsController = ({ strapi: strapi2 }) => ({
24211
+ const PluginSettingsController = ({ strapi: _strapi }) => ({
24111
24212
  async getContentTransferSetup(ctx) {
24112
24213
  ctx.body = await getPluginSettingsService().getContentTransferSetup();
24113
24214
  },
@@ -24685,6 +24786,9 @@ const StrapiService = ({ strapi: strapi2 }) => ({
24685
24786
  },
24686
24787
  async getPluginVersion() {
24687
24788
  return await Promise.resolve().then(() => _package$1).then((module2) => module2.version);
24789
+ },
24790
+ getStrapiVersion() {
24791
+ return strapi2.config.get("info.strapi");
24688
24792
  }
24689
24793
  });
24690
24794
  const LocalazyPubAPIService = ({ strapi: strapi2 }) => ({
@@ -24895,6 +24999,11 @@ const LocalazyTransferUploadService = ({ strapi: strapi2 }) => ({
24895
24999
  ...pickedFlatten
24896
25000
  };
24897
25001
  });
25002
+ const characterLimitsMetadata = getCharacterLimitsMetadata(pickedFlattenStrapiContent, modelUid);
25003
+ pickedFlattenStrapiContent = {
25004
+ ...pickedFlattenStrapiContent,
25005
+ ...characterLimitsMetadata
25006
+ };
24898
25007
  }
24899
25008
  const strapiDefaultLocaleCode = await StrapiI18nService2.getDefaultLocaleCode();
24900
25009
  const localazyLocaleCode = strapiDefaultLocaleCode ? isoStrapiToLocalazy(strapiDefaultLocaleCode) : config.default.LOCALAZY_DEFAULT_LOCALE;
@@ -25583,9 +25692,7 @@ const LocalazyTransferDownloadService = ({ strapi: strapi2 }) => ({
25583
25692
  locDownloadPLevel: 6
25584
25693
  });
25585
25694
  if (isEmpty(baseEntry)) {
25586
- strapi2.log.info(
25587
- `Source language entry ${uid}[${documentId}] does not exist anymore, skipping...`
25588
- );
25695
+ strapi2.log.info(`Source language entry ${uid}[${documentId}] does not exist anymore, skipping...`);
25589
25696
  await markKeysProcessed(sourceKeys);
25590
25697
  continue;
25591
25698
  }
@@ -25597,7 +25704,7 @@ const LocalazyTransferDownloadService = ({ strapi: strapi2 }) => ({
25597
25704
  const localazySearchUrl = `${user.project.url}/source-language?search=${uid}[${documentId}]`;
25598
25705
  if (isEmpty(currentLanguageLocalizedEntry)) {
25599
25706
  try {
25600
- const createdEntry = await StrapiLocalazyI18nService2.createEntry(
25707
+ await StrapiLocalazyI18nService2.createEntry(
25601
25708
  uid,
25602
25709
  strapiContentTypesModels,
25603
25710
  translatedModel,
@@ -25625,7 +25732,7 @@ const LocalazyTransferDownloadService = ({ strapi: strapi2 }) => ({
25625
25732
  } else {
25626
25733
  try {
25627
25734
  const localizedDocumentId = currentLanguageLocalizedEntry.documentId;
25628
- const updatedEntry = await StrapiLocalazyI18nService2.updateEntry(
25735
+ await StrapiLocalazyI18nService2.updateEntry(
25629
25736
  uid,
25630
25737
  localizedDocumentId,
25631
25738
  strapiContentTypesModels,
@@ -25662,7 +25769,10 @@ const LocalazyTransferDownloadService = ({ strapi: strapi2 }) => ({
25662
25769
  }
25663
25770
  }
25664
25771
  }
25665
- const totalProcessedKeys = Object.values(processedKeys).reduce((sum, langKeys) => sum + Object.keys(langKeys).length, 0);
25772
+ const totalProcessedKeys = Object.values(processedKeys).reduce(
25773
+ (sum, langKeys) => sum + Object.keys(langKeys).length,
25774
+ 0
25775
+ );
25666
25776
  strapi2.log.info(
25667
25777
  `Download finished. Tracked ${totalProcessedKeys} processed keys across ${Object.keys(processedKeys).length} languages.`
25668
25778
  );
@@ -1,12 +1,12 @@
1
1
  declare const _default: {
2
- LocalazyUserController: ({ strapi }: {
2
+ LocalazyUserController: ({ strapi: _strapi }: {
3
3
  strapi: import("@strapi/types/dist/core").Strapi;
4
4
  }) => {
5
5
  getUser(ctx: any): Promise<void>;
6
6
  updateUser(ctx: any): Promise<void>;
7
7
  deleteUser(ctx: any): Promise<void>;
8
8
  };
9
- LocalazyAuthController: ({ strapi }: {
9
+ LocalazyAuthController: ({ strapi: _strapi }: {
10
10
  strapi: import("@strapi/types/dist/core").Strapi;
11
11
  }) => {
12
12
  generateKeys(ctx: any): Promise<void>;
@@ -20,12 +20,12 @@ declare const _default: {
20
20
  postLifecycleLocalazyWebhooks(): Promise<void>;
21
21
  getPluginVersion(ctx: any): Promise<void>;
22
22
  };
23
- LocalazyProjectController: ({ strapi }: {
23
+ LocalazyProjectController: ({ strapi: _strapi }: {
24
24
  strapi: import("@strapi/types/dist/core").Strapi;
25
25
  }) => {
26
26
  getConnectedProject(ctx: any): Promise<void>;
27
27
  };
28
- PluginSettingsController: ({ strapi }: {
28
+ PluginSettingsController: ({ strapi: _strapi }: {
29
29
  strapi: import("@strapi/types/dist/core").Strapi;
30
30
  }) => {
31
31
  getContentTransferSetup(ctx: any): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { Core } from '@strapi/strapi';
2
- declare const LocalazyAuthController: ({ strapi }: {
2
+ declare const LocalazyAuthController: ({ strapi: _strapi }: {
3
3
  strapi: Core.Strapi;
4
4
  }) => {
5
5
  generateKeys(ctx: any): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { Core } from '@strapi/strapi';
2
- declare const LocalazyProjectController: ({ strapi }: {
2
+ declare const LocalazyProjectController: ({ strapi: _strapi }: {
3
3
  strapi: Core.Strapi;
4
4
  }) => {
5
5
  getConnectedProject(ctx: any): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { Core } from '@strapi/strapi';
2
- declare const LocalazyUserController: ({ strapi }: {
2
+ declare const LocalazyUserController: ({ strapi: _strapi }: {
3
3
  strapi: Core.Strapi;
4
4
  }) => {
5
5
  getUser(ctx: any): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { Core } from '@strapi/strapi';
2
- declare const PluginSettingsController: ({ strapi }: {
2
+ declare const PluginSettingsController: ({ strapi: _strapi }: {
3
3
  strapi: Core.Strapi;
4
4
  }) => {
5
5
  getContentTransferSetup(ctx: any): Promise<void>;
@@ -36,6 +36,7 @@ export declare const getStrapiService: () => {
36
36
  getModels(): Promise<any[]>;
37
37
  getLocalizableModels(): Promise<any[]>;
38
38
  getPluginVersion(): Promise<string>;
39
+ getStrapiVersion(): string;
39
40
  };
40
41
  export declare const getStrapiI18nService: () => {
41
42
  getLocales(): Promise<import("../models/strapi/locale").Locale[]>;
@@ -1,5 +1,5 @@
1
1
  import type { Core } from '@strapi/strapi';
2
- declare const destroy: ({ strapi }: {
2
+ declare const destroy: ({ strapi: _strapi }: {
3
3
  strapi: Core.Strapi;
4
4
  }) => void;
5
5
  export default destroy;
@@ -5,7 +5,7 @@ declare const _default: {
5
5
  bootstrap: ({ strapi }: {
6
6
  strapi: import("@strapi/types/dist/core").Strapi;
7
7
  }) => void;
8
- destroy: ({ strapi }: {
8
+ destroy: ({ strapi: _strapi }: {
9
9
  strapi: import("@strapi/types/dist/core").Strapi;
10
10
  }) => void;
11
11
  config: {
@@ -26,14 +26,14 @@ declare const _default: {
26
26
  validator(): void;
27
27
  };
28
28
  controllers: {
29
- LocalazyUserController: ({ strapi }: {
29
+ LocalazyUserController: ({ strapi: _strapi }: {
30
30
  strapi: import("@strapi/types/dist/core").Strapi;
31
31
  }) => {
32
32
  getUser(ctx: any): Promise<void>;
33
33
  updateUser(ctx: any): Promise<void>;
34
34
  deleteUser(ctx: any): Promise<void>;
35
35
  };
36
- LocalazyAuthController: ({ strapi }: {
36
+ LocalazyAuthController: ({ strapi: _strapi }: {
37
37
  strapi: import("@strapi/types/dist/core").Strapi;
38
38
  }) => {
39
39
  generateKeys(ctx: any): Promise<void>;
@@ -47,12 +47,12 @@ declare const _default: {
47
47
  postLifecycleLocalazyWebhooks(): Promise<void>;
48
48
  getPluginVersion(ctx: any): Promise<void>;
49
49
  };
50
- LocalazyProjectController: ({ strapi }: {
50
+ LocalazyProjectController: ({ strapi: _strapi }: {
51
51
  strapi: import("@strapi/types/dist/core").Strapi;
52
52
  }) => {
53
53
  getConnectedProject(ctx: any): Promise<void>;
54
54
  };
55
- PluginSettingsController: ({ strapi }: {
55
+ PluginSettingsController: ({ strapi: _strapi }: {
56
56
  strapi: import("@strapi/types/dist/core").Strapi;
57
57
  }) => {
58
58
  getContentTransferSetup(ctx: any): Promise<void>;
@@ -124,6 +124,7 @@ declare const _default: {
124
124
  getModels(): Promise<any[]>;
125
125
  getLocalizableModels(): Promise<any[]>;
126
126
  getPluginVersion(): Promise<string>;
127
+ getStrapiVersion(): string;
127
128
  };
128
129
  LocalazyPubAPIService: ({ strapi }: {
129
130
  strapi: import("@strapi/types/dist/core").Strapi;
@@ -12,6 +12,7 @@ declare const _default: {
12
12
  getModels(): Promise<any[]>;
13
13
  getLocalizableModels(): Promise<any[]>;
14
14
  getPluginVersion(): Promise<string>;
15
+ getStrapiVersion(): string;
15
16
  };
16
17
  LocalazyPubAPIService: ({ strapi }: {
17
18
  strapi: import("@strapi/types/dist/core").Strapi;
@@ -5,6 +5,7 @@ declare const StrapiService: ({ strapi }: {
5
5
  getModels(): Promise<any[]>;
6
6
  getLocalizableModels(): Promise<any[]>;
7
7
  getPluginVersion(): Promise<string>;
8
+ getStrapiVersion(): string;
8
9
  };
9
10
  export type StrapiServiceReturnType = ReturnType<typeof StrapiService>;
10
11
  export default StrapiService;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Extracts character limit metadata from Strapi content type schemas
3
+ * and returns @meta: entries for keys that have maxLength defined.
4
+ *
5
+ * The @meta: prefix is used by the Localazy API to associate metadata
6
+ * (such as character limits) with specific keys during import.
7
+ *
8
+ * @see https://localazy.com/docs/api/import
9
+ */
10
+ declare const getCharacterLimitsMetadata: (flattenedContent: Record<string, any>, modelUid: string) => Record<string, {
11
+ limit: number;
12
+ }>;
13
+ export { getCharacterLimitsMetadata };
@@ -1,6 +1,8 @@
1
1
  import type { HookParams } from '../models/plugin/hook-params';
2
2
  declare const _default: (params: HookParams) => Promise<{
3
- pickedFlatten: Record<string, any>;
3
+ pickedFlatten: {
4
+ [x: string]: any;
5
+ };
4
6
  eventEntryLocale: string;
5
7
  projectSourceLanguageCode: string;
6
8
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@localazy/strapi-plugin",
3
- "version": "1.0.11",
3
+ "version": "1.1.0",
4
4
  "description": "The official Strapi Plugin by Localazy.",
5
5
  "keywords": [
6
6
  "strapi",
@@ -61,11 +61,12 @@
61
61
  "test:server": "jest --config server/jest.config.ts",
62
62
  "test:server:coverage": "jest --config server/jest.config.ts --coverage",
63
63
  "test:server:watch": "jest --config server/jest.config.ts --watch",
64
- "test:ts:back": "run -T tsc -p server/tsconfig.json",
65
- "test:ts:front": "run -T tsc -p admin/tsconfig.json",
64
+ "test:ts:back": "tsc -p server/tsconfig.json --noEmit",
65
+ "test:ts:front": "tsc -p admin/tsconfig.json --noEmit",
66
66
  "verify": "strapi-plugin verify",
67
67
  "watch": "strapi-plugin watch",
68
- "watch:link": "strapi-plugin watch:link"
68
+ "watch:link": "strapi-plugin watch:link",
69
+ "prepare": "husky"
69
70
  },
70
71
  "lint-staged": {
71
72
  "*.{ts,tsx}": [