@littlebox/strapi-suite 1.0.52 → 1.0.54

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 (27) hide show
  1. package/README.md +29 -0
  2. package/dist/_chunks/{App-C-h--Kv_.js → App-B7_8BaVG.js} +2 -2
  3. package/dist/_chunks/{App-C1HyspTk.mjs → App-BfGB2pF_.mjs} +2 -2
  4. package/dist/_chunks/{SlugInput-CU9_b0dd.mjs → SlugInput-CvgVtZza.mjs} +1 -1
  5. package/dist/_chunks/{SlugInput-3gkr6B0t.js → SlugInput-eCwgqJtH.js} +1 -1
  6. package/dist/_chunks/{en-CLNZnNeq.js → en-D89cXiov.js} +16 -1
  7. package/dist/_chunks/{en-F6RYx79c.mjs → en-knG97mCH.mjs} +16 -1
  8. package/dist/_chunks/{index-DQ3vX9So.mjs → index-97f0S4q6.mjs} +1632 -65
  9. package/dist/_chunks/{index-60sq8G6p.js → index-DnXsi_Ar.js} +1629 -62
  10. package/dist/admin/index.js +1 -1
  11. package/dist/admin/index.mjs +1 -1
  12. package/dist/admin/src/core/utils/tabs.d.ts +53 -0
  13. package/dist/admin/src/ctb/TabSelect.d.ts +31 -0
  14. package/dist/admin/src/ctb/TabsEditor.d.ts +21 -0
  15. package/dist/admin/src/ctb/registerTabsInContentTypeBuilder.d.ts +1 -0
  16. package/dist/admin/src/ctb/tabBadges.d.ts +14 -0
  17. package/dist/admin/src/editView/TabSection.d.ts +6 -0
  18. package/dist/admin/src/editView/TabsBar.d.ts +10 -0
  19. package/dist/admin/src/editView/mutateEditViewLayout.d.ts +12 -0
  20. package/dist/admin/src/editView/sectionVisibility.d.ts +7 -0
  21. package/dist/admin/src/editView/tabsStore.d.ts +13 -0
  22. package/dist/server/index.js +426 -313
  23. package/dist/server/index.mjs +426 -313
  24. package/dist/server/src/middlewares/tabs.d.ts +4 -0
  25. package/dist/server/src/utils/groupByContentTypeTabs.d.ts +7 -0
  26. package/dist/server/src/utils/tabs.d.ts +17 -0
  27. package/package.json +6 -3
package/README.md CHANGED
@@ -4,3 +4,32 @@ The Littlebox Strapi Suite is a plugin designed to enhance Strapi for building a
4
4
 
5
5
  For installation instructions and detailed documentation, please refer to:
6
6
  [Before Starting - Littlebox Strapi Suite Documentation](https://strapi-suite.littlebox.pt/before-starting)
7
+
8
+ ## Content type tabs
9
+
10
+ Organize the fields of a collection type or single type in tabs.
11
+
12
+ 1. In the Content-Type Builder, open the content type settings and, under **Advanced settings → Tabs**, add, rename and reorder the tabs.
13
+ 2. In the advanced settings of each field, pick the **Tab** where it is shown. Fields without a tab stay visible above the tabs.
14
+
15
+ The Content Manager edit view shows one tab at a time. Switching tabs keeps unsaved changes, and the active tab is kept in the URL hash (`#ltbTab=<key>`).
16
+
17
+ REST read requests (`find` and `findOne`) and the slugs module routes (`/api/littlebox-strapi-suite/modules/pages/home` and `/api/littlebox-strapi-suite/modules/pages?slug=...`) return the fields of each tab inside a property named after the tab. The name is converted to lowercase, accents are removed, spaces become `_` and other special characters are dropped (`"Loja - Vitrine"` → `loja_vitrine`):
18
+
19
+ ```json
20
+ {
21
+ "data": {
22
+ "id": 1,
23
+ "documentId": "abc",
24
+ "title": "Home",
25
+ "loja_vitrine": { "banner": {}, "produtos_destaque": [] }
26
+ }
27
+ }
28
+ ```
29
+
30
+ Notes:
31
+
32
+ - Only the root level of the response is grouped. `filters`, `sort`, `fields` and `populate` keep using the original field names.
33
+ - Renaming a tab changes its key in the API.
34
+ - A tab whose key is empty or conflicts with a root field is not grouped, and a warning is logged.
35
+ - Writes through the REST API and GraphQL are not affected.
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const reactRouterDom = require("react-router-dom");
5
5
  const React = require("react");
6
6
  const designSystem = require("@strapi/design-system");
7
- const index = require("./index-60sq8G6p.js");
7
+ const index = require("./index-DnXsi_Ar.js");
8
8
  const icons = require("@strapi/icons");
9
9
  const reactIntl = require("react-intl");
10
10
  const styled = require("styled-components");
@@ -722,7 +722,7 @@ const HomePage = () => {
722
722
  style: { marginRight: "10px" },
723
723
  endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLink, {}),
724
724
  onClick: () => window.open("https://www.npmjs.com/package/@littlebox/strapi-suite", "_blank"),
725
- children: "v1.0.52"
725
+ children: "v1.0.54"
726
726
  }
