@geekron/strapi 0.1.4 → 0.1.6

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.
@@ -20435,54 +20435,38 @@ var require_react_window = __commonJS((exports2) => {
20435
20435
  });
20436
20436
 
20437
20437
  // admin/src/components/ApiErrorAlert.tsx
20438
- var import_design_system9, import_icons12, jsx_dev_runtime27, ApiErrorAlert = ({
20438
+ var import_design_system9, jsx_dev_runtime27, ApiErrorAlert = ({
20439
20439
  message,
20440
- title = "接口访问异常",
20441
- suggestion,
20442
- isWarning = false
20440
+ title = "操作提醒",
20441
+ suggestion
20443
20442
  }) => {
20444
- const backgroundColor = isWarning ? "warning100" : "danger100";
20445
- const textColor = isWarning ? "warning700" : "danger700";
20446
- return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Box, {
20447
- background: backgroundColor,
20448
- padding: 4,
20449
- hasRadius: true,
20450
- children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Flex, {
20451
- gap: 2,
20452
- alignItems: "flex-start",
20453
- children: [
20454
- /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_icons12.WarningCircle, {
20455
- width: "1.2rem",
20456
- height: "1.2rem",
20457
- color: textColor
20458
- }, undefined, false, undefined, this),
20459
- /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Flex, {
20460
- direction: "column",
20461
- gap: 1,
20462
- children: [
20463
- title && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20464
- fontWeight: "bold",
20465
- textColor,
20466
- children: title
20467
- }, undefined, false, undefined, this),
20468
- /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20469
- textColor,
20470
- children: message
20471
- }, undefined, false, undefined, this),
20472
- suggestion && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20473
- textColor,
20474
- fontSize: 0,
20475
- children: suggestion
20476
- }, undefined, false, undefined, this)
20477
- ]
20478
- }, undefined, true, undefined, this)
20479
- ]
20480
- }, undefined, true, undefined, this)
20481
- }, undefined, false, undefined, this);
20443
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Flex, {
20444
+ justifyContent: "center",
20445
+ alignItems: "center",
20446
+ direction: "column",
20447
+ children: [
20448
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20449
+ variant: "alpha",
20450
+ marginBottom: "1rem",
20451
+ children: title
20452
+ }, undefined, false, undefined, this),
20453
+ suggestion && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20454
+ variant: "omega",
20455
+ textColor: "neutral600",
20456
+ children: suggestion
20457
+ }, undefined, false, undefined, this),
20458
+ message && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20459
+ variant: "omega",
20460
+ textColor: "neutral600",
20461
+ lineHeight: 1.4,
20462
+ style: { opacity: 0.85 },
20463
+ children: message
20464
+ }, undefined, false, undefined, this)
20465
+ ]
20466
+ }, undefined, true, undefined, this);
20482
20467
  }, ApiErrorAlert_default;
20483
20468
  var init_ApiErrorAlert = __esm(() => {
20484
20469
  import_design_system9 = require("@strapi/design-system");
20485
- import_icons12 = require("@strapi/icons");
20486
20470
  jsx_dev_runtime27 = require("react/jsx-dev-runtime");
20487
20471
  ApiErrorAlert_default = ApiErrorAlert;
20488
20472
  });
@@ -20555,7 +20539,8 @@ var import_design_system10, import_admin7, import_react11, jsx_dev_runtime28, Da
20555
20539
  children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(ApiErrorAlert_default, {
20556
20540
  message: error,
20557
20541
  title: "仪表盘数据加载失败",
20558
- suggestion: "请检查网络连接或联系管理员"
20542
+ suggestion: "请检查网络连接或联系管理员",
20543
+ type: "error"
20559
20544
  }, undefined, false, undefined, this)
20560
20545
  }, undefined, false, undefined, this);
20561
20546
  }
@@ -20667,7 +20652,7 @@ var init_DashboardStats = __esm(() => {
20667
20652
  });
20668
20653
 
20669
20654
  // admin/src/pages/Dashboard.tsx
