@fluid-app/rep-sdk 0.1.5 → 0.1.7

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.
package/dist/index.d.cts CHANGED
@@ -8,6 +8,7 @@ import { WidgetSchema, ThemeDefinition, ScreenDefinition as ScreenDefinition$1,
8
8
  export { AlignOptions, BackgroundType, BackgroundValue, BorderRadiusOptions, ButtonSizeOptions, ColorOptions, FontSizeOptions, GapOptions, NavigationItem, PaddingOptions, RepAppData, RepAppManifest, RepAppProfile, ResolvedTheme, SectionLayoutType, ShareableItem, ThemeColorInput, ThemeDefinition, ThemePayload, TypedWidgetSchema, WIDGET_TYPE_NAMES, WidgetPath, WidgetRegistry, WidgetSchema, WidgetType, WidgetTypeName, assertDefined, assertNever, isWidgetType, isWidgetTypeName, sectionLayoutConfig } from '@fluid-app/rep-core/types';
9
9
  import { RawApiTheme } from '@fluid-app/rep-core/theme';
10
10
  export { DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, FontFamilyKey, FontSizeKey, GenerateThemeCSSOptions, OklchPlain, RADIUS_KEYS, RadiusKey, RawApiTheme, ResolvedColorSet, ResolvedSemanticColor, SEMANTIC_COLOR_NAMES, SHADE_STEPS, SemanticColorName, ShadeStep, ThemeColorPlain, applyTheme, buildThemeDefinition, deriveDarkVariant, deserialiseTheme, generateShades, generateThemeCSS, getActiveThemeId, getDefaultThemeDefinition, getForegroundColor, mergeDarkOverrides, parseColor, removeAllThemes, removeTheme, resolveTheme, serialiseTheme, transformThemes } from '@fluid-app/rep-core/theme';
11
+ import { components } from '@fluid-app/fluidos-api-client';
11
12
  import { FluidAuthConfig, FluidAuthContextValue } from '@fluid-app/auth';
12
13
  export { AUTH_CONSTANTS, DEFAULT_AUTH_URL, FluidAuthConfig, FluidAuthContextValue, JWTPayload, STORAGE_KEYS, TokenValidationResult, URL_PARAMS, USER_TYPES, UserType, cleanTokenFromUrl, clearTokens, createDefaultAuthRedirect, decodeToken, extractAllTokensFromUrl, extractCompanyTokenFromUrl, extractTokenFromUrl, getStoredToken, getTokenExpiration, getTokenTimeRemaining, hasStoredToken, hasTokenInUrl, isTokenExpired, isUserType, isValidToken, storeToken, validateToken } from '@fluid-app/auth';
13
14
  import { MessagingAuthContext, FileUploader } from '@fluid-app/fluid-messaging-core';
@@ -355,17 +356,8 @@ declare function toScreenDefinition(screen: RawApiScreen): ScreenDefinition$1;
355
356
  * - apps/fluid-admin/networking/reps/screens.api.ts
356
357
  */
357
358
 
358
- /** Raw navigation item from the FluidOS API */
359
- interface RawApiNavigationItem {
360
- id: number | string;
361
- label?: string | null;
362
- slug?: string | null;
363
- icon?: string | null;
364
- screen_id?: number | string | null;
365
- parent_id?: number | string | null;
366
- position?: number | null;
367
- children?: RawApiNavigationItem[];
368
- }
359
+ /** Raw navigation item from the FluidOS API (derived from generated types) */
360
+ type RawApiNavigationItem = components["schemas"]["FluidOSNavigationItem"];
369
361
  /**
370
362
  * Convert a raw FluidOS navigation item to NavigationItem.
371
363
  * Recursively transforms children and sorts by position.
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import { WidgetSchema, ThemeDefinition, ScreenDefinition as ScreenDefinition$1,
8
8
  export { AlignOptions, BackgroundType, BackgroundValue, BorderRadiusOptions, ButtonSizeOptions, ColorOptions, FontSizeOptions, GapOptions, NavigationItem, PaddingOptions, RepAppData, RepAppManifest, RepAppProfile, ResolvedTheme, SectionLayoutType, ShareableItem, ThemeColorInput, ThemeDefinition, ThemePayload, TypedWidgetSchema, WIDGET_TYPE_NAMES, WidgetPath, WidgetRegistry, WidgetSchema, WidgetType, WidgetTypeName, assertDefined, assertNever, isWidgetType, isWidgetTypeName, sectionLayoutConfig } from '@fluid-app/rep-core/types';
9
9
  import { RawApiTheme } from '@fluid-app/rep-core/theme';
10
10
  export { DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, FontFamilyKey, FontSizeKey, GenerateThemeCSSOptions, OklchPlain, RADIUS_KEYS, RadiusKey, RawApiTheme, ResolvedColorSet, ResolvedSemanticColor, SEMANTIC_COLOR_NAMES, SHADE_STEPS, SemanticColorName, ShadeStep, ThemeColorPlain, applyTheme, buildThemeDefinition, deriveDarkVariant, deserialiseTheme, generateShades, generateThemeCSS, getActiveThemeId, getDefaultThemeDefinition, getForegroundColor, mergeDarkOverrides, parseColor, removeAllThemes, removeTheme, resolveTheme, serialiseTheme, transformThemes } from '@fluid-app/rep-core/theme';
11
+ import { components } from '@fluid-app/fluidos-api-client';
11
12
  import { FluidAuthConfig, FluidAuthContextValue } from '@fluid-app/auth';
12
13
  export { AUTH_CONSTANTS, DEFAULT_AUTH_URL, FluidAuthConfig, FluidAuthContextValue, JWTPayload, STORAGE_KEYS, TokenValidationResult, URL_PARAMS, USER_TYPES, UserType, cleanTokenFromUrl, clearTokens, createDefaultAuthRedirect, decodeToken, extractAllTokensFromUrl, extractCompanyTokenFromUrl, extractTokenFromUrl, getStoredToken, getTokenExpiration, getTokenTimeRemaining, hasStoredToken, hasTokenInUrl, isTokenExpired, isUserType, isValidToken, storeToken, validateToken } from '@fluid-app/auth';
13
14
  import { MessagingAuthContext, FileUploader } from '@fluid-app/fluid-messaging-core';
@@ -355,17 +356,8 @@ declare function toScreenDefinition(screen: RawApiScreen): ScreenDefinition$1;
355
356
  * - apps/fluid-admin/networking/reps/screens.api.ts
356
357
  */
357
358
 
358
- /** Raw navigation item from the FluidOS API */
359
- interface RawApiNavigationItem {
360
- id: number | string;
361
- label?: string | null;
362
- slug?: string | null;
363
- icon?: string | null;
364
- screen_id?: number | string | null;
365
- parent_id?: number | string | null;
366
- position?: number | null;
367
- children?: RawApiNavigationItem[];
368
- }
359
+ /** Raw navigation item from the FluidOS API (derived from generated types) */
360
+ type RawApiNavigationItem = components["schemas"]["FluidOSNavigationItem"];
369
361
  /**
370
362
  * Convert a raw FluidOS navigation item to NavigationItem.
371
363
  * Recursively transforms children and sorts by position.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { themes_exports, useFluidApi, transformManifestToRepAppData, useThemeContext, useFluidAuthContext, MessagingScreen } from './chunk-O47ODLEF.js';
2
- export { ApiError, DEFAULT_AUTH_URL, DEFAULT_SDK_WIDGET_REGISTRY, FluidAuthProvider, FluidProvider, FluidThemeProvider, MessagingScreen, buildThemeDefinition, createDefaultAuthRedirect, createFluidClient, createFluidFileUploader, getActiveThemeId, isApiError, messagingScreenPropertySchema, normalizeComponentTree, toNavigationItem, toScreenDefinition, transformManifestToRepAppData, transformThemes, useFluidApi, useFluidAuthContext, useFluidContext, useMessagingAuth, useMessagingConfig, useThemeContext } from './chunk-O47ODLEF.js';
1
+ import { themes_exports, useFluidApi, transformManifestToRepAppData, useThemeContext, useFluidAuthContext, MessagingScreen } from './chunk-VIITMYKW.js';
2
+ export { ApiError, DEFAULT_AUTH_URL, DEFAULT_SDK_WIDGET_REGISTRY, FluidAuthProvider, FluidProvider, FluidThemeProvider, MessagingScreen, buildThemeDefinition, createDefaultAuthRedirect, createFluidClient, createFluidFileUploader, getActiveThemeId, isApiError, messagingScreenPropertySchema, normalizeComponentTree, toNavigationItem, toScreenDefinition, transformManifestToRepAppData, transformThemes, useFluidApi, useFluidAuthContext, useFluidContext, useMessagingAuth, useMessagingConfig, useThemeContext } from './chunk-VIITMYKW.js';
3
3
  import { ContactsScreen } from './chunk-CMF2FYTD.js';
4
4
  export { ContactsScreen, contactsScreenPropertySchema } from './chunk-CMF2FYTD.js';
5
5
  import { OrdersScreen } from './chunk-WFPYEYC7.js';
@@ -23,6 +23,8 @@ import { AppShellLayout } from '@fluid-app/rep-core/shell/AppShellLayout';
23
23
  import { useThemeMode, ThemeModeProvider } from '@fluid-app/rep-core/shell/ThemeModeContext';
24
24
  export { ThemeModeProvider, getThemeModeAttribute, useThemeMode } from '@fluid-app/rep-core/shell/ThemeModeContext';
25
25
  import { normalizeSlug, getSystemNavigationBySection, isSystemNavigationItem } from '@fluid-app/rep-core/navigation/system-navigation-items';
26
+ import { ScreenHeader } from '@fluid-app/rep-core/shell/ScreenHeader';
27
+ import { ScreenHeaderProvider } from '@fluid-app/rep-core/shell/ScreenHeaderContext';
26
28
  import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
27
29
  import { faEllipsis } from '@fortawesome/pro-regular-svg-icons/faEllipsis';
28
30
  import { faXmark } from '@fortawesome/pro-regular-svg-icons/faXmark';
@@ -1657,7 +1659,7 @@ function RequireAuth({
1657
1659
 
1658
1660
  // src/screens/index.ts
1659
1661
  var screenPropertySchemas = {
1660
- MessagingScreen: () => import('./MessagingScreen-BBINFP67.js').then((m) => m.messagingScreenPropertySchema),
1662
+ MessagingScreen: () => import('./MessagingScreen-6WDU3XE4.js').then((m) => m.messagingScreenPropertySchema),
1661
1663
  ContactsScreen: () => import('./ContactsScreen-33AJ5XUB.js').then((m) => m.contactsScreenPropertySchema),
1662
1664
  OrdersScreen: () => import('./OrdersScreen-IPPZLEYF.js').then((m) => m.ordersScreenPropertySchema),
1663
1665
  CustomersScreen: () => import('./CustomersScreen-E4HXBKV7.js').then((m) => m.customersScreenPropertySchema),
@@ -2410,17 +2412,21 @@ function AppShell({
2410
2412
  const mobileCurrentSection = findCurrentSection(mobileNavItems, baseSlug);
2411
2413
  const mobileSecondLevelTabs = mobileCurrentSection?.children ?? [];
2412
2414
  const currentNavItem = findNavItem(navItems, baseSlug);
2413
- const content = typeof children === "function" ? children({ currentSlug: activeSlug, currentNavItem }) : children ?? /* @__PURE__ */ jsx(
2414
- PageRouter,
2415
- {
2416
- currentSlug: activeSlug,
2417
- currentNavItem,
2418
- customPages,
2419
- screens,
2420
- baseSlug,
2421
- restParams
2422
- }
2423
- );
2415
+ const screenTitle = currentNavItem?.label || screens?.find((s) => s.id === currentNavItem?.screen_id)?.name || void 0;
2416
+ const content = typeof children === "function" ? children({ currentSlug: activeSlug, currentNavItem }) : children ?? /* @__PURE__ */ jsxs(ScreenHeaderProvider, { children: [
2417
+ /* @__PURE__ */ jsx(ScreenHeader, { title: screenTitle }),
2418
+ /* @__PURE__ */ jsx(
2419
+ PageRouter,
2420
+ {
2421
+ currentSlug: activeSlug,
2422
+ currentNavItem,
2423
+ customPages,
2424
+ screens,
2425
+ baseSlug,
2426
+ restParams
2427
+ }
2428
+ )
2429
+ ] });
2424
2430
  if (isLoading2 && !appData) {
2425
2431
  return /* @__PURE__ */ jsx(AppShellLoading, {});
2426
2432
  }