@salsita-ai/sdk 0.50.0-develop.f41849ae55 → 0.50.0-develop.f6390cb584
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/common/configurator-interface.d.ts +21 -2
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/index.d.ts +1 -0
- package/dist/configurator/index.js +1 -1
- package/dist/configurator/toolbar-actions/index.d.ts +2 -0
- package/dist/configurator/toolbar-actions/index.js +1 -0
- package/dist/configurator/toolbar-actions/use-assistant-panel.d.ts +18 -0
- package/dist/configurator/toolbar-actions/use-assistant-panel.js +1 -0
- package/dist/configurator/toolbar-actions/use-measurements.d.ts +35 -0
- package/dist/configurator/toolbar-actions/use-measurements.js +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LanguageMenuAction.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LanguageToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/MeasurementsMenuAction.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/MeasurementsToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/ShareToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/DimensionUnitSelector.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/share/ShareModal.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/share/use-share.d.ts +7 -8
- package/dist/configurator/ui/phoenix-layout-elements/share/use-share.js +1 -1
- package/dist/docs/index.json +1 -1
- package/dist/docs/layouts/custom-layout.mdx +1 -1
- package/dist/docs/phoenix/configurator-interface.mdx +11 -0
- package/dist/react-sdk/domain-context/index.d.ts +3 -0
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +8 -0
- package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.d.ts +24 -0
- package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.d.ts +32 -0
- package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.js +1 -0
- package/package.json +3 -3
- package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.d.ts +0 -4
- package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.js +0 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.d.ts +0 -4
- package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
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 UseActiveViewports, 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, useLocalizable, useResolveLocalizable } 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 UseActiveViewports, 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 UseLocaleSwitch, 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 UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
|
|
3
3
|
import { type CreatePhoenixIconSet } from '#package/ui-sdk';
|
|
4
4
|
import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
|
|
5
5
|
import { type CreateConfigurationNotFoundPage } from '../configuration-not-found-page/index.js';
|
|
@@ -8,8 +8,8 @@ import { type CreateConfiguratorErrorPage } from '../configurator-error-page/ind
|
|
|
8
8
|
import { useCloseAction } from '../integration/index.js';
|
|
9
9
|
import { type CreateGetTextureProcessingMapHandler } from '../scene/index.js';
|
|
10
10
|
import type { UseUpdateEntityObjectSelection } from '../scene/scene-entity/drag-and-drop/use-updated-selection.js';
|
|
11
|
+
import { type UseAssistantPanel, type UseMeasurements } from '../toolbar-actions/index.js';
|
|
11
12
|
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, LayoutSlots, useSceneSafeArea } from '../ui/index.js';
|
|
12
|
-
import { useGenerateShareLink } from '../ui/phoenix-layout-elements/share/use-share.js';
|
|
13
13
|
import { type CreatePresetDeviceNotSupported, type CreatePresetPageAction, type CreatePresetUi } from '../ui/preset-layout/PresetUi.js';
|
|
14
14
|
import { type UseResetCamera } from './use-reset-camera.js';
|
|
15
15
|
export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, FINALIZE_DATA extends Record<string, unknown>, FINALIZE_RESULT extends Record<string, unknown>> {
|
|
@@ -553,6 +553,25 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
553
553
|
* Turn one localizable text of the spec into a string in the current language
|
|
554
554
|
*/
|
|
555
555
|
useLocalizable: typeof useLocalizable;
|
|
556
|
+
/**
|
|
557
|
+
* The unit of dimensions and the dimension indicators, with functions that change them, as the toolbar's
|
|
558
|
+
* measurements button does
|
|
559
|
+
*/
|
|
560
|
+
useMeasurements: UseMeasurements;
|
|
561
|
+
/**
|
|
562
|
+
* The languages the configurator offers and the active one, with a function that switches it, as the toolbar's
|
|
563
|
+
* language button does
|
|
564
|
+
*/
|
|
565
|
+
useLocaleSwitch: UseLocaleSwitch;
|
|
566
|
+
/**
|
|
567
|
+
* Links that share the configuration for editing and for viewing, as the toolbar's share dialog generates them
|
|
568
|
+
*/
|
|
569
|
+
useShareLinks: UseShareLinks;
|
|
570
|
+
/**
|
|
571
|
+
* Whether the assistant panel is open, with a function that opens or closes it, as the toolbar's assistant button
|
|
572
|
+
* does
|
|
573
|
+
*/
|
|
574
|
+
useAssistantPanel: UseAssistantPanel;
|
|
556
575
|
/**
|
|
557
576
|
* Returns composition tree of the domain
|
|
558
577
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as
|
|
1
|
+
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as o,createGetThemeHandler as r,createGetWebComponentOptionsHandler as t,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as a,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createCollectFrontendDataHandler as f,createFilterPublishedChunksHandler as u,createNotAuthenticatedPage as c,isAngleDimensionUpdate as g,isAttributeSelectionUpdate as l,isAttributeSwitchUpdate as j,isDeleteEntityUpdate as x,isDistanceDimensionUpdate as k,isGenericDimensionUpdate as y,isSwatchSelectionUpdate as I,isTextValueUpdate as A,useAccessService as C,useActiveNavigationState as S,useActiveToolState as w,useActiveViewState as E,useActiveViewports as b,useAnalyticsService as q,useAngleDimension as B,useAttributeSelection as P,useAttributeSwitch as R,useAuthenticatedClient as U,useAuthorizedClient as h,useBackendData as v,useChildEntitySelection as z,useCommittedSlice as D,useCommittedState as F,useComponent as G,useComponents as H,useComposition as J,useConfigurationId as K,useConfiguratorMessages as L,useControlViolations as M,useCookRecipes as N,useCookReplaceRecipes as O,useCookedRecipes as Q,useCookedReplaceRecipes as T,useCreateAuthorizedClient as V,useDeleteEntity as W,useDeletedEntity as X,useDeselect as Y,useDistanceDimension as Z,useDistanceDimensionSelection as $,useDomain as _,useDomainApplication as ee,useDomainApplicationProps as eo,useDomainEntityRenderedState as er,useDomainEntityState as et,useEntityPrice as ei,useEntitySelector as en,useFinalizeAction as es,useFinalizeActions as ea,useFinalizeViolations as em,useFirstComponent as ep,useFirstRenderedComponent as ed,useFirstRootComponent as ef,useFirstRootRenderedComponent as eu,useFrontendData as ec,useGenerateShareLink as eg,useGenericDimension as el,useGroupedRecipeOptions as ej,useHoveredDomainEntityId as ex,useHoveredEntity as ek,useHoveredEntityId as ey,useIntegrationService as eI,useIntegrationState as eA,useIsFullscreenActive as eC,useLoadedData as eS,useLoadingState as ew,useLoadingStateValue as eE,useLocaleSwitch as eb,useLocalizable as eq,useMapViolationHints as eB,useNavigate as eP,usePopNavigate as eR,usePresetEmbeddedState as eU,usePublishedData as eh,usePushNavigate as ev,useRecipeEmbeddedState as ez,useRenderedComponent as eD,useRenderedComponents as eF,useRenderedEntitySelector as eG,useRenderedRootEntitySelector as eH,useRenderedSelector as eJ,useRenderedSelector$ as eK,useRenderedSlice as eL,useRenderedState as eM,useReplaceEntityRecipeOptions as eN,useResolveLocalizable as eO,useRootComponents as eQ,useRootEntityId as eT,useRootEntityPrice as eV,useRootEntityRenderedId as eW,useRootEntityRenderedState as eX,useRootEntitySelector as eY,useRootEntityState as eZ,useRootRenderedComponents as e$,useSelectEntity as e_,useSelectParent as e0,useSelectedDomainEntityId as e1,useSelectedEntity as e2,useSelectedEntityId as e3,useSession as e4,useSessionRole as e5,useSessionService as e6,useSetFullscreen as e7,useSetViewState as e8,useShareLinks as e9,useStateValidity as oe,useStepNavigation as oo,useStoreSelector as or,useStoreSelector$ as ot,useSwatchSelection as oi,useTabNavigation as on,useTextValue as os,useUndoRedo as oa,useUpdateControl as om,useUpdatedControl as op}from"#package/react-sdk";import{createPhoenixIconSet as od}from"#package/ui-sdk";import{useConfigurator as of}from"../application-runtime/index.js";import{createConfigurationNotFoundPage as ou}from"../configuration-not-found-page/index.js";import{createOnApplicationStartProvider as oc,createOnBackendDataReadyProvider as og,createOnConfiguratorReadyProvider as ol,createOnFrontendDataReadyProvider as oj,createOnGoToIndexHandler as ox,createOnPresetLoadedHandler as ok,createOnPublishedDataReadyProvider as oy,createOnRoutingReadyProvider as oI,createOnSessionReadyProvider as oA,useConfiguratorRouting as oC,usePresetSelection as oS,usePreview as ow,usePropertyPageStack as oE,usePropertyPageState as ob}from"../configurator-context/index.js";import{createConfiguratorErrorPage as oq}from"../configurator-error-page/index.js";import{useCloseAction as oB}from"../integration/index.js";import{createGetTextureProcessingMapHandler as oP}from"../scene/index.js";import{useUpdateEntityObjectSelection as oR}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as oU,useMeasurements as oh}from"../toolbar-actions/index.js";import{LayoutSlots as ov,createAppLoader as oz,createCanvasLoader as oD,createLayoutAdminUi as oF,createLayoutCustomOwnerUi as oG,createLayoutCustomReadUi as oH,createLayoutDialog as oJ,createLayoutFooter as oK,createLayoutToolbarDesktop as oL,createLayoutToolbarDesktopFullScreen as oM,createLayoutToolbarReadDesktop as oN,createLayoutToolbarReadDesktopFullScreen as oO,createLayoutUserUi as oQ,createToolbarHelp as oT,useSceneSafeArea as oV}from"../ui/index.js";import{createPresetDeviceNotSupported as oW,createPresetPageAction as oX,createPresetUi as oY}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as oZ}from"./use-reset-camera.js";export const createConfiguratorInterface=o$=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:t,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:o,createPhoenixIconSet:od,createGetTextureProcessingMapHandler:oP,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:u,createOnGoToIndexHandler:ox,createOnApplicationStartProvider:oc,createOnSessionReadyProvider:oA,createOnPublishedDataReadyProvider:oy,createOnFrontendDataReadyProvider:oj,createOnBackendDataReadyProvider:og,createOnRoutingReadyProvider:oI,createOnConfiguratorReadyProvider:ol,createOnPresetLoadedHandler:ok,createPresetUi:oY,createPresetPageAction:oX,createPresetDeviceNotSupported:oW,createLayoutFooter:oK,createAppLoader:oz,createCanvasLoader:oD,createLayoutDialog:oJ,createLayoutToolbarDesktop:oL,createLayoutToolbarDesktopFullScreen:oM,createLayoutToolbarReadDesktop:oN,createLayoutToolbarReadDesktopFullScreen:oO,createLayoutCustomOwnerUi:oG,createLayoutCustomReadUi:oH,createLayoutAdminUi:oF,createLayoutUserUi:oQ,createToolbarHelp:oT,createNotAuthenticatedPage:c,createConfigurationNotFoundPage:ou,createConfiguratorErrorPage:oq,createTransformer:n,transformerBuilder:s(),useAnalytics:q,useAuthenticatedClient:U,useAuthorizedClient:h,useCreateAuthorizedClient:V,useAccessService:C,useConfigurationId:K,useSession:e4,useSessionRole:e5,useSessionService:e6,useDomain:_,useDomainApplication:ee,useConfigurator:of,useConfiguratorRouting:oC,usePresetSelection:oS,usePublishedData:eh,useFrontendData:ec,useBackendData:v,useDomainApplicationProps:eo,useLoadedData:eS,useIntegrationService:eI,useIntegrationState:eA,usePresetEmbeddedState:eU,useRecipeEmbeddedState:ez,useCommittedSlice:D,useRenderedSlice:eL,useCommittedState:F,useRenderedState:eM,useStoreSelector:or,useRenderedSelector:eJ,useStoreSelector$:ot,useRenderedSelector$:eK,useEntitySelector:en,useRenderedEntitySelector:eG,useRootEntitySelector:eY,useRenderedRootEntitySelector:eH,useStateValidity:oe,useMapViolationHints:eB,useNavigate:eP,usePopNavigate:eR,usePushNavigate:ev,useControlViolations:M,useFinalizeViolations:em,useConfiguratorMessages:L,useFinalizeAction:es,useFinalizeActions:ea,useComponent:G,useRenderedComponent:eD,useComponents:H,useRenderedComponents:eF,useFirstComponent:ep,useFirstRenderedComponent:ed,useRootComponents:eQ,useRootRenderedComponents:e$,useFirstRootComponent:ef,useFirstRootRenderedComponent:eu,useEntityState:et,useEntityRenderedState:er,useRootEntityState:eZ,useRootEntityRenderedState:eX,useRootEntityId:eT,useRootEntityRenderedId:eW,useEntityPrice:ei,useRootEntityPrice:eV,useSelectedEntity:e2,useSelectedEntityId:e3,useSelectedDomainEntityId:e1,useSelectEntity:e_,useDeselect:Y,useSelectParent:e0,useHoveredEntity:ek,useHoveredEntityId:ey,useHoveredDomainEntityId:ex,useActiveNavigationState:S,useActiveViewState:E,useSetViewState:e8,useActiveToolState:w,useIsFullscreenActive:eC,useSetFullscreen:e7,useResetCamera:oZ,useUndoRedo:oa,useTabNavigation:on,useStepNavigation:oo,useSceneSafeArea:oV,useActiveViewports:b,usePreview:ow,useCloseAction:oB,useIsCloningAllowed:ov.useIsCloningAllowed,useResolveLocalizable:eO,useLocalizable:eq,useMeasurements:oh,useLocaleSwitch:eb,useShareLinks:e9,useAssistantPanel:oU,useComposition:J,useUpdateControl:om,useUpdatedControl:op,useCookRecipes:N,useCookedRecipes:Q,useCookReplaceRecipes:O,useCookedReplaceRecipes:T,useDeleteEntity:W,useDeletedEntity:X,useSwatchSelection:oi,useTextValue:os,useAttributeSelection:P,useAttributeSwitch:R,useDistanceDimension:Z,useDistanceDimensionSelection:$,useGenericDimension:el,useAngleDimension:B,useChildEntitySelection:z,useGroupedRecipeOptions:ej,useReplaceEntityRecipeOptions:eN,useUpdateEntityObjectSelection:oR,useGenerateShareLink:eg,useLoadingState:ew,useLoadingStateValue:eE,usePropertyPageStack:oE,usePropertyPageState:ob,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:x,isAngleDimensionUpdate:g,isDistanceDimensionUpdate:k,isGenericDimensionUpdate:y,isAttributeSelectionUpdate:l,isAttributeSwitchUpdate:j,isTextValueUpdate:A,isSwatchSelectionUpdate:I});
|
|
@@ -3,6 +3,7 @@ export { createConfigurationNotFoundPage, type CreateConfigurationNotFoundPage,
|
|
|
3
3
|
export { createConfiguratorErrorPage, type CreateConfiguratorErrorPage } from './configurator-error-page/index.js';
|
|
4
4
|
export * from './application-runtime/index.js';
|
|
5
5
|
export * from './common/index.js';
|
|
6
|
+
export * from './toolbar-actions/index.js';
|
|
6
7
|
export * from './configurator-context/index.js';
|
|
7
8
|
export * from './pages/index.js';
|
|
8
9
|
export * from './scene/index.js';
|
|
@@ -1 +1 @@
|
|
|
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
|
+
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"./toolbar-actions/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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{useMeasurements}from"./use-measurements.js";export{useAssistantPanel}from"./use-assistant-panel.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a project layout needs to open and close the assistant panel.
|
|
3
|
+
* - `available`: whether the spec has an `assistant`; the built-in assistant button renders nothing otherwise.
|
|
4
|
+
* - `open` and `setOpen`: whether the panel is open, and a function that opens or closes it.
|
|
5
|
+
* - `hasUnreadReply`: whether the assistant replied while the panel was closed.
|
|
6
|
+
*/
|
|
7
|
+
export interface UseAssistantPanelResult {
|
|
8
|
+
readonly available: boolean;
|
|
9
|
+
readonly open: boolean;
|
|
10
|
+
readonly hasUnreadReply: boolean;
|
|
11
|
+
readonly setOpen: (open: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export type UseAssistantPanel = () => UseAssistantPanelResult;
|
|
14
|
+
/**
|
|
15
|
+
* Hook to open and close the assistant panel, as the built-in toolbar's assistant button does. The panel itself
|
|
16
|
+
* renders only inside `LayoutSlots.DesktopSidebar`, so a layout without it has no panel to open.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useAssistantPanel: UseAssistantPanel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMemo as e}from"react";import{useEagerObservableValue as t,useSpecAssistant as a}from"#package/react-sdk";import{useConfigurator as r}from"../application-runtime/index.js";export const useAssistantPanel=()=>{let{assistantSystem:n}=r(),p=a(),{open:i,hasUnreadReply:o}=t(n.panel$);return e(()=>({available:null!=p,open:i,hasUnreadReply:o,setOpen:n.setOpen}),[p,i,o,n])};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type DimensionUnit } from '#package/domain';
|
|
2
|
+
export interface UseMeasurementsOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the dimension-indicator switch is offered, overriding `applicationConfig.indicatorSwitch`; the
|
|
5
|
+
* `showIndicatorSwitch` prop of the built-in measurements button
|
|
6
|
+
*/
|
|
7
|
+
readonly showIndicatorSwitch?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* What a project layout needs to offer the measurement settings.
|
|
11
|
+
* - `units`: the units the spec's dimension configuration offers; with one there is nothing to choose.
|
|
12
|
+
* - `unit` and `setUnit`: the unit dimensions are shown in, and a function that changes it and pushes the
|
|
13
|
+
* analytics event of the built-in unit buttons.
|
|
14
|
+
* - `hasIndicatorSwitch`: whether the dimension indicators can be switched on and off (`showIndicatorSwitch`,
|
|
15
|
+
* else `applicationConfig.indicatorSwitch`, else `true`).
|
|
16
|
+
* - `indicatorsShown` and `toggleIndicators`: whether the dimension indicators show in the scene, and a function
|
|
17
|
+
* that switches them and pushes the analytics event of the built-in switch.
|
|
18
|
+
* - `available`: whether there is anything to set, more than one unit or the indicator switch; the built-in
|
|
19
|
+
* measurements button renders nothing otherwise.
|
|
20
|
+
*/
|
|
21
|
+
export interface UseMeasurementsResult {
|
|
22
|
+
readonly units: readonly DimensionUnit[];
|
|
23
|
+
readonly unit: DimensionUnit;
|
|
24
|
+
readonly setUnit: (unit: DimensionUnit) => void;
|
|
25
|
+
readonly hasIndicatorSwitch: boolean;
|
|
26
|
+
readonly indicatorsShown: boolean;
|
|
27
|
+
readonly toggleIndicators: () => void;
|
|
28
|
+
readonly available: boolean;
|
|
29
|
+
}
|
|
30
|
+
export type UseMeasurements = (options?: UseMeasurementsOptions) => UseMeasurementsResult;
|
|
31
|
+
/**
|
|
32
|
+
* Hook to read and change the measurement settings, the unit of dimensions and the dimension indicators in the
|
|
33
|
+
* scene, as the built-in toolbar's measurements button does. It does not check read mode.
|
|
34
|
+
*/
|
|
35
|
+
export declare const useMeasurements: UseMeasurements;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useObservableEagerState as o}from"observable-hooks";import{useCallback as i,useMemo as t}from"react";import{applicationConfigComponent as e}from"#package/domain";import{FrontendAnalyticsFactory as n,useAnalyticsService as r,useDimensionConfig as a,useDimensionState as s,useDimensions as m,useFirstRootComponent as c}from"#package/react-sdk";import{useConfigurator as p}from"../application-runtime/index.js";export const useMeasurements=(l={})=>{let{showIndicatorSwitch:d}=l,u=r(),{canvasSystem:g}=p(),h=c(e),{availableDimensions:f}=a(),{unit:k}=s(),{setGlobalUnit:b}=m(),D=o(g.dimensionIndicatorShown$),I=d??h?.state.indicatorSwitch??!0,v=i(o=>{u.push(n.GlobalDimensionsButtonClicked(o)),b(o)},[u,b]),w=i(()=>{u.push(n.DimensionIndicatorsToggled()),g.toggleDimensionIndicator()},[u,g]);return t(()=>({units:f,unit:k,setUnit:v,hasIndicatorSwitch:I,indicatorsShown:D,toggleIndicators:w,available:f.length>1||I}),[f,k,v,I,D,w])};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{Badge as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Badge as o}from"@mui/material";import{memo as r,useCallback as a}from"react";import{assistantToolbarButtonSchema as s,createPhoenixLayoutElement as i}from"#package/domain";import{useLocalizable as e}from"#package/react-sdk";import{DesktopToolbar as m,PhxIcon as n,useResponsive as l}from"#package/ui-sdk";import{useAssistantPanel as c}from"../../toolbar-actions/index.js";let p={id:"sdk.assistant.toolbarButton.label",message:"Assistant"};export const AssistantToolbarButton=i({schema:s,component:r(r=>{let{icon:s,showTitle:i=!0}=r,{available:d,open:u,hasUnreadReply:k,setOpen:f}=c(),b=e(p),{isPhone:A,isTablet:g}=l(),x=a(()=>{f(!u)},[f,u]);return d?t(m.Button,{title:b,onClick:x,showTitle:i&&!A&&!g,"aria-pressed":u,sx:{'&[aria-pressed="true"]':{backgroundColor:"action.selected"}},children:t(o,{color:"primary",variant:"dot",overlap:"circular",invisible:!k,children:t(n,{name:s??(u?"CustomAiAssistantBold":"CustomAiAssistant")})})}):null})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Trans as n}from"@lingui/react";import{Button as o,DialogActions as r,DialogContent as i,DialogTitle as l,ListItemText as t,MenuItem as m,MenuList as s,menuItemClasses as c,styled as g}from"@mui/material";import{memo as u,useCallback as d}from"react";import{createPhoenixLayoutElement as p,languageMenuActionSchema as h}from"#package/domain";import{useLocaleSwitch as x}from"#package/react-sdk";import{LocaleIcon as f}from"./language/LocaleIcon.js";import{useMenuRouting as C}from"./menu-actions/MenuRoutingContext.js";import{RoutingMenuAction as k}from"./menu-actions/RoutingMenuAction.js";let y=g(s)(({theme:{spacing:e}})=>({columnGap:e(2),display:"grid",gridTemplateColumns:"min-content auto",[`.${c.root}`]:{display:"grid",gridColumn:"1 / -1",gridTemplateColumns:"subgrid"}}));export const LanguageMenuAction=p({schema:h,component:u(()=>{let{locales:s,locale:c,setLocale:g}=x(),{close:u}=C(),p=d(e=>{g(e),u()},[g,u]);return a(k,{label:e(n,{id:"sdk.layout.hamburgerMenu.language.label",message:"Change Language"}),icon:e(f,{children:c}),children:[e(l,{children:e(n,{id:"sdk.layout.hamburgerMenu.language.dialogTitle",message:"Change Language"})}),e(i,{sx:{px:0},children:e(y,{children:s.map(n=>a(m,{onClick:()=>{p(n.locale)},children:[e(f,{sx:{color:"text.secondary"},children:n.locale}),e(t,{children:n.displayName})]},n.locale))})}),e(r,{children:e(o,{variant:"text",color:"inherit",onClick:u,children:e(n,{id:"sdk.layout.menu.language.close.label",message:"Close"})})})]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a,Fragment as o}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as e,jsxs as a,Fragment as o}from"react/jsx-runtime";import{ListItemButton as r,ListItemText as l,List as t,listItemButtonClasses as i,styled as n}from"@mui/material";import{memo as m,useCallback as c}from"react";import{createPhoenixLayoutElement as s,languageToolbarButtonSchema as p}from"#package/domain";import{useLocaleSwitch as d,useResolveLocalizable as g}from"#package/react-sdk";import{DesktopToolbar as u}from"#package/ui-sdk";import{LocaleIcon as h}from"./language/LocaleIcon.js";let x=n(t)(({theme:{spacing:e}})=>({columnGap:e(2),display:"grid",gridTemplateColumns:"min-content auto",maxBlockSize:"calc(100cqb - 50px)",overflowY:"auto",[`.${i.root}`]:{display:"grid",gridColumn:"1 / -1",gridTemplateColumns:"subgrid"}})),f={id:"sdk.toolbar.language.title",message:"Switch language"},k="language-toolbar";export const LanguageToolbarButton=s({schema:p,component:m(()=>{let{locales:t,locale:i,setLocale:n}=d(),{ref:m,handleClose:s,handleToggle:p,openedKey:b}=u.useToolbarPopper(),C=g(),y=c(()=>{p("language-toolbar")},[p]),T=c(e=>{n(e),y()},[n,y]);return a(o,{children:[e(u.Button,{ref:m,title:C(f),size:"small","aria-expanded":b===k?"true":void 0,"aria-haspopup":"menu",onClick:y,children:e(h,{sx:{minInlineSize:24},children:i})}),e(u.Popper,{placement:"top-start",anchorEl:m.current,isOpen:b===k,onClose:s,children:e(x,{children:t.map(o=>a(r,{onClick:()=>{T(o.locale)},children:[e(h,{sx:{color:"text.secondary"},children:o.locale}),e(l,{primary:o.displayName})]},o.locale))})})]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import{Trans as m}from"@lingui/react";import{Button as r,DialogActions as s,DialogContent as t,DialogTitle as o,Stack as i}from"@mui/material";import{memo as a}from"react";import{createPhoenixLayoutElement as u,measurementsMenuActionSchema as c}from"#package/domain";import{useMeasurements as l}from"../../toolbar-actions/index.js";import{DimensionUnitSelector as d}from"./measurements/DimensionUnitSelector.js";import{MeasurementsIcon as p}from"./measurements/MeasurementsIcon.js";import{MeasurementsIndicatorsSwitch as f}from"./measurements/MeasurementsIndicatorsSwitch.js";import{useMenuRouting as h}from"./menu-actions/MenuRoutingContext.js";import{RoutingMenuAction as g}from"./menu-actions/RoutingMenuAction.js";export const MeasurementsMenuAction=u({schema:c,component:a(a=>{let{showIndicatorSwitch:u,icons:c}=a,{unit:j,hasIndicatorSwitch:x,available:M}=l({showIndicatorSwitch:u}),{close:b}=h();return M?n(g,{label:e(m,{id:"sdk.layout.menu.measurements.label",message:"Change measure"}),icon:e(p,{unit:j,icons:c}),children:[e(o,{children:e(m,{id:"sdk.layout.menu.measurements.label",message:"Change measure"})}),e(t,{children:n(i,{spacing:2,direction:"column",children:[x&&e(f,{}),e(d,{})]})}),e(s,{children:e(r,{variant:"text",color:"inherit",onClick:b,children:e(m,{id:"sdk.layout.menu.measurements.close.label",message:"Close"})})})]}):null})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as s}from"react/jsx-runtime";import{Box as
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as s}from"react/jsx-runtime";import{Box as o,Stack as a}from"@mui/material";import{memo as n,useCallback as t}from"react";import{createPhoenixLayoutElement as m,measurementsToolbarButtonSchema as i}from"#package/domain";import{FrontendAnalyticsFactory as u,useAnalyticsService as p,useLocalizable as l}from"#package/react-sdk";import{DesktopToolbar as c}from"#package/ui-sdk";import{useMeasurements as d}from"../../toolbar-actions/index.js";import{DimensionUnitSelector as h}from"./measurements/DimensionUnitSelector.js";import{MeasurementsIcon as g}from"./measurements/MeasurementsIcon.js";import{MeasurementsIndicatorsSwitch as f}from"./measurements/MeasurementsIndicatorsSwitch.js";let k="measurements",j={id:"sdk.measurements",message:"Change measure"},x={id:"sdk.toolbar.measurements.change.aria",message:"open measure menu"};export const MeasurementsToolbarButton=m({schema:i,component:n(n=>{let{showIndicatorSwitch:m,icons:i}=n,{ref:M,handleClose:b,handleToggle:C,openedKey:T}=c.useToolbarPopper(),v=p(),{unit:B,hasIndicatorSwitch:I,available:P}=d({showIndicatorSwitch:m}),S=t(()=>{v.push(u.MeasurementsMenuToggled()),C(k)},[v,C]),w=t(e=>{v.push(u.MeasurementsMenuClosed()),b(e)},[v,b]),z=l(j),D=l(x);return P?r(s,{children:[e(c.Button,{ref:M,title:z,size:"small","aria-expanded":T===k?"true":void 0,"aria-label":D,"aria-haspopup":"menu",onClick:S,children:e(g,{unit:B,icons:i})}),e(c.Popper,{placement:"top-start",anchorEl:M.current,isOpen:T===k,onClose:w,children:e(o,{component:"div",sx:{p:2},children:r(a,{spacing:2,direction:"column",children:[I&&e(f,{}),e(h,{})]})})})]}):null})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{memo as a,useCallback as t,useState as m}from"react";import{createPhoenixLayoutElement as s,shareToolbarButtonSchema as l}from"#package/domain";import{useResolveLocalizable as n,useShareLinks as i}from"#package/react-sdk";import{DesktopToolbar as p,PhxIcon as c}from"#package/ui-sdk";import{ShareModal as d}from"./share/ShareModal.js";let h={id:"sdk.toolbar.share.open.label",message:"Share"};export const ShareToolbarButton=s({schema:l,component:a(a=>{let{icon:s}=a,[l,k]=m(!1),{available:f}=i({enabled:!1}),u=t(()=>{k(!0)},[]),g=t(()=>{k(!1)},[]),x=n();return f?r(o,{children:[e(p.Button,{title:x(h),size:"small",onClick:u,children:e(c,{name:s??"Export"})}),l&&e(d,{onClose:g})]}):null})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import{match as i}from"ts-pattern";import{DimensionUnit as m}from"#package/domain";import{useLocalizable as r}from"#package/react-sdk";import{ToggleSelector as a}from"#package/ui-sdk";import{useMeasurements as o}from"../../../toolbar-actions/index.js";let n=r=>{let{value:o,onSelect:n}=r,l=e(()=>i(o).with(m.mm,()=>"mm").with(m.cm,()=>"cm").with(m.m,()=>"m").with(m.inch,()=>"in").with(m.feet,()=>"ft").exhaustive(),[o]),s=e(()=>i(o).with(m.mm,()=>"millimeter").with(m.cm,()=>"centimeter").with(m.m,()=>"meter").with(m.inch,()=>"inches").with(m.feet,()=>"feet").exhaustive(),[o]);return t(a.Item,{value:o,"aria-label":s,onClick:()=>n(o),children:l})},l={id:"sdk.toolbar.measurements.units.aria",message:"Measurement unit setup"};export const DimensionUnitSelector=()=>{let{units:e,unit:i,setUnit:m}=o(),s=r(l);return e.length<=1?null:t(a.Root,{"aria-label":s,value:i,exclusive:!0,columnCount:"auto-fit",sx:{maxWidth:500},children:e.map(e=>t(n,{value:e,onSelect:m},e))})};
|
package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Trans as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Trans as t}from"@lingui/react";import{Switch as r}from"@mui/material";import{useLocalizable as a}from"#package/react-sdk";import{MobileToolbar as i}from"#package/ui-sdk";import{useMeasurements as o}from"../../../toolbar-actions/index.js";let s={id:"sdk.toolbar.measurements.input.aria",message:"Switch measurements"};export const MeasurementsIndicatorsSwitch=()=>{let{indicatorsShown:m,toggleIndicators:n}=o(),c=a(s);return e(i.SectionItem,{title:e(t,{id:"sdk.toolbar.measurements.indicators.label",message:"Dimension indicators"}),content:e(r,{inputProps:{"aria-label":c},checked:m,onChange:n})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Trans as a}from"@lingui/react";import{Button as
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Trans as a}from"@lingui/react";import{Button as l,DialogActions as r,DialogContent as o,DialogTitle as n,FormControlLabel as s,LinearProgress as t,Stack as d,Switch as c,TextField as h}from"@mui/material";import{memo as m,useCallback as p,useState as b}from"react";import{useResolveLocalizable as g,useShareLinks as k}from"#package/react-sdk";import{Dialog as u,PhxIcon as x}from"#package/ui-sdk";let C=i=>{let{isLinkCopied:r,onCopy:o,disabled:n}=i;return r?e(l,{variant:"muted",color:"success",startIcon:e(x,{name:"Check"}),disabled:n,onClick:o,children:e(a,{id:"sdk.toolbar.share.linkCopied.label",message:"Copied"})}):e(l,{variant:"contained",disabled:n,onClick:o,children:e(a,{id:"sdk.toolbar.share.copyLink.label",message:"Copy link"})})},v={id:"sdk.toolbar.share.loading.label",message:"loading link..."},f=({link:a,onFocus:l})=>i(d,{sx:{display:"grid","& > *":{gridArea:"1 / 1"}},children:[e(h,{value:a??"",placeholder:g()(v),hiddenLabel:!0,InputProps:{readOnly:!0},onFocus:l}),e(t,{sx:{alignSelf:"end",visibility:null==a?"visible":"hidden"}})]});export const ShareModal=m(t=>{let{onClose:h}=t,{ownerLinkAvailable:m,readLinkAvailable:g,ownerLink:x,readLink:v}=k(),[y,w]=b(!g),[T,j]=b(null),L=(y?x:v)??void 0,S=void 0!==L&&L===T,A=p(async()=>{L&&(await navigator.clipboard.writeText(L),j(L))},[L]),F=p(e=>{e.currentTarget.select()},[]),I=p(e=>{w(e.currentTarget.checked)},[]);return i(u.Root,{sx:{maxWidth:"unset",width:"min(100%, 520px)"},isOpen:!0,onClose:h,children:[e(n,{children:e(a,{id:"sdk.toolbar.share.label",message:"Share configuration"})}),e(o,{children:i(d,{sx:{gap:2},children:[e(f,{link:L,onFocus:F}),m&&g&&e(s,{control:e(c,{value:y,disabled:!L,onChange:I}),label:e(a,{id:"sdk.toolbar.share.allowEdit.label",message:"Allow the recipient to edit configuration"})})]})}),i(r,{children:[e(l,{variant:"text",color:"inherit",onClick:h,children:e(a,{id:"sdk.toolbar.share.close.label",message:"Close"})}),e(C,{isLinkCopied:S,disabled:!L,onCopy:A})]})]})});
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import type { AccessLevel } from '@salsita-ai/contracts/api';
|
|
2
|
-
export interface GenerateShareLinkOptions {
|
|
3
|
-
access: AccessLevel;
|
|
4
|
-
expiration?: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const useGenerateShareLink: () => (options: GenerateShareLinkOptions) => Promise<{
|
|
7
|
-
readonly link: string;
|
|
8
|
-
}>;
|
|
9
1
|
interface UseShareDataParams {
|
|
10
2
|
/**
|
|
11
3
|
* Expiration time in hours. When undefined, links do not expire.
|
|
@@ -14,6 +6,9 @@ interface UseShareDataParams {
|
|
|
14
6
|
ownerLinkDisabled: boolean;
|
|
15
7
|
readRevisionLinkDisabled: boolean;
|
|
16
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use useShareLinks() instead. This API will be removed in a future version.
|
|
11
|
+
*/
|
|
17
12
|
export declare const useShareData: (params: UseShareDataParams) => {
|
|
18
13
|
isLoadingOwnerData: boolean;
|
|
19
14
|
isLoadingRevisionData: boolean;
|
|
@@ -24,6 +19,10 @@ export declare const useShareData: (params: UseShareDataParams) => {
|
|
|
24
19
|
readonly link: string;
|
|
25
20
|
}> | undefined;
|
|
26
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use useShareLinks() instead, whose `available`, `ownerLinkAvailable` and `readLinkAvailable` say which
|
|
24
|
+
* links can be shared. This API will be removed in a future version.
|
|
25
|
+
*/
|
|
27
26
|
export declare const useShareSettings: () => {
|
|
28
27
|
disabled: boolean;
|
|
29
28
|
ownerLinkDisabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useQuery as e}from"@tanstack/react-query";import{
|
|
1
|
+
import{useQuery as e}from"@tanstack/react-query";import{applicationConfigComponent as a}from"#package/domain";import{useConfigurationId as t,useDomain as r,useFirstRootComponent as s,useGenerateShareLink as i}from"#package/react-sdk";export const useShareData=a=>{let{expiration:s,ownerLinkDisabled:n,readRevisionLinkDisabled:o}=a,d=i(),{storeSystem:c}=r(),l=t(),u=c.stateSlices.committed.value.state,{data:m,isLoading:h}=e({queryKey:["share-owner-link",l],staleTime:1/0,queryFn:()=>d({access:"o",expiration:s}),enabled:!n}),{data:k,isLoading:y,isFetchedAfterMount:p}=e({queryKey:["share-revision-link",l,u.entities,u.rootEntityId],queryFn:()=>d({access:"rr",expiration:s}),enabled:!o});return{isLoadingOwnerData:h,isLoadingRevisionData:y,ownerData:m,revisionData:p?k:void 0}};export const useShareSettings=()=>{let e=s(a),t=e?.state.shareDisabled??!1,r=t||(e?.state.shareOwnerLinkDisabled??!1),i=t||(e?.state.shareReadRevisionLinkDisabled??!1);return{disabled:r&&i,ownerLinkDisabled:r,readRevisionLinkDisabled:i}};
|
package/dist/docs/index.json
CHANGED
|
@@ -1268,7 +1268,7 @@ The same layout in a frame 390 pixels wide, as on a phone. Opened on its own fro
|
|
|
1268
1268
|
A project layout has only what it renders. This one leaves out the following, each of which a product may need. [Layout Slots](?path=/docs/phoenix-layout-slots--docs) describes every `LayoutSlots` member named here.
|
|
1269
1269
|
|
|
1270
1270
|
- **Messages that stay snackbars.** The toast shows violations, side effects, errors and failed saves, and the finalize button shows its own error. Two kinds of message stay snackbars. An error of a built-in action, such as one from `LayoutSlots.DesktopToolbar`, renders into `LayoutSlots.DesktopSnackbarsRoot`; this layout mounts neither, and a layout that mounts such an action mounts the root too, or the snackbar appears outside the configurator. A failure to start from a preset appears on the preset screen, before this layout mounts; a project replaces that screen with `phx.frontend.createPresetUi`, see [Configurator Interface → Preset UI](?path=/docs/phoenix-configurator-interface--docs#preset-ui).
|
|
1271
|
-
- **Toolbar actions.** Undo and redo, measurements, sharing and language switching are not offered. A layout can mount `LayoutSlots.DesktopToolbar` for the toolbar the spec configures, or build its own buttons
|
|
1271
|
+
- **Toolbar actions.** Undo and redo, measurements, sharing and language switching are not offered. A layout can mount `LayoutSlots.DesktopToolbar` for the toolbar the spec configures, or build its own buttons: `phx.frontend.useUndoRedo()`, `useMeasurements()`, `useShareLinks()` and `useLocaleSwitch()` serve single actions, pushing the same analytics events as the built-in buttons; see [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout).
|
|
1272
1272
|
- **The spec's view controls, tool controls and leaving a tool mode.** A spec can configure view controls and tool controls, and a tool mode has a button that leaves it. The built-in layout places them with `LayoutSlots.DesktopViewControls`, `LayoutSlots.DesktopToolControls` and `LayoutSlots.DesktopCallToAction`; this layout mounts none of them, so the spec's `viewControls` and `toolControls` do not appear. Its views come from its own buttons instead, see [Control the scene](#control-the-scene), and it has no tool modes.
|
|
1273
1273
|
- **A project's layout dialog.** A dialog the project registers with `phx.frontend.createLayoutDialog` is shown by `LayoutDialog`, which the built-in layout mounts. This layout does not; a layout that needs the dialog mounts `LayoutDialog` from `@salsita-ai/sdk/configurator`.
|
|
1274
1274
|
- **Selection.** The table has no parts to select. A product with selectable parts reads `phx.frontend.useSelectedDomainEntityId()` and shows the controls of the selected part.
|
|
@@ -573,6 +573,17 @@ export const Wizard = () => {
|
|
|
573
573
|
}
|
|
574
574
|
```
|
|
575
575
|
|
|
576
|
+
**Toolbar**
|
|
577
|
+
|
|
578
|
+
A layout places the toolbar's actions with the hooks below, or mounts `LayoutSlots.DesktopToolbar` for the toolbar the spec configures. Each hook does what the built-in toolbar button of the same action does and pushes the same analytics events; opening and closing the layout's own dialogs and popovers push none. `useMeasurements` and `useAssistantPanel` are exported from `@salsita-ai/sdk/configurator` besides `phx.frontend`, not from `@salsita-ai/sdk/react`. `useShareData()` and `useShareSettings()` from `@salsita-ai/sdk/configurator` are deprecated in favour of `useShareLinks()`. Undo and redo are `phx.frontend.useUndoRedo()` above, fullscreen is `useIsFullscreenActive()` with `useSetFullscreen()`, and the camera reset is `useResetCamera()`.
|
|
579
|
+
|
|
580
|
+
| Hook | Returns |
|
|
581
|
+
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
582
|
+
| `phx.frontend.useMeasurements(options?)` | `{ units, unit, setUnit, hasIndicatorSwitch, indicatorsShown, toggleIndicators, available }`: the units the dimension configuration offers, the one dimensions are shown in and a function that changes it; whether the dimension indicators can be switched (`options.showIndicatorSwitch`, else `applicationConfig.indicatorSwitch`, else `true`), whether they show and a function that switches them; and whether there is anything to set, more than one unit or the switch. |
|
|
583
|
+
| `phx.frontend.useLocaleSwitch()` | `{ locales, locale, setLocale, available }`: the spec's `availableLocales` as `{ locale, displayName }`, each named in its own language, the active locale, a function that activates one, and whether there is more than one to choose from. Besides `phx.frontend`, `@salsita-ai/sdk/react` exports it. |
|
|
584
|
+
| `phx.frontend.useShareLinks(options?)` | `{ available, ownerLinkAvailable, readLinkAvailable, ownerLink, readLink, isLoading }`: whether sharing is offered and which kinds of link the application config enables, a link that opens the configuration for editing and one that opens its current revision for viewing, each `null` until generated, and whether one is still being generated. While enabled, each commit of the configuration generates a new read link. Generating a link saves the configuration, so a layout passes `{ enabled: open }` with whether its share dialog is open; `enabled` is `true` by default. Besides `phx.frontend`, `@salsita-ai/sdk/react` exports it. |
|
|
585
|
+
| `phx.frontend.useAssistantPanel()` | `{ available, open, hasUnreadReply, setOpen }`: whether the spec has an `assistant`, whether its panel is open, whether it replied while closed, and a function that opens or closes it. The panel renders only inside `LayoutSlots.DesktopSidebar`, so a layout without that slot does not offer it. |
|
|
586
|
+
|
|
576
587
|
**Violations**
|
|
577
588
|
|
|
578
589
|
| Hook | Returns |
|
|
@@ -13,6 +13,9 @@ export { useComposition, type UseComposition } from './system-hooks/composition-
|
|
|
13
13
|
export { useUndoRedo, type UseUndoRedo, type UseUndoRedoResult } from './system-hooks/undo-redo-hooks.js';
|
|
14
14
|
export { useTabNavigation, type TabEntry, type TabSource, type UseTabNavigation, type UseTabNavigationOptions, type UseTabNavigationResult, } from './system-hooks/tab-navigation-hooks.js';
|
|
15
15
|
export { useStepNavigation, type NavigationStepEntry, type StepStatus, type UseStepNavigation, type UseStepNavigationResult, } from './system-hooks/step-navigation-hooks.js';
|
|
16
|
+
export { useLocaleSwitch, type UseLocaleSwitch, type UseLocaleSwitchResult, type LocaleOption, } from './system-hooks/locale-switch-hooks.js';
|
|
17
|
+
export { useGenerateShareLink, type GenerateShareLinkOptions } from './system-hooks/generate-share-link-hooks.js';
|
|
18
|
+
export { useShareLinks, type UseShareLinks, type UseShareLinksOptions, type UseShareLinksResult, } from './system-hooks/share-links-hooks.js';
|
|
16
19
|
export { useHoveredDomainEntityId, useHoveredEntity, useHoveredEntityId, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, } from './system-hooks/hover-hooks.js';
|
|
17
20
|
export { type UseRootEntityState, useRootEntityState, useRootEntityRenderedState, } from './entity-hooks/use-root-entity-state.js';
|
|
18
21
|
export { type UseRootEntityId, useRootEntityId, useRootEntityRenderedId } from './entity-hooks/use-root-entity-id.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useDomain}from"./common-hooks/use-domain-context.js";export{useStoreSelector,useRenderedSelector,useRenderedSelector$,useStoreSelector$}from"./common-hooks/use-store-selector.js";export{useEagerObservableSelector,usePatientObservableSelector,usePatientObservableValue,useEagerObservableValue}from"./common-hooks/use-observable-selector.js";export{useStateValidity,useMapViolationHints,useControlViolations,useFinalizeViolations}from"./common-hooks/use-state-validity.js";export{useConfiguratorMessages}from"./common-hooks/use-configurator-messages.js";export{useComponent,useRenderedComponent,useComponents,useDynamicComponents,useRenderedComponents,useRootComponents,useRootRenderedComponents,useFirstComponent,useFirstRenderedComponent,useFirstRootComponent,useFirstRootRenderedComponent}from"./component-hooks/use-component.js";export{useCommittedState,useCommittedSlice,useRenderedSlice,useRenderedState}from"./common-hooks/use-slices.js";export{useDomainEntityState,useDomainEntityRenderedState}from"./entity-hooks/use-domain-entity-state.js";export{useEntityPrice,useRootEntityPrice}from"./entity-hooks/use-entity-price.js";export{useSelectEntity,useSelectedEntity,useSelectedEntityId,useSelectedDomainEntityId,useDeselect,useSelectParent}from"./system-hooks/selection-hooks.js";export{useActiveNavigationState,useActiveViewState,useSetViewState,useActiveToolState,useIsFullscreenActive,useSetFullscreen,useActiveViewports,useDraggedDomainEntityId,useNavigate,usePushNavigate,usePopNavigate}from"./system-hooks/navigation-hooks.js";export{useComposition}from"./system-hooks/composition-hooks.js";export{useUndoRedo}from"./system-hooks/undo-redo-hooks.js";export{useTabNavigation}from"./system-hooks/tab-navigation-hooks.js";export{useStepNavigation}from"./system-hooks/step-navigation-hooks.js";export{useHoveredDomainEntityId,useHoveredEntity,useHoveredEntityId}from"./system-hooks/hover-hooks.js";export{useRootEntityState,useRootEntityRenderedState}from"./entity-hooks/use-root-entity-state.js";export{useRootEntityId,useRootEntityRenderedId}from"./entity-hooks/use-root-entity-id.js";export{useEntitySelector,useRootEntitySelector,useRenderedEntitySelector,useRenderedRootEntitySelector}from"./common-hooks/use-entity-selector.js";export{useDimensionState,useDimensions,useDimensionConfig}from"./system-hooks/dimension-hooks.js";
|
|
1
|
+
export{useDomain}from"./common-hooks/use-domain-context.js";export{useStoreSelector,useRenderedSelector,useRenderedSelector$,useStoreSelector$}from"./common-hooks/use-store-selector.js";export{useEagerObservableSelector,usePatientObservableSelector,usePatientObservableValue,useEagerObservableValue}from"./common-hooks/use-observable-selector.js";export{useStateValidity,useMapViolationHints,useControlViolations,useFinalizeViolations}from"./common-hooks/use-state-validity.js";export{useConfiguratorMessages}from"./common-hooks/use-configurator-messages.js";export{useComponent,useRenderedComponent,useComponents,useDynamicComponents,useRenderedComponents,useRootComponents,useRootRenderedComponents,useFirstComponent,useFirstRenderedComponent,useFirstRootComponent,useFirstRootRenderedComponent}from"./component-hooks/use-component.js";export{useCommittedState,useCommittedSlice,useRenderedSlice,useRenderedState}from"./common-hooks/use-slices.js";export{useDomainEntityState,useDomainEntityRenderedState}from"./entity-hooks/use-domain-entity-state.js";export{useEntityPrice,useRootEntityPrice}from"./entity-hooks/use-entity-price.js";export{useSelectEntity,useSelectedEntity,useSelectedEntityId,useSelectedDomainEntityId,useDeselect,useSelectParent}from"./system-hooks/selection-hooks.js";export{useActiveNavigationState,useActiveViewState,useSetViewState,useActiveToolState,useIsFullscreenActive,useSetFullscreen,useActiveViewports,useDraggedDomainEntityId,useNavigate,usePushNavigate,usePopNavigate}from"./system-hooks/navigation-hooks.js";export{useComposition}from"./system-hooks/composition-hooks.js";export{useUndoRedo}from"./system-hooks/undo-redo-hooks.js";export{useTabNavigation}from"./system-hooks/tab-navigation-hooks.js";export{useStepNavigation}from"./system-hooks/step-navigation-hooks.js";export{useLocaleSwitch}from"./system-hooks/locale-switch-hooks.js";export{useGenerateShareLink}from"./system-hooks/generate-share-link-hooks.js";export{useShareLinks}from"./system-hooks/share-links-hooks.js";export{useHoveredDomainEntityId,useHoveredEntity,useHoveredEntityId}from"./system-hooks/hover-hooks.js";export{useRootEntityState,useRootEntityRenderedState}from"./entity-hooks/use-root-entity-state.js";export{useRootEntityId,useRootEntityRenderedId}from"./entity-hooks/use-root-entity-id.js";export{useEntitySelector,useRootEntitySelector,useRenderedEntitySelector,useRenderedRootEntitySelector}from"./common-hooks/use-entity-selector.js";export{useDimensionState,useDimensions,useDimensionConfig}from"./system-hooks/dimension-hooks.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AccessLevel } from '@salsita-ai/contracts/api';
|
|
2
|
+
export interface GenerateShareLinkOptions {
|
|
3
|
+
access: AccessLevel;
|
|
4
|
+
expiration?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const useGenerateShareLink: () => (options: GenerateShareLinkOptions) => Promise<{
|
|
7
|
+
readonly link: string;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as e}from"react";import{match as r}from"ts-pattern";import{applicationConfigComponent as t}from"#package/domain";import{useAuthorizedClient as a,useConfigurationId as o,useDomainApplication as i}from"../../application-runtime/index.js";import{useFirstRootComponent as n}from"../component-hooks/index.js";export const useGenerateShareLink=()=>{let s=n(t),m=s?.state.shareStrategy??"deployment-registered",{configurationPersistSystem:c}=i(),d=o(),p=a();return e(async e=>{let t=r(m).with("deployment-registered",()=>void 0).with("current-frontend",()=>{let e=new URL(window.location.href);return e.searchParams.delete("cid"),e.searchParams.delete("ca"),e.toString()}).exhaustive(),a=await c.save();return p.generateShareLink(d,"rr"===e.access?a:void 0,e.expiration,e.access,t)},[m,c,p,d])};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** A language the configurator offers, with its name in that language. */
|
|
2
|
+
export interface LocaleOption {
|
|
3
|
+
readonly locale: string;
|
|
4
|
+
readonly displayName: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* What a project layout needs to offer a language switch.
|
|
8
|
+
* - `locales`: the spec's `applicationConfig.availableLocales` (`['en']` without it), each with its own name.
|
|
9
|
+
* - `locale`: the active locale.
|
|
10
|
+
* - `setLocale`: activates a locale, falling back to a supported one as `useLinguiActivate` does.
|
|
11
|
+
* - `available`: whether there is more than one locale to choose from, the built-in rule for showing the switch.
|
|
12
|
+
*/
|
|
13
|
+
export interface UseLocaleSwitchResult {
|
|
14
|
+
readonly locales: readonly LocaleOption[];
|
|
15
|
+
readonly locale: string;
|
|
16
|
+
readonly setLocale: (locale: string) => void;
|
|
17
|
+
readonly available: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type UseLocaleSwitch = () => UseLocaleSwitchResult;
|
|
20
|
+
/**
|
|
21
|
+
* Hook to list the languages the configurator offers and switch between them, as the built-in toolbar's language
|
|
22
|
+
* button and the menu's language action do. It re-renders when the language changes.
|
|
23
|
+
*/
|
|
24
|
+
export declare const useLocaleSwitch: UseLocaleSwitch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useLingui as e}from"@lingui/react";import{useMemo as a}from"react";import{applicationConfigComponent as o}from"#package/domain";import{useLinguiActivate as l}from"../../localizable/index.js";import{useFirstRootComponent as t}from"../component-hooks/index.js";export const useLocaleSwitch=()=>{let{i18n:r}=e(),i=t(o),m=l(),n=i?.state.availableLocales,c=a(()=>(n??["en"]).map(e=>{let a=new Intl.DisplayNames([e],{type:"language",fallback:"code"});return{locale:e,displayName:a.of(e)??e}}),[n]),p=r.locale;return a(()=>({locales:c,locale:p,setLocale:e=>{m(e)},available:c.length>1}),[c,p,m])};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface UseShareLinksOptions {
|
|
2
|
+
/** Whether the links are generated; `true` by default. A layout passes whether its share dialog is open. */
|
|
3
|
+
readonly enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* What a project layout needs to share the configuration.
|
|
7
|
+
* - `available`: whether sharing is offered, that is `applicationConfig.shareDisabled` is not set and at least one
|
|
8
|
+
* kind of link is enabled; the built-in share button renders nothing otherwise.
|
|
9
|
+
* - `ownerLinkAvailable` and `readLinkAvailable`: whether each kind of link is enabled
|
|
10
|
+
* (`applicationConfig.shareOwnerLinkDisabled`, `applicationConfig.shareReadRevisionLinkDisabled`).
|
|
11
|
+
* - `ownerLink`: a link that opens the configuration for editing, or `null` while it loads, is disabled or the
|
|
12
|
+
* hook is not `enabled`.
|
|
13
|
+
* - `readLink`: a link that opens the current revision of the configuration for viewing, `null` in the same cases.
|
|
14
|
+
* The configuration is saved before the link is generated; while the hook is enabled, each commit of the
|
|
15
|
+
* configuration generates a new link, and `readLink` is `null` again until it arrives.
|
|
16
|
+
* - `isLoading`: whether an enabled link is still being generated.
|
|
17
|
+
*/
|
|
18
|
+
export interface UseShareLinksResult {
|
|
19
|
+
readonly available: boolean;
|
|
20
|
+
readonly ownerLinkAvailable: boolean;
|
|
21
|
+
readonly readLinkAvailable: boolean;
|
|
22
|
+
readonly ownerLink: string | null;
|
|
23
|
+
readonly readLink: string | null;
|
|
24
|
+
readonly isLoading: boolean;
|
|
25
|
+
}
|
|
26
|
+
export type UseShareLinks = (options?: UseShareLinksOptions) => UseShareLinksResult;
|
|
27
|
+
/**
|
|
28
|
+
* Hook to generate the links that share the configuration, as the built-in share dialog does. The links expire
|
|
29
|
+
* after `applicationConfig.shareExpiration` hours, or never without it. Generating a link saves the configuration,
|
|
30
|
+
* so a layout enables the hook only while its share dialog is open. It does not check read mode.
|
|
31
|
+
*/
|
|
32
|
+
export declare const useShareLinks: UseShareLinks;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useQuery as e}from"@tanstack/react-query";import{useMemo as t}from"react";import{applicationConfigComponent as i}from"#package/domain";import{useConfigurationId as r}from"../../application-runtime/index.js";import{useStoreSelector as a}from"../common-hooks/index.js";import{useFirstRootComponent as n}from"../component-hooks/index.js";import{useGenerateShareLink as s}from"./generate-share-link-hooks.js";export const useShareLinks=(o={})=>{let{enabled:l=!0}=o,d=n(i),m=s(),c=r(),h=d?.state.shareExpiration,k=d?.state.shareDisabled??!1,p=!k&&!d?.state.shareOwnerLinkDisabled,u=!k&&!d?.state.shareReadRevisionLinkDisabled,y=l&&u,f=a(e=>({entities:e.state.entities,rootEntityId:e.state.rootEntityId}),[],y),b=e({queryKey:["share-owner-link",c],staleTime:1/0,queryFn:()=>m({access:"o",expiration:h}),enabled:l&&p}),q=e({queryKey:y?["share-revision-link",c,f.entities,f.rootEntityId]:["share-revision-link",c,"disabled"],queryFn:()=>m({access:"rr",expiration:h}),enabled:y}),x=l&&p&&b.data?.link||null,F=y&&q.isFetchedAfterMount&&q.data?.link||null,g=l&&p&&b.isLoading||y&&q.isFetching&&!q.isFetchedAfterMount;return t(()=>({available:p||u,ownerLinkAvailable:p,readLinkAvailable:u,ownerLink:x,readLink:F,isLoading:g}),[p,u,x,F,g])};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salsita-ai/sdk",
|
|
3
|
-
"version": "0.50.0-develop.
|
|
3
|
+
"version": "0.50.0-develop.f6390cb584",
|
|
4
4
|
"description": "TypeScript SDK and CLI for building, running, and deploying Phoenix configurator applications.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"salsita",
|
|
@@ -298,8 +298,8 @@
|
|
|
298
298
|
"yaml": "2.9.0",
|
|
299
299
|
"yargs": "17.7.2",
|
|
300
300
|
"zod": "3.25.76",
|
|
301
|
-
"@salsita-ai/
|
|
302
|
-
"@salsita-ai/
|
|
301
|
+
"@salsita-ai/contracts": "0.50.0-develop.f6390cb584",
|
|
302
|
+
"@salsita-ai/common": "0.50.0-develop.f6390cb584"
|
|
303
303
|
},
|
|
304
304
|
"devDependencies": {
|
|
305
305
|
"@clerk/clerk-react": "5.61.8",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useMemo as a}from"react";import{applicationConfigComponent as e}from"#package/domain";import{useFirstRootComponent as t}from"#package/react-sdk";export const useLocaleOptions=()=>{let o=t(e),r=a(()=>o?.state.availableLocales??["en"],[o]);return a(()=>r.map(a=>{let e=new Intl.DisplayNames([a],{type:"language",fallback:"code"});return{locale:a,displayName:e.of(a)??a}}),[r])};
|
package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{applicationConfigComponent as e}from"#package/domain";import{useDimensionConfig as t,useFirstRootComponent as r}from"#package/react-sdk";export const useMeasurementsVisibility=a=>{let i=r(e),{availableDimensions:o}=t(),s=a??i?.state.indicatorSwitch??!0,m=o.length>1;return{indicatorSwitchShown:s,measurementsShown:s||m}};
|