20670
- var import_design_system12, import_icons14, import_admin9, jsx_dev_runtime30, Dashboard = () => {
20655
+ var import_design_system12, import_icons13, import_admin9, jsx_dev_runtime30, Dashboard = () => {
20671
20656
  return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_admin9.Page.Main, {
20672
20657
  children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_design_system12.Box, {
20673
20658
  padding: 8,
@@ -20686,7 +20671,7 @@ var import_design_system12, import_icons14, import_admin9, jsx_dev_runtime30, Da
20686
20671
  alignItems: "center",
20687
20672
  gap: 2,
20688
20673
  children: [
20689
- /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_icons14.ChartPie, {
20674
+ /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_icons13.ChartPie, {
20690
20675
  width: "24px",
20691
20676
  height: "24px"
20692
20677
  }, undefined, false, undefined, this),
@@ -20711,14 +20696,14 @@ var import_design_system12, import_icons14, import_admin9, jsx_dev_runtime30, Da
20711
20696
  var init_Dashboard = __esm(() => {
20712
20697
  init_DashboardStats();
20713
20698
  import_design_system12 = require("@strapi/design-system");
20714
- import_icons14 = require("@strapi/icons");
20699
+ import_icons13 = require("@strapi/icons");
20715
20700
  import_admin9 = require("@strapi/strapi/admin");
20716
20701
  jsx_dev_runtime30 = require("react/jsx-dev-runtime");
20717
20702
  Dashboard_default = Dashboard;
20718
20703
  });
20719
20704
 
20720
20705
  // admin/src/pages/Inquiry.tsx
20721
- var import_design_system13, import_icons15, import_symbols, import_admin10, import_react13, import_react_router_dom, jsx_dev_runtime31, Inquiry = () => {
20706
+ var import_design_system13, import_icons14, import_symbols, import_admin10, import_react13, import_react_router_dom, jsx_dev_runtime31, Inquiry = () => {
20722
20707
  const navigate = import_react_router_dom.useNavigate();
20723
20708
  const fetchClient = import_admin10.useFetchClient();
20724
20709
  const { toggleNotification } = import_admin10.useNotification();
@@ -20815,7 +20800,8 @@ var import_design_system13, import_icons15, import_symbols, import_admin10, impo
20815
20800
  children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(ApiErrorAlert_default, {
20816
20801
  message: error,
20817
20802
  title: "询盘列表加载失败",
20818
- suggestion: "请检查网络连接或联系管理员"
20803
+ suggestion: "请检查网络连接或联系管理员",
20804
+ type: "error"
20819
20805
  }, undefined, false, undefined, this)
20820
20806
  }, undefined, false, undefined, this)
20821
20807
  }, undefined, false, undefined, this)
@@ -20907,7 +20893,7 @@ var import_design_system13, import_icons15, import_symbols, import_admin10, impo
20907
20893
  onClick: () => handleViewDetail(row.id),
20908
20894
  label: "查看详情",
20909
20895
  borderWidth: 0,
20910
- children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_icons15.Eye, {}, undefined, false, undefined, this)
20896
+ children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_icons14.Eye, {}, undefined, false, undefined, this)
20911
20897
  }, undefined, false, undefined, this)
20912
20898
  }, undefined, false, undefined, this)
20913
20899
  }
@@ -20930,7 +20916,7 @@ var init_Inquiry = __esm(() => {
20930
20916
  init_ApiErrorAlert();
20931
20917
  init_DataTable();
20932
20918
  import_design_system13 = require("@strapi/design-system");
20933
- import_icons15 = require("@strapi/icons");
20919
+ import_icons14 = require("@strapi/icons");
20934
20920
  import_symbols = require("@strapi/icons/symbols");
20935
20921
  import_admin10 = require("@strapi/strapi/admin");
20936
20922
  import_react13 = require("react");
@@ -21517,7 +21503,8 @@ var import_design_system15, import_symbols2, import_admin12, import_react15, jsx
21517
21503
  children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(ApiErrorAlert_default, {
21518
21504
  message: error,
21519
21505
  title: "访客记录加载失败",
21520
- suggestion: "请检查网络连接或联系管理员"
21506
+ suggestion: "请检查网络连接或联系管理员",
21507
+ type: "error"
21521
21508
  }, undefined, false, undefined, this)
21522
21509
  }, undefined, false, undefined, this)
