@salsita-ai/sdk 0.50.0-develop.d815756961 → 0.50.0-develop.d87b28256e
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/configurator/ConfiguratorApp.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +28 -1
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.d.ts +9 -0
- package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +1 -0
- package/dist/configurator/configuration-not-found-page/index.d.ts +1 -0
- package/dist/configurator/configuration-not-found-page/index.js +1 -1
- package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +12 -0
- package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -0
- package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
- package/dist/configurator/configurator-context/ViewportStateSync.d.ts +2 -2
- package/dist/configurator/configurator-context/ViewportStateSync.js +1 -1
- package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +6 -0
- package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +6 -0
- package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -0
- package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +12 -0
- package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -0
- package/dist/configurator/configurator-error-page/create-configurator-error-page.d.ts +9 -0
- package/dist/configurator/configurator-error-page/create-configurator-error-page.js +1 -0
- package/dist/configurator/configurator-error-page/index.d.ts +3 -0
- package/dist/configurator/configurator-error-page/index.js +1 -0
- package/dist/configurator/index.d.ts +2 -0
- package/dist/configurator/index.js +1 -1
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/pages/PresetCreationErrorPage.d.ts +1 -1
- package/dist/configurator/pages/PresetCreationErrorPage.js +1 -1
- package/dist/configurator/pages/default-configurator-elements.d.ts +3 -2
- package/dist/configurator/pages/default-configurator-elements.js +1 -1
- package/dist/configurator/pages/error-boundaries/GeneralErrorBoundary.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.d.ts +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +3 -3
- package/dist/configurator/ui/phoenix-layout-elements/header/common/horizontal-tabs/DesktopHorizontalTabs.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.d.ts +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -8
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/FinalizeActions.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/NextStepButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
- package/dist/docs/index.json +1 -1
- package/dist/docs/other-features/error-5xx.mdx +1 -1
- package/dist/docs/other-features/not-found-404.mdx +1 -1
- package/dist/docs/phoenix/configurator-interface.mdx +110 -58
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/layout-slots.mdx +11 -11
- package/dist/docs/phoenix/testing.mdx +1 -1
- package/dist/phoenix/services/swc.js +1 -1
- package/dist/react-sdk/domain-context/index.d.ts +2 -0
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.d.ts +57 -0
- package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.d.ts +61 -0
- package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.js +1 -0
- package/dist/react-sdk/elements/configurator-error-page-props.d.ts +20 -0
- package/dist/react-sdk/elements/configurator-error-page-props.js +1 -0
- package/dist/react-sdk/elements/index.d.ts +1 -0
- package/dist/react-sdk/handlers/FinalizeActionRunner.d.ts +13 -0
- package/dist/react-sdk/handlers/FinalizeActionRunner.js +1 -0
- package/dist/react-sdk/handlers/FinalizeActionsHost.d.ts +10 -0
- package/dist/react-sdk/handlers/FinalizeActionsHost.js +1 -0
- package/dist/react-sdk/handlers/FinalizeActionsProvider.d.ts +11 -0
- package/dist/react-sdk/handlers/FinalizeActionsProvider.js +1 -0
- package/dist/react-sdk/handlers/finalize-actions-context.d.ts +6 -0
- package/dist/react-sdk/handlers/finalize-actions-context.js +1 -0
- package/dist/react-sdk/handlers/finalize-actions-store.d.ts +23 -0
- package/dist/react-sdk/handlers/finalize-actions-store.js +1 -0
- package/dist/react-sdk/handlers/index.d.ts +5 -0
- package/dist/react-sdk/handlers/index.js +1 -1
- package/dist/react-sdk/handlers/use-finalize-action.d.ts +3 -2
- package/dist/react-sdk/handlers/use-finalize-action.js +1 -1
- package/dist/react-sdk/handlers/use-finalize-actions.d.ts +53 -0
- package/dist/react-sdk/handlers/use-finalize-actions.js +1 -0
- package/dist/react-sdk/index.d.ts +1 -0
- package/dist/react-sdk/index.js +1 -1
- package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +25 -0
- package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +1 -0
- package/dist/react-sdk/responsive-state/canvas-padding.d.ts +14 -0
- package/dist/react-sdk/responsive-state/canvas-padding.js +1 -0
- package/dist/react-sdk/responsive-state/index.d.ts +5 -0
- package/dist/react-sdk/responsive-state/index.js +1 -0
- package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +111 -0
- package/dist/react-sdk/responsive-state/responsive-state-manager.js +1 -0
- package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +10 -0
- package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +1 -0
- package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +11 -0
- package/dist/react-sdk/responsive-state/use-responsive-state.js +1 -0
- package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +9 -0
- package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.js +1 -1
- package/dist/ui-sdk/responsive-application/index.d.ts +1 -0
- package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +57 -0
- package/dist/ui-sdk/responsive-application/responsive-state-store.js +1 -0
- package/dist/ui-sdk/responsive-application/use-store-responsive-info.d.ts +7 -0
- package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -0
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{I18nProvider as o}from"@lingui/react";import{QueryClientProvider as i}from"@tanstack/react-query";import n from"mui-modal-provider";import{useEffect as t}from"react";import{standardWebComponentProperties as c}from"#package/domain";import{getAvailableLocales as a,resolveLocale as m}from"#package/i18n";import{ApplicationType as l,ApplicationTypeProvider as d,InvalidDeploymentReload as p,LoadingStateProvider as s,SessionServiceProvider as f,useApplicationQueryClient as u,useI18n as h,useSpecAlwaysExpand as g,useSpecAppLoader as x,useSpecPrefetchTextureUrls as j,useSpecPreview as k,useWebComponentProperty$ as
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{I18nProvider as o}from"@lingui/react";import{QueryClientProvider as i}from"@tanstack/react-query";import n from"mui-modal-provider";import{useEffect as t}from"react";import{standardWebComponentProperties as c}from"#package/domain";import{getAvailableLocales as a,resolveLocale as m}from"#package/i18n";import{ApplicationType as l,ApplicationTypeProvider as d,InvalidDeploymentReload as p,LoadingStateProvider as s,SessionServiceProvider as f,useApplicationQueryClient as u,useI18n as h,useSpecAlwaysExpand as g,useSpecAppLoader as x,useSpecPrefetchTextureUrls as j,useSpecPreview as k,useWebComponentProperty$ as v,useWebComponentPropertySetter as b,useWebComponentPropertyValue as y,useWebComponentReadonlySync as C}from"#package/react-sdk";import{SnackbarProvider as w}from"#package/ui-sdk";import{ConfiguratorDataProvider as E}from"./configurator-context/ConfiguratorDataProvider.js";import{ConfiguratorResponsiveProvider as I}from"./configurator-context/ConfiguratorResponsiveProvider.js";import{usePowerRoutingLifecycle as L}from"./configurator-context/configurator-routing/use-power-routing-lifecycle.js";import{ConfiguratorRoutingProvider as P,OnApplicationStartProvider as Z,OnRoutingReadyProvider as q,OnSessionReadyProvider as A,PresetSelectionProvider as B,PreviewApplicationProvider as D}from"./configurator-context/index.js";import{LoadingErrorBoundary as F}from"./pages/error-boundaries/LoadingErrorBoundary.js";import{GeneralErrorFallback as R,RootPage as S}from"./pages/index.js";import{SceneResourcesProvider as T}from"./scene/index.js";import{EncapsulatedConfiguratorTheme as U}from"./ui/index.js";import{AppLoader as z}from"./ui/phoenix-layout-elements/index.js";export const ConfiguratorApp=()=>{let G=u(),H=h(),J=x(),K=k(),M=g(),N=j(),O=b(c.locale),Q=v(c.locale);C(),t(()=>{let r=Q.subscribe(r=>{let e=m(r,a(H));H.activate(e)}),e=()=>{O(H.locale)};return H.on("change",e),()=>{r.unsubscribe(),H.removeListener("change",e)}},[Q,H,O]);let V=y(c.containerZIndex),W=y(c.power);return(L(),"off"===W)?null:r(d,{type:l.Configurator,children:r(i,{client:G,children:r(U,{children:r(s,{children:r(I,{containerZIndex:V,children:r(z,{mode:J,children:r(D,{alwaysExpand:M,preview:K,children:r(o,{i18n:H,children:r(w,{maxSnack:5,children:r(F,{FallbackComponent:R,children:r(T,{prefetchTextureUrls:N,children:r(Z,{children:r(f,{children:r(A,{children:"on"===W&&r(P,{children:r(E,{children:r(B,{children:r(q,{children:e(n,{children:[r(p,{}),r(S,{})]})})})})})})})})})})})})})})})})})})})};
|
|
@@ -3,7 +3,7 @@ import type { Observable } from 'rxjs';
|
|
|
3
3
|
import { OrthographicCamera, PerspectiveCamera } from 'three';
|
|
4
4
|
import type { ObservableWithLastValue, ValueOf } from '@salsita-ai/common/utils';
|
|
5
5
|
import { type DomainEntityId } from '#package/domain';
|
|
6
|
-
import type { CanvasPadding } from '#package/
|
|
6
|
+
import type { CanvasPadding } from '#package/react-sdk';
|
|
7
7
|
import type { ConfiguratorExtensionSelectors } from '../../selectors.js';
|
|
8
8
|
export declare const CameraControlType: {
|
|
9
9
|
readonly Perspective: 'perspective';
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type $DomainEntity, type ConfiguratorBuilder, type CreateCustomPhoenixEntityElement, type CreateCustomPhoenixLayoutElement, type CreateGetThemeHandler, type CreateGetWebComponentOptionsHandler, type CreatePhoenixHandler, type DomainEntity, type IsCreateRecipeUpdate, type IsReplaceRecipeUpdate, type TransformerBuilder, type TransformerFactory, type UpdateFactory, getIdSequence } from '#package/domain';
|
|
2
|
-
import { type CreateCollectFrontendDataHandler, type CreateFilterPublishedChunksHandler, type CreateNotAuthenticatedPage, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfiguratorMessages, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseSlice, type UseState, type UseStateValidity, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useLoadingStateValue } from '#package/react-sdk';
|
|
2
|
+
import { type CreateCollectFrontendDataHandler, type CreateFilterPublishedChunksHandler, type CreateNotAuthenticatedPage, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfiguratorMessages, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useLoadingStateValue } from '#package/react-sdk';
|
|
3
3
|
import { type CreatePhoenixIconSet } from '#package/ui-sdk';
|
|
4
4
|
import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
|
|
5
|
+
import { type CreateConfigurationNotFoundPage } from '../configuration-not-found-page/index.js';
|
|
5
6
|
import { type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type UseConfiguratorRouting, type UsePresetSelection, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
|
|
7
|
+
import { type CreateConfiguratorErrorPage } from '../configurator-error-page/index.js';
|
|
6
8
|
import { type CreateGetTextureProcessingMapHandler } from '../scene/index.js';
|
|
7
9
|
import type { UseUpdateEntityObjectSelection } from '../scene/scene-entity/drag-and-drop/use-updated-selection.js';
|
|
8
10
|
import { type CreateAppLoader, type CreateCanvasLoader, type CreateLayoutAdminUi, type CreateLayoutCustomOwnerUi, type CreateLayoutCustomReadUi, type CreateLayoutDialog, type CreateLayoutFooter, type CreateLayoutToolbarDesktop, type CreateLayoutToolbarDesktopFullScreen, type CreateLayoutToolbarReadDesktop, type CreateLayoutToolbarReadDesktopFullScreen, type CreateLayoutUserUi, type CreateToolbarHelp } from '../ui/index.js';
|
|
@@ -180,6 +182,16 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
180
182
|
* Creates a custom page shown when session authentication fails.
|
|
181
183
|
*/
|
|
182
184
|
createNotAuthenticatedPage: CreateNotAuthenticatedPage;
|
|
185
|
+
/**
|
|
186
|
+
* Creates the page shown when a configuration cannot be loaded or opened, replacing the built-in
|
|
187
|
+
* `ConfigurationNotFoundPage`.
|
|
188
|
+
*/
|
|
189
|
+
createConfigurationNotFoundPage: CreateConfigurationNotFoundPage;
|
|
190
|
+
/**
|
|
191
|
+
* Creates the page the configurator shows in production when it cannot go on, replacing the built-in
|
|
192
|
+
* `ConfiguratorErrorPage`.
|
|
193
|
+
*/
|
|
194
|
+
createConfiguratorErrorPage: CreateConfiguratorErrorPage;
|
|
183
195
|
/**
|
|
184
196
|
* Factory for creating transformers for entities.
|
|
185
197
|
* @deprecated Use {@link #transformerBuilder} instead.
|
|
@@ -353,6 +365,11 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
353
365
|
* finalize violations; call it once per component, wrapped in `PhoenixHandlerBoundary`
|
|
354
366
|
*/
|
|
355
367
|
useFinalizeAction: UseFinalizeAction;
|
|
368
|
+
/**
|
|
369
|
+
* The spec's finalize actions, each with its resolved texts and its own `run`, `isPending` and `error`, the
|
|
370
|
+
* primary one picked as the built-in footer picks it; call it anywhere and render the actions in a loop
|
|
371
|
+
*/
|
|
372
|
+
useFinalizeActions: UseFinalizeActions;
|
|
356
373
|
/**
|
|
357
374
|
* Returns component based on a filter specified
|
|
358
375
|
*/
|
|
@@ -495,6 +512,16 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
495
512
|
* buttons do
|
|
496
513
|
*/
|
|
497
514
|
useUndoRedo: UseUndoRedo;
|
|
515
|
+
/**
|
|
516
|
+
* The spec's tabs (`sidebarTabs` or `horizontalTabs`) with the active one, and switching between them, as the
|
|
517
|
+
* built-in tabs do
|
|
518
|
+
*/
|
|
519
|
+
useTabNavigation: UseTabNavigation<NAVIGATION_STATES>;
|
|
520
|
+
/**
|
|
521
|
+
* The spec's steps (`navigationSteps`) with the active one, and moving between them, as the built-in step buttons
|
|
522
|
+
* and the header's stepper do
|
|
523
|
+
*/
|
|
524
|
+
useStepNavigation: UseStepNavigation<NAVIGATION_STATES>;
|
|
498
525
|
/**
|
|
499
526
|
* Returns composition tree of the domain
|
|
500
527
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as r,createGetThemeHandler as t,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as
|
|
1
|
+
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as r,createGetThemeHandler as t,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as a,createUpdateFactory as s,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as u}from"#package/domain";import{createCollectFrontendDataHandler as d,createFilterPublishedChunksHandler as f,createNotAuthenticatedPage as c,isAngleDimensionUpdate as g,isAttributeSelectionUpdate as j,isAttributeSwitchUpdate as x,isDeleteEntityUpdate as l,isDistanceDimensionUpdate as y,isGenericDimensionUpdate as k,isSwatchSelectionUpdate as h,isTextValueUpdate as S,useAccessService as E,useActiveNavigationState as I,useActiveToolState as q,useActiveViewState as A,useAnalyticsService as B,useAngleDimension as C,useAttributeSelection as P,useAttributeSwitch as R,useAuthenticatedClient as U,useAuthorizedClient as b,useBackendData as v,useChildEntitySelection as w,useCommittedSlice as z,useCommittedState as D,useComponent as F,useComponents as G,useComposition as H,useConfigurationId as J,useConfiguratorMessages as K,useControlViolations as L,useCookRecipes as M,useCookReplaceRecipes as N,useCookedRecipes as O,useCookedReplaceRecipes as Q,useCreateAuthorizedClient as T,useDeleteEntity as V,useDeletedEntity as W,useDeselect as X,useDistanceDimension as Y,useDistanceDimensionSelection as Z,useDomain as $,useDomainApplication as _,useDomainApplicationProps as ee,useDomainEntityRenderedState as er,useDomainEntityState as et,useEntityPrice as eo,useEntitySelector as ei,useFinalizeAction as en,useFinalizeActions as ea,useFinalizeViolations as es,useFirstComponent as em,useFirstRenderedComponent as ep,useFirstRootComponent as eu,useFirstRootRenderedComponent as ed,useFrontendData as ef,useGenericDimension as ec,useGroupedRecipeOptions as eg,useHoveredDomainEntityId as ej,useHoveredEntity as ex,useHoveredEntityId as el,useIntegrationService as ey,useIntegrationState as ek,useIsFullscreenActive as eh,useLoadedData as eS,useLoadingState as eE,useLoadingStateValue as eI,useMapViolationHints as eq,useNavigate as eA,usePopNavigate as eB,usePresetEmbeddedState as eC,usePublishedData as eP,usePushNavigate as eR,useRecipeEmbeddedState as eU,useRenderedComponent as eb,useRenderedComponents as ev,useRenderedEntitySelector as ew,useRenderedRootEntitySelector as ez,useRenderedSelector as eD,useRenderedSelector$ as eF,useRenderedSlice as eG,useRenderedState as eH,useReplaceEntityRecipeOptions as eJ,useRootComponents as eK,useRootEntityId as eL,useRootEntityPrice as eM,useRootEntityRenderedId as eN,useRootEntityRenderedState as eO,useRootEntitySelector as eQ,useRootEntityState as eT,useRootRenderedComponents as eV,useSelectEntity as eW,useSelectParent as eX,useSelectedDomainEntityId as eY,useSelectedEntity as eZ,useSelectedEntityId as e$,useSession as e_,useSessionRole as e0,useSessionService as e1,useSetFullscreen as e2,useSetViewState as e3,useStateValidity as e4,useStepNavigation as e5,useStoreSelector as e6,useStoreSelector$ as e7,useSwatchSelection as e8,useTabNavigation as e9,useTextValue as re,useUndoRedo as rr,useUpdateControl as rt,useUpdatedControl as ro}from"#package/react-sdk";import{createPhoenixIconSet as ri}from"#package/ui-sdk";import{useConfigurator as rn}from"../application-runtime/index.js";import{createConfigurationNotFoundPage as ra}from"../configuration-not-found-page/index.js";import{createOnApplicationStartProvider as rs,createOnBackendDataReadyProvider as rm,createOnConfiguratorReadyProvider as rp,createOnFrontendDataReadyProvider as ru,createOnGoToIndexHandler as rd,createOnPresetLoadedHandler as rf,createOnPublishedDataReadyProvider as rc,createOnRoutingReadyProvider as rg,createOnSessionReadyProvider as rj,useConfiguratorRouting as rx,usePresetSelection as rl,usePropertyPageStack as ry,usePropertyPageState as rk}from"../configurator-context/index.js";import{createConfiguratorErrorPage as rh}from"../configurator-error-page/index.js";import{createGetTextureProcessingMapHandler as rS}from"../scene/index.js";import{useUpdateEntityObjectSelection as rE}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{createAppLoader as rI,createCanvasLoader as rq,createLayoutAdminUi as rA,createLayoutCustomOwnerUi as rB,createLayoutCustomReadUi as rC,createLayoutDialog as rP,createLayoutFooter as rR,createLayoutToolbarDesktop as rU,createLayoutToolbarDesktopFullScreen as rb,createLayoutToolbarReadDesktop as rv,createLayoutToolbarReadDesktopFullScreen as rw,createLayoutUserUi as rz,createToolbarHelp as rD}from"../ui/index.js";import{useGenerateShareLink as rF}from"../ui/phoenix-layout-elements/share/use-share.js";import{createPresetDeviceNotSupported as rG,createPresetPageAction as rH,createPresetUi as rJ}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as rK}from"./use-reset-camera.js";export const createConfiguratorInterface=rL=>({updates:s(),getIdSequence:m,createGetWebComponentOptionsHandler:o,createGetThemeHandler:t,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:r,createPhoenixIconSet:ri,createGetTextureProcessingMapHandler:rS,createCollectFrontendDataHandler:d,createFilterPublishedChunksHandler:f,createOnGoToIndexHandler:rd,createOnApplicationStartProvider:rs,createOnSessionReadyProvider:rj,createOnPublishedDataReadyProvider:rc,createOnFrontendDataReadyProvider:ru,createOnBackendDataReadyProvider:rm,createOnRoutingReadyProvider:rg,createOnConfiguratorReadyProvider:rp,createOnPresetLoadedHandler:rf,createPresetUi:rJ,createPresetPageAction:rH,createPresetDeviceNotSupported:rG,createLayoutFooter:rR,createAppLoader:rI,createCanvasLoader:rq,createLayoutDialog:rP,createLayoutToolbarDesktop:rU,createLayoutToolbarDesktopFullScreen:rb,createLayoutToolbarReadDesktop:rv,createLayoutToolbarReadDesktopFullScreen:rw,createLayoutCustomOwnerUi:rB,createLayoutCustomReadUi:rC,createLayoutAdminUi:rA,createLayoutUserUi:rz,createToolbarHelp:rD,createNotAuthenticatedPage:c,createConfigurationNotFoundPage:ra,createConfiguratorErrorPage:rh,createTransformer:n,transformerBuilder:a(),useAnalytics:B,useAuthenticatedClient:U,useAuthorizedClient:b,useCreateAuthorizedClient:T,useAccessService:E,useConfigurationId:J,useSession:e_,useSessionRole:e0,useSessionService:e1,useDomain:$,useDomainApplication:_,useConfigurator:rn,useConfiguratorRouting:rx,usePresetSelection:rl,usePublishedData:eP,useFrontendData:ef,useBackendData:v,useDomainApplicationProps:ee,useLoadedData:eS,useIntegrationService:ey,useIntegrationState:ek,usePresetEmbeddedState:eC,useRecipeEmbeddedState:eU,useCommittedSlice:z,useRenderedSlice:eG,useCommittedState:D,useRenderedState:eH,useStoreSelector:e6,useRenderedSelector:eD,useStoreSelector$:e7,useRenderedSelector$:eF,useEntitySelector:ei,useRenderedEntitySelector:ew,useRootEntitySelector:eQ,useRenderedRootEntitySelector:ez,useStateValidity:e4,useMapViolationHints:eq,useNavigate:eA,usePopNavigate:eB,usePushNavigate:eR,useControlViolations:L,useFinalizeViolations:es,useConfiguratorMessages:K,useFinalizeAction:en,useFinalizeActions:ea,useComponent:F,useRenderedComponent:eb,useComponents:G,useRenderedComponents:ev,useFirstComponent:em,useFirstRenderedComponent:ep,useRootComponents:eK,useRootRenderedComponents:eV,useFirstRootComponent:eu,useFirstRootRenderedComponent:ed,useEntityState:et,useEntityRenderedState:er,useRootEntityState:eT,useRootEntityRenderedState:eO,useRootEntityId:eL,useRootEntityRenderedId:eN,useEntityPrice:eo,useRootEntityPrice:eM,useSelectedEntity:eZ,useSelectedEntityId:e$,useSelectedDomainEntityId:eY,useSelectEntity:eW,useDeselect:X,useSelectParent:eX,useHoveredEntity:ex,useHoveredEntityId:el,useHoveredDomainEntityId:ej,useActiveNavigationState:I,useActiveViewState:A,useSetViewState:e3,useActiveToolState:q,useIsFullscreenActive:eh,useSetFullscreen:e2,useResetCamera:rK,useUndoRedo:rr,useTabNavigation:e9,useStepNavigation:e5,useComposition:H,useUpdateControl:rt,useUpdatedControl:ro,useCookRecipes:M,useCookedRecipes:O,useCookReplaceRecipes:N,useCookedReplaceRecipes:Q,useDeleteEntity:V,useDeletedEntity:W,useSwatchSelection:e8,useTextValue:re,useAttributeSelection:P,useAttributeSwitch:R,useDistanceDimension:Y,useDistanceDimensionSelection:Z,useGenericDimension:ec,useAngleDimension:C,useChildEntitySelection:w,useGroupedRecipeOptions:eg,useReplaceEntityRecipeOptions:eJ,useUpdateEntityObjectSelection:rE,useGenerateShareLink:rF,useLoadingState:eE,useLoadingStateValue:eI,usePropertyPageStack:ry,usePropertyPageState:rk,isCreateEntityUpdate:p,isReplaceEntityUpdate:u,isDeleteEntityUpdate:l,isAngleDimensionUpdate:g,isDistanceDimensionUpdate:y,isGenericDimensionUpdate:k,isAttributeSelectionUpdate:j,isAttributeSwitchUpdate:x,isTextValueUpdate:S,isSwatchSelectionUpdate:h});
|
package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PhoenixLayoutElementRegistration } from '#package/domain';
|
|
2
|
+
import type { ConfigurationNotFoundPageProps } from '#package/react-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Registers a project's "configuration not accessible" page as the `ConfigurationNotFoundPage`
|
|
5
|
+
* element, with its props typed. Registering a layout element under that name with
|
|
6
|
+
* `createCustomPhoenixLayoutElement` works too, but its component is typed as taking only `children`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createConfigurationNotFoundPage: (Element: (props: ConfigurationNotFoundPageProps) => JSX.Element) => PhoenixLayoutElementRegistration;
|
|
9
|
+
export type CreateConfigurationNotFoundPage = (Element: (props: ConfigurationNotFoundPageProps) => JSX.Element) => PhoenixLayoutElementRegistration;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{ConfigurationNotFoundPageName as t}from"./ConfigurationNotFoundPageElement.js";export const createConfigurationNotFoundPage=n=>o(t,n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ConfigurationNotFoundPageElement,ConfigurationNotFoundPageName}from"./ConfigurationNotFoundPageElement.js";
|
|
1
|
+
export{ConfigurationNotFoundPageElement,ConfigurationNotFoundPageName}from"./ConfigurationNotFoundPageElement.js";export{createConfigurationNotFoundPage}from"./create-configuration-not-found-page.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
interface ConfiguratorResponsiveProviderProps {
|
|
3
|
+
readonly children: ReactNode;
|
|
4
|
+
readonly containerZIndex: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Gives the configurator its responsive state for as long as it is mounted, and renders the root
|
|
8
|
+
* container that measures itself into that state. The lifecycle reads the state from the runtime
|
|
9
|
+
* provider, the UI through `useResponsive()`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ConfiguratorResponsiveProvider: (props: ConfiguratorResponsiveProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{useState as e}from"react";import{ResponsiveStateManager as o,ResponsiveStateProvider as t}from"#package/react-sdk";import{ResponsiveApplicationProvider as a}from"#package/ui-sdk";export const ConfiguratorResponsiveProvider=i=>{let{children:n,containerZIndex:m}=i,[c]=e(()=>new o);return r(t,{manager:c,children:r(a,{containerZIndex:m,store:c,children:n})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{createContext as r,useCallback as t,useContext as o,useEffect as i,useMemo as a,useState as n}from"react";import{match as s}from"ts-pattern";import{standardWebComponentProperties as d}from"#package/domain";import{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{createContext as r,useCallback as t,useContext as o,useEffect as i,useMemo as a,useState as n}from"react";import{match as s}from"ts-pattern";import{standardWebComponentProperties as d}from"#package/domain";import{useResponsiveState as m,useResponsiveStateManager as p,useWebComponentPropertyState as u,useWebComponentPropertyValue as w}from"#package/react-sdk";let h=r(null);export const PreviewContextProvider=r=>{let{children:o,preview:v,alwaysExpand:c}=r,[f,x]=n(!0),[l,P]=u(d.expanded),g=w(d.mode),k=w(d.power),{isMobile:C}=m(),{expand:b,collapse:j,show:y,hide:E}=p(),q=t(()=>{x(!1),(c||C)&&P(!0)},[C,c,P]),z=t(()=>{x(!0),P(!1)},[P]),A=a(()=>!!l||"configurator"===g&&s(v).with("hide",()=>!1).with("never",()=>!1).with("always",()=>!0).with("auto",()=>C).exhaustive(),[v,l,C,g]),B=!l&&A&&f,D="hide"===v&&!l&&"configurator"===g,F=a(()=>({isPreview:B,isExpanded:l,enter:q,leave:z,isPreviewEnabled:A,isHidden:D}),[B,l,q,z,A,D]),G=s(k).with("on",()=>!0).with("standby","off",()=>!1).exhaustive();return i(()=>{l&&G?b():j()},[l,b,j,G]),i(()=>{D?E():y()},[D,E,y]),e(h.Provider,{value:F,children:o})};export const usePreview=()=>{let e=o(h);if(!e)throw Error("Context was not provided - usePreview must be used inside PreviewContext provider");return e};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Viewport } from '#package/domain';
|
|
2
|
-
import { type
|
|
3
|
-
type ViewportFlags = Pick<
|
|
2
|
+
import { type ResponsiveState } from '#package/react-sdk';
|
|
3
|
+
type ViewportFlags = Pick<ResponsiveState, 'isPhone' | 'isMobile' | 'isTablet' | 'isDesktop' | 'isLandscape' | 'isPortrait'>;
|
|
4
4
|
/**
|
|
5
5
|
* Maps the responsive flags of the configurator container to the viewport classes stored in the domain.
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as t,useRef as e}from"react";import{useDomain as r
|
|
1
|
+
import{useEffect as t,useRef as e}from"react";import{useDomain as r,useResponsiveState as o}from"#package/react-sdk";let i=[["isPhone","phone"],["isMobile","mobile"],["isTablet","tablet"],["isDesktop","desktop"],["isLandscape","landscape"],["isPortrait","portrait"]];export const getActiveViewports=t=>i.filter(([e])=>t[e]).map(([,t])=>t);export const ViewportStateSync=()=>{let{storeSystem:i,navigationSystem:l}=r(),{isPhone:n,isMobile:p,isTablet:a,isDesktop:s,isLandscape:c,isPortrait:g}=o(),m=e(null);return t(()=>{let t,e=getActiveViewports({isPhone:n,isMobile:p,isTablet:a,isDesktop:s,isLandscape:c,isPortrait:g});0===e.length||(t=m.current,null!==t&&t.length===e.length&&t.every((t,r)=>t===e[r]))||(m.current=e,i.stageAndCommit([l.getViewportUpdate(e)]))},[n,p,a,s,c,g,i,l]),null};
|
|
@@ -43,6 +43,9 @@ export declare const useToolbarState: () => import("#package/domain").ToolbarCom
|
|
|
43
43
|
export declare const useEmbeddedModeActive: () => boolean;
|
|
44
44
|
export declare const usePresetEmbeddedModeActive: () => boolean;
|
|
45
45
|
export declare const useBackToPresetEnabled: () => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Use `phx.frontend.useStepNavigation()` instead. This API will be removed in a future version.
|
|
48
|
+
*/
|
|
46
49
|
export declare const useSteps: () => {
|
|
47
50
|
currentStep: import("#package/domain").NavigationStep | undefined;
|
|
48
51
|
progress: number;
|
|
@@ -51,5 +54,8 @@ export declare const useSteps: () => {
|
|
|
51
54
|
isLastStep: boolean;
|
|
52
55
|
previousStepDisabled: boolean;
|
|
53
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated Use `phx.frontend.useStepNavigation()` instead. This API will be removed in a future version.
|
|
59
|
+
*/
|
|
54
60
|
export declare const useHasSteps: () => boolean | null;
|
|
55
61
|
export declare const useHeaderStyle: () => 'none' | 'floating' | 'fixed';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ConfiguratorErrorPageProps } from '#package/react-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The configurator's built-in production error page, the default `ConfiguratorErrorPage`
|
|
4
|
+
* registration and the page shown when a project's error page throws.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BuiltInConfiguratorErrorPage: (props: ConfiguratorErrorPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{match as t}from"ts-pattern";import{ErrorPage as o}from"#package/ui-sdk";export const BuiltInConfiguratorErrorPage=r=>{let{reason:n,onRetry:i}=r;return t(n).with("presetCreationFailed",()=>e(o,{title:"Whoops, something went wrong!",message:"We couldn't start configuring from this preset. Please reload the page and try again.",buttonLabel:"Reload page",onButtonClick:i})).with("uncaughtError",()=>e(o,{title:"Whoops, something went wrong!",message:"We're experiencing some technical difficulties right now. Please try again in a few minutes. Thank you for your patience!",buttonLabel:"Try Again",onButtonClick:i})).exhaustive()};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ConfiguratorErrorPageProps } from '#package/react-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The name a project registers a layout element under to replace the configurator's production error
|
|
4
|
+
* page. Its default, `BuiltInConfiguratorErrorPage`, is registered in `defaultConfiguratorElements`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ConfiguratorErrorPageName = "ConfiguratorErrorPage";
|
|
7
|
+
/**
|
|
8
|
+
* Renders the `ConfiguratorErrorPage` element. The page is shown after something already failed, so
|
|
9
|
+
* a registered page that throws in turn falls back to the built-in page instead of taking the
|
|
10
|
+
* configurator down; a hot reload that replaces or removes that page renders the element again.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ConfiguratorErrorPageElement: (props: ConfiguratorErrorPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{useCallback as e}from"react";import{ErrorBoundary as o}from"react-error-boundary";import{PhoenixLayoutElement as t,useLogger as a,usePhoenixElementSlots as n}from"#package/react-sdk";import{BuiltInConfiguratorErrorPage as i}from"./BuiltInConfiguratorErrorPage.js";export const ConfiguratorErrorPageName="ConfiguratorErrorPage";export const ConfiguratorErrorPageElement=g=>{let m=a(),{layoutElements:s}=n(),f=e(r=>{m.error("The ConfiguratorErrorPage element threw while rendering, so the built-in error page is shown instead. Fix the error in the registered ConfiguratorErrorPage element.",{},r)},[m]);return r(o,{fallback:r(i,{...g}),onError:f,resetKeys:[s[ConfiguratorErrorPageName]],children:r(t,{name:ConfiguratorErrorPageName,elementProps:{...g}})})};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PhoenixLayoutElementRegistration } from '#package/domain';
|
|
2
|
+
import type { ConfiguratorErrorPageProps } from '#package/react-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Registers a project's production error page as the `ConfiguratorErrorPage` element, with its props
|
|
5
|
+
* typed. Registering a layout element under that name with `createCustomPhoenixLayoutElement` works
|
|
6
|
+
* too, but its component is typed as taking only `children`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createConfiguratorErrorPage: (Element: (props: ConfiguratorErrorPageProps) => JSX.Element) => PhoenixLayoutElementRegistration;
|
|
9
|
+
export type CreateConfiguratorErrorPage = (Element: (props: ConfiguratorErrorPageProps) => JSX.Element) => PhoenixLayoutElementRegistration;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createCustomPhoenixLayoutElement as r}from"#package/domain";import{ConfiguratorErrorPageName as o}from"./ConfiguratorErrorPageElement.js";export const createConfiguratorErrorPage=a=>r(o,a);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { BuiltInConfiguratorErrorPage } from './BuiltInConfiguratorErrorPage.js';
|
|
2
|
+
export { ConfiguratorErrorPageElement, ConfiguratorErrorPageName } from './ConfiguratorErrorPageElement.js';
|
|
3
|
+
export { createConfiguratorErrorPage, type CreateConfiguratorErrorPage } from './create-configurator-error-page.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{BuiltInConfiguratorErrorPage}from"./BuiltInConfiguratorErrorPage.js";export{ConfiguratorErrorPageElement,ConfiguratorErrorPageName}from"./ConfiguratorErrorPageElement.js";export{createConfiguratorErrorPage}from"./create-configurator-error-page.js";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { ConfiguratorApp } from './ConfiguratorApp.js';
|
|
2
|
+
export { createConfigurationNotFoundPage, type CreateConfigurationNotFoundPage, } from './configuration-not-found-page/index.js';
|
|
3
|
+
export { createConfiguratorErrorPage, type CreateConfiguratorErrorPage } from './configurator-error-page/index.js';
|
|
2
4
|
export * from './application-runtime/index.js';
|
|
3
5
|
export * from './common/index.js';
|
|
4
6
|
export * from './configurator-context/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ConfiguratorApp}from"./ConfiguratorApp.js";export*from"./application-runtime/index.js";export*from"./common/index.js";export*from"./configurator-context/index.js";export*from"./pages/index.js";export*from"./scene/index.js";export*from"./ui/index.js";export*from"./integration/index.js";
|
|
1
|
+
export{ConfiguratorApp}from"./ConfiguratorApp.js";export{createConfigurationNotFoundPage}from"./configuration-not-found-page/index.js";export{createConfiguratorErrorPage}from"./configurator-error-page/index.js";export*from"./application-runtime/index.js";export*from"./common/index.js";export*from"./configurator-context/index.js";export*from"./pages/index.js";export*from"./scene/index.js";export*from"./ui/index.js";export*from"./integration/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as r}from"react/jsx-runtime";import e from"mui-modal-provider";import{memo as i,useCallback as n,useEffect as t}from"react";import{InvalidAccessKeyError as a}from"#package/client";import{BuiltInLoadingPhase as d,CommonAnalyticsFactory as s,DomainLifecycleBoundary as l,
|
|
1
|
+
import{jsx as o,jsxs as r}from"react/jsx-runtime";import e from"mui-modal-provider";import{memo as i,useCallback as n,useEffect as t}from"react";import{InvalidAccessKeyError as a}from"#package/client";import{BuiltInLoadingPhase as d,CommonAnalyticsFactory as s,DomainLifecycleBoundary as l,FinalizeActionsHost as c,FinalizeActionsProvider as u,LoadedDataProvider as f,PhoenixLayoutElement as m,useAccessService as g,useAnalyticsService as p,useAuthorizedClient as v,useConfiguratorDomainFactory as I,useConfiguratorLoadStatus as h,useConfiguratorRawLoadedData as j,useExpectPhase as C,useLoadedDataActions as k,useLoadingError as w,useLoadingPhase as b,useLogger as y,useRoutingService as x,useSpecAssistant as E}from"#package/react-sdk";import{useConfigurator as M}from"../application-runtime/index.js";import{IntegrationSubscription as D,OnConfiguratorReadyProvider as F,ViewportStateSync as L}from"../configurator-context/index.js";import{ConfiguratorNotFoundPage as T}from"./ConfiguratorNotFoundPage.js";import{ConfiguratorLayoutName as A}from"./configurator-layout-name.js";import{DevContextFallback as P}from"./error-boundaries/DevContextFallback.js";import{DevLoadingFallback as R}from"./error-boundaries/DevLoadingFallback.js";import{LoadingErrorBoundary as S}from"./error-boundaries/LoadingErrorBoundary.js";import{useLoad as V}from"./use-load.js";let q=i(()=>((()=>{let{assistantSystem:o}=M(),r=null!=E();t(()=>{if(r)return o.activate()},[o,r])})(),o(u,{children:o(e,{children:r(F,{children:[o(c,{}),o(m,{name:A})]})})})));export const LoadedConfiguratorDetailPage=()=>{C(d.SceneAssets);let{configurationId:e,accessInfo:i}=g(),t=v(),c=x(),u=y(),m=p(),{startConfiguratorLoad:E,completeConfiguratorLoad:M,failConfiguratorLoad:F,resetConfiguratorLoad:A}=k(),{isLoading:B,isError:G}=h(),N=j(),z=I(),H=n(()=>i.viewMode&&void 0!==i.revisionId?t.getConfigurationRevision(e,i.revisionId):t.getConfiguration(e),[i.revisionId,i.viewMode,t,e]),J=n(()=>{E()},[E]),K=n(o=>{M({initialRevisionId:o.revisionId,initialEntities:o.data,modelVersion:o.modelVersion,rootEntityType:o.rootEntityType,schemaIdentity:z}),m.push(s.ConfigurationLoaded(o.configurationId,o.revisionId,i.viewMode?"read":"owner")),u.appendToGlobalContext({configurationId:o.configurationId,revisionId:o.revisionId,mode:i.viewMode}),u.info("Configuration loaded.")},[i.viewMode,m,M,z,u]),O=n(o=>{if(F(o),o instanceof a)return void c.rejectAccessToken(e,i.raw);let r=o instanceof Error?o:Error("Configuration loading failed with an unknown error.",{cause:o});u.error("Configuration loading failed because the API request did not succeed. Verify the configuration ID and access token.",{configurationId:e},r)},[i.raw,e,F,u,c]),Q=n(()=>{A()},[A]);return(V({key:[t,e,i.revisionId,i.viewMode],load:H,onStart:J,onSuccess:K,onError:O,onCleanup:Q}),b({id:d.DataFetch,label:"Loading configuration…"},B),w(G),G)?o(T,{}):null===N?null:o(f,{value:N,children:o(S,{fallbackRender:r=>o(R,{...r}),children:o(l,{type:"configurator",children:o(S,{FallbackComponent:P,children:r(D,{children:[o(L,{}),o(q,{})]})})})})})};
|
|
@@ -4,7 +4,7 @@ interface PresetCreationErrorPageProps {
|
|
|
4
4
|
/**
|
|
5
5
|
* Page shown when creating a configuration from a preset fails. Renders the
|
|
6
6
|
* detailed `DevErrorPage` in development (with extra guidance for known errors)
|
|
7
|
-
* and the
|
|
7
|
+
* and the `ConfiguratorErrorPage` element in production. The action reloads the page rather
|
|
8
8
|
* than retrying, since the common causes are not resolved by a retry.
|
|
9
9
|
*/
|
|
10
10
|
export declare const PresetCreationErrorPage: (props: PresetCreationErrorPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Box as t,Typography as o}from"@mui/material";import{useCallback as a}from"react";import{isConfigurationSchemaMismatchError as i}from"#package/client";import{isStateMigrationError as n}from"#package/domain";import{useIsDev as d}from"#package/react-sdk";import{DevErrorPage as s}from"#package/ui-sdk";import{ConfiguratorErrorPageElement as l}from"../configurator-error-page/index.js";let m=a=>{let{heading:i,details:n}=a;return r(t,{component:"div",sx:{p:2,backgroundColor:"#ffebee",borderRadius:1,borderLeft:"4px solid #f44336"},children:[e(o,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:"error.main"},children:i}),e(o,{variant:"body2",sx:{mb:1},children:"Update the preset data to match the current model, or re-register/redeploy the schema. Details:"}),e(t,{component:"pre",sx:{m:0,p:1.5,backgroundColor:"#fff",borderRadius:1,border:"1px solid #e0e0e0",fontFamily:"monospace",fontSize:"0.75rem",whiteSpace:"pre-wrap",overflowX:"auto"},children:n})]})};export const PresetCreationErrorPage=r=>{let{error:t}=r,o=d(),c=a(()=>{window.location.reload()},[]);if(!o)return e(l,{reason:"presetCreationFailed",onRetry:c});let p=i(t)?{title:"Preset does not match the registered schema (Dev Mode)",heading:"⚠️ Preset data rejected by the configuration schema on the server",details:t.details}:n(t)?{title:"Preset could not be migrated to the current model (Dev Mode)",heading:"⚠️ Preset data is invalid for the current domain model",details:t.message}:null;return e(s,{title:p?.title??"Failed to create configuration (Dev Mode)",subtitle:"Creating a configuration from the preset failed. This detailed view is only visible in development mode.",errorName:t.name,errorMessage:t.message,errorStack:p?null:t.stack,error:t,onReset:c,resetLabel:"Reload page",children:p&&e(m,{heading:p.heading,details:p.details})})};
|
|
@@ -5,7 +5,8 @@ import { type ElementRegistration } from '#package/domain';
|
|
|
5
5
|
* loaded configuration, `ConfigurationNotFoundPage` the page shown when a configuration cannot be
|
|
6
6
|
* loaded or opened, `NotAuthenticatedPage` the page shown when session authentication fails or an
|
|
7
7
|
* anonymous visitor who may not create a configuration opens the start page, `PresetUi` the preset
|
|
8
|
-
* screen, and the others are the built-in
|
|
9
|
-
* sidebar-footer pieces under the spec kinds that YAML
|
|
8
|
+
* screen, `ConfiguratorErrorPage` the production error page, and the others are the built-in
|
|
9
|
+
* controls, toolbar buttons, menu actions and sidebar-footer pieces under the spec kinds that YAML
|
|
10
|
+
* names.
|
|
10
11
|
*/
|
|
11
12
|
export declare const defaultConfiguratorElements: readonly ElementRegistration[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{ConfigurationNotFoundPage as
|
|
1
|
+
import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{ConfigurationNotFoundPage as r,createNotAuthenticatedPage as t}from"#package/react-sdk";import{createConfigurationNotFoundPage as e}from"../configuration-not-found-page/index.js";import{BuiltInConfiguratorErrorPage as i,createConfiguratorErrorPage as m}from"../configurator-error-page/index.js";import{createPresetUi as a}from"../ui/index.js";import{DefaultConfiguratorLayout as f}from"./DefaultConfiguratorLayout.js";import{DefaultNotAuthenticatedPage as n}from"./DefaultNotAuthenticatedPage.js";import{DefaultPresetUi as p}from"./DefaultPresetUi.js";import{ConfiguratorLayoutName as u}from"./configurator-layout-name.js";import{domainControlElements as s,recipePanelElements as d,sidebarFooterElements as g,toolbarElements as c}from"./default-elements/index.js";export const defaultConfiguratorElements=[o(u,f),e(r),t(n),a(p),m(i),...s,...d,...c,...g];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Box as t,Stack as n,Typography as i}from"@mui/material";import{useApplicationRuntime as o,useIsDev as a}from"#package/react-sdk";import{DevErrorPage as l}from"#package/ui-sdk";import{ConfiguratorErrorPageElement as c}from"../../configurator-error-page/index.js";import{useResetOnEditorHotReload as d}from"./use-reset-on-editor-hot-reload.js";let s=()=>{let a=o();try{let o=a.selectors.domainContext.configurator;if(!o.getInitializationState().isCurrent)return null;let{storeSystem:l}=o.getDomainSystems(),c=l.stateSlices.committed.value,d=l.stateSlices.potentiallyInvalid.value,s=d.validity.valid||"uncaught"===d.validity.severity?[]:d.validity.entityViolations,m=s.length>0,p="reset"!==c.kind?c.updates:[];if(!m&&0===p.length)return null;return r(t,{component:"div",sx:{p:2,backgroundColor:m?"#ffebee":"#e3f2fd",borderRadius:1,borderLeft:m?"4px solid #f44336":"4px solid #2196f3"},children:[e(i,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:m?"error.main":"primary.main"},children:m?"⚠️ Error likely caused by invariant violations":"\uD83D\uDD04 Last state changes before error"}),m&&r(t,{component:"div",sx:{mb:2},children:[e(i,{variant:"body2",sx:{mb:1},children:"The following invariant violations were detected:"}),e(n,{component:"div",spacing:.5,children:s.map((e,t)=>r(i,{variant:"caption",sx:{fontFamily:"monospace",fontSize:"0.75rem",display:"block",pl:2},children:["• Entity ",String(e.entityId),": ",JSON.stringify(e.violation)]},t))})]}),p.length>0&&r(t,{component:"div",children:[r(i,{variant:"body2",sx:{mb:1},children:[p.length," update",1!==p.length?"s":""," applied just before the error:"]}),r(n,{component:"div",spacing:.5,children:[p.slice(0,5).map((e,t)=>{let n="";return"createDomainEntity"===e.kind?n=` (${e.entity.type})`:"deleteEntity"===e.kind||"modifyDomainEntity"===e.kind||"replaceDomainEntity"===e.kind?n=` (${e.entityId})`:("createEphemeralRecord"===e.kind||"modifyEphemeralRecord"===e.kind||"deleteEphemeralRecord"===e.kind)&&(n=` (${e.componentInstance.entityId})`),r(i,{variant:"caption",sx:{fontFamily:"monospace",fontSize:"0.75rem",display:"block",pl:2},children:["• ",e.kind,n]},t)}),p.length>5&&r(i,{variant:"caption",sx:{fontFamily:"monospace",fontSize:"0.75rem",display:"block",pl:2,fontStyle:"italic"},children:["... and ",p.length-5," more"]})]})]})]})}catch{return null}};export const DevGeneralErrorFallback=r=>{let{error:t,resetErrorBoundary:n}=r;return d(n),e(l,{title:"Application Error (Dev Mode)",subtitle:"An uncaught error occurred in the application. This detailed view is only visible in development mode.",errorName:t instanceof Error?t.name:"Error",errorMessage:t instanceof Error?t.message:String(t),errorStack:t instanceof Error?t.stack:null,error:t,onReset:n,resetLabel:"Try Again",children:e(s,{})})};export const ProdGeneralErrorFallback=r=>{let{resetErrorBoundary:t}=r;return e(c,{reason:"uncaughtError",onRetry:t})};export const GeneralErrorFallback=r=>a()?e(DevGeneralErrorFallback,{...r}):e(ProdGeneralErrorFallback,{...r});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const useMobileTabs: () => {
|
|
2
2
|
tabs: {
|
|
3
3
|
label: string;
|
|
4
|
-
icon: import("react").ReactNode;
|
|
4
|
+
icon: string | number | boolean | Iterable<import("react").ReactNode> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
5
5
|
value: string;
|
|
6
6
|
isActive: boolean;
|
|
7
7
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as
|
|
1
|
+
import{useCallback as t,useMemo as e}from"react";import{horizontalTabsComponent as o,sidebarTabsComponent as a}from"#package/domain";import{useComponents as n,useDomain as i,useResolveLocalizable as r,useSelectedDomainEntityId as s,useTabNavigation as c}from"#package/react-sdk";import{useIsSidebarSummaryActive as b}from"../../../../configurator-context/index.js";export const useMobileTabs=()=>{let{tabs:l,activeTab:m}=c(),{navigationSystem:p,storeSystem:d}=i(),h=n({componentTypes:[a],entityIds:[s()]}),f=n({componentTypes:[o]}),g=r(),u=b(),v=e(()=>l.map(t=>({label:t.label,icon:t.iconNode??t.icon,value:t.state,isActive:t.isActive})),[l]),y=t(t=>{d.stageAndCommit([p.getNavigationUpdate(t)])},[p,d]),T=m?.state??"none";if(h.length>0&&f.length>0)throw Error("Both sidebar tabs and horizontal tabs are configured, only one tabs component type can be used at a time, remove either sidebarTabs or horizontalTabs from your domain configuration");if(h.length>1)throw Error("Multiple sidebar tab components are active, only one sidebar tabs component can be active at a time, check your domain configuration to ensure only one sidebarTabs component is defined");if(f.length>1)throw Error("Multiple horizontal tab components are active, only one horizontal tabs component can be active at a time, check your domain configuration to ensure only one horizontalTabs component is defined");let k=[...h.flatMap(t=>t.state.tabs),...f.flatMap(t=>t.state.tabs)].find(t=>0===t.navigationStates.length);if(k)throw Error(`Tab ${g(k.label)} has no navigation states!`);return u?{tabs:[],activeTab:"none",onChange:()=>{}}:{tabs:v,activeTab:T,onChange:y}};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const useSidebarTabs: () => {
|
|
2
2
|
tabs: {
|
|
3
3
|
label: string;
|
|
4
|
-
icon: import("react").ReactNode;
|
|
4
|
+
icon: string | number | boolean | Iterable<import("react").ReactNode> | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
5
5
|
value: string;
|
|
6
6
|
isActive: boolean;
|
|
7
7
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as t,useMemo as a}from"react";import{sidebarTabsComponent as e}from"#package/domain";import{
|
|
1
|
+
import{useCallback as t,useMemo as a}from"react";import{sidebarTabsComponent as e}from"#package/domain";import{useComponents as o,useResolveLocalizable as n,useSelectedDomainEntityId as i,useTabNavigation as s}from"#package/react-sdk";import{useIsSidebarSummaryActive as r}from"../../../../configurator-context/index.js";export const useSidebarTabs=()=>{let{tabs:c,activeTab:b,select:m}=s({source:"sidebarTabs"}),p=o({componentTypes:[e],entityIds:[i()]}),d=n(),l=r(),f=a(()=>c.map(t=>({label:t.label,icon:t.iconNode??t.icon,value:t.state,isActive:t.isActive})),[c]),g=t(t=>{m(c.findIndex(a=>a.state===t))},[m,c]),v=b?.state??"none",T=p.flatMap(t=>t.state.tabs).find(t=>0===t.navigationStates.length);if(T)throw Error(`Tab ${d(T.label)} has no navigation states!`);return l?{tabs:[],activeTab:"none",onChange:()=>{}}:{tabs:f,activeTab:v,onChange:g}};
|
|
@@ -7,7 +7,7 @@ export interface LayoutSceneSafeAreaOptions {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Measures the gap between a full-area container and an inner "safe area" element,
|
|
10
|
-
* and writes the resulting gaps to the responsive
|
|
10
|
+
* and writes the resulting gaps to the responsive state as canvas padding — letting the
|
|
11
11
|
* 3D scene render only in the region not covered by overlay UI (preview body, sidebar, etc.).
|
|
12
12
|
*
|
|
13
13
|
* The implementation behind `useSceneSafeArea`, with the two things only the built-in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as t,useEffect as e,useRef as r}from"react";import{canvasPaddingComponent as n}from"#package/domain";import{useFirstComponent as o
|
|
1
|
+
import{useCallback as t,useEffect as e,useRef as r}from"react";import{canvasPaddingComponent as n}from"#package/domain";import{useFirstComponent as o,useResponsiveStateManager as a}from"#package/react-sdk";export const useLayoutSceneSafeArea=c=>{let{enabled:u,hasMiniSidebar:i}=c,{setCanvasPadding:l}=a(),m=r(null),s=r(null),f=r(null),h=r(null),g=r(0),p=r(()=>{}),b=o({componentTypes:[n]}),d=t(()=>{let t=s.current,e=f.current;if(!u||!t||!e)return;let r=t.getBoundingClientRect(),n=e.getBoundingClientRect();if(Math.abs(r.width-t.offsetWidth)>1||Math.abs(r.height-t.offsetHeight)>1){if(g.current+=1,g.current>60){g.current=0;return}m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(()=>p.current());return}g.current=0;let o={bottom:Math.max(0,r.bottom-n.bottom),left:Math.max(0,n.left-r.left),right:Math.max(0,r.right-n.right),top:Math.max(0,n.top-r.top)},a=i?.3:1,c=b?.state.bottom??1,h=b?.state.left??1,d=b?.state.right??a,A=b?.state.top??1;l({bottom:o.bottom*c,left:o.left*h,right:o.right*d,top:o.top*A})},[u,i,b?.state.bottom,b?.state.left,b?.state.right,b?.state.top,l]);p.current=d;let A=t(()=>{m.current&&cancelAnimationFrame(m.current),m.current=requestAnimationFrame(d)},[d]),M=t(()=>{h.current?.disconnect(),h.current=null},[]),x=t(()=>{let t=s.current,e=f.current;if(!u||!t||!e)return void M();M();let r=new ResizeObserver(A);r.observe(t),r.observe(e),h.current=r},[M,u,A]),F=t(t=>{s.current=t,x()},[x]),v=t(t=>{f.current=t,x()},[x]);return e(()=>(x(),()=>{M(),m.current&&cancelAnimationFrame(m.current)}),[x,M]),{containerRef:F,safeAreaRef:v,update:A}};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* A layout attaches `containerRef` to the element that covers the whole canvas and `safeAreaRef`
|
|
5
5
|
* to the region the scene should stay visible in. The hook measures the gap between the two,
|
|
6
|
-
* again whenever either element resizes, and writes it to the responsive
|
|
6
|
+
* again whenever either element resizes, and writes it to the responsive state as the canvas
|
|
7
7
|
* padding the camera frames the scene with.
|
|
8
8
|
*
|
|
9
9
|
* Returns:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{keyframes as a,styled as o}from"@mui/material";import{useRef as i}from"react";import{createCustomPhoenixLayoutElement as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{keyframes as a,styled as o}from"@mui/material";import{useRef as i}from"react";import{createCustomPhoenixLayoutElement as n}from"#package/domain";import{BuiltInLoadingPhase as s,PhoenixLayoutElement as p,useLoadingStateValue as m,useResponsiveState as c}from"#package/react-sdk";let l="AppLoaderContent";export const createAppLoader=t=>[n(l,()=>{let{phases:r}=m();return e(t,{phases:r})})];let d=a`
|
|
2
2
|
0% { transform: perspective(200px) rotateX(0deg) rotateY(0deg) }
|
|
3
3
|
50% { transform: perspective(200px) rotateX(-180deg) rotateY(0deg) }
|
|
4
4
|
100% { transform: perspective(200px) rotateX(-180deg) rotateY(-180deg) }
|
|
5
|
-
`,g=o("span")(({theme:e})=>({animation:`${
|
|
5
|
+
`,g=o("span")(({theme:e})=>({animation:`${d} 1s linear infinite`,aspectRatio:1,background:e.palette.primary.main,height:36})),x=a`
|
|
6
6
|
from { opacity: 0 }
|
|
7
7
|
to { opacity: 1 }
|
|
8
|
-
`,
|
|
8
|
+
`,f=o("div")({animation:`${x} 1000ms linear 300ms forwards`,opacity:0,display:"grid",inset:0,maxBlockSize:"var(--phx-app-height)",placeItems:"center",pointerEvents:"none",position:"absolute",transition:"inset 100ms ease-in-out",zIndex:9999}),u=()=>e(g,{});export const AppLoader=({mode:a="universal",children:o})=>{let{isLoading:n,hasError:d,phases:g,expectedPhaseIds:x}=m(),{canvasPadding:h}=c(),v=i(!1);if(g.some(e=>e.id===s.SceneAssets)&&(v.current=!0),"legacy"===a)return o;let y=x.has(s.SceneAssets)&&!v.current;return t(r,{children:[o,!d&&(n||y)&&e(f,{style:{inset:`${h.top}px ${h.right}px ${h.bottom}px ${h.left}px`},children:e(p,{name:l,elementProps:{},defaultSlot:u})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{Tab as a,Tabs as n}from"@mui/material";import{memo as e,useCallback as t}from"react";import{horizontalTabsComponent as r}from"#package/domain";import{useComponents as i,useTabNavigation as l}from"#package/react-sdk";import{PhxIcon as c}from"#package/ui-sdk";export const DesktopHorizontalTabs=e(()=>{let e=i({componentTypes:[r]}),{source:m,tabs:s,activeTab:p,select:u}=l({source:"horizontalTabs"}),b=t((o,a)=>{u(a)},[u]);if(null===m)return null;if(e.length>1)throw Error("Multiple horizontal tabs components are active, only one horizontal tabs component can be active at a time, check your domain configuration to ensure only one horizontalTabs component is defined");return o(n,{variant:"scrollable",value:!!p&&p.index,onChange:b,children:s.map(n=>o(a,{label:n.label,icon:n.icon?o(c,{name:n.icon}):void 0,iconPosition:"start"},n.index))})});
|
|
@@ -38,7 +38,7 @@ export interface ThemeableDesktopNavigationStepsProps extends OwnerState {
|
|
|
38
38
|
* - Renders horizontal step navigation for desktop layouts.
|
|
39
39
|
* - Hides when no navigation steps are available.
|
|
40
40
|
* - Integrates with MUI theming for customizable width behavior.
|
|
41
|
-
* - Retrieves steps
|
|
41
|
+
* - Retrieves the steps and moves between them with `useStepNavigation`.
|
|
42
42
|
*/
|
|
43
43
|
export declare const DesktopNavigationSteps: () => import("react/jsx-runtime").JSX.Element | null;
|
|
44
44
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{stepClasses as o,stepperClasses as e,styled as i,useThemeProps as r}from"@mui/material";import{
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{stepClasses as o,stepperClasses as e,styled as i,useThemeProps as r}from"@mui/material";import{useStepNavigation as n}from"#package/react-sdk";import{StepsNavigation as a}from"./StepsNavigation.js";let l="PhxDesktopStepsNavigation",d=i("div",{name:l,slot:"root",shouldForwardProp:t=>"ownerState"!==t})(({ownerState:t,theme:{spacing:i}})=>({flexGrow:1,marginBlock:i(1),marginInline:"auto",maxInlineSize:t.fullWidth?void 0:856,[`.${e.horizontal}`]:{overflow:"hidden"},[`.${o.horizontal}`]:{"&:first-child":{paddingInlineStart:0},"&:last-child":{paddingInlineEnd:0}}}));export const DesktopNavigationSteps=()=>{let{fullWidth:o=!1}=r({props:{fullWidth:void 0},name:l}),{steps:e,activeIndex:i,goTo:s}=n();return 0===e.length?null:t(d,{ownerState:{fullWidth:o},children:t(a,{steps:e,activeIndex:i,goTo:s})})};
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export
|
|
3
|
-
readonly navigationStates: readonly string[];
|
|
4
|
-
label: Localizable;
|
|
5
|
-
}
|
|
6
|
-
export interface StepsNavigationComponentProps {
|
|
7
|
-
steps: readonly TopNavigationStep[];
|
|
8
|
-
}
|
|
1
|
+
import { type UseStepNavigationResult } from '#package/react-sdk';
|
|
2
|
+
export type StepsNavigationComponentProps = Pick<UseStepNavigationResult, 'steps' | 'activeIndex' | 'goTo'>;
|
|
9
3
|
export declare const StepsNavigation: import("react").MemoExoticComponent<(props: StepsNavigationComponentProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{Trans as
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{Trans as o}from"@lingui/react";import{memo as a,useCallback as i}from"react";import{FrontendAnalyticsFactory as r,useAnalyticsService as s,usePresetEmbeddedState as c}from"#package/react-sdk";import{TopNavigation as p,useResponsive as l}from"#package/ui-sdk";import{useConfiguratorRouting as n,usePresetSelection as m}from"../../../../../configurator-context/index.js";export const StepsNavigation=a(a=>{let{steps:d,activeIndex:u,goTo:f}=a,g=s(),k=n(),{presetCategories:x}=m(),h=c(),C=x.flatMap(t=>t.presets).length>1,b=!h&&C,{isTablet:j}=l(),v=i(()=>{g.push(r.GoToProductsClicked()),k.goToIndex()},[g,k]);return e(p.Root,{activeStep:u+ +!!b,nonLinear:!0,compact:j,fullWidth:!0,children:[b&&t(p.Step,{isCompleted:!0,onClick:v,compact:j,children:t(o,{id:"sdk.layout.navigation.steps.first.label",message:"Products"})}),d.map(e=>{let o="complete"===e.status;return t(p.Step,{isCompleted:o,isDisabled:!o,compact:j,onClick:()=>f(e.index),children:e.label},e.label)})]})});
|