727
727
  ),
728
728
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useNavigate, useParams, Routes, Route } from "react-router-dom";
3
3
  import React__default, { useState, useEffect, createContext, useContext, Fragment as Fragment$1, useRef } from "react";
4
4
  import { Box, Loader, Main, Typography, Button, Flex, Breadcrumbs, Crumb, CrumbLink, CardBody, CardContent, CardTitle, CardBadge, CardSubtitle, Card as Card$1, Dialog, IconButton, Toggle, SingleSelect, SingleSelectOption, SearchForm, Searchbar, Table, Thead, Tr, Th, Checkbox, VisuallyHidden, Tbody, Td, EmptyStateLayout, TextInput, Field, Tooltip } from "@strapi/design-system";
5
- import { R as Registry, F as FetchSettings, g as getTranslation, c as config, S as SLUG_LANGUAGE_STRATEGY, a as SLUG_CONTENT_STRATEGY, b as FetchSlugs, d as FetchLocales, e as convertToSlug, A as AI_TRANSLATION_DEFAULT_MODEL, f as fetchTemplates } from "./index-DQ3vX9So.mjs";
5
+ import { R as Registry, F as FetchSettings, g as getTranslation, c as config, S as SLUG_LANGUAGE_STRATEGY, a as SLUG_CONTENT_STRATEGY, b as FetchSlugs, d as FetchLocales, e as convertToSlug, A as AI_TRANSLATION_DEFAULT_MODEL, f as fetchTemplates } from "./index-97f0S4q6.mjs";
6
6
  import { ArrowLeft, ExternalLink, WarningCircle, Cross, BulletList, Pencil, Trash, Plus, Duplicate, Drag, Check, Sparkle } from "@strapi/icons";
7
7
  import { useIntl } from "react-intl";
8
8
  import styled, { useTheme } from "styled-components";
@@ -717,7 +717,7 @@ const HomePage = () => {
717
717
  style: { marginRight: "10px" },
718
718
  endIcon: /* @__PURE__ */ jsx(ExternalLink, {}),
719
719
  onClick: () => window.open("https://www.npmjs.com/package/@littlebox/strapi-suite", "_blank"),
720
- children: "v1.0.52"
720
+ children: "v1.0.54"
721
721
  }
722
722
  ),