21523
21510
  }, undefined, false, undefined, this)
@@ -21683,22 +21670,18 @@ var import_strapi_admin, import_design_system16, import_react16, import_react_ro
21683
21670
  const [isConnected, setIsConnected] = import_react16.default.useState(null);
21684
21671
  const [checking, setChecking] = import_react16.default.useState(true);
21685
21672
  import_react16.default.useEffect(() => {
21686
- const checkConnection = async () => {
21687
- try {
21688
- const response = await client.get("/website/hello");
21689
- if (response?.data?.message) {
21690
- setIsConnected(true);
21691
- } else {
21692
- setIsConnected(false);
21693
- }
21694
- } catch (error) {
21695
- console.error("Network check failed:", error);
21673
+ client.get("/website/check").then((response) => {
21674
+ if (response?.data?.message) {
21675
+ setIsConnected(true);
21676
+ } else {
21696
21677
  setIsConnected(false);
21697
- } finally {
21698
- setChecking(false);
21699
21678
  }
21700
- };
21701
- checkConnection();
21679
+ }).catch((error) => {
21680
+ console.error("Network check failed:", error);
21681
+ setIsConnected(false);
21682
+ }).finally(() => {
21683
+ setChecking(false);
21684
+ });
21702
21685
  }, [client]);
21703
21686
  if (checking) {
21704
21687
  return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Flex, {
@@ -21715,23 +21698,21 @@ var import_strapi_admin, import_design_system16, import_react16, import_react_ro
21715
21698
  return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Flex, {
21716
21699
  justifyContent: "center",
21717
21700
  alignItems: "center",
21701
+ direction: "column",
21718
21702
  height: "100vh",
21719
- children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Box, {
21720
- textAlign: "center",
21721
- children: [
21722
- /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Typography, {
21723
- variant: "alpha",
21724
- marginBottom: "1rem",
21725
- children: "网站信息未正确配置"
21726
- }, undefined, false, undefined, this),
21727
- /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Typography, {
21728
- variant: "omega",
21729
- textColor: "neutral600",
21730
- children: "无法连接到网站服务,请检查网站配置"
21731
- }, undefined, false, undefined, this)
21732
- ]
21733
- }, undefined, true, undefined, this)
21734
- }, undefined, false, undefined, this);
21703
+ children: [
21704
+ /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Typography, {
21705
+ variant: "alpha",
21706
+ marginBottom: "1rem",
21707
+ children: "网站信息未正确配置"
21708
+ }, undefined, false, undefined, this),
21709
+ /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Typography, {
21710
+ variant: "omega",
21711
+ textColor: "neutral600",
21712
+ children: "无法连接到网站服务,请检查网站配置"
21713
+ }, undefined, false, undefined, this)
21714
+ ]
21715
+ }, undefined, true, undefined, this);
21735
21716
  }
