@salsita-ai/sdk 0.50.0-develop.ef06ca4ac1 → 0.50.0-develop.f0150c4c2f
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 +52 -2
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +4 -0
- package/dist/configurator/index.d.ts +1 -0
- package/dist/configurator/index.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/default-elements/index.d.ts +1 -0
- package/dist/configurator/pages/default-elements/index.js +1 -1
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/index.d.ts +6 -0
- package/dist/configurator/pages/default-elements/scene-controls/index.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.d.ts +6 -0
- package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.js +1 -0
- package/dist/configurator/scene/index.d.ts +1 -0
- package/dist/configurator/scene/index.js +1 -1
- package/dist/configurator/scene/scene-controls/ToolFab.d.ts +4 -0
- package/dist/configurator/scene/scene-controls/ToolFab.js +1 -1
- package/dist/configurator/scene/scene-controls/use-scene-control-tooltip.d.ts +2 -1
- package/dist/configurator/scene/scene-entity/scene-controls/SceneEntityHtmlHotspots.js +1 -1
- package/dist/configurator/toolbar-actions/index.d.ts +3 -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/toolbar-actions/use-toolbar-actions.d.ts +100 -0
- package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -0
- package/dist/configurator/toolbar-actions/use-toolbar-help.d.ts +7 -0
- package/dist/configurator/toolbar-actions/use-toolbar-help.js +1 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
- package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
- package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
- package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/alert/index.js +1 -0
- package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
- package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
- package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
- package/dist/configurator/ui/assistant/form/built-in-form-registry.js +1 -1
- package/dist/configurator/ui/assistant/form/compose-answer.d.ts +2 -1
- package/dist/configurator/ui/assistant/form/compose-answer.js +1 -1
- package/dist/configurator/ui/assistant/form/form-model.d.ts +3 -2
- package/dist/configurator/ui/assistant/form/form-registry.d.ts +1 -1
- package/dist/configurator/ui/assistant/form/form-registry.js +2 -2
- package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +2 -1
- package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
- package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -1
- package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
- package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
- package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +4 -1
- package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
- package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +4 -1
- package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +4 -1
- package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
- package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +4 -1
- package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -1
- package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
- package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +17 -13
- package/dist/configurator/ui/assistant/form-elements/index.d.ts +4 -0
- package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
- package/dist/configurator/ui/assistant/resource-image/index.d.ts +1 -1
- package/dist/configurator/ui/assistant/resource-image/index.js +1 -1
- package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +0 -9
- package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -1
- package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -2
- package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
- 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/complex-use-cases/focus-mode.mdx +2 -0
- package/dist/docs/fabs/basic.mdx +4 -0
- package/dist/docs/index.json +18 -1
- package/dist/docs/layouts/custom-layout.mdx +3 -1
- package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
- package/dist/docs/other-features/navigation-hotspot.mdx +2 -0
- package/dist/docs/phoenix/configurator-interface.mdx +68 -1
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +1 -1
- package/dist/docs/selection-and-highlight/hotspots.mdx +2 -0
- package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +163 -0
- package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
- package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
- package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
- package/dist/domain/application/assistant/form/get-assistant-form-value-attribute.d.ts +6 -0
- package/dist/domain/application/assistant/form/get-assistant-form-value-attribute.js +1 -0
- package/dist/domain/application/assistant/form/index.d.ts +4 -0
- package/dist/domain/application/assistant/form/index.js +1 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +1 -2
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- 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/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -1
- package/dist/react-sdk/index.d.ts +1 -0
- package/dist/react-sdk/index.js +1 -1
- package/dist/react-sdk/scene-control-elements/AddEntityFabElement.d.ts +36 -0
- package/dist/react-sdk/scene-control-elements/AddEntityFabElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.d.ts +44 -0
- package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.d.ts +38 -0
- package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.d.ts +30 -0
- package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.d.ts +30 -0
- package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-add-entity-fab.d.ts +9 -0
- package/dist/react-sdk/scene-control-elements/create-add-entity-fab.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.d.ts +9 -0
- package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.d.ts +10 -0
- package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-selection-hotspot.d.ts +9 -0
- package/dist/react-sdk/scene-control-elements/create-selection-hotspot.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.d.ts +9 -0
- package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.js +1 -0
- package/dist/react-sdk/scene-control-elements/index.d.ts +11 -0
- package/dist/react-sdk/scene-control-elements/index.js +1 -0
- package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.d.ts +5 -0
- package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.js +1 -0
- package/dist/react-sdk/web-component/create-web-component.js +1 -1
- package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
- package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
- package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
- package/dist/react-sdk/web-component/god-mode/index.js +1 -0
- package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
- package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
- package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
- package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
- package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
- package/dist/ui-sdk/icons/__generated/index.js +1 -1
- package/dist/ui-sdk/icons/icons-registry.js +1 -1
- package/dist/ui-sdk/theme/types.d.ts +1 -1
- 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
- package/dist/domain/application/assistant/assistant-form-elements.d.ts +0 -28
- package/dist/domain/application/assistant/assistant-form-elements.js +0 -1
- package/dist/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
- package/dist/react-sdk/application-runtime/runtime/god-mode.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 CreateAddEntityFab, type CreateCollectFrontendDataHandler, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreateSelectionHotspot, type CreateToolMenuFab, 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, type UseToolbarActions } 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>> {
|
|
@@ -193,6 +193,32 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
193
193
|
* `ConfiguratorErrorPage`.
|
|
194
194
|
*/
|
|
195
195
|
createConfiguratorErrorPage: CreateConfiguratorErrorPage;
|
|
196
|
+
/**
|
|
197
|
+
* Creates the in-scene FAB that adds child entities (`sceneEntityAddFab`), replacing the built-in
|
|
198
|
+
* `AddEntityFab` element. It receives the component's settings and reads the recipes it offers
|
|
199
|
+
* with `useGroupedRecipeOptions(entityId, instanceNames, fixableViolations)`.
|
|
200
|
+
*/
|
|
201
|
+
createAddEntityFab: CreateAddEntityFab;
|
|
202
|
+
/**
|
|
203
|
+
* Creates the in-scene FAB that deletes an entity (`sceneEntityDeleteFab`), replacing the built-in
|
|
204
|
+
* `DeleteEntityFab` element. It receives `onDelete`, `disabled` and `disabledHint`.
|
|
205
|
+
*/
|
|
206
|
+
createDeleteEntityFab: CreateDeleteEntityFab;
|
|
207
|
+
/**
|
|
208
|
+
* Creates the in-scene hotspot that selects an entity (`sceneEntitySelectHotspot`), replacing the
|
|
209
|
+
* built-in `SelectionHotspot` element. It receives `onSelect`.
|
|
210
|
+
*/
|
|
211
|
+
createSelectionHotspot: CreateSelectionHotspot;
|
|
212
|
+
/**
|
|
213
|
+
* Creates the in-scene hotspot that goes to a navigation state (`sceneEntityNavigationHotspot`),
|
|
214
|
+
* replacing the built-in `NavigationHotspot` element. It receives `onNavigate`.
|
|
215
|
+
*/
|
|
216
|
+
createNavigationHotspot: CreateNavigationHotspot;
|
|
217
|
+
/**
|
|
218
|
+
* Creates the in-scene FAB that switches tools (`toolMenuFab`), replacing the built-in `ToolMenuFab`
|
|
219
|
+
* element. It receives the tool `options` and `onSelectTool`.
|
|
220
|
+
*/
|
|
221
|
+
createToolMenuFab: CreateToolMenuFab;
|
|
196
222
|
/**
|
|
197
223
|
* Factory for creating transformers for entities.
|
|
198
224
|
* @deprecated Use {@link #transformerBuilder} instead.
|
|
@@ -553,6 +579,30 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
553
579
|
* Turn one localizable text of the spec into a string in the current language
|
|
554
580
|
*/
|
|
555
581
|
useLocalizable: typeof useLocalizable;
|
|
582
|
+
/**
|
|
583
|
+
* The spec's toolbar for a placement as runnable entries, grouped as the spec groups them, for a layout's own
|
|
584
|
+
* toolbar
|
|
585
|
+
*/
|
|
586
|
+
useToolbarActions: UseToolbarActions;
|
|
587
|
+
/**
|
|
588
|
+
* The unit of dimensions and the dimension indicators, with functions that change them, as the toolbar's
|
|
589
|
+
* measurements button does
|
|
590
|
+
*/
|
|
591
|
+
useMeasurements: UseMeasurements;
|
|
592
|
+
/**
|
|
593
|
+
* The languages the configurator offers and the active one, with a function that switches it, as the toolbar's
|
|
594
|
+
* language button does
|
|
595
|
+
*/
|
|
596
|
+
useLocaleSwitch: UseLocaleSwitch;
|
|
597
|
+
/**
|
|
598
|
+
* Links that share the configuration for editing and for viewing, as the toolbar's share dialog generates them
|
|
599
|
+
*/
|
|
600
|
+
useShareLinks: UseShareLinks;
|
|
601
|
+
/**
|
|
602
|
+
* Whether the assistant panel is open, with a function that opens or closes it, as the toolbar's assistant button
|
|
603
|
+
* does
|
|
604
|
+
*/
|
|
605
|
+
useAssistantPanel: UseAssistantPanel;
|
|
556
606
|
/**
|
|
557
607
|
* Returns composition tree of the domain
|
|
558
608
|
*/
|
|
@@ -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{createAddEntityFab as f,createCollectFrontendDataHandler as u,createDeleteEntityFab as c,createFilterPublishedChunksHandler as g,createNavigationHotspot as l,createNotAuthenticatedPage as j,createSelectionHotspot as x,createToolMenuFab as k,isAngleDimensionUpdate as y,isAttributeSelectionUpdate as I,isAttributeSwitchUpdate as A,isDeleteEntityUpdate as C,isDistanceDimensionUpdate as S,isGenericDimensionUpdate as w,isSwatchSelectionUpdate as E,isTextValueUpdate as b,useAccessService as q,useActiveNavigationState as B,useActiveToolState as P,useActiveViewState as R,useActiveViewports as U,useAnalyticsService as h,useAngleDimension as v,useAttributeSelection as z,useAttributeSwitch as D,useAuthenticatedClient as F,useAuthorizedClient as G,useBackendData as H,useChildEntitySelection as J,useCommittedSlice as K,useCommittedState as L,useComponent as M,useComponents as N,useComposition as O,useConfigurationId as Q,useConfiguratorMessages as T,useControlViolations as V,useCookRecipes as W,useCookReplaceRecipes as X,useCookedRecipes as Y,useCookedReplaceRecipes as Z,useCreateAuthorizedClient as $,useDeleteEntity as _,useDeletedEntity as ee,useDeselect as eo,useDistanceDimension as er,useDistanceDimensionSelection as et,useDomain as ei,useDomainApplication as en,useDomainApplicationProps as es,useDomainEntityRenderedState as ea,useDomainEntityState as em,useEntityPrice as ep,useEntitySelector as ed,useFinalizeAction as ef,useFinalizeActions as eu,useFinalizeViolations as ec,useFirstComponent as eg,useFirstRenderedComponent as el,useFirstRootComponent as ej,useFirstRootRenderedComponent as ex,useFrontendData as ek,useGenerateShareLink as ey,useGenericDimension as eI,useGroupedRecipeOptions as eA,useHoveredDomainEntityId as eC,useHoveredEntity as eS,useHoveredEntityId as ew,useIntegrationService as eE,useIntegrationState as eb,useIsFullscreenActive as eq,useLoadedData as eB,useLoadingState as eP,useLoadingStateValue as eR,useLocaleSwitch as eU,useLocalizable as eh,useMapViolationHints as ev,useNavigate as ez,usePopNavigate as eD,usePresetEmbeddedState as eF,usePublishedData as eG,usePushNavigate as eH,useRecipeEmbeddedState as eJ,useRenderedComponent as eK,useRenderedComponents as eL,useRenderedEntitySelector as eM,useRenderedRootEntitySelector as eN,useRenderedSelector as eO,useRenderedSelector$ as eQ,useRenderedSlice as eT,useRenderedState as eV,useReplaceEntityRecipeOptions as eW,useResolveLocalizable as eX,useRootComponents as eY,useRootEntityId as eZ,useRootEntityPrice as e$,useRootEntityRenderedId as e_,useRootEntityRenderedState as e0,useRootEntitySelector as e1,useRootEntityState as e2,useRootRenderedComponents as e3,useSelectEntity as e4,useSelectParent as e5,useSelectedDomainEntityId as e6,useSelectedEntity as e7,useSelectedEntityId as e8,useSession as e9,useSessionRole as oe,useSessionService as oo,useSetFullscreen as or,useSetViewState as ot,useShareLinks as oi,useStateValidity as on,useStepNavigation as os,useStoreSelector as oa,useStoreSelector$ as om,useSwatchSelection as op,useTabNavigation as od,useTextValue as of,useUndoRedo as ou,useUpdateControl as oc,useUpdatedControl as og}from"#package/react-sdk";import{createPhoenixIconSet as ol}from"#package/ui-sdk";import{useConfigurator as oj}from"../application-runtime/index.js";import{createConfigurationNotFoundPage as ox}from"../configuration-not-found-page/index.js";import{createOnApplicationStartProvider as ok,createOnBackendDataReadyProvider as oy,createOnConfiguratorReadyProvider as oI,createOnFrontendDataReadyProvider as oA,createOnGoToIndexHandler as oC,createOnPresetLoadedHandler as oS,createOnPublishedDataReadyProvider as ow,createOnRoutingReadyProvider as oE,createOnSessionReadyProvider as ob,useConfiguratorRouting as oq,usePresetSelection as oB,usePreview as oP,usePropertyPageStack as oR,usePropertyPageState as oU}from"../configurator-context/index.js";import{createConfiguratorErrorPage as oh}from"../configurator-error-page/index.js";import{useCloseAction as ov}from"../integration/index.js";import{createGetTextureProcessingMapHandler as oz}from"../scene/index.js";import{useUpdateEntityObjectSelection as oD}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as oF,useMeasurements as oG,useToolbarActions as oH}from"../toolbar-actions/index.js";import{LayoutSlots as oJ,createAppLoader as oK,createCanvasLoader as oL,createLayoutAdminUi as oM,createLayoutCustomOwnerUi as oN,createLayoutCustomReadUi as oO,createLayoutDialog as oQ,createLayoutFooter as oT,createLayoutToolbarDesktop as oV,createLayoutToolbarDesktopFullScreen as oW,createLayoutToolbarReadDesktop as oX,createLayoutToolbarReadDesktopFullScreen as oY,createLayoutUserUi as oZ,createToolbarHelp as o$,useSceneSafeArea as o_}from"../ui/index.js";import{createPresetDeviceNotSupported as o0,createPresetPageAction as o1,createPresetUi as o2}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as o3}from"./use-reset-camera.js";export const createConfiguratorInterface=o4=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:t,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:o,createPhoenixIconSet:ol,createGetTextureProcessingMapHandler:oz,createCollectFrontendDataHandler:u,createFilterPublishedChunksHandler:g,createOnGoToIndexHandler:oC,createOnApplicationStartProvider:ok,createOnSessionReadyProvider:ob,createOnPublishedDataReadyProvider:ow,createOnFrontendDataReadyProvider:oA,createOnBackendDataReadyProvider:oy,createOnRoutingReadyProvider:oE,createOnConfiguratorReadyProvider:oI,createOnPresetLoadedHandler:oS,createPresetUi:o2,createPresetPageAction:o1,createPresetDeviceNotSupported:o0,createLayoutFooter:oT,createAppLoader:oK,createCanvasLoader:oL,createLayoutDialog:oQ,createLayoutToolbarDesktop:oV,createLayoutToolbarDesktopFullScreen:oW,createLayoutToolbarReadDesktop:oX,createLayoutToolbarReadDesktopFullScreen:oY,createLayoutCustomOwnerUi:oN,createLayoutCustomReadUi:oO,createLayoutAdminUi:oM,createLayoutUserUi:oZ,createToolbarHelp:o$,createNotAuthenticatedPage:j,createConfigurationNotFoundPage:ox,createConfiguratorErrorPage:oh,createAddEntityFab:f,createDeleteEntityFab:c,createSelectionHotspot:x,createNavigationHotspot:l,createToolMenuFab:k,createTransformer:n,transformerBuilder:s(),useAnalytics:h,useAuthenticatedClient:F,useAuthorizedClient:G,useCreateAuthorizedClient:$,useAccessService:q,useConfigurationId:Q,useSession:e9,useSessionRole:oe,useSessionService:oo,useDomain:ei,useDomainApplication:en,useConfigurator:oj,useConfiguratorRouting:oq,usePresetSelection:oB,usePublishedData:eG,useFrontendData:ek,useBackendData:H,useDomainApplicationProps:es,useLoadedData:eB,useIntegrationService:eE,useIntegrationState:eb,usePresetEmbeddedState:eF,useRecipeEmbeddedState:eJ,useCommittedSlice:K,useRenderedSlice:eT,useCommittedState:L,useRenderedState:eV,useStoreSelector:oa,useRenderedSelector:eO,useStoreSelector$:om,useRenderedSelector$:eQ,useEntitySelector:ed,useRenderedEntitySelector:eM,useRootEntitySelector:e1,useRenderedRootEntitySelector:eN,useStateValidity:on,useMapViolationHints:ev,useNavigate:ez,usePopNavigate:eD,usePushNavigate:eH,useControlViolations:V,useFinalizeViolations:ec,useConfiguratorMessages:T,useFinalizeAction:ef,useFinalizeActions:eu,useComponent:M,useRenderedComponent:eK,useComponents:N,useRenderedComponents:eL,useFirstComponent:eg,useFirstRenderedComponent:el,useRootComponents:eY,useRootRenderedComponents:e3,useFirstRootComponent:ej,useFirstRootRenderedComponent:ex,useEntityState:em,useEntityRenderedState:ea,useRootEntityState:e2,useRootEntityRenderedState:e0,useRootEntityId:eZ,useRootEntityRenderedId:e_,useEntityPrice:ep,useRootEntityPrice:e$,useSelectedEntity:e7,useSelectedEntityId:e8,useSelectedDomainEntityId:e6,useSelectEntity:e4,useDeselect:eo,useSelectParent:e5,useHoveredEntity:eS,useHoveredEntityId:ew,useHoveredDomainEntityId:eC,useActiveNavigationState:B,useActiveViewState:R,useSetViewState:ot,useActiveToolState:P,useIsFullscreenActive:eq,useSetFullscreen:or,useResetCamera:o3,useUndoRedo:ou,useTabNavigation:od,useStepNavigation:os,useSceneSafeArea:o_,useActiveViewports:U,usePreview:oP,useCloseAction:ov,useIsCloningAllowed:oJ.useIsCloningAllowed,useResolveLocalizable:eX,useLocalizable:eh,useToolbarActions:oH,useMeasurements:oG,useLocaleSwitch:eU,useShareLinks:oi,useAssistantPanel:oF,useComposition:O,useUpdateControl:oc,useUpdatedControl:og,useCookRecipes:W,useCookedRecipes:Y,useCookReplaceRecipes:X,useCookedReplaceRecipes:Z,useDeleteEntity:_,useDeletedEntity:ee,useSwatchSelection:op,useTextValue:of,useAttributeSelection:z,useAttributeSwitch:D,useDistanceDimension:er,useDistanceDimensionSelection:et,useGenericDimension:eI,useAngleDimension:v,useChildEntitySelection:J,useGroupedRecipeOptions:eA,useReplaceEntityRecipeOptions:eW,useUpdateEntityObjectSelection:oD,useGenerateShareLink:ey,useLoadingState:eP,useLoadingStateValue:eR,usePropertyPageStack:oR,usePropertyPageState:oU,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:C,isAngleDimensionUpdate:y,isDistanceDimensionUpdate:S,isGenericDimensionUpdate:w,isAttributeSelectionUpdate:I,isAttributeSwitchUpdate:A,isTextValueUpdate:b,isSwatchSelectionUpdate:E});
|
|
@@ -39,6 +39,10 @@ export declare const useSidebarContents: () => {
|
|
|
39
39
|
};
|
|
40
40
|
export declare const useSidebarGoBack: () => () => void;
|
|
41
41
|
export declare const useHasSidebarSummary: () => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Use `useToolbarActions()` instead, or mount `LayoutSlots.DesktopToolbar` to keep project element
|
|
44
|
+
* overrides. This API will be removed in a future version.
|
|
45
|
+
*/
|
|
42
46
|
export declare const useToolbarState: () => import("#package/domain").ToolbarComponentState;
|
|
43
47
|
export declare const useEmbeddedModeActive: () => boolean;
|
|
44
48
|
export declare const usePresetEmbeddedModeActive: () => boolean;
|
|
@@ -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";
|
|
@@ -6,7 +6,8 @@ import { type ElementRegistration } from '#package/domain';
|
|
|
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
8
|
* screen, `ConfiguratorErrorPage` the production error page, `AppLoaderContent` what the app loader
|
|
9
|
-
* overlay shows,
|
|
10
|
-
*
|
|
9
|
+
* overlay shows, `AddEntityFab`, `DeleteEntityFab`, `SelectionHotspot`, `NavigationHotspot` and
|
|
10
|
+
* `ToolMenuFab` the in-scene entity controls, and the others are the built-in controls, toolbar
|
|
11
|
+
* buttons, menu actions and sidebar-footer pieces under the spec kinds that YAML names.
|
|
11
12
|
*/
|
|
12
13
|
export declare const defaultConfiguratorElements: readonly ElementRegistration[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{ConfigurationNotFoundPage as r,createNotAuthenticatedPage as t}from"#package/react-sdk";import{AppLoaderContentName as e,DefaultAppLoaderContent as i}from"../app-loader-content/index.js";import{createConfigurationNotFoundPage as m}from"../configuration-not-found-page/index.js";import{BuiltInConfiguratorErrorPage as a,createConfiguratorErrorPage as f}from"../configurator-error-page/index.js";import{createPresetUi as n}from"../ui/index.js";import{DefaultConfiguratorLayout as p}from"./DefaultConfiguratorLayout.js";import{DefaultNotAuthenticatedPage as u}from"./DefaultNotAuthenticatedPage.js";import{DefaultPresetUi as s}from"./DefaultPresetUi.js";import{ConfiguratorLayoutName as d}from"./configurator-layout-name.js";import{domainControlElements as g,recipePanelElements as c,
|
|
1
|
+
import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{ConfigurationNotFoundPage as r,createNotAuthenticatedPage as t}from"#package/react-sdk";import{AppLoaderContentName as e,DefaultAppLoaderContent as i}from"../app-loader-content/index.js";import{createConfigurationNotFoundPage as m}from"../configuration-not-found-page/index.js";import{BuiltInConfiguratorErrorPage as a,createConfiguratorErrorPage as f}from"../configurator-error-page/index.js";import{createPresetUi as n}from"../ui/index.js";import{DefaultConfiguratorLayout as p}from"./DefaultConfiguratorLayout.js";import{DefaultNotAuthenticatedPage as u}from"./DefaultNotAuthenticatedPage.js";import{DefaultPresetUi as s}from"./DefaultPresetUi.js";import{ConfiguratorLayoutName as d}from"./configurator-layout-name.js";import{domainControlElements as g,recipePanelElements as c,sceneControlElements as j,sidebarFooterElements as l,toolbarElements as x}from"./default-elements/index.js";export const defaultConfiguratorElements=[o(d,p),m(r),t(u),n(s),f(a),o(e,i),...g,...c,...j,...x,...l];
|
|
@@ -2,3 +2,4 @@ export { domainControlElements } from './domain-control-elements.js';
|
|
|
2
2
|
export { recipePanelElements } from './recipe-panel-elements.js';
|
|
3
3
|
export { sidebarFooterElements } from './sidebar-footer-elements.js';
|
|
4
4
|
export { toolbarElements } from './toolbar-elements.js';
|
|
5
|
+
export { BuiltInAddEntityFab, BuiltInDeleteEntityFab, BuiltInNavigationHotspot, BuiltInSelectionHotspot, BuiltInToolMenuFab, sceneControlElements, } from './scene-controls/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{domainControlElements}from"./domain-control-elements.js";export{recipePanelElements}from"./recipe-panel-elements.js";export{sidebarFooterElements}from"./sidebar-footer-elements.js";export{toolbarElements}from"./toolbar-elements.js";
|
|
1
|
+
export{domainControlElements}from"./domain-control-elements.js";export{recipePanelElements}from"./recipe-panel-elements.js";export{sidebarFooterElements}from"./sidebar-footer-elements.js";export{toolbarElements}from"./toolbar-elements.js";export{BuiltInAddEntityFab,BuiltInDeleteEntityFab,BuiltInNavigationHotspot,BuiltInSelectionHotspot,BuiltInToolMenuFab,sceneControlElements}from"./scene-controls/index.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AddEntityFabElementProps } from '#package/react-sdk';
|
|
2
|
+
/** The default of the `AddEntityFab` element: the SDK's add-entity FAB with its recipe menu. */
|
|
3
|
+
export declare const BuiltInAddEntityFab: (props: AddEntityFabElementProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{PhxIcon as e}from"#package/ui-sdk";import{AddEntityFab as t}from"../../../scene/index.js";export const BuiltInAddEntityFab=n=>{let{entityId:o,instanceNames:a,fixableViolations:r,icon:s,label:l,title:m,tooltipVisibility:p,skipMenuWhenOnlyOne:d,hideWhenNone:c}=n;return i(t,{parentEntityId:o,instanceNames:a,fixableViolations:r,icon:s?i(e,{name:s}):void 0,title:m,tooltipVisibility:p,label:l,skipMenuWhenOnlyOne:d,hideWhenNone:c})};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type DeleteEntityFabElementProps } from '#package/react-sdk';
|
|
2
|
+
/** The default of the `DeleteEntityFab` element: the SDK's delete-entity FAB. */
|
|
3
|
+
export declare const BuiltInDeleteEntityFab: (props: DeleteEntityFabElementProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{LocalizableMessage as i}from"#package/react-sdk";import{PhxIcon as t,DeleteEntityFab as o}from"#package/ui-sdk";import{useSceneControlTooltip as r}from"../../../scene/index.js";export const BuiltInDeleteEntityFab=a=>{let{icon:n,label:l,title:s,tooltipVisibility:d,onDelete:c,disabled:m,disabledHint:p,trace:b}=a,{tooltipOpen:k}=r(d);return e(o,{label:l?e(i,{children:l}):void 0,title:s?e(i,{children:s}):void 0,icon:n?e(t,{name:n}):void 0,disabled:m,disabledMessage:p,tooltipOpen:k,onClick:c,onDebugClick:b})};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { NavigationHotspotElementProps } from '#package/react-sdk';
|
|
2
|
+
/** The default of the `NavigationHotspot` element: the SDK's hotspot dot. */
|
|
3
|
+
export declare const BuiltInNavigationHotspot: (props: NavigationHotspotElementProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{SceneHotspot as i}from"../../../scene/index.js";export const BuiltInNavigationHotspot=o=>{let{title:e,tooltipVisibility:r,onNavigate:n}=o;return t(i,{onClick:n,title:e,tooltipVisibility:r})};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SelectionHotspotElementProps } from '#package/react-sdk';
|
|
2
|
+
/** The default of the `SelectionHotspot` element: the SDK's hotspot dot. */
|
|
3
|
+
export declare const BuiltInSelectionHotspot: (props: SelectionHotspotElementProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{SceneHotspot as i}from"../../../scene/index.js";export const BuiltInSelectionHotspot=o=>{let{title:e,tooltipVisibility:r,onSelect:n}=o;return t(i,{onClick:n,title:e,tooltipVisibility:r})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{ToolMenuFab as t}from"../../../scene/index.js";export const BuiltInToolMenuFab=i=>{let{options:e,icon:n,title:r,tooltipVisibility:l,onSelectTool:s}=i;return o(t,{options:e,icon:n,title:r,tooltipVisibility:l,onSelectTool:s})};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BuiltInAddEntityFab } from './BuiltInAddEntityFab.js';
|
|
2
|
+
export { BuiltInDeleteEntityFab } from './BuiltInDeleteEntityFab.js';
|
|
3
|
+
export { BuiltInNavigationHotspot } from './BuiltInNavigationHotspot.js';
|
|
4
|
+
export { BuiltInSelectionHotspot } from './BuiltInSelectionHotspot.js';
|
|
5
|
+
export { BuiltInToolMenuFab } from './BuiltInToolMenuFab.js';
|
|
6
|
+
export { sceneControlElements } from './scene-control-elements.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{BuiltInAddEntityFab}from"./BuiltInAddEntityFab.js";export{BuiltInDeleteEntityFab}from"./BuiltInDeleteEntityFab.js";export{BuiltInNavigationHotspot}from"./BuiltInNavigationHotspot.js";export{BuiltInSelectionHotspot}from"./BuiltInSelectionHotspot.js";export{BuiltInToolMenuFab}from"./BuiltInToolMenuFab.js";export{sceneControlElements}from"./scene-control-elements.js";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ElementRegistration } from '#package/domain';
|
|
2
|
+
/**
|
|
3
|
+
* The SDK's in-scene entity controls, registered under the element names the scene renders them by:
|
|
4
|
+
* `AddEntityFab`, `DeleteEntityFab`, `SelectionHotspot`, `NavigationHotspot` and `ToolMenuFab`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const sceneControlElements: readonly ElementRegistration[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createAddEntityFab as t,createDeleteEntityFab as o,createNavigationHotspot as i,createSelectionHotspot as r,createToolMenuFab as n}from"#package/react-sdk";import{BuiltInAddEntityFab as e}from"./BuiltInAddEntityFab.js";import{BuiltInDeleteEntityFab as m}from"./BuiltInDeleteEntityFab.js";import{BuiltInNavigationHotspot as s}from"./BuiltInNavigationHotspot.js";import{BuiltInSelectionHotspot as l}from"./BuiltInSelectionHotspot.js";import{BuiltInToolMenuFab as p}from"./BuiltInToolMenuFab.js";export const sceneControlElements=[t(e),o(m),r(l),i(s),n(p)];
|
|
@@ -32,6 +32,7 @@ export { usePixelWorldSize } from './three/use-pixel-world-size.js';
|
|
|
32
32
|
export { addSceneDebugNode } from './SceneDebugNodes.js';
|
|
33
33
|
export * from './scene-html/index.js';
|
|
34
34
|
export * from './scene-controls/index.js';
|
|
35
|
+
export { createAddEntityFab, createDeleteEntityFab, createNavigationHotspot, createSelectionHotspot, createToolMenuFab, type AddEntityFabElementProps, type CreateAddEntityFab, type CreateDeleteEntityFab, type CreateNavigationHotspot, type CreateSelectionHotspot, type CreateToolMenuFab, type DeleteEntityFabElementProps, type NavigationHotspotElementProps, type SelectionHotspotElementProps, type ToolMenuFabElementProps, } from '#package/react-sdk';
|
|
35
36
|
export * from './postprocessing/index.js';
|
|
36
37
|
export * from './sketching/index.js';
|
|
37
38
|
export * from './export/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{Scene}from"./Scene.js";export{SceneEnvironment}from"./SceneEnvironment.js";export{CameraControls}from"./cameras/CameraControls.js";export{CameraPadding}from"./cameras/CameraPadding.js";export{useEntityCameraDrivenOpacity}from"./cameras/use-entity-camera-driven-opacity.js";export{Animations}from"./animations/Animations.js";export{SceneEntityDimensionIndicators}from"./scene-entity/dimension-indicators/SceneEntityDimensionIndicators.js";export{DimensionIndicator}from"./scene-entity/dimension-indicators/DimensionIndicator.js";export{SceneEntityHtmlHotspots}from"./scene-entity/scene-controls/SceneEntityHtmlHotspots.js";export{SceneEntityControls}from"./scene-entity/scene-controls/SceneEntityControls.js";export{SceneEntity}from"./scene-entity/SceneEntity.js";export{SceneEntityHighlightedObject}from"./scene-entity/objects/SceneEntityHighlightedObject.js";export{SceneEntityObject}from"./scene-entity/objects/SceneEntityObject.js";export{SceneEntityObjectClip}from"./scene-entity/objects/SceneEntityObjectClip.js";export{SceneEntityObjectDecal}from"./scene-entity/objects/SceneEntityObjectDecal.js";export{SceneEntityObjectTextDecal}from"./scene-entity/objects/SceneEntityObjectTextDecal.js";export{SceneEntityPrimitiveObject}from"./scene-entity/objects/SceneEntityPrimitiveObject.js";export{SceneEntityRemoteObject}from"./scene-entity/objects/SceneEntityRemoteObject.js";export{SceneRootEntity}from"./scene-entity/SceneRootEntity.js";export{SceneEntityObjectTransformer}from"./scene-entity/objects/SceneEntityObjectTransformer.js";export{SceneEntityObjectMaterials}from"./scene-entity/materials/SceneEntityObjectMaterials.js";export{ReplacedMaterialTransition}from"./scene-entity/materials/ReplacedMaterialTransition.js";export{ReplacedMaterialTransformer}from"./scene-entity/materials/ReplacedMaterialTransformer.js";export{useSceneEntityHighlight}from"./scene-entity/entity-hooks/use-scene-entity-highlight.js";export{useSceneEntityObjectMorphing}from"./scene-entity/entity-hooks/use-scene-entity-object-morphing.js";export{useSceneEntityRemoteObject}from"./scene-entity/entity-hooks/use-scene-entity-remote-object.js";export{useSceneEntityInteractions}from"./scene-entity/drag-and-drop/use-scene-entity-interactions.js";export{useRotateHandle}from"./scene-entity/drag-and-drop/use-rotate-handle.js";export{isStandardMaterial,isWithMaterial}from"./three/with-material.js";export{usePixelWorldSize}from"./three/use-pixel-world-size.js";export{addSceneDebugNode}from"./SceneDebugNodes.js";export*from"./scene-html/index.js";export*from"./scene-controls/index.js";export*from"./postprocessing/index.js";export*from"./sketching/index.js";export*from"./export/index.js";export*from"./resources/index.js";export*from"./cameras/index.js";export*from"./scene-entity/index.js";
|
|
1
|
+
export{Scene}from"./Scene.js";export{SceneEnvironment}from"./SceneEnvironment.js";export{CameraControls}from"./cameras/CameraControls.js";export{CameraPadding}from"./cameras/CameraPadding.js";export{useEntityCameraDrivenOpacity}from"./cameras/use-entity-camera-driven-opacity.js";export{Animations}from"./animations/Animations.js";export{SceneEntityDimensionIndicators}from"./scene-entity/dimension-indicators/SceneEntityDimensionIndicators.js";export{DimensionIndicator}from"./scene-entity/dimension-indicators/DimensionIndicator.js";export{SceneEntityHtmlHotspots}from"./scene-entity/scene-controls/SceneEntityHtmlHotspots.js";export{SceneEntityControls}from"./scene-entity/scene-controls/SceneEntityControls.js";export{SceneEntity}from"./scene-entity/SceneEntity.js";export{SceneEntityHighlightedObject}from"./scene-entity/objects/SceneEntityHighlightedObject.js";export{SceneEntityObject}from"./scene-entity/objects/SceneEntityObject.js";export{SceneEntityObjectClip}from"./scene-entity/objects/SceneEntityObjectClip.js";export{SceneEntityObjectDecal}from"./scene-entity/objects/SceneEntityObjectDecal.js";export{SceneEntityObjectTextDecal}from"./scene-entity/objects/SceneEntityObjectTextDecal.js";export{SceneEntityPrimitiveObject}from"./scene-entity/objects/SceneEntityPrimitiveObject.js";export{SceneEntityRemoteObject}from"./scene-entity/objects/SceneEntityRemoteObject.js";export{SceneRootEntity}from"./scene-entity/SceneRootEntity.js";export{SceneEntityObjectTransformer}from"./scene-entity/objects/SceneEntityObjectTransformer.js";export{SceneEntityObjectMaterials}from"./scene-entity/materials/SceneEntityObjectMaterials.js";export{ReplacedMaterialTransition}from"./scene-entity/materials/ReplacedMaterialTransition.js";export{ReplacedMaterialTransformer}from"./scene-entity/materials/ReplacedMaterialTransformer.js";export{useSceneEntityHighlight}from"./scene-entity/entity-hooks/use-scene-entity-highlight.js";export{useSceneEntityObjectMorphing}from"./scene-entity/entity-hooks/use-scene-entity-object-morphing.js";export{useSceneEntityRemoteObject}from"./scene-entity/entity-hooks/use-scene-entity-remote-object.js";export{useSceneEntityInteractions}from"./scene-entity/drag-and-drop/use-scene-entity-interactions.js";export{useRotateHandle}from"./scene-entity/drag-and-drop/use-rotate-handle.js";export{isStandardMaterial,isWithMaterial}from"./three/with-material.js";export{usePixelWorldSize}from"./three/use-pixel-world-size.js";export{addSceneDebugNode}from"./SceneDebugNodes.js";export*from"./scene-html/index.js";export*from"./scene-controls/index.js";export{createAddEntityFab,createDeleteEntityFab,createNavigationHotspot,createSelectionHotspot,createToolMenuFab}from"#package/react-sdk";export*from"./postprocessing/index.js";export*from"./sketching/index.js";export*from"./export/index.js";export*from"./resources/index.js";export*from"./cameras/index.js";export*from"./scene-entity/index.js";
|
|
@@ -3,5 +3,9 @@ import { type SceneFabProps } from './SceneFab.js';
|
|
|
3
3
|
export interface ToolMenuFabProps extends Pick<SceneFabProps, 'title' | 'tooltipVisibility'> {
|
|
4
4
|
readonly options: readonly ToolMenuFabOption[];
|
|
5
5
|
readonly icon?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Switches to the tool state of the chosen option. Without it, the menu switches the tool itself.
|
|
8
|
+
*/
|
|
9
|
+
readonly onSelectTool?: (toolState: string) => void;
|
|
6
10
|
}
|
|
7
11
|
export declare const ToolMenuFab: (props: ToolMenuFabProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o,Fragment as
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{ListItemIcon as l,ListSubheader as i,MenuItem as n,menuClasses as a}from"@mui/material";import{memo as c,useCallback as m,useState as s}from"react";import{LocalizableMessage as p,useDomain as g}from"#package/react-sdk";import{PhxIcon as d,ResponsiveMenu as h}from"#package/ui-sdk";import{SceneFab as u}from"./SceneFab.js";let f=c(t=>{let{options:c,title:s,open:u,anchorEl:f,onClose:k,onSelectTool:S}=t,{navigationSystem:b,storeSystem:C}=g(),x=m(e=>{S?S(e.toolState):C.stageAndCommit([b.getToolUpdate(e.toolState)]),k()},[b,C,k,S]);return o(h,{closeLabel:e(r,{id:"sdk.controls.tool.close.label",message:"Close"}),open:u,anchorEl:f,onClose:k,menuProps:{anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},sx:{[`.${a.paper}`]:{minInlineSize:220,marginLeft:2,marginRight:1}}},children:[e(i,{children:e(p,{children:s})}),c.map(t=>o(n,{onClick:()=>{x(t)},children:[e(l,{children:t.icon&&e(d,{name:t.icon})}),e(p,{children:t.label})]},t.toolState))]})});export const ToolMenuFab=r=>{let{options:l,icon:i,title:n,tooltipVisibility:a,onSelectTool:c}=r,[p,g]=s(null),h=null!==p,k=m(e=>{g(e.currentTarget),e.stopPropagation()},[]),S=m(()=>{g(null)},[]);return o(t,{children:[e(u,{title:n,icon:e(d,{name:i??"PencilSimpleBold"}),tooltipVisibility:a,onClick:k}),h&&e(f,{anchorEl:p,open:h,onClose:S,options:l,title:n,onSelectTool:c})]})};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { SceneControlTooltipVisibility } from '#package/react-sdk';
|
|
2
|
+
export type { SceneControlTooltipVisibility };
|
|
2
3
|
export interface SceneControlTooltip {
|
|
3
4
|
/**
|
|
4
5
|
* Whether tooltip is open (undefined = uncontrolled hover behavior)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{memo as o}from"react";import{match as i}from"ts-pattern";import{htmlHotspotComponent as s,isHtmlHotspotComponentSnapshot as a,isSceneEntityAddFabComponentSnapshot as c,isSceneEntityDeleteFabComponentSnapshot as l,isSceneEntityNavigationHotspotComponentSnapshot as
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as n}from"react/jsx-runtime";import{memo as o}from"react";import{match as i}from"ts-pattern";import{htmlHotspotComponent as s,isHtmlHotspotComponentSnapshot as a,isSceneEntityAddFabComponentSnapshot as c,isSceneEntityDeleteFabComponentSnapshot as l,isSceneEntityNavigationHotspotComponentSnapshot as p,isSceneEntitySelectHotspotComponentSnapshot as r,isToolMenuFabComponentSnapshot as h,sceneEntityAddFabComponent as m,sceneEntityDeleteFabComponent as d,sceneEntityNavigationHotspotComponent as y,sceneEntitySelectHotspotComponent as f,toolMenuFabComponent as I}from"#package/domain";import{AddEntityFabElement as w,DeleteEntityFabElement as u,NavigationHotspotElement as W,PhoenixEntityElementWithChildren as b,SelectionHotspotElement as V,ToolMenuFabElement as g,useRenderedComponents as O}from"#package/react-sdk";import{SceneEntityHtml as $}from"../../scene-html/index.js";import{SuspendedBoundary as H}from"../SuspendedBoundary.js";export const SceneEntityHtmlHotspots=o(o=>{let{id:k}=o;return t(n,{children:O({entityIds:[k],componentTypes:[m,s,d,f,I,y]}).map(n=>{let o={entityId:k,showWhen:n.state.showWhen},s={offsetX:n.state.offsetX,offsetY:n.state.offsetY,offsetZ:n.state.offsetZ,screenOffsetHorizontal:n.state.screenOffsetHorizontal,screenOffsetVertical:n.state.screenOffsetVertical},m={polarAngleLimits:n.state.polarAngleLimits,azimuthAngleLimits:n.state.azimuthAngleLimits,distanceLimits:n.state.distanceLimits,minInteractiveOpacity:n.state.minInteractiveOpacity},d={hideWhileDragging:n.state.hideWhileDragging,occlude:n.state.occlude};return i(n).when(c,e=>t(H,{children:t($,{...o,...s,...m,...d,showWhen:e.state.showWhen??["selected"],controlHotspot:!0,children:t(w,{entityId:k,instanceNames:e.state.instanceNames,fixableViolations:e.state.hiddenViolations,icon:e.state.icon,title:e.state.title,tooltipVisibility:e.state.tooltipVisibility??"on-hover",label:e.state.label,skipMenuWhenOnlyOne:e.state.skipMenuWhenOnlyOne,hideWhenNone:e.state.hideWhenNone})})},`${e.componentInstance.componentType.name}-${e.componentInstance.instanceName}`)).when(l,e=>t(H,{children:t($,{...o,...s,...m,...d,showWhen:e.state.showWhen??["selected"],controlHotspot:!0,children:t(u,{entityId:k,fixableViolations:e.state.hiddenViolations,icon:e.state.icon,title:e.state.title,tooltipVisibility:e.state.tooltipVisibility??"on-hover",label:e.state.label})})},`${e.componentInstance.componentType.name}-${e.componentInstance.instanceName}`)).when(r,e=>t(H,{children:t($,{...o,...s,...m,...d,showWhen:e.state.showWhen??["unselected"],controlHotspot:!1,children:t(V,{entityId:k,title:e.state.title,tooltipVisibility:e.state.tooltipVisibility??"on-hover"})})},`${e.componentInstance.componentType.name}-${e.componentInstance.instanceName}`)).when(p,e=>t(H,{children:t($,{...o,...s,...m,...d,showWhen:e.state.showWhen??["unselected"],controlHotspot:!1,children:t(W,{entityId:k,navigationState:e.state.navigationState,pushToStack:e.state.pushToStack,canStackOnto:e.state.canStackOnto,title:e.state.title,tooltipVisibility:e.state.tooltipVisibility??"on-hover"})})},`${e.componentInstance.componentType.name}-${e.componentInstance.instanceName}`)).when(h,e=>t(H,{children:t($,{...o,...s,...m,...d,showWhen:e.state.showWhen??["unselected"],controlHotspot:!1,children:t(g,{entityId:k,options:e.state.options,icon:e.state.icon,title:e.state.title,tooltipVisibility:e.state.tooltipVisibility??"on-hover"})})},`${e.componentInstance.componentType.name}-${e.componentInstance.instanceName}`)).when(a,n=>t(H,{children:e($,{...o,...s,...m,...d,controlHotspot:n.state.controlHotspot,pointerEvents:n.state.inert?"none":"auto",children:[n.state.node,n.state.name&&t(b,{kind:n.state.name,entityId:k})]})},`${n.componentInstance.componentType.name}-${n.componentInstance.instanceName}`)).otherwise(()=>null)})})});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useMeasurements, type UseMeasurements, type UseMeasurementsOptions, type UseMeasurementsResult, } from './use-measurements.js';
|
|
2
|
+
export { useAssistantPanel, type UseAssistantPanel, type UseAssistantPanelResult } from './use-assistant-panel.js';
|
|
3
|
+
export { useToolbarActions, type UseToolbarActions, type UseToolbarActionsResult, type ToolbarAction, type ToolbarPlacement, } from './use-toolbar-actions.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{useMeasurements}from"./use-measurements.js";export{useAssistantPanel}from"./use-assistant-panel.js";export{useToolbarActions}from"./use-toolbar-actions.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])};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
|
+
import type { DimensionUnit } from '#package/domain';
|
|
3
|
+
import { type UseLocaleSwitchResult } from '#package/react-sdk';
|
|
4
|
+
import { type UseAssistantPanelResult } from './use-assistant-panel.js';
|
|
5
|
+
import { type UseMeasurementsResult } from './use-measurements.js';
|
|
6
|
+
/** Which of the spec's toolbar lists to read: `toolbar.desktop`, `toolbar.mobile` or `toolbar.mobileMenu`. */
|
|
7
|
+
export type ToolbarPlacement = 'desktop' | 'mobile' | 'mobileMenu';
|
|
8
|
+
interface ToolbarEntryBase {
|
|
9
|
+
/** Stable for the entry's placement, group and position, to key the rendered list */
|
|
10
|
+
readonly key: string;
|
|
11
|
+
/** The element's `icon` prop, when its kind has one and the spec sets it */
|
|
12
|
+
readonly icon: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The element's `showTitle` prop, else the built-in button's default: `true` for the assistant, else `false`. The
|
|
15
|
+
* built-in assistant button also hides its title on a phone or tablet-sized layout; the layout decides that here.
|
|
16
|
+
*/
|
|
17
|
+
readonly showTitle: boolean;
|
|
18
|
+
/** The built-in button's title in the current language, such as "Undo" or "Share"; a custom entry's `name` */
|
|
19
|
+
readonly label: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* One entry of the toolbar, by `kind`:
|
|
23
|
+
* - `undo`, `redo`: `run` undoes or redoes as `useUndoRedo` does; `disabled` while there is nothing to undo or redo.
|
|
24
|
+
* - `fullscreen`: `active` is the fullscreen flag, `run` toggles it and pushes the built-in button's analytics event.
|
|
25
|
+
* - `resetCamera`: `run` resets the camera as `useResetCamera` does.
|
|
26
|
+
* - `share`: the layout opens its own share dialog, which calls `useShareLinks`.
|
|
27
|
+
* - `measurements`: the layout opens its own settings over `measurements`, the result of `useMeasurements` with the
|
|
28
|
+
* element's `showIndicatorSwitch` applied; `icons` is the element's icon per unit, when the spec sets it.
|
|
29
|
+
* - `language`: the layout opens its own language list over `language`, the result of `useLocaleSwitch`.
|
|
30
|
+
* - `help`: `Content` renders the help, the element's children or else the help registered with
|
|
31
|
+
* `createToolbarHelp`, for the layout's own dialog. The built-in menu action falls back to nothing instead.
|
|
32
|
+
* - `assistant`: `run` opens or closes the assistant panel; `assistant` is the result of `useAssistantPanel`.
|
|
33
|
+
* - `custom`: `Element` renders the project element the spec's `customLayoutElement` names.
|
|
34
|
+
*/
|
|
35
|
+
export type ToolbarAction = (ToolbarEntryBase & {
|
|
36
|
+
readonly kind: 'undo';
|
|
37
|
+
readonly disabled: boolean;
|
|
38
|
+
readonly run: () => void;
|
|
39
|
+
}) | (ToolbarEntryBase & {
|
|
40
|
+
readonly kind: 'redo';
|
|
41
|
+
readonly disabled: boolean;
|
|
42
|
+
readonly run: () => void;
|
|
43
|
+
}) | (ToolbarEntryBase & {
|
|
44
|
+
readonly kind: 'fullscreen';
|
|
45
|
+
readonly active: boolean;
|
|
46
|
+
readonly run: () => void;
|
|
47
|
+
}) | (ToolbarEntryBase & {
|
|
48
|
+
readonly kind: 'resetCamera';
|
|
49
|
+
readonly run: () => void;
|
|
50
|
+
}) | (ToolbarEntryBase & {
|
|
51
|
+
readonly kind: 'share';
|
|
52
|
+
}) | (ToolbarEntryBase & {
|
|
53
|
+
readonly kind: 'measurements';
|
|
54
|
+
readonly measurements: UseMeasurementsResult;
|
|
55
|
+
readonly icons: Partial<Record<DimensionUnit, string>> | undefined;
|
|
56
|
+
}) | (ToolbarEntryBase & {
|
|
57
|
+
readonly kind: 'language';
|
|
58
|
+
readonly language: UseLocaleSwitchResult;
|
|
59
|
+
}) | (ToolbarEntryBase & {
|
|
60
|
+
readonly kind: 'help';
|
|
61
|
+
readonly Content: ComponentType;
|
|
62
|
+
}) | (ToolbarEntryBase & {
|
|
63
|
+
readonly kind: 'assistant';
|
|
64
|
+
readonly assistant: UseAssistantPanelResult;
|
|
65
|
+
readonly run: () => void;
|
|
66
|
+
}) | (ToolbarEntryBase & {
|
|
67
|
+
readonly kind: 'custom';
|
|
68
|
+
readonly name: string;
|
|
69
|
+
readonly Element: ComponentType;
|
|
70
|
+
});
|
|
71
|
+
export interface UseToolbarActionsResult {
|
|
72
|
+
/**
|
|
73
|
+
* The spec's groups (`toolbarButtonGroup`), each a list of entries; an entry outside a group is a group of one, and
|
|
74
|
+
* a group nested in a group is flattened into it, where the built-in toolbar nests it
|
|
75
|
+
*/
|
|
76
|
+
readonly groups: readonly (readonly ToolbarAction[])[];
|
|
77
|
+
/** The same entries, flattened */
|
|
78
|
+
readonly actions: readonly ToolbarAction[];
|
|
79
|
+
}
|
|
80
|
+
export type UseToolbarActions = (placement?: ToolbarPlacement) => UseToolbarActionsResult;
|
|
81
|
+
/**
|
|
82
|
+
* Hook to build a project layout's toolbar from the spec's `toolbar`, as the built-in `LayoutSlots.DesktopToolbar`,
|
|
83
|
+
* `LayoutSlots.MobileToolbar` and `LayoutSlots.MobileHamburgerMenu` do, as runnable entries instead of buttons.
|
|
84
|
+
* - It reads the first active root `toolbar` component's list for `placement` (`'desktop'` by default). Without
|
|
85
|
+
* one, it reads the default toolbar, which follows fullscreen and, for a viewer, leaves out share, undo and redo.
|
|
86
|
+
* - It leaves out an entry with nothing to offer: share when sharing is disabled, measurements or language with
|
|
87
|
+
* nothing to choose, help without content, the assistant without one in the spec. It leaves out an element that is
|
|
88
|
+
* not a toolbar entry, with a warning in development.
|
|
89
|
+
* - A project element registered under a built-in kind, such as `undoToolbarButton`, replaces that button in the
|
|
90
|
+
* built-in toolbar but not here: the entry stays the built-in action.
|
|
91
|
+
* - It differs from the built-in toolbar in four ways: the entries keep the spec's order for every placement, where
|
|
92
|
+
* `LayoutSlots.MobileToolbar` renders the `mobile` list reversed; a group nested in a group is flattened into it;
|
|
93
|
+
* the assistant's `showTitle` is the spec's, where the built-in button also hides its title on a phone or
|
|
94
|
+
* tablet-sized layout; and a `helpMenuAction` without children shows the registered help.
|
|
95
|
+
*
|
|
96
|
+
* The actions push the analytics events of the built-in buttons. Opening and closing the layout's own dialogs and
|
|
97
|
+
* popovers push none; the layout pushes its own through `useAnalytics`.
|
|
98
|
+
*/
|
|
99
|
+
export declare const useToolbarActions: UseToolbarActions;
|
|
100
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useCallback as t,useEffect as n,useMemo as a,useRef as o}from"react";import{P as r,match as s}from"ts-pattern";import{FrontendAnalyticsFactory as l,PhoenixLayoutElementWithChildren as i,PhoenixLayoutElements as u,useAnalyticsService as d,useIsDev as m,useIsFullscreenActive as p,useLocaleSwitch as b,useResolveLocalizable as c,useSetFullscreen as g,useShareLinks as h,useStoreSelector as k,useUndoRedo as T}from"#package/react-sdk";import{useConfigurator as B}from"../application-runtime/index.js";import{useAssistantPanel as f}from"./use-assistant-panel.js";import{useMeasurements as w}from"./use-measurements.js";import{useToolbarHelp as A}from"./use-toolbar-help.js";let v={undo:{id:"sdk.toolbar.undoRedo.undo.label",message:"Undo"},redo:{id:"sdk.toolbar.undoRedo.redo.label",message:"Redo"},enterFullscreen:{id:"sdk.toolbar.fullscreen.enter.label",message:"Open fullscreen"},exitFullscreen:{id:"sdk.toolbar.fullscreen.exit.label",message:"Exit fullscreen"},resetCamera:{id:"sdk.toolbar.camera.reset.label",message:"Reset camera"},shareToolbarButton:{id:"sdk.toolbar.share.open.label",message:"Share"},shareMenuAction:{id:"sdk.layout.menu.hamburger.share.label",message:"Share configuration"},measurementsToolbarButton:{id:"sdk.measurements",message:"Change measure"},measurementsMenuAction:{id:"sdk.layout.menu.measurements.label",message:"Change measure"},languageToolbarButton:{id:"sdk.toolbar.language.title",message:"Switch language"},languageMenuAction:{id:"sdk.layout.hamburgerMenu.language.label",message:"Change Language"},helpToolbarButton:{id:"sdk.toolbar.help.label",message:"Help"},helpMenuAction:{id:"sdk.layout.menu.hamburger.help.label",message:"Show help"},assistant:{id:"sdk.assistant.toolbarButton.label",message:"Assistant"}},C=(e,t,n=!1)=>({key:e,icon:t?.icon,showTitle:t?.showTitle??n});export const useToolbarActions=(M="desktop")=>{let{layoutSystem:P,cameraControlSystem:x}=B(),S=k(e=>P.getToolbarState(e.state),[P])[M],y=d(),$=c(),F=m(),R=T(),j=p(),L=g(),E=h({enabled:!1}),G=w(),D=b(),I=f(),O=A(),U=t(()=>{y.push(l.FullScreenModeToggled()),L(!j)},[y,L,j]),H=t(()=>{x.resetCamera()},[x]),W=t(()=>{I.setOpen(!I.open)},[I]),q=o(new WeakMap),z=t((e,t)=>{let n=q.current.get(e);if(n)return n;let a=()=>t();return q.current.set(e,a),a},[]),J=a(()=>{let t=[],n=(n,a)=>s(n).returnType().with({kind:"undoToolbarButton"},e=>({...C(a,e.props),kind:"undo",label:$(v.undo),disabled:!R.canUndo,run:R.undo})).with({kind:"redoToolbarButton"},e=>({...C(a,e.props),kind:"redo",label:$(v.redo),disabled:!R.canRedo,run:R.redo})).with({kind:r.union("enterFullscreenToolbarButton","exitFullscreenToolbarButton")},e=>({...C(a,e.props),kind:"fullscreen",label:$(j?v.exitFullscreen:v.enterFullscreen),active:j,run:U})).with({kind:"resetCameraToolbarButton"},e=>({...C(a,e.props),kind:"resetCamera",label:$(v.resetCamera),run:H})).with({kind:r.union("shareToolbarButton","shareMenuAction")},e=>E.available?{...C(a,e.props),kind:"share",label:$(v[e.kind])}:null).with({kind:r.union("measurementsToolbarButton","measurementsMenuAction")},e=>{let t=e.props?.showIndicatorSwitch??G.hasIndicatorSwitch,n=G.units.length>1||t;return n?{...C(a,void 0),kind:"measurements",label:$(v[e.kind]),measurements:{...G,hasIndicatorSwitch:t,available:n},icons:e.props?.icons}:null}).with({kind:r.union("languageToolbarButton","languageMenuAction")},e=>D.available?{...C(a,void 0),kind:"language",label:$(v[e.kind]),language:D}:null).with({kind:r.union("helpToolbarButton","helpMenuAction")},t=>{let{children:n}=t,o=void 0!==n?z(t,()=>e(u,{elements:n})):O;return o?{...C(a,t.props),kind:"help",label:$(v[t.kind]),Content:o}:null}).with({kind:"assistantToolbarButton"},e=>I.available?{...C(a,e.props,!0),kind:"assistant",label:$(v.assistant),assistant:I,run:W}:null).with({kind:"customLayoutElement"},t=>({...C(a,void 0),kind:"custom",label:t.props.name,name:t.props.name,Element:z(t,()=>e(i,{kind:t.kind,elementProps:t.props,children:t.children}))})).with({kind:r.union("toolbarButtonGroup","adminConnectedResourcePage","adminDataTableActions","adminDataTablePage","adminPresetActions","adminPresetCategoryActions","adminPresetCategoryPage","adminPresetListPage","adminRecipeActions","adminRecipeCollectionPage","enterSummaryButton","footerPrice","mainFooterActions","nextStepButton","otherActions","previousStepButton","saveTemplateButton","stepLabel","stepProgress")},e=>(t.push(e.kind),null)).exhaustive(),a=(e,t)=>{if("toolbarButtonGroup"!==e.kind){let a=n(e,`${t}-0`);return a?[a]:[]}return(e.children??[]).flatMap((e,o)=>"toolbarButtonGroup"===e.kind?a(e,`${t}-${o}`):n(e,`${t}-${o}`)??[])},o=(S??[]).map((e,t)=>a(e,`${M}-${t}`)).filter(e=>e.length>0);return{groups:o,actions:o.flat(),unsupported:t}},[S,M,$,R,j,U,H,E.available,G,D,I,W,O,z]),K=J.unsupported.join(", ");return n(()=>{F&&K&&console.warn(`useToolbarActions('${M}') leaves out elements that are not toolbar entries: ${K}.`)},[F,M,K]),a(()=>({groups:J.groups,actions:J.actions}),[J])};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
export type UseToolbarHelp = () => ComponentType | null;
|
|
3
|
+
/**
|
|
4
|
+
* Internal to `useToolbarActions`, not public: the help the project registers with the deprecated
|
|
5
|
+
* `createToolbarHelp`, which the default toolbar's help button shows, as a component, or `null` without one.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useToolbarHelp: UseToolbarHelp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{PhoenixLayoutElement as t,usePhoenixLayoutElementExists as o}from"#package/react-sdk";import{toolbarHelpElementName as r}from"../application-runtime/index.js";let l=()=>e(t,{name:r,elementProps:{},defaultSlot:()=>null});export const useToolbarHelp=()=>o(r)?l:null;
|
|
@@ -6,7 +6,7 @@ export interface AssistantMarkdownProps {
|
|
|
6
6
|
readonly forms: AssistantFormsVisibility;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Assistant text of the thread: Markdown with lists, tables, links, entity links, references, images, code and forms,
|
|
9
|
+
* Assistant text of the thread: Markdown with lists, tables, alerts, links, entity links, references, images, code and forms,
|
|
10
10
|
* without a bubble. A form fence the model is still writing shows a placeholder.
|
|
11
11
|
*/
|
|
12
12
|
export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ markdown, isStreaming, forms }: AssistantMarkdownProps) => import("react/jsx-runtime").JSX.Element>;
|