@bigbinary/neeto-themes-frontend 5.0.0 → 5.1.0-beta1

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.
@@ -30,7 +30,8 @@
30
30
  "addBackgroundImage": "Add background image",
31
31
  "changeBackgroundImage": "Change background image",
32
32
  "activeTheme": "Active theme",
33
- "defaultTheme": "(default theme)",
33
+ "defaultTheme": "Default theme",
34
+ "defaultThemeInfo": "The default theme is applied automatically to every new {{entityType}}.",
34
35
  "edit": "Edit",
35
36
  "noResultsFound": "No results found!",
36
37
  "searchThemes": "Search themes",
package/dist/.ready CHANGED
@@ -1 +1 @@
1
- Built at 2026-11-25T13:22:48.584Z
1
+ Built at 2026-11-28T04:46:11.702Z
@@ -7,7 +7,7 @@ import { useTranslation, Trans } from 'react-i18next';
7
7
  import _regenerator from '@babel/runtime/helpers/regenerator';
8
8
  import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
9
9
  import Toastr from '@bigbinary/neetoui/Toastr';
10
- import { n, u as useShowGlobalTheme, a as useFetchTheme, b as useListThemes, c as useCreateTheme, d as useUpdateTheme, e as useApplyTheme, f as routes, g as useShowThemeEntity, h as useDeleteTheme, r as registerNeetoThemesTranslations } from './useGlobalThemesApi-CT6pst6z.js';
10
+ import { n, u as useShowGlobalTheme, a as useFetchTheme, b as useListThemes, c as useCreateTheme, d as useUpdateTheme, e as useApplyTheme, f as routes, g as useShowThemeEntity, h as useDeleteTheme, r as registerNeetoThemesTranslations } from './useGlobalThemesApi-HW95zFgg.js';
11
11
  import { a as useExpandedSection, b as useConfigStore, c as useThemeStore, u as useThemeUtils, P as POSITION_OPTIONS, H as HUNDRED, O as OVERLAY_OPACITY_SLIDER_MARKS, F as FONT_OPTIONS, d as useSyncExpandedSectionFromUrl, T as THEME_VALIDATION_SCHEMA, A as APPLY_SPINNER_DELAY } from './useExpandedSection-Dpv_-kLy.js';
12
12
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
13
13
  import classnames from 'classnames';
@@ -9,7 +9,7 @@ var reactI18next = require('react-i18next');
9
9
  var _regenerator = require('@babel/runtime/helpers/regenerator');
10
10
  var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
11
11
  var Toastr = require('@bigbinary/neetoui/Toastr');
12
- var useGlobalThemesApi = require('../useGlobalThemesApi-B3ulFgMt.js');
12
+ var useGlobalThemesApi = require('../useGlobalThemesApi-Cyxc64Lr.js');
13
13
  var useExpandedSection = require('../useExpandedSection-D0PusQFE.js');
14
14
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
15
15
  var classnames = require('classnames');
package/dist/cjs/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var NeetoThemesBuilder = require('./NeetoThemesBuilder.js');
4
4
  var useExpandedSection = require('../useExpandedSection-D0PusQFE.js');
5
- var useGlobalThemesApi = require('../useGlobalThemesApi-B3ulFgMt.js');
5
+ var useGlobalThemesApi = require('../useGlobalThemesApi-Cyxc64Lr.js');
6
6
  var utils = require('../index-CZdpMMBb.js');
7
7
  require('zustand/shallow');
8
8
  require('react');
@@ -6,7 +6,7 @@ var neetoAtoms = require('@bigbinary/neeto-atoms');
6
6
  var neetoCist = require('@bigbinary/neeto-cist');
7
7
  var reactUtils$1 = require('@bigbinary/neeto-commons-frontend/v2/react-utils');
8
8
  var reactI18next = require('react-i18next');
9
- var useGlobalThemesApi = require('../../useGlobalThemesApi-B3ulFgMt.js');
9
+ var useGlobalThemesApi = require('../../useGlobalThemesApi-Cyxc64Lr.js');
10
10
  var useExpandedSection = require('../../useExpandedSection-D0PusQFE.js');
11
11
  var _regenerator = require('@babel/runtime/helpers/regenerator');
12
12
  var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
@@ -1831,7 +1831,9 @@ var Thumbnail = function Thumbnail(_ref) {
1831
1831
  backgroundSize: "cover"
1832
1832
  },
1833
1833
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
1834
- className: "rounded-lg cursor-pointer p-3 transition-all duration-300 ease-in-out group-hover:opacity-85",
1834
+ className: classnames("rounded-lg p-3 transition-all duration-300 ease-in-out group-hover:opacity-85", {
1835
+ "cursor-pointer": !(active && isPreviewing)
1836
+ }),
1835
1837
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
1836
1838
  className: "rounded-lg p-3",