21736
21717
  return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(LayoutContainer, {
21737
21718
  children: [
@@ -21836,14 +21817,111 @@ __export(exports_src, {
21836
21817
  });
21837
21818
  module.exports = __toCommonJS(exports_src);
21838
21819
 
21820
+ // admin/src/boot/handle-missing-translations.ts
21821
+ function extractTranslationInfo(logMessage) {
21822
+ const regex = /Missing message: "([^"]+)"[^,]+, using default message \(([^)]+)\)/;
21823
+ const match = logMessage.match(regex);
21824
+ if (match) {
21825
+ return {
21826
+ messageId: match[1],
21827
+ defaultMessage: match[2]
21828
+ };
21829
+ }
21830
+ return null;
21831
+ }
21832
+ var missTranslations = {};
21833
+ var handleMissingTranslations = (message) => {
21834
+ const info = extractTranslationInfo(message);
21835
+ if (info?.messageId)
21836
+ missTranslations[info.messageId] = info.defaultMessage;
21837
+ console.log(JSON.stringify(missTranslations));
21838
+ };
21839
+ var originalError = console.error;
21840
+ var originalWarn = () => {};
21841
+ console.warn = (..._args) => {
21842
+ originalWarn();
21843
+ };
21844
+ console.error = (error) => {
21845
+ try {
21846
+ if (error?.message?.includes("MISSING_TRANSLATION")) {
21847
+ handleMissingTranslations(error.message);
21848
+ } else {
21849
+ originalError(error);
21850
+ }
21851
+ } catch (error2) {
21852
+ originalError(error2);
21853
+ }
21854
+ };
21855
+
21856
+ // admin/src/boot/remove-links.ts
21857
+ function waitForLi(href, callback) {
21858
+ const findLi = () => {
21859
+ const anchor = document.querySelector(`li a[href="${href}"]`);
21860
+ if (anchor) {
21861
+ const li = anchor.closest("li");
21862
+ if (li)
21863
+ return li;
21864
+ }
21865
+ return null;
21866
+ };
21867
+ setInterval(() => {
21868
+ const initial = findLi();
21869
+ if (initial) {
21870
+ callback(initial);
21871
+ return;
21872
+ }
21873
+ });
21874
+ }
21875
+ function waitForDD(href, callback) {
21876
+ const findDD = () => {
21877
+ const anchor = document.querySelector(`div a[href="${href}"]`);
21878
+ if (anchor) {
21879
+ const dd = anchor.closest("div");
21880
+ if (dd)
21881
+ return dd;
21882
+ }
21883
+ return null;
21884
+ };
21885
+ setInterval(() => {
21886
+ const initial = findDD();
21887
+ if (initial) {
21888
+ callback(initial);
21889
+ return;
21890
+ }
21891
+ });
21892
+ }
21893
+ var removeLinks = () => {
21894
+ const hrefs = [
21895
+ "/admin/settings/purchase-content-history",
21896
+ "/admin/settings/plugins/purchase-content-releases",
21897
+ "/admin/settings/purchase-review-workflows",
21898
+ "/admin/settings/purchase-single-sign-on",
21899
+ "/admin/settings/purchase-audit-logs"
21900
+ ];
21901
+ hrefs.forEach((href) => {
21902
+ waitForLi(href, (li) => {
21903
+ const parent = li.parentNode;
21904
+ parent.removeChild(li);
21905
+ });
21906
+ });
21907
+ const ddHrefs = ["https://strapi.io/pricing-self-hosted"];
21908
+ ddHrefs.forEach((href) => {
21909
+ waitForDD(href, (dd) => {
21910
+ const parent = dd.parentNode;
21911
+ parent.removeChild(dd);
21912
+ });
21913
+ });
21914
+ };
21915
+
21839
21916
  // admin/src/bootstrap.ts
21840
21917
  var bootstrap = (_app) => {
21841
21918
  console.log("website admin plugin: bootstrap");
21919
+ removeLinks();
21842
21920
  };
21843
21921
  var bootstrap_default = bootstrap;
21844
21922
 
21845
21923
  // admin/src/register.ts
21846
- var import_icons16 = require("@strapi/icons");
21924
+ var import_icons15 = require("@strapi/icons");
21847
21925
 
21848
21926
  // admin/src/contract.ts
21849
21927
  var pluginId = "website";
@@ -46701,7 +46779,22 @@ var registerColorPicker = (app) => {
46701
46779
  components: {
46702
46780
  Input: () => Promise.resolve({ default: ColorPickerInput })
46703
46781
  },
46704
- options: {}
46782
+ options: {
46783
+ advanced: [
46784
+ {
46785
+ name: "required",
46786
+ type: "checkbox",
46787
+ intlLabel: {
46788
+ id: "form.attribute.item.requiredField",
46789
+ defaultMessage: "Required field"
46790
+ },
46791
+ description: {
46792
+ id: "form.attribute.item.requiredField.description",
46793
+ defaultMessage: "Cannot create entry if empty"
46794
+ }
46795
+ }
46796
+ ]
46797
+ }
46705
46798
  });