723
723
  /* @__PURE__ */ jsx(
@@ -6,7 +6,7 @@ import { useComposedRefs, Field, Box, Typography, TextInput, IconButton, Button
6
6
  import { Pin, Cross } from "@strapi/icons";
7
7
  import { useFocusInputField, unstable_useContentManagerContext } from "@strapi/strapi/admin";
8
8
  import styled from "styled-components";
9
- import { R as Registry, P as PageAttributeUpdated, D as DocumentCustomFieldStarted, h as PluginIcon, g as getTranslation, c as config, e as convertToSlug, d as FetchLocales, i as FetchModuleSettings } from "./index-DQ3vX9So.mjs";
9
+ import { R as Registry, P as PageAttributeUpdated, D as DocumentCustomFieldStarted, h as PluginIcon, g as getTranslation, c as config, e as convertToSlug, d as FetchLocales, i as FetchModuleSettings } from "./index-97f0S4q6.mjs";
10
10
  const BoxInput = styled(Box)`
11
11
  & > div {
12
12
  width: 100%;
@@ -8,7 +8,7 @@ const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const admin = require("@strapi/strapi/admin");
10
10
  const styled = require("styled-components");
11
- const index = require("./index-60sq8G6p.js");
11
+ const index = require("./index-DnXsi_Ar.js");
12
12
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
13
13
  function _interopNamespace(e) {
14
14
  if (e && e.__esModule) return e;
@@ -201,6 +201,21 @@ const en = {
201
201
  "littlebox-strapi-suite.modal.handler.input.uid.error.duplicated": "The UID already exists",
202
202
  "littlebox-strapi-suite.modal.handler.input.name": "Name",
203
203
  "littlebox-strapi-suite.modal.input.name": "Name",
204
- "littlebox-strapi-suite.modal.handler.button": "Save"
204
+ "littlebox-strapi-suite.modal.handler.button": "Save",
205
+ "littlebox-strapi-suite.tabs.ctb.content-type.label": "Tabs",
206
+ "littlebox-strapi-suite.tabs.ctb.content-type.description": "Organize the fields of this content type in tabs. Fields in a tab are returned by the REST API inside a property named after the tab.",
207
+ "littlebox-strapi-suite.tabs.ctb.field.label": "Tab",
208
+ "littlebox-strapi-suite.tabs.ctb.field.description": "Tab where this field is shown. Fields without a tab are always visible.",
209
+ "littlebox-strapi-suite.tabs.ctb.field.none": "None (always visible)",
210
+ "littlebox-strapi-suite.tabs.ctb.add": "Add tab",
211
+ "littlebox-strapi-suite.tabs.ctb.remove": "Remove tab",
212
+ "littlebox-strapi-suite.tabs.ctb.reorder": "Drag to reorder",
213
+ "littlebox-strapi-suite.tabs.ctb.name.placeholder": "Tab name",
214
+ "littlebox-strapi-suite.tabs.ctb.empty": "No tabs yet.",
215
+ "littlebox-strapi-suite.tabs.ctb.error.name.required": "Every tab needs a name",
216
+ "littlebox-strapi-suite.tabs.ctb.error.key.empty": "Tab names must contain letters or numbers",
217
+ "littlebox-strapi-suite.tabs.ctb.error.key.duplicated": "Two tabs generate the same API key",
218
+ "littlebox-strapi-suite.tabs.edit-view.label": "Content tabs",
219
+ "littlebox-strapi-suite.tabs.edit-view.errors": "{count, plural, one {# error} other {# errors}}"
205
220
  };
206
221
  exports.default = en;
@@ -199,7 +199,22 @@ const en = {
199
199
  "littlebox-strapi-suite.modal.handler.input.uid.error.duplicated": "The UID already exists",
200
200
  "littlebox-strapi-suite.modal.handler.input.name": "Name",
201
201
  "littlebox-strapi-suite.modal.input.name": "Name",
202
- "littlebox-strapi-suite.modal.handler.button": "Save"
202
+ "littlebox-strapi-suite.modal.handler.button": "Save",
203
+ "littlebox-strapi-suite.tabs.ctb.content-type.label": "Tabs",
204
+ "littlebox-strapi-suite.tabs.ctb.content-type.description": "Organize the fields of this content type in tabs. Fields in a tab are returned by the REST API inside a property named after the tab.",
205
+ "littlebox-strapi-suite.tabs.ctb.field.label": "Tab",
206
+ "littlebox-strapi-suite.tabs.ctb.field.description": "Tab where this field is shown. Fields without a tab are always visible.",
207
+ "littlebox-strapi-suite.tabs.ctb.field.none": "None (always visible)",
208
+ "littlebox-strapi-suite.tabs.ctb.add": "Add tab",
209
+ "littlebox-strapi-suite.tabs.ctb.remove": "Remove tab",
210
+ "littlebox-strapi-suite.tabs.ctb.reorder": "Drag to reorder",
211
+ "littlebox-strapi-suite.tabs.ctb.name.placeholder": "Tab name",
212
+ "littlebox-strapi-suite.tabs.ctb.empty": "No tabs yet.",
213
+ "littlebox-strapi-suite.tabs.ctb.error.name.required": "Every tab needs a name",
214
+ "littlebox-strapi-suite.tabs.ctb.error.key.empty": "Tab names must contain letters or numbers",
215
+ "littlebox-strapi-suite.tabs.ctb.error.key.duplicated": "Two tabs generate the same API key",
216
+ "littlebox-strapi-suite.tabs.edit-view.label": "Content tabs",
217
+ "littlebox-strapi-suite.tabs.edit-view.errors": "{count, plural, one {# error} other {# errors}}"
203
218
  };
204
219
  export {
205
220
  en as default