1837
1839
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -1885,12 +1887,14 @@ var Card = function Card(_ref) {
1885
1887
  return {
1886
1888
  themePropertiesSchema: store["themePropertiesSchema"],
1887
1889
  enabledFeatures: store["enabledFeatures"],
1888
- proFeatures: store["proFeatures"]
1890
+ proFeatures: store["proFeatures"],
1891
+ entityType: store["entityType"]
1889
1892
  };
1890
1893
  })),
1891
1894
  themePropertiesSchema = _useConfigStore.themePropertiesSchema,
1892
1895
  enabledFeatures = _useConfigStore.enabledFeatures,
1893
- proFeatures = _useConfigStore.proFeatures;
1896
+ proFeatures = _useConfigStore.proFeatures,
1897
+ entityType = _useConfigStore.entityType;
1894
1898
  var id = theme.id,
1895
1899
  name = theme.name;
1896
1900
  var imageProperties = neetoCist.filterBy({
@@ -1912,6 +1916,12 @@ var Card = function Card(_ref) {
1912
1916
  };
1913
1917
  };
1914
1918
  var showMoreDropdown = isFunction(onDeleteTheme);
1919
+
1920
+ // v2 revamp: the active theme is previewed on the right by default, so its
1921
+ // card isn't clickable while it is the one being previewed (clicking it would
1922
+ // do nothing). It becomes clickable again — to return to its preview — once
1923
+ // another theme is being previewed.
1924
+ var isActiveThemePreviewed = active && isPreviewing;
1915
1925
  return (
1916
1926
  /*#__PURE__*/
1917
1927
  // v2 revamp: one soft card (16px radius), the preview inset and full
@@ -1923,12 +1933,13 @@ var Card = function Card(_ref) {
1923
1933
  "data-testid": active ? "active-theme-card" : "theme-card",
1924
1934
  id: theme.id,
1925
1935
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
1926
- className: classnames("neeto-themes-theme-thumbnail group/thumbnail border-border bg-background relative cursor-pointer overflow-hidden rounded-2xl border transition-all duration-300 ease-in-out", {
1936
+ className: classnames("neeto-themes-theme-thumbnail group/thumbnail border-border bg-background relative overflow-hidden rounded-2xl border transition-all duration-300 ease-in-out", {
1937
+ "cursor-pointer": !isActiveThemePreviewed,
1927
1938
  "neeto-themes-theme-thumbnail--active": active,
1928
1939
  "neeto-themes-theme-thumbnail--preview-active": isPreviewing,
1929
1940
  "neeto-themes-theme-thumbnail--highlight-active": isHighLightedTheme
1930
1941
  }),
1931
- onClick: function onClick() {
1942
+ onClick: isActiveThemePreviewed ? undefined : function () {
1932
1943
  return onSetPreviewTheme(theme);
1933
1944
  },
1934
1945
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -1948,77 +1959,89 @@ var Card = function Card(_ref) {
1948
1959
  })
1949
1960
  })
1950
1961
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
1951
- className: "border-border relative flex items-center justify-between gap-1 border-t px-3.5 py-3",
1962
+ className: "border-border relative flex flex-col gap-1 border-t px-3.5 py-3",
1952
1963
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
1953
- className: "flex min-w-0 flex-1 items-center space-x-2",
1964
+ className: "relative flex items-center justify-between gap-1",
1954
1965
  children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
1966
+ className: "text-foreground min-w-0 grow truncate text-sm font-semibold",
1955
1967
  "data-testid": "theme-name",
1956
1968
  variant: "body2",
1969
+ children: name
1970
+ }), (active || showMoreDropdown) && /*#__PURE__*/jsxRuntime.jsxs("div", {
1971
+ className: "flex shrink-0 items-center gap-1",
1972
+ children: [active && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
1973
+ className: "shrink-0",
1974
+ "data-testid": "active-theme-badge",
1975
+ label: t("neetoThemes.common.active"),
1976
+ variant: "green-subtle"
1977
+ }), showMoreDropdown && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
1978
+ dropdownButtonProps: {
1979
+ size: "icon"
1980
+ },
1981
+ dropdownProps: {
1982
+ className: "w-max",
1983
+ onClick: function onClick(e) {
1984
+ return e.stopPropagation();
1985
+ }
1986
+ },
1987
+ menuItems: [{
1988
+ key: "delete",
1989
+ "data-testid": "delete-theme-menu-item",
1990
+ label: t("neetoThemes.build.leftSideBar.themes.themeOptions.delete"),
1991
+ isDisabled: isApplyingTheme,
1992
+ onClick: function onClick(e) {
1993
+ e.stopPropagation();
1994
+ handleDeleteTheme();
1995
+ },
1996
+ variant: "destructive"
1997
+ }]
1998
+ })]
1999
+ }), !active && /*#__PURE__*/jsxRuntime.jsx("div", {
1957
2000
  className: classnames(
1958
- // v2 revamp: one line with an ellipsis (narrow phone cards broke
1959
- // the name mid-word); Apply fades in over its end on hover.
1960
- "text-foreground min-w-0 grow truncate text-sm font-semibold", {
1961
- "pt-0.5": showMoreDropdown
2001
+ // v2 revamp: Apply hugs the right edge — flush when the card
2002
+ // has no menu, and 4px before the ⋮ when it does.
2003
+ "from-background via-background absolute inset-y-0 flex items-center gap-1.5 bg-linear-to-l from-0% via-85% to-transparent ps-8 transition-opacity duration-(--motion-short) ease-(--ease-out)", {
2004
+ "end-8": showMoreDropdown,
2005
+ "end-0": !showMoreDropdown,
2006
+ "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100": !isPreviewing
1962
2007
  }),
1963
- children: name
1964
- }), isGlobalTheme && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
2008
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
2009
+ className: "neeto-themes-theme-thumbnail__apply-btn",
2010
+ "data-testid": "apply-theme-button",
2011
+ disabled: isApplyingTheme,
2012
+ label: t("neetoThemes.common.useTheme"),
2013
+ loading: isApplyingTheme,
2014
+ size: "sm",
2015
+ variant: "default",
2016
+ onClick: function onClick() {
2017
+ return onApplyTheme(theme);
2018
+ }
2019
+ })
2020
+ })]
2021
+ }), isGlobalTheme &&
2022
+ /*#__PURE__*/
2023
+ // v2 revamp: the default-theme marker sits on its own line as a
2024
+ // quiet caption, so it never congests the name row.
2025
+ jsxRuntime.jsxs("div", {
2026
+ className: "flex items-center gap-1",
2027
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Typography, {
2028
+ className: "text-xs",
1965
2029
  color: "muted",
1966
2030
  "data-testid": "default-theme-label",
1967
- variant: "body2",
1968
- className: classnames("shrink-0 text-sm", {
1969
- "pt-0.5": showMoreDropdown
1970
- }),
2031
+ variant: "body3",
1971
2032
  children: t("neetoThemes.common.defaultTheme")
2033
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Tooltip, {
2034
+ content: t("neetoThemes.common.defaultThemeInfo", {
2035
+ entityType: t("neetoThemes.entityType.".concat(entityType.toLowerCase()))
2036
+ }),
2037
+ children: /*#__PURE__*/jsxRuntime.jsx("span", {
2038
+ className: "inline-flex shrink-0",
2039
+ children: /*#__PURE__*/jsxRuntime.jsx(lucideReact.Info, {
2040
+ className: "text-muted-foreground",
2041
+ size: 14
2042
+ })
2043
+ })
1972
2044
  })]
1973
- }), (active || showMoreDropdown) && /*#__PURE__*/jsxRuntime.jsxs("div", {
1974
- className: "flex shrink-0 items-center gap-1",
1975
- children: [active && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Badge, {
1976
- className: "shrink-0",
1977
- "data-testid": "active-theme-badge",
1978
- label: t("neetoThemes.common.active"),
1979
- variant: "green-subtle"
1980
- }), showMoreDropdown && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
1981
- dropdownButtonProps: {
1982
- size: "sm"
1983
- },
1984
- dropdownProps: {
1985
- className: "w-max",
1986
- onClick: function onClick(e) {
1987
- return e.stopPropagation();
1988
- }
1989
- },
1990
- menuItems: [{
1991
- key: "delete",
1992
- "data-testid": "delete-theme-menu-item",
1993
- label: t("neetoThemes.build.leftSideBar.themes.themeOptions.delete"),
1994
- isDisabled: isApplyingTheme,
1995
- onClick: function onClick(e) {
1996
- e.stopPropagation();
1997
- handleDeleteTheme();
1998
- },
1999
- variant: "destructive"
2000
- }]
2001
- })]
2002
- }), !active && /*#__PURE__*/jsxRuntime.jsx("div", {
2003
- className: classnames("from-background via-background absolute inset-y-0 flex items-center gap-1.5 bg-linear-to-l from-0% via-85% to-transparent ps-8 transition-opacity duration-(--motion-short) ease-(--ease-out)", {
2004
- // Stop short of the ⋮ menu (32px button + the footer's
2005
- // 14px padding) so Apply never covers it.
2006
- "end-12 pe-1": showMoreDropdown,
2007
- "end-0 pe-3.5": !showMoreDropdown,
2008
- "pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100": !isPreviewing
2009
- }),
2010
- children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, {
2011
- className: "neeto-themes-theme-thumbnail__apply-btn",
2012
- "data-testid": "apply-theme-button",
2013
- disabled: isApplyingTheme,
2014
- label: t("neetoThemes.common.useTheme"),
2015
- loading: isApplyingTheme,
2016
- size: "sm",
2017
- variant: "default",
2018
- onClick: function onClick() {
2019
- return onApplyTheme(theme);
2020
- }
2021
- })
2022
2045
  })]
2023
2046
  }), active && /*#__PURE__*/jsxRuntime.jsxs("div", {
2024
2047
  className: "border-border flex flex-col gap-0.5 border-t p-1.5",