46706
46799
  };
46707
46800
 
@@ -47236,6 +47329,7 @@ var DataSelector = ({
47236
47329
  const { formatMessage } = import_react_intl3.useIntl();
47237
47330
  const { contentTypes } = import_admin2.unstable_useContentManagerContext();
47238
47331
  const client = import_admin2.useFetchClient();
47332
+ const { toggleNotification } = import_admin2.useNotification();
47239
47333
  const displayedContentTypes = React3.useMemo(() => contentTypes?.filter((ct) => ct.isDisplayed && !ct.uid.startsWith("plugin:")) || [], [contentTypes]);
47240
47334
  const loadCollectionData = React3.useCallback(async (contentType, currentPage = 1, currentPageSize = 10) => {
47241
47335
  setIsDataLoading(true);
@@ -47272,8 +47366,19 @@ var DataSelector = ({
47272
47366
  onChange(selectedData);
47273
47367
  setIsOpen(false);
47274
47368
  }
47275
- } catch (error) {
47276
- console.error("Failed to load single type data:", error);
47369
+ } catch (err) {
47370
+ const error = err?.response?.data?.error;
47371
+ if (error.status === 404) {
47372
+ toggleNotification({
47373
+ type: "warning",
47374
+ message: formatMessage({
47375
+ id: getTrad("data-select.single-type-not-found"),
47376
+ defaultMessage: 'Content type "{displayName}" is not filled yet. Please fill in the content type information and save it before trying again.'
47377
+ }, { displayName: contentType.info.displayName })
47378
+ });
47379
+ } else {
47380
+ console.error("Failed to load single type data:", error);
47381
+ }
47277
47382
  } finally {
47278
47383
  setIsDataLoading(false);
47279
47384
  }
@@ -47284,7 +47389,7 @@ var DataSelector = ({
47284
47389
  setPageSize(10);
47285
47390
  await loadCollectionData(contentType, 1, 10);
47286
47391
  }
47287
- }, [client, onChange, loadCollectionData]);
47392
+ }, [client, onChange, loadCollectionData, toggleNotification, formatMessage]);
47288
47393
  const handleBackToContentTypes = React3.useCallback(() => {
47289
47394
  setSelectedContentType(null);
47290
47395
  setDataItems([]);
@@ -48739,7 +48844,22 @@ var registerDataNested = (app) => {
48739
48844
  components: {
48740
48845
  Input: () => Promise.resolve({ default: DataNested })
48741
48846
  },
48742
- options: {}
48847
+ options: {
48848
+ advanced: [
48849
+ {
48850
+ name: "required",
48851
+ type: "checkbox",
48852
+ intlLabel: {
48853
+ id: "form.attribute.item.requiredField",
48854
+ defaultMessage: "Required field"
48855
+ },
48856
+ description: {
48857
+ id: "form.attribute.item.requiredField.description",
48858
+ defaultMessage: "Cannot create entry if empty"
48859
+ }
48860
+ }
48861
+ ]
48862
+ }
48743
48863
  });
48744
48864
  };
48745
48865
 
@@ -48793,7 +48913,22 @@ var registerDataSelect = (app) => {
48793
48913
  components: {
48794
48914
  Input: () => Promise.resolve({ default: DataSelectInput })
48795
48915
  },
48796
- options: {}
48916
+ options: {
48917
+ advanced: [
48918
+ {
48919
+ name: "required",
48920
+ type: "checkbox",
48921
+ intlLabel: {
48922
+ id: "form.attribute.item.requiredField",
48923
+ defaultMessage: "Required field"
48924
+ },
48925
+ description: {
48926
+ id: "form.attribute.item.requiredField.description",
48927
+ defaultMessage: "Cannot create entry if empty"
48928
+ }
48929
+ }
48930
+ ]
48931
+ }
48797
48932
  });
