@balena/ui-shared-components 15.3.1-build-secureboot-ensure-esr-supports-3d03d62fbc8ad68169af2ab7339986800301267f-1 → 15.4.0-build-revert-consolidate-fomrats-0b90d5d2bac464c3618b0fe05049c2a9668b1fdd-1

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.
@@ -53,10 +53,10 @@ export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVers
53
53
  const versionSelectionOpts = useMemo(() => (showAllVersions ? selectionOpts : preferredSelectionOpts), [preferredSelectionOpts, selectionOpts, showAllVersions]);
54
54
  const showAllVersionsToggle = useMemo(() => preferredSelectionOpts.length < selectionOpts.length, [preferredSelectionOpts.length, selectionOpts.length]);
55
55
  const supportsSecureBoot = useMemo(() => {
56
- var _a;
57
- return (model.deviceType.slug === GENERIC_X86_SLUG &&
58
- semver.gte((_a = model.basedOnVersion) !== null && _a !== void 0 ? _a : model.version, GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION));
59
- }, [model.deviceType.slug, model.version, model.basedOnVersion]);
56
+ return (osType === 'default' &&
57
+ model.deviceType.slug === GENERIC_X86_SLUG &&
58
+ semver.gte(model.version, GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION));
59
+ }, [model.deviceType.slug, model.version, osType]);
60
60
  const secureBootDontShowAgainKey = `${model.deviceType.slug}_secureboot_warning_do_not_show_again`;
61
61
  const dismissSecureBootWarning = useCallback((accepted, dontShowAgain) => {
62
62
  var _a;
@@ -99,7 +99,6 @@ export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVers
99
99
  else {
100
100
  newState.version = ver === null || ver === void 0 ? void 0 : ver.rawVersion;
101
101
  }
102
- newState.basedOnVersion = ver.basedOnVersion;
103
102
  onChange(newState);
104
103
  setVersion(ver);
105
104
  }, [versionSelectionOpts, variant, onChange, handleVariantChange]);
@@ -10,7 +10,6 @@ export interface DownloadImageFormModel {
10
10
  releaseId: number | undefined;
11
11
  deviceType: DeviceType;
12
12
  version: string;
13
- basedOnVersion?: string;
14
13
  network: 'ethernet' | 'wifi';
15
14
  secureboot: boolean;
16
15
  developmentMode?: boolean;
@@ -9,14 +9,12 @@ export type VersionSelectionOptions = {
9
9
  } & ({
10
10
  hasPrebuiltVariants: false;
11
11
  rawVersion: string;
12
- basedOnVersion?: string;
13
12
  } | {
14
13
  hasPrebuiltVariants: true;
15
14
  rawVersions: {
16
15
  dev?: string;
17
16
  prod?: string;
18
17
  };
19
- basedOnVersion?: string;
20
18
  });
21
19
  export declare const transformVersions: (versions: OsVersion[]) => VersionSelectionOptions[];
22
20
  export declare const getPreferredVersionOpts: (versionOpts: VersionSelectionOptions[]) => VersionSelectionOptions[];
@@ -11,14 +11,12 @@ export const transformVersions = (versions) => {
11
11
  ? {
12
12
  hasPrebuiltVariants: false,
13
13
  rawVersion: version.raw_version,
14
- basedOnVersion: version.basedOnVersion,
15
14
  }
16
15
  : {
17
16
  hasPrebuiltVariants: true,
18
17
  rawVersions: Object.assign(Object.assign({}, (existingSelectionOpt != null &&
19
18
  'rawVersions' in existingSelectionOpt &&
20
19
  existingSelectionOpt.rawVersions)), { [version.variant]: version.raw_version }),
21
- basedOnVersion: version.basedOnVersion,
22
20
  }));
23
21
  });
24
22
  return Object.values(optsByVersion);
@@ -3,10 +3,10 @@ import React from 'react';
3
3
  import { PersistentFilters } from './PersistentFilters';
4
4
  import { Filters as FiltersComponent, } from '../components/Filters';
5
5
  import { modifySchemaWithRefSchemes, removeFieldsWithNoFilter, removeRefSchemeSeparatorsFromFilters, } from './utils';
6
- import { useNavigate } from '../../../hooks/useNavigate';
6
+ import { useUiSharedComponentsContext } from '../../../hooks/useUiSharedComponentsContext';
7
7
  const DEFAULT_RENDER_MODE = ['add', 'search', 'views'].slice();