48798
48933
  };
48799
48934
 
@@ -50732,7 +50867,22 @@ var registerIconPicker = (app) => {
50732
50867
  components: {
50733
50868
  Input: () => Promise.resolve({ default: IconPickerInput })
50734
50869
  },
50735
- options: {}
50870
+ options: {
50871
+ advanced: [
50872
+ {
50873
+ name: "required",
50874
+ type: "checkbox",
50875
+ intlLabel: {
50876
+ id: "form.attribute.item.requiredField",
50877
+ defaultMessage: "Required field"
50878
+ },
50879
+ description: {
50880
+ id: "form.attribute.item.requiredField.description",
50881
+ defaultMessage: "Cannot create entry if empty"
50882
+ }
50883
+ }
50884
+ ]
50885
+ }
50736
50886
  });
50737
50887
  };
50738
50888
 
@@ -50824,6 +50974,9 @@ var SlugInput = React8.forwardRef(({ hint, labelAction, label, name, required, a
50824
50974
  if (!value || documentId && field.initialValue === value) {
50825
50975
  return;
50826
50976
  }
50977
+ if (!attribute?.unique) {
50978
+ return;
50979
+ }
50827
50980
  try {
50828
50981
  setIsCheckingAvailability(true);
50829
50982
  const { data } = await fetchClient.post(`/website/fields/check-available`, {
@@ -50849,6 +51002,7 @@ var SlugInput = React8.forwardRef(({ hint, labelAction, label, name, required, a
50849
51002
  setIsCheckingAvailability(false);
50850
51003
  }
50851
51004
  }, [
51005
+ attribute?.unique,
50852
51006
  contentType?.kind,
50853
51007
  contentType?.uid,
50854
51008
  documentId,
@@ -50944,58 +51098,6 @@ var SlugInput = React8.forwardRef(({ hint, labelAction, label, name, required, a
50944
51098
  }, undefined, false, undefined, this);
50945
51099
  });
50946
51100
  var registerSlugInput = (app) => {
50947
- const options = [
50948
- {
50949
- name: "options.target",
50950
- type: "text",
50951
- intlLabel: {
50952
- id: `${pluginId}.fields.slugInput.options.targetField.label`,
50953
- defaultMessage: "Target field"
50954
- },
50955
- description: {
50956
- id: `${pluginId}.fields.slugInput.options.targetField.description`,
50957
- defaultMessage: "After filling in the information, a slug will be automatically generated following the target field."
50958
- }
50959
- },
50960
- {
50961
- name: "options.unique",
50962
- type: "boolean-radio-group",
50963
- size: 12,
50964
- defaultValue: true,
50965
- intlLabel: {
50966
- id: `${pluginId}.fields.slugInput.options.unique.label`,
50967
- defaultMessage: "Unique check"
50968
- },
50969
- description: {
50970
- id: `${pluginId}.fields.slugInput.options.unique.description`,
50971
- defaultMessage: "Enable unique value checking?"
50972
- },
50973
- radios: [
50974
- {
50975
- title: {
50976
- id: `${pluginId}.fields.slugInput.options.unique.true.label`,
50977
- defaultMessage: "Enable"
50978
- },
50979
- description: {
50980
- id: `${pluginId}.fields.slugInput.options.unique.true.description`,
50981
- defaultMessage: "When enabled, it will perform a uniqueness check on the value."
50982
- },
50983
- value: true
50984
- },
50985
- {
50986
- title: {
50987
- id: `${pluginId}.fields.slugInput.options.unique.false.label`,
50988
- defaultMessage: "Disable"
50989
- },
50990
- description: {
50991
- id: `${pluginId}.fields.slugInput.options.unique.false.description`,
50992
- defaultMessage: "Disabling unique value checks will prevent the use of unique values."
50993
- },
50994
- value: false
50995
- }
50996
- ]
50997
- }
50998
- ];
50999
51101
  app.customFields.register({
51000
51102
  name: "slugInput",
51001
51103
  pluginId,
@@ -51013,7 +51115,70 @@ var registerSlugInput = (app) => {
51013
51115
  Input: () => Promise.resolve({ default: SlugInput })
51014
51116
  },
51015
51117
  options: {
51016
- base: options
51118
+ base: [
51119
+ {
51120
+ name: "options.target",
51121
+ type: "text",
51122
+ intlLabel: {
51123
+ id: `${pluginId}.fields.slugInput.options.targetField.label`,
51124
+ defaultMessage: "Target field"
51125
+ },
51126
+ description: {
51127
+ id: `${pluginId}.fields.slugInput.options.targetField.description`,
51128
+ defaultMessage: "Auto-generate slug from a text field. Leave empty to disable."
51129
+ }
51130
+ }
51131
+ ],
51132
+ advanced: [
51133
+ {
51134
+ name: "required",
51135
+ type: "checkbox",
51136
+ intlLabel: {
51137
+ id: "form.attribute.item.requiredField",
51138
+ defaultMessage: "Required field"
51139
+ },
51140
+ description: {
51141
+ id: "form.attribute.item.requiredField.description",
51142
+ defaultMessage: "Cannot create entry if empty"
51143
+ }
51144
+ },
51145
+ {
51146
+ name: "unique",
51147
+ type: "checkbox",
51148
+ intlLabel: {
51149
+ id: "form.attribute.item.uniqueField",
51150
+ defaultMessage: "Unique field"
51151
+ },
51152
+ description: {
51153
+ id: "form.attribute.item.uniqueField.description",
51154
+ defaultMessage: "Cannot create entry with duplicate value"
51155
+ }
51156
+ },
51157
+ {
51158
+ name: "minLength",
51159
+ type: "number",
51160
+ intlLabel: {
51161
+ id: "form.attribute.item.minimum",
51162
+ defaultMessage: "Minimum length"
51163
+ },
51164
+ description: {
51165
+ id: "form.attribute.item.minimum.description",
51166
+ defaultMessage: "Minimum character count"
51167
+ }
51168
+ },
51169
+ {
51170
+ name: "maxLength",
51171
+ type: "number",
51172
+ intlLabel: {
51173
+ id: "form.attribute.item.maximum",
51174
+ defaultMessage: "Maximum length"
51175
+ },
51176
+ description: {
51177
+ id: "form.attribute.item.maximum.description",
51178
+ defaultMessage: "Maximum character count"
51179
+ }
51180
+ }
51181
+ ]
51017
51182
  }
51018
51183
  });
51019
51184
  };
@@ -51028,7 +51193,7 @@ var registerFields = (app) => {
51028
51193
  };
51029
51194
 
51030
51195
  // admin/src/widgets/index.ts
51031
- var import_icons13 = require("@strapi/icons");
51196
+ var import_icons12 = require("@strapi/icons");
51032
51197
 
51033
51198
  // admin/src/widgets/WelcomeWidget.tsx
51034
51199
  init_DashboardStats();
@@ -51116,7 +51281,7 @@ var WelcomeWidget_default = WelcomeWidget;
51116
51281
  // admin/src/widgets/index.ts
51117
51282
  var registerWidgets = (app) => {
51118
51283
  app.widgets.register({
51119
- icon: import_icons13.ChartPie,
51284
+ icon: import_icons12.ChartPie,
51120
51285
  title: {
51121
51286
  id: `${pluginId}.widget.title`,
51122
51287
  defaultMessage: "Dashboard"
@@ -51142,7 +51307,7 @@ var register = (app) => {
51142
51307
  });
51143
51308
  app.addMenuLink({
51144
51309
  to: `/website`,
51145
- icon: import_icons16.ChartPie,
51310
+ icon: import_icons15.ChartPie,
51146
51311
  intlLabel: {
51147
51312
  id: `${pluginId}.plugin.name`,
51148
51313
  defaultMessage: "Website"