8
8
  export const Filters = ({ schema, filters, views, changeFilters, changeViews, viewsRestorationKey, renderMode, onSearch, persistFilters, }) => {
9
- const navigate = useNavigate();
9
+ const { navigate } = useUiSharedComponentsContext();
10
10
  const filteredSchema = React.useMemo(() => removeFieldsWithNoFilter(schema), [schema]);
11
11
  // This is the function that will rework the schema taking in consideration x-ref-scheme and x-foreign-key-scheme.
12
12
  const reworkedSchema = React.useMemo(() => modifySchemaWithRefSchemes(filteredSchema), [filteredSchema]);
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import debounce from 'lodash/debounce';
4
- import { useNavigate } from '../../../../hooks/useNavigate';
4
+ import { useUiSharedComponentsContext } from '../../../../hooks/useUiSharedComponentsContext';
5
5
  import { ajvFilter, createFullTextSearchFilter } from './SchemaSieve';
6
6
  import { Box, styled, Typography } from '@mui/material';
7
7
  import { convertToPineClientFilter } from '../../oData/jsonToOData';
@@ -34,7 +34,7 @@ const FocusItem = styled(Box)(({ hasGetBaseUrl }) => ({
34
34
  }));
35
35
  export const FocusSearch = ({ searchTerm, filtered, rjstContext, model, rowKey = 'id', }) => {
36
36
  var _a;
37
- const navigate = useNavigate();
37
+ const { navigate } = useUiSharedComponentsContext();
38
38
  const [searchResults, setSearchResults] = React.useState(null);
39
39
  const [isLoading, setIsLoading] = React.useState(false);
40
40
  const inputSearch = (_a = rjstContext.sdk) === null || _a === void 0 ? void 0 : _a.inputSearch;
@@ -6,7 +6,6 @@ import { rjstDefaultPermissions, rjstGetModelForCollection, rjstRunTransformers
6
6
  import { rjstGetDisabledReason } from './utils';
7
7
  import type { LensTemplate } from './Lenses';
8
8
  import type { BoxProps } from '@mui/material';
9
- import type { Format } from './components/Widget/utils';
10
9
  import type { Pagination } from './components/Table/utils';
11
10
  export interface NoDataInfo {
12
11
  title?: string | React.ReactElement;
@@ -21,8 +20,6 @@ export interface RJSTProps<T> extends Omit<BoxProps, 'onChange'> {
21
20
  model: RJSTModel<T>;
22
21
  /** Array of data or data entity to display */
23
22
  data: T[] | undefined;
24
- /** Formats are custom widgets to render in the table cell. The type of format to display is described in the model. */
25
- formats?: Format[];
26
23
  /** Actions is an array of actions applicable on the selected items */
27
24
  actions?: Array<RJSTAction<T>>;
28
25
  /** The sdk is used to pass the method to handle tags when added removed or updated */
@@ -57,5 +54,5 @@ export interface RJSTProps<T> extends Omit<BoxProps, 'onChange'> {
57
54
  noDataInfo?: NoDataInfo;
58
55
  persistFilters?: boolean;
59
56
  }
60
- export declare const RJST: <T extends RJSTBaseResource<T>>({ model: modelRaw, data, formats, actions, sdk, customSort, refresh, getBaseUrl, onEntityClick, onChange, pagination, customLenses, loading, rowKey, noDataInfo, persistFilters, ...boxProps }: RJSTProps<T>) => import("react/jsx-runtime").JSX.Element;
57
+ export declare const RJST: <T extends RJSTBaseResource<T>>({ model: modelRaw, data, actions, sdk, customSort, refresh, getBaseUrl, onEntityClick, onChange, pagination, customLenses, loading, rowKey, noDataInfo, persistFilters, ...boxProps }: RJSTProps<T>) => import("react/jsx-runtime").JSX.Element;
61
58
  export { rjstRunTransformers, rjstDefaultPermissions, rjstGetModelForCollection, rjstAddToSchema, type RJSTAction, type RJSTBaseResource, type RJSTRawModel, type RJSTModel, rjstJsonSchemaPick, rjstGetDisabledReason, getPropertyScheme, getSubSchemaFromRefScheme, parseDescription, parseDescriptionProperty, generateSchemaFromRefScheme, };
@@ -17,7 +17,7 @@ import { NoRecordsFoundView } from './NoRecordsFoundView';
17
17
  import { Box, Link, styled } from '@mui/material';
18
18
  import { useTranslation } from '../../hooks/useTranslations';
19
19
  import { useAnalyticsContext } from '../../contexts/AnalyticsContext';
20
- import { useNavigate } from '../../hooks/useNavigate';
20
+ import { useUiSharedComponentsContext } from '../../hooks/useUiSharedComponentsContext';
21
21
  import { convertToPineClientFilter, orderbyBuilder } from './oData/jsonToOData';
22
22
  import { ajvFilter } from './components/Filters/SchemaSieve';
23
23
  import { Spinner } from '../Spinner';
@@ -37,10 +37,10 @@ const HeaderGrid = styled(Box)(({ theme }) => ({
37
37
  // any typing we have in lenses today.
38
38
  export const RJST = (_a) => {
39
39
  var _b, _c, _d, _e, _f;
40
- var { model: modelRaw, data, formats, actions, sdk, customSort, refresh, getBaseUrl, onEntityClick, onChange, pagination, customLenses, loading = false, rowKey, noDataInfo, persistFilters = true } = _a, boxProps = __rest(_a, ["model", "data", "formats", "actions", "sdk", "customSort", "refresh", "getBaseUrl", "onEntityClick", "onChange", "pagination", "customLenses", "loading", "rowKey", "noDataInfo", "persistFilters"]);
40
+ var { model: modelRaw, data, actions, sdk, customSort, refresh, getBaseUrl, onEntityClick, onChange, pagination, customLenses, loading = false, rowKey, noDataInfo, persistFilters = true } = _a, boxProps = __rest(_a, ["model", "data", "actions", "sdk", "customSort", "refresh", "getBaseUrl", "onEntityClick", "onChange", "pagination", "customLenses", "loading", "rowKey", "noDataInfo", "persistFilters"]);
41
41
  const { t } = useTranslation();
42
42
  const { state: analytics } = useAnalyticsContext();
43
- const navigate = useNavigate();
43
+ const { navigate, RJSTFormats: formats } = useUiSharedComponentsContext();
44
44
  const modelRef = React.useRef(modelRaw);
45
45
  // This allows the component to work even if
46
46
  // consumers are passing a new model object every time.
@@ -1,9 +1,11 @@
1
1
  import type { TFunction } from '../hooks/useTranslations';
2
2
  import type { NavigateFunction } from 'react-router-dom';
3
+ import type { Format } from '../components/RJST/components/Widget/utils';
3
4
  export interface UiSharedComponentsContextProviderInterface {
4
5
  navigate?: NavigateFunction;
5
6
  t?: TFunction;
6
7
  externalTranslationMap?: Dictionary<string>;
8
+ RJSTFormats?: Format[];
7
9
  }
8
10
  export declare const UiSharedComponentsContextProvider: import("react").Context<UiSharedComponentsContextProviderInterface>;
9
11
  export declare const UiSharedComponentsProvider: ({ children, ...otherProps }: UiSharedComponentsContextProviderInterface & {
@@ -0,0 +1 @@
1
+ export declare const useUiSharedComponentsContext: () => import("../contexts/UiSharedComponentsContextProvider").UiSharedComponentsContextProviderInterface;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { UiSharedComponentsContextProvider } from '../contexts/UiSharedComponentsContextProvider';
3
+ export const useUiSharedComponentsContext = () => {
4
+ const context = React.useContext(UiSharedComponentsContextProvider);
5
+ return context;
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@balena/ui-shared-components",
3
- "version": "15.3.1-build-secureboot-ensure-esr-supports-3d03d62fbc8ad68169af2ab7339986800301267f-1",
3
+ "version": "15.4.0-build-revert-consolidate-fomrats-0b90d5d2bac464c3618b0fe05049c2a9668b1fdd-1",
4
4
  "main": "./dist/index.js",
5
5
  "sideEffects": false,
6
6
  "files": [
@@ -137,7 +137,7 @@
137
137
  },
138
138
  "homepage": "https://github.com/balena-io/ui-shared-components#readme",
139
139
  "versionist": {
140
- "publishedAt": "2025-12-23T15:11:30.249Z"
140
+ "publishedAt": "2025-12-23T22:06:46.512Z"
141
141
  },
142
142
  "overrides": {
143
143
  "storybook": "$storybook",
@@ -1 +0,0 @@
1
- export declare const useNavigate: () => import("react-router").NavigateFunction | undefined;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { UiSharedComponentsContextProvider } from '../contexts/UiSharedComponentsContextProvider';
3
- export const useNavigate = () => {
4
- const { navigate } = React.useContext(UiSharedComponentsContextProvider);
5
- return navigate;
6
- };