@salsita-ai/sdk 0.50.0-develop.9cf426b400 → 0.50.0-develop.aabb56df09
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/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +146 -13
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +8 -3
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +4 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +16 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.d.ts +9 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
- package/dist/configurator/common/frontend-analytics.d.ts +21 -21
- package/dist/configurator/index.d.ts +0 -1
- package/dist/configurator/index.js +1 -1
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/scene/scene-analytics/scene-analytics.d.ts +2 -2
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +6 -0
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
- package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -0
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
- package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
- package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
- package/dist/configurator/ui/assistant/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/index.js +1 -0
- package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
- package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
- package/dist/configurator/ui/assistant/theme.d.ts +2 -0
- package/dist/configurator/ui/assistant/theme.js +1 -0
- package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
- package/dist/configurator/ui/assistant/thread-items.js +1 -0
- package/dist/configurator/ui/assistant/tool-chip.d.ts +37 -0
- package/dist/configurator/ui/assistant/tool-chip.js +1 -0
- package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
- package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
- package/dist/configurator/ui/assistant/use-is-assistant-panel-open.d.ts +5 -0
- package/dist/configurator/ui/assistant/use-is-assistant-panel-open.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
- package/dist/configurator/ui/legacy/mobile-controls/MobileControls.d.ts +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
- package/dist/docs/index.json +1 -1
- package/dist/docs/layouts/toolbar.mdx +6 -0
- package/dist/docs/other-features/side-effects.mdx +26 -0
- package/dist/docs/phoenix/phoenix-cli.mdx +1 -1
- package/dist/domain/components/updates.d.ts +16 -0
- package/dist/domain/domain-context/index.d.ts +1 -1
- package/dist/domain/domain-context/store-system/store-system.js +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
- package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
- package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
- package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
- package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
- package/dist/editor/graphql/GraphQLPanel.js +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/legacy/domain-spec/__generated/domain-schema.d.ts +6 -0
- package/dist/phoenix/application-spec/generate-assistant-prompt.d.ts +3 -2
- package/dist/phoenix/application-spec/generate-assistant-prompt.js +1 -1
- package/dist/phoenix/commands/deploy.js +2 -2
- package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +2 -2
- package/dist/react-sdk/application-runtime/common-services/analytics/domain-controls-analytics.d.ts +21 -21
- package/dist/react-sdk/application-runtime/hooks/data/use-published-data.d.ts +1 -1
- package/dist/ui-sdk/common/use-viewport-size.d.ts +4 -1
- package/dist/ui-sdk/common/use-viewport-size.js +1 -1
- package/dist/ui-sdk/components/mobile-controls/index.d.ts +1 -1
- package/dist/ui-sdk/theme/types.d.ts +4 -0
- package/package.json +5 -8
- package/schema/domain-spec.json +24 -0
- package/dist/configurator/assistant/index.d.ts +0 -1
- package/dist/configurator/assistant/index.js +0 -1
- package/dist/configurator/assistant/use-assistant-chat.d.ts +0 -20
- package/dist/configurator/assistant/use-assistant-chat.js +0 -1
- package/dist/extras/assistant/AssistantChat.d.ts +0 -6
- package/dist/extras/assistant/AssistantChat.js +0 -1
- package/dist/extras/assistant/index.d.ts +0 -1
- package/dist/extras/assistant/index.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{jsx as a,jsxs as t,Fragment as o}from"react/jsx-runtime";import{keyframes as e,paperClasses as r,snackbarClasses as d,styled as i,useTheme as n,useThemeProps as s}from"@mui/material";import{AnimatePresence as l,motion as p}from"motion/react";import{useCallback as b,useRef as u}from"react";import{useAccessService as c,useIsFullscreenActive as m}from"#package/react-sdk";import{attrf as h,commonStyles as y,numToPx as g,useInvalidateScrollTimeline as f,useIsEmpty as
|
|
1
|
+
import{jsx as a,jsxs as t,Fragment as o}from"react/jsx-runtime";import{keyframes as e,paperClasses as r,snackbarClasses as d,styled as i,useTheme as n,useThemeProps as s}from"@mui/material";import{AnimatePresence as l,motion as p}from"motion/react";import{useCallback as b,useRef as u}from"react";import{useAccessService as c,useIsFullscreenActive as m}from"#package/react-sdk";import{attrf as h,commonStyles as y,numToPx as g,useInvalidateScrollTimeline as f,useIsEmpty as x,useResponsive as k}from"#package/ui-sdk";import{usePreview as v}from"../../../configurator-context/index.js";import{ASSISTANT_PANEL_SLOT as S,AssistantPanel as E,useIsAssistantPanelOpen as w}from"../../assistant/index.js";import{LayoutSlots as R}from"../slots/index.js";import{DesktopPreview as $}from"./DesktopPreview.js";import{useSceneSafeArea as B}from"./use-scene-safe-area.js";let C="PhxDesktopSidebar",D="minimalist",T="split",I="visible",A="hidden",P="assistant",F={Root:i("div",{name:C,slot:"root",shouldForwardProp:a=>"ownerState"!==a})(({ownerState:a})=>[`
|
|
2
2
|
--phx-sidebar-background: ${a.background};
|
|
3
3
|
--phx-sidebar-border: ${a.border};
|
|
4
4
|
--phx-sidebar-filter: ${a.filter};
|
|
5
5
|
--phx-sidebar-padding: ${a.padding};
|
|
6
6
|
--phx-sidebar-radius: ${a.borderRadius}px;
|
|
7
7
|
--phx-sidebar-scrollable-indicator-background: ${a.scrollableIndicatorBackground};
|
|
8
|
-
`,{borderRadius:"var(--phx-sidebar-radius)",display:"grid",filter:"var(--phx-sidebar-filter)",gridTemplateRows:"min-content minmax(0, 1fr) min-content",inlineSize:a.width,position:"relative","& > *":{pointerEvents:"auto"},"@container style(--inspect: on)":{"--phx-sidebar-background":"hsl(from gold h s l / 50%)"},[`&[data-sidebar*="${
|
|
8
|
+
`,{borderRadius:"var(--phx-sidebar-radius)",display:"grid",filter:"var(--phx-sidebar-filter)",gridTemplateRows:"min-content minmax(0, 1fr) min-content",inlineSize:a.width,position:"relative","& > *":{pointerEvents:"auto"},"@container style(--inspect: on)":{"--phx-sidebar-background":"hsl(from gold h s l / 50%)"},[`&[data-sidebar*="${I}"]`]:{opacity:1},[`&[data-sidebar*="${A}"]`]:{opacity:0},[`&[data-sidebar*="${P}"] > :not([data-sidebar="${S}"])`]:{visibility:"hidden"}}]),Tabs:i("div",{name:C,slot:"tabs",shouldForwardProp:a=>"ownerState"!==a})(({theme:{spacing:a}})=>({insetBlockStart:0,insetInlineEnd:"100%",maxInlineSize:150,paddingInlineEnd:a(2),position:"absolute","&:is(:empty)":{padding:0},[`.${r.root}`]:{boxShadow:"none"}})),Header:i("header",{name:C,slot:"header",shouldForwardProp:a=>"ownerState"!==a})({background:"var(--phx-sidebar-background)",border:"var(--phx-sidebar-border)",borderBlockEnd:0,borderStartStartRadius:"inherit",borderStartEndRadius:"inherit",paddingBlock:"calc(0.6 * var(--phx-sidebar-padding))",paddingInline:"var(--phx-sidebar-padding)","&:is(:empty)":{border:0,paddingBlock:0}}),Body:i("div",{name:C,slot:"body",shouldForwardProp:a=>"ownerState"!==a})(({ownerState:a})=>({background:"var(--phx-sidebar-background)",border:"var(--phx-sidebar-border)",borderBlockStart:0,borderBlockEnd:0,display:"grid",position:"relative",'[data-layout*="slot[sidebar]"]:where(:has([data-sidebar="slot[header]"])) &':{...a.isHeaderEmpty&&{borderBlockStart:"var(--phx-sidebar-border)",borderStartStartRadius:"inherit",borderStartEndRadius:"inherit",paddingBlockStart:"var(--phx-sidebar-padding)"}},'&:has([data-sidebar*="slot[content]"]:empty)':{...a.isContentEmpty&&{paddingBlock:0}},[`[data-sidebar*="${D}"] &`]:{...a.isContentEmpty&&{border:0}},[`[data-sidebar*="${T}"] &`]:{borderBlockEnd:"var(--phx-sidebar-border)",borderEndStartRadius:"inherit",borderEndEndRadius:"inherit",paddingBlockEnd:"var(--phx-sidebar-padding)"}})),Content:i("div",{name:C,slot:"content",shouldForwardProp:a=>"ownerState"!==a})(({ownerState:a,theme:{spacing:t}})=>({...y.layout.normalizeScrollableContainer,alignContent:"start",borderRadius:"inherit",display:"grid",gap:t(3),padding:"var(--phx-sidebar-padding)","@supports (animation-timeline: scroll())":{"&[data-scrollable]":{scrollTimeline:"--phx-sidebar-timeline y","&::after, &::before":{animation:`${y.keyframes.fadeIn} both`,animationTimeline:"--phx-sidebar-timeline",background:"var(--phx-sidebar-scrollable-indicator-background)",backgroundRepeat:"no-repeat",content:'""',display:"block",insetInline:0,opacity:0,pointerEvents:"none",position:"absolute",zIndex:1},"&::after":{animationDirection:"reverse",animationRange:`calc(100% - ${t(4)}) 100%`,borderEndStartRadius:"inherit",borderEndEndRadius:"inherit",insetBlockStart:"50%",insetBlockEnd:0,scale:"1 -1"},"&::before":{animationRange:`0 ${t(4)}`,borderStartStartRadius:"inherit",borderStartEndRadius:"inherit",insetBlockStart:0,insetBlockEnd:"50%"}}},"&:is(:empty)":{paddingBlock:0},'[data-layout*="slot[sidebar]"] &':{...a.isHeaderEmpty&&{paddingBlockStart:0,"&::before":{borderStartStartRadius:0,borderStartEndRadius:0,insetBlockStart:"var(--phx-sidebar-padding)"}}},[`[data-sidebar*="${T}"] &`]:{paddingBlockEnd:0,"&::after":{borderEndStartRadius:0,borderEndEndRadius:0,insetBlockEnd:"var(--phx-sidebar-padding)"}}})),Footer:i("footer",{name:C,slot:"footer",shouldForwardProp:a=>"ownerState"!==a})(({ownerState:a,theme:{palette:t,spacing:o}})=>({background:"var(--phx-sidebar-background)",border:"var(--phx-sidebar-border)",borderBlockStart:`1px solid ${t.divider}`,borderEndStartRadius:"inherit",borderEndEndRadius:"inherit",padding:"var(--phx-sidebar-padding)","&:is(:empty)":{border:0,paddingBlock:0},[`[data-sidebar*="${D}"] &`]:{...a.isContentEmpty&&{borderBlockStart:"var(--phx-sidebar-border)",borderStartStartRadius:"inherit",borderStartEndRadius:"inherit"}},[`[data-sidebar*="${T}"] &`]:{borderBlockStart:"var(--phx-sidebar-border)",borderStartStartRadius:"inherit",borderStartEndRadius:"inherit",marginBlockStart:o(2)}}))};export const PhxDesktopLayoutName="PhxDesktopLayout";let j="PhxDesktopLayout",z=i(p.div,{name:j,slot:"root",shouldForwardProp:a=>"ownerState"!==a})(({ownerState:a,theme:{spacing:t}})=>{let o=e({"0%":{marginInlineEnd:0},"100%":{marginInlineEnd:t(-2)}});return[`
|
|
9
9
|
--inspect: off; // 🕹️ inspection mode toggle
|
|
10
10
|
|
|
11
11
|
--phx-layout-sidebar-track-size: ${g(a.sidebarWidth)};
|
|
@@ -38,12 +38,12 @@ import{jsx as a,jsxs as t,Fragment as o}from"react/jsx-runtime";import{keyframes
|
|
|
38
38
|
[bottom-start]
|
|
39
39
|
min-content
|
|
40
40
|
[bottom-end full-end]
|
|
41
|
-
`,inset:0,isolation:"isolate",pointerEvents:"none",position:"absolute","@container style(--inspect: on)":{'& > *, & > * > *, [data-layout*="slot[body.footer]"] > *':{outline:"2px solid hsl(from tomato h s l / 50%)"}},'[data-layout*="interactive"]':{"& > *":{pointerEvents:"auto"}},'[data-layout*="slot[header]"]':{gridArea:"top-start / main-start / top-end / sidebar-end"},'[data-layout*="slot[body]"]':{containerType:"size",display:"grid",gridArea:"main",gridRowStart:"top-end",gridTemplateRows:"min-content 1fr min-content"},'[data-layout*="slot[body.top]"]':{gridArea:"1 / 1 / 2 / -1","& > *":{...y.transition.fadeIn}},'[data-layout*="slot[body.safeSceneArea]"]':{gridArea:"1 / 1 / 3 / -1","@container style(--inspect: on)":{background:"hsl(from lime h s l / 50%)"}},'[data-layout*="slot[body.bottom]"]':{alignItems:"end",display:"grid",gap:t(2),gridArea:"3 / 1 / 4 / -1",gridTemplateColumns:"minmax(0, auto) minmax(60px, 1fr)",justifyContent:"start",position:"relative",'&:has([data-layout="slot[body.viewControls]"]:empty)':{gap:0,gridTemplateColumns:"repeat(2, auto)"}},'[data-layout="slot[body.toolbar]"]':{animation:`${o} auto linear both`,animationTimeline:"scroll(self inline)",display:"flex",margin:t(-2),overflowX:"scroll",overscrollBehavior:"contain",padding:t(2),scrollbarWidth:"none","&::after":{content:'""'}},'[data-layout="slot[body.toolControls]"]':{insetBlockEnd:`calc(100% + ${t(6)})`,position:"absolute","& > *":{...y.transition.fadeIn,transitionDuration:"300ms"}},'[data-layout="slot[body.viewControls]"]':{},'[data-layout="slot[body.logo]"], [data-layout="slot[body.sideEffects]"]':{insetBlockEnd:`calc(100% + ${t(2)})`,position:"absolute"},'[data-layout="slot[body.sideEffects]"]':{insetInline:0,[`.${d.root}`]:{inset:"unset",insetBlockEnd:0,position:"absolute"}},'[data-layout*="slot[sidebar]"]':{display:"grid",gridArea:"top-start / sidebar-start / main-end / sidebar-end",gridTemplateRows:"minmax(0, auto)"},'[data-layout*="slot[footer]"]':{display:"grid",gap:"var(--phx-layout-gap)",gridArea:"bottom-start / full-start / bottom-end / full-end"},'&:has([data-header*="fixed"])':{'[data-layout*="slot[header]"]':{gridArea:"full-start / full-start / top-end / full-end"},'[data-layout*="slot[body]"]':{gridRowStart:"main-start"},'[data-layout*="slot[sidebar]"]':{gridRow:"main-start / main-end"}},'&:has([data-header*="floating"])':{'[data-layout*="slot[header]"]':{gridColumnEnd:"main-end"}},[`&:has([data-sidebar*="${
|
|
41
|
+
`,inset:0,isolation:"isolate",pointerEvents:"none",position:"absolute","@container style(--inspect: on)":{'& > *, & > * > *, [data-layout*="slot[body.footer]"] > *':{outline:"2px solid hsl(from tomato h s l / 50%)"}},'[data-layout*="interactive"]':{"& > *":{pointerEvents:"auto"}},'[data-layout*="slot[header]"]':{gridArea:"top-start / main-start / top-end / sidebar-end"},'[data-layout*="slot[body]"]':{containerType:"size",display:"grid",gridArea:"main",gridRowStart:"top-end",gridTemplateRows:"min-content 1fr min-content"},'[data-layout*="slot[body.top]"]':{gridArea:"1 / 1 / 2 / -1","& > *":{...y.transition.fadeIn}},'[data-layout*="slot[body.safeSceneArea]"]':{gridArea:"1 / 1 / 3 / -1","@container style(--inspect: on)":{background:"hsl(from lime h s l / 50%)"}},'[data-layout*="slot[body.bottom]"]':{alignItems:"end",display:"grid",gap:t(2),gridArea:"3 / 1 / 4 / -1",gridTemplateColumns:"minmax(0, auto) minmax(60px, 1fr)",justifyContent:"start",position:"relative",'&:has([data-layout="slot[body.viewControls]"]:empty)':{gap:0,gridTemplateColumns:"repeat(2, auto)"}},'[data-layout="slot[body.toolbar]"]':{animation:`${o} auto linear both`,animationTimeline:"scroll(self inline)",display:"flex",margin:t(-2),overflowX:"scroll",overscrollBehavior:"contain",padding:t(2),scrollbarWidth:"none","&::after":{content:'""'}},'[data-layout="slot[body.toolControls]"]':{insetBlockEnd:`calc(100% + ${t(6)})`,position:"absolute","& > *":{...y.transition.fadeIn,transitionDuration:"300ms"}},'[data-layout="slot[body.viewControls]"]':{},'[data-layout="slot[body.logo]"], [data-layout="slot[body.sideEffects]"]':{insetBlockEnd:`calc(100% + ${t(2)})`,position:"absolute"},'[data-layout="slot[body.sideEffects]"]':{insetInline:0,[`.${d.root}`]:{inset:"unset",insetBlockEnd:0,position:"absolute"}},'[data-layout*="slot[sidebar]"]':{display:"grid",gridArea:"top-start / sidebar-start / main-end / sidebar-end",gridTemplateRows:"minmax(0, auto)"},'[data-layout*="slot[footer]"]':{display:"grid",gap:"var(--phx-layout-gap)",gridArea:"bottom-start / full-start / bottom-end / full-end"},'&:has([data-header*="fixed"])':{'[data-layout*="slot[header]"]':{gridArea:"full-start / full-start / top-end / full-end"},'[data-layout*="slot[body]"]':{gridRowStart:"main-start"},'[data-layout*="slot[sidebar]"]':{gridRow:"main-start / main-end"}},'&:has([data-header*="floating"])':{'[data-layout*="slot[header]"]':{gridColumnEnd:"main-end"}},[`&:has([data-sidebar*="${D}"])`]:{'[data-layout*="slot[sidebar]"]':{alignContent:"end",gridRow:"main-start / main-end"}},[`&:has([data-header*="floating"]):has([data-sidebar*="${D}"])`]:{'[data-layout*="slot[header]"]':{gridColumnEnd:"sidebar-end"},'[data-layout*="slot[sidebar]"]':{gridRowStart:"top-end"}},[`&:has([data-sidebar*="${P}"])`]:{'[data-layout*="slot[sidebar]"]':{alignContent:"stretch"}},[`&:has([data-sidebar*="${A}"])`]:{"--phx-layout-gap":0,"--phx-layout-sidebar-track-size":0,'[data-layout*="slot[sidebar]"]':{overflow:"hidden"}}}]}),H=i("div")({gridArea:"1 / 1 / -1 / -1"});export const DesktopLayout=()=>{let e=u(null),r=u(null),{palette:d,shape:i,spacing:p}=n(),{sidebarWidth:y="clamp(360px, 30cqi, 400px)"}=s({props:{},name:j}),{background:g=d.background.paper,border:S=0,borderRadius:L=i.sidebarBorderRadius??i.borderRadius,filter:W=`
|
|
42
42
|
drop-shadow(0 1px 1.5px hsl(from ${d.common.black} h s l / 12%))
|
|
43
43
|
drop-shadow(0 1px 0.5px hsl(from ${d.common.black} h s l / 14%))
|
|
44
44
|
drop-shadow(0 2px 0.5px hsl(from ${d.common.black} h s l / 20%))
|
|
45
|
-
`,padding:
|
|
45
|
+
`,padding:q=p(2.5),scrollableIndicatorBackground:M=`linear-gradient(
|
|
46
46
|
180deg,
|
|
47
47
|
hsl(from black h s l / 12%),
|
|
48
48
|
hsl(from black h s l / 0%) 8px
|
|
49
|
-
)`}=s({props:{},name:
|
|
49
|
+
)`}=s({props:{},name:C}),{hasMiniSidebar:N,hasSplitSidebar:V}=R.useSidebarContent(),X=w(),{accessInfo:G}=c(),J=m(),{isPreview:K,isHidden:O}=v(),Q=!O&&!K,U=!J,{setCanvasPadding:Y,setAnimating:Z}=k(),{containerRef:_,safeAreaRef:aa,update:at}=B(Y,N&&!X,Q),ao=b(()=>{Z(!0)},[Z]),ae=b(()=>{Z(!1),at()},[Z,at]),ar=Q&&U,ad=x(e,{disabled:!ar}),ai=x(r,{disabled:!ar});f(r,{disabled:!ar});let an={background:g,border:S,borderRadius:L,filter:W,isHeaderEmpty:ad,isContentEmpty:ai,padding:q,scrollableIndicatorBackground:M,width:y};return a(o,{children:t(l,{mode:"wait",children:[!O&&K&&a($,{},"preview-layout"),Q&&t(z,{layoutId:"ui-layout",layout:!0,ownerState:{sidebarWidth:y},"data-layout":h({state:{initial:!J,fullscreen:J}}),onLayoutAnimationStart:ao,onLayoutAnimationComplete:ae,children:[a(H,{ref:_}),a("header",{"data-layout":"slot[header]",children:a(R.DesktopHeader,{})}),t("main",{"data-layout":"slot[body]",children:[a("div",{"data-layout":"slot[body.top] interactive",children:a(R.DesktopCallToAction,{})}),a("div",{ref:aa,"data-layout":"slot[body.safeSceneArea]"}),t("div",{"data-layout":"slot[body.bottom] interactive",children:[a("div",{"data-layout":"slot[body.toolbar]",children:a(R.DesktopToolbar,{})}),a("div",{"data-layout":"slot[body.toolControls]",children:!J&&a(R.DesktopToolControls,{})}),a("div",{"data-layout":"slot[body.viewControls]",children:a(R.DesktopViewControls,{})}),a("div",{"data-layout":"slot[body.logo]",children:a(R.DesktopPoweredBy,{})}),a("div",{"data-layout":"slot[body.sideEffects]",children:a(R.DesktopSnackbarsRoot,{})})]})]}),a("aside",{"data-layout":"slot[sidebar]",children:t(F.Root,{ownerState:an,"data-sidebar":h({variant:{[`${D}`]:N,[`${T}`]:V},state:{[`${I}`]:U,[`${A}`]:!U,[`${P}`]:X}}),inert:U?void 0:"",children:[a(F.Tabs,{ownerState:an,"data-sidebar":"slot[tabs]",children:a(R.DesktopSidebarTabs,{})}),a(F.Header,{ref:e,ownerState:an,"data-sidebar":"slot[header]",children:a(R.DesktopSidebarBackButton,{})}),a(F.Body,{ownerState:an,"data-sidebar":"slot[body]",children:a(F.Content,{ref:r,ownerState:an,"data-sidebar":"slot[content]",children:a(R.DesktopSidebarContent,{})})}),a(F.Footer,{ownerState:an,"data-sidebar":"slot[footer]",children:a(R.DesktopSidebarFooter,{})}),a(E,{})]})}),t("footer",{"data-layout":"slot[footer] interactive",children:[G.viewMode&&!J&&a(R.DesktopReadonlyBanner,{}),a(R.DesktopFooter,{})]})]},"interface-layout")]})})};
|
|
@@ -86,6 +86,8 @@ declare module '@mui/material/styles' {
|
|
|
86
86
|
}
|
|
87
87
|
interface LayoutOwnerState {
|
|
88
88
|
readonly isContentEmpty?: boolean;
|
|
89
|
+
/** Height of the assistant panel while its input has focus: what the on-screen keyboard leaves free. */
|
|
90
|
+
readonly assistantFocusHeight?: number;
|
|
89
91
|
}
|
|
90
92
|
export interface ThemeableMobileLayoutProps extends LayoutOwnerState {
|
|
91
93
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import{snackbarClasses as o,styled as
|
|
1
|
+
import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import{snackbarClasses as o,styled as i,useTheme as r,useThemeProps as n}from"@mui/material";import d from"lodash/noop.js";import{AnimatePresence as s}from"motion/react";import{useRef as l}from"react";import{useAccessService as m,useEagerObservableSelector as c,useIsFullscreenActive as p}from"#package/react-sdk";import{attrf as u,commonStyles as b,numToPx as h,useIsEmpty as g,useResponsive as f,useViewportSize as y}from"#package/ui-sdk";import{useConfigurator as x}from"../../../application-runtime/index.js";import{usePreview as v}from"../../../configurator-context/index.js";import{ASSISTANT_PANEL_SLOT as w,AssistantPanel as S,useIsAssistantPanelOpen as $}from"../../assistant/index.js";import{LayoutSlots as k}from"../slots/index.js";import{MobileHeader as C}from"../slots/slots.js";import{MobilePreview as F}from"./MobilePreview.js";import{useSceneSafeArea as M}from"./use-scene-safe-area.js";let T="visible",I="hidden",R=i("div",{name:"PhxMobileHeader",slot:"root"})(({theme:{spacing:t}})=>({...b.transition.fadeInFrom,alignItems:"center",display:"flex",gap:t(1),justifyContent:"space-between",position:"relative","@container style(--inspect: on)":{background:"hsl(from tomato h s l / 50%)"},'[data-header*="slot"]':{display:"flex",gap:t(2),"& > *":{pointerEvents:"auto"}},'[data-header="slot[center]"]':{display:"grid",inset:0,placeItems:"center",position:"absolute"},[`&[data-header*="${T}"]`]:{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"},[`&[data-header*="${I}"]`]:{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 -60%"}})),B="visible",E="hidden",P=i("div",{name:"PhxMobileControls",slot:"root"})(({theme:{spacing:t}})=>({alignItems:"end",display:"flex",position:"relative","@container style(--inspect: on)":{background:"hsl(from tomato h s l / 50%)"},'[data-controls*="slot"]':{"& > *":{pointerEvents:"auto"}},'[data-controls="slot[toolControls]"]':{...b.transition.fadeInFrom,"&:not(:empty)":{marginInlineEnd:t(2)},"& > *":{...b.transition.fadeIn,transitionDelay:"300ms",transitionDuration:"300ms"}},'[data-controls="slot[viewControls]"]':{...b.transition.fadeInFrom,marginInlineStart:"auto"},'[data-controls="slot[toolbar]"]':{"&:not(:empty)":{marginInlineStart:t(2)}},[`&[data-controls*="${B}"]`]:{'[data-controls="slot[toolControls]"], [data-controls="slot[viewControls]"]':{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"}},[`&[data-controls*="${E}"]`]:{'[data-controls="slot[toolControls]"], [data-controls="slot[viewControls]"]':{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 60%"}}})),D="PhxMobileSidebar",j="visible",A="hidden",z="assistant",H={Root:i("div",{name:D,slot:"root",shouldForwardProp:t=>"ownerState"!==t})(({ownerState:t})=>[`
|
|
2
2
|
--phx-sidebar-background: ${t.background};
|
|
3
3
|
--phx-sidebar-padding: ${t.padding};
|
|
4
4
|
--phx-sidebar-radius: ${t.borderRadius}px;
|
|
5
|
-
`,{...
|
|
5
|
+
`,{...b.transition.fadeInFrom,background:"var(--phx-sidebar-background)",borderStartStartRadius:"var(--phx-sidebar-radius)",borderStartEndRadius:"var(--phx-sidebar-radius)",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"min-content minmax(0, 1fr) min-content",position:"relative","& > *":{pointerEvents:"auto"},"@container style(--inspect: on)":{background:"hsl(from gold h s l / 50%)"},'&:has([data-sidebar*="slot[content]"])':{...t.isContentEmpty&&{"--phx-sidebar-radius":0,'[data-sidebar*="slot[header]"]':{paddingBlock:0,"& > *":{display:"none"}}}},[`&[data-sidebar*="${j}"]`]:{opacity:1,transitionDuration:"200ms, 300ms",transitionTimingFunction:"linear, ease-out",translate:"0 0"},[`&[data-sidebar*="${A}"]`]:{opacity:0,transitionDuration:"100ms, 100ms",transitionTimingFunction:"linear, ease-in",translate:"0 60%"},[`&[data-sidebar*="${z}"] > :not([data-sidebar="${w}"])`]:{visibility:"hidden"}}]),Header:i("header",{name:D,slot:"header",shouldForwardProp:t=>"ownerState"!==t})(({theme:{spacing:t}})=>({alignItems:"center",borderStartStartRadius:"inherit",borderStartEndRadius:"inherit",display:"grid",gap:t(1),gridTemplateColumns:"repeat(2, minmax(0, 1fr))",paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","& > *":{...b.transition.fadeIn,transitionDelay:"100ms",transitionDuration:"300ms"},'[data-sidebar="slot[header.start]"]':{},'[data-sidebar="slot[header.end]"]':{justifySelf:"end"}})),Body:i("div",{name:D,slot:"body",shouldForwardProp:t=>"ownerState"!==t})({display:"grid",gridTemplateRows:"minmax(0, 1fr)"}),Content:i("div",{name:D,slot:"content",shouldForwardProp:t=>"ownerState"!==t})(({theme:{spacing:t}})=>({...b.layout.normalizeScrollableContainer,display:"grid",gap:t(2),gridAutoRows:"min-content",paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","&:empty":{paddingBlock:0}})),Tabs:i("div",{name:D,slot:"tabs",shouldForwardProp:t=>"ownerState"!==t})(({theme:{palette:t}})=>({borderBlockStart:`1px solid ${t.divider}`,paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"calc(var(--phx-sidebar-padding) * 0.75)","&:is(:empty)":{border:0,padding:0}})),Footer:i("footer",{name:D,slot:"footer",shouldForwardProp:t=>"ownerState"!==t})(({theme:{palette:t}})=>({borderBlockStart:`1px solid ${t.divider}`,paddingBlock:"calc(var(--phx-sidebar-padding) * 0.5)",paddingInline:"var(--phx-sidebar-padding)","&:is(:empty)":{borderColor:"transparent",paddingBlock:0}}))};export const PhxMobileLayoutName="PhxMobileLayout";let L="initial",q="fullscreen",N="min(480px, 50cqb)",V=["auto","min-content","max-content","fit-content"],G=i("div",{name:"PhxMobileLayout",slot:"root",shouldForwardProp:t=>"ownerState"!==t})(({ownerState:t,theme:{spacing:a}})=>[`
|
|
6
6
|
--inspect: off; // 🕹️ inspection mode toggle
|
|
7
7
|
|
|
8
|
-
--phx-layout-sidebar-track-size: ${
|
|
8
|
+
--phx-layout-sidebar-track-size: ${h(t.sidebarHeight)};
|
|
9
9
|
--phx-layout-gutter: ${a(2)};
|
|
10
10
|
`,{display:"grid",gridTemplateColumns:`
|
|
11
11
|
[full-start]
|
|
@@ -39,4 +39,4 @@ import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import{snackbarC
|
|
|
39
39
|
[footer-end]
|
|
40
40
|
var(--phx-layout-gutter)
|
|
41
41
|
[full-end]
|
|
42
|
-
`},'[data-layout*="slot[body.header]"]':{gridArea:"header-start / main-start / header-end / main-end"},'[data-layout*="slot[body.footer]"]':{gridArea:"footer-start / main-start / footer-end / main-end",position:"relative"},'[data-layout*="slot[body.safeSceneArea]"]':{gridArea:"full","@container style(--inspect: on)":{background:"hsl(from lime h s l / 50%)"}},'[data-layout="slot[body.sideEffects]"]':{insetBlockEnd:`calc(100% + ${a(2)})`,position:"absolute"},'[data-layout*="slot[sidebar]"]':{display:"grid",gridArea:"sidebar-start / full-start / sidebar-end / full-end",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, auto)"},'[data-layout*="slot[footer]"]':{gridArea:"footer-start / full-start / footer-end / full-end",zIndex:1},'&:has([data-sidebar*="slot[content]"])':{...t.isContentEmpty&&{"--phx-layout-sidebar-track-size":"min-content"}},[`&[data-layout*="${
|
|
42
|
+
`},'[data-layout*="slot[body.header]"]':{gridArea:"header-start / main-start / header-end / main-end"},'[data-layout*="slot[body.footer]"]':{gridArea:"footer-start / main-start / footer-end / main-end",position:"relative"},'[data-layout*="slot[body.safeSceneArea]"]':{gridArea:"full","@container style(--inspect: on)":{background:"hsl(from lime h s l / 50%)"}},'[data-layout="slot[body.sideEffects]"]':{insetBlockEnd:`calc(100% + ${a(2)})`,position:"absolute"},'[data-layout*="slot[sidebar]"]':{display:"grid",gridArea:"sidebar-start / full-start / sidebar-end / full-end",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"minmax(0, auto)"},'[data-layout*="slot[footer]"]':{gridArea:"footer-start / full-start / footer-end / full-end",zIndex:1},'&:has([data-sidebar*="slot[content]"])':{...t.isContentEmpty&&{"--phx-layout-sidebar-track-size":"min-content"}},[`&[data-layout*="${L}"]`]:{transitionDelay:"200ms",transitionDuration:"300ms"},[`&[data-layout*="${q}"]`]:{transitionDelay:"0ms",transitionDuration:"300ms"},[`&:has([data-sidebar*="${A}"])[class]`]:{"--phx-layout-sidebar-track-size":0}},null!=t.assistantFocusHeight&&{'[data-layout*="slot[sidebar]"]':{alignSelf:"start",blockSize:`min(100%, ${t.assistantFocusHeight}px)`,gridRow:"full-start / full-end",zIndex:2}}]),J=i("div")({gridArea:"1 / 1 / -1 / -1"}),K=t=>({inert:t?"":void 0});export const MobileLayout=()=>{let o=l(null),{palette:i,shape:b,spacing:h}=r(),{sidebarHeight:w=N}=n({props:{},name:"PhxMobileLayout"}),{background:O=i.background.paper,borderRadius:Q=b.sidebarBorderRadius??b.borderRadius,padding:U=h(2)}=n({props:{},name:D}),{accessInfo:W}=m(),X=p(),{isPreview:Y,isHidden:Z}=v(),_=!Z&&!Y,tt=!X&&_,ta=!X&&_,te=!X,{setCanvasPadding:to}=f(),{containerRef:ti,safeAreaRef:tr}=M(_?to:d,!1),tn=g(o,{disabled:!te}),{assistantSystem:td}=x(),ts=$(),tl=c(td.panel$,t=>t.isInputFocused,[]),tm=ts&&te&&tl,tc=y(tm),tp=tn&&!ts,tu={isContentEmpty:tp,sidebarHeight:ts?V.includes(w)?N:w:w,assistantFocusHeight:tm?tc?.[1]:void 0},tb={background:O,borderRadius:Q,padding:U,isContentEmpty:tp};return a(e,{children:[t(s,{initial:!1,children:!Z&&Y&&t(F,{})}),a(G,{ownerState:tu,"data-layout":u({state:{[`${L}`]:!X,[`${q}`]:X}}),...K(!_),children:[t(J,{ref:ti}),t("div",{"data-layout":"slot[sideEffects]",children:t(k.MobileSnackbarsRoot,{})}),a("main",{"data-layout":"slot[body]",children:[t("header",{"data-layout":"slot[body.header]",children:a(R,{"data-header":u({state:{[`${T}`]:tt,[`${I}`]:!tt}}),...K(!tt),children:[t("div",{"data-header":"slot[start]",children:t(C,{})}),t("div",{"data-header":"slot[center]",children:t(k.MobileCallToAction,{})}),a("div",{"data-header":"slot[end]",children:[W.viewMode&&!X&&t(k.MobileReadonlyBanner,{}),t(k.MobileHamburgerMenu,{})]})]})}),t("div",{ref:tr,"data-layout":"slot[body.safeSceneArea]"}),t("div",{"data-layout":"slot[body.footer] interactive",children:a(P,{"data-controls":u({state:{[`${B}`]:ta,[`${E}`]:!ta}}),children:[t("div",{"data-controls":"slot[toolControls]",...K(!ta),children:t(k.MobileToolControls,{})}),t("div",{"data-controls":"slot[viewControls]",...K(!ta),children:t(k.MobileViewControls,{})}),t("div",{"data-controls":"slot[toolbar]",children:_&&t(k.MobileToolbar,{})})]})})]}),t("aside",{"data-layout":"slot[sidebar]",children:a(H.Root,{ownerState:tb,"data-sidebar":u({state:{[`${j}`]:te,[`${A}`]:!te,[`${z}`]:ts}}),...K(!te),children:[a(H.Header,{ownerState:tb,"data-sidebar":"slot[header]",children:[t("div",{"data-sidebar":"slot[header.start]",children:t(k.MobileSidebarBackButton,{})}),t("div",{"data-sidebar":"slot[header.end]",children:t(k.MobilePoweredBy,{})})]}),t(H.Body,{ownerState:tb,"data-sidebar":"slot[body]",children:t(H.Content,{ref:o,ownerState:tb,"data-sidebar":"slot[content]",children:t(k.MobileSidebarContent,{})})}),t(H.Tabs,{ownerState:tb,"data-sidebar":"slot[tabs]",children:t(k.MobileTabs,{})}),t(H.Footer,{ownerState:tb,"data-sidebar":"slot[footer]",children:t(k.MobileSidebarFooter,{})}),t(S,{})]})}),t("footer",{"data-layout":"slot[footer] interactive",children:t(k.MobileFooter,{})})]})]})};
|
|
@@ -57,6 +57,6 @@ declare const ResponsiveNavigation: <VALUE extends string, ENTITY_ID extends Dom
|
|
|
57
57
|
*/
|
|
58
58
|
export declare const MobileControls: {
|
|
59
59
|
Navigation: typeof ResponsiveNavigation;
|
|
60
|
-
ViewOnlyMode: (inProps: import("
|
|
60
|
+
ViewOnlyMode: (inProps: import("#package/ui-sdk").ViewOnlyModeProps & import("#package/ui-sdk").MobileControlsThemeableProps) => import("react/jsx-runtime").JSX.Element;
|
|
61
61
|
};
|
|
62
62
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Opens and closes the assistant panel. It renders nothing in a project without an assistant. A
|
|
3
|
+
* layout that lists the button is expected to carry the panel; the button does not check for it.
|
|
4
|
+
*/
|
|
5
|
+
export declare const AssistantToolbarButton: import("react").FunctionComponent<{
|
|
6
|
+
readonly showTitle?: boolean;
|
|
7
|
+
readonly icon?: string;
|
|
8
|
+
} & {
|
|
9
|
+
children?: import("react").ReactNode;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Badge as r}from"@mui/material";import{memo as o,useCallback as a}from"react";import{assistantToolbarButtonSchema as i,createPhoenixLayoutElement as e}from"#package/domain";import{useEagerObservableValue as s,useLocalizable as n,useSpecAssistant as m}from"#package/react-sdk";import{DesktopToolbar as l,PhxIcon as p,useResponsive as c}from"#package/ui-sdk";import{useConfigurator as d}from"../../application-runtime/index.js";let u={id:"sdk.assistant.toolbarButton.label",message:"Assistant"};export const AssistantToolbarButton=e({schema:i,component:o(o=>{let{icon:i,showTitle:e=!0}=o,{assistantSystem:k}=d(),f=m(),{open:A,hasUnreadReply:b}=s(k.panel$),g=n(u),{isPhone:x,isTablet:h}=c(),B=a(()=>{k.setOpen(!A)},[k,A]);return f?t(l.Button,{title:g,onClick:B,showTitle:e&&!x&&!h,"aria-pressed":A,sx:{'&[aria-pressed="true"]':{backgroundColor:"action.selected"}},children:t(r,{color:"primary",variant:"dot",overlap:"circular",invisible:!b,children:t(p,{name:i??(A?"CustomAiAssistantBold":"CustomAiAssistant")})})}):null})});
|
|
@@ -14,6 +14,7 @@ export { UndoToolbarButton } from './UndoToolbarButton.js';
|
|
|
14
14
|
export { RedoToolbarButton } from './RedoToolbarButton.js';
|
|
15
15
|
export { MeasurementsToolbarButton } from './MeasurementsToolbarButton.js';
|
|
16
16
|
export { HelpToolbarButton } from './HelpToolbarButton.js';
|
|
17
|
+
export { AssistantToolbarButton } from './AssistantToolbarButton.js';
|
|
17
18
|
export { HelpMenuAction } from './HelpMenuAction.js';
|
|
18
19
|
export { LanguageMenuAction } from './LanguageMenuAction.js';
|
|
19
20
|
export { MeasurementsMenuAction } from './MeasurementsMenuAction.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./sidebar-footer/index.js";export*from"./header/index.js";export{useShareData,useShareSettings}from"./share/use-share.js";export{MenuRoutingProvider,useMenuRouting}from"./menu-actions/MenuRoutingContext.js";export{MenuAction}from"./menu-actions/MenuAction.js";export{RoutingMenuAction}from"./menu-actions/RoutingMenuAction.js";export{EnterFullscreenToolbarButton}from"./EnterFullscreenToolbarButton.js";export{ExitFullscreenToolbarButton}from"./ExitFullscreenToolbarButton.js";export{LanguageToolbarButton}from"./LanguageToolbarButton.js";export{ToolbarButtonGroup}from"./ToolbarButtonGroup.js";export{ShareMenuAction}from"./ShareMenuAction.js";export{ShareToolbarButton}from"./ShareToolbarButton.js";export{UndoToolbarButton}from"./UndoToolbarButton.js";export{RedoToolbarButton}from"./RedoToolbarButton.js";export{MeasurementsToolbarButton}from"./MeasurementsToolbarButton.js";export{HelpToolbarButton}from"./HelpToolbarButton.js";export{HelpMenuAction}from"./HelpMenuAction.js";export{LanguageMenuAction}from"./LanguageMenuAction.js";export{MeasurementsMenuAction}from"./MeasurementsMenuAction.js";export{ResetCameraToolbarButton}from"./ResetCameraToolbarButton.js";export{SimpleSummary}from"./SimpleSummary.js";export{ResetUndoListener}from"./ResetUndoListener.js";export{SetAsRecipeButton}from"./SetAsRecipeButton.js";export{LayoutDialog,createLayoutDialog}from"./LayoutDialog.js";export{LayoutFooter,createLayoutFooter}from"./LayoutFooter.js";export{CanvasLoader,createCanvasLoader}from"./CanvasLoader.js";export{AppLoader,createAppLoader}from"./AppLoader.js";export{ToolbarHelp,createToolbarHelp,useToolbarHelpExists}from"./ToolbarHelp.js";export{LayoutToolbarDesktop,createLayoutToolbarDesktop}from"./LayoutToolbarDesktop.js";export{LayoutToolbarDesktopFullScreen,createLayoutToolbarDesktopFullScreen}from"./LayoutToolbarDesktopFullScreen.js";export{LayoutToolbarReadDesktop,createLayoutToolbarReadDesktop}from"./LayoutToolbarReadDesktop.js";export{LayoutToolbarReadDesktopFullScreen,createLayoutToolbarReadDesktopFullScreen}from"./LayoutToolbarReadDesktopFullScreen.js";export{LayoutCustomOwnerUi,createLayoutCustomOwnerUi}from"./LayoutCustomOwnerUi.js";export{LayoutCustomReadUi,createLayoutCustomReadUi}from"./LayoutCustomReadUi.js";export{LayoutAdminUi,createLayoutAdminUi}from"./LayoutAdminUi.js";export{LayoutUserUi,createLayoutUserUi}from"./LayoutUserUi.js";export{ExitToolModeFab}from"./call-to-action/ExitToolModeFab.js";export*from"./svg-throbber-3d/index.js";
|
|
1
|
+
export*from"./sidebar-footer/index.js";export*from"./header/index.js";export{useShareData,useShareSettings}from"./share/use-share.js";export{MenuRoutingProvider,useMenuRouting}from"./menu-actions/MenuRoutingContext.js";export{MenuAction}from"./menu-actions/MenuAction.js";export{RoutingMenuAction}from"./menu-actions/RoutingMenuAction.js";export{EnterFullscreenToolbarButton}from"./EnterFullscreenToolbarButton.js";export{ExitFullscreenToolbarButton}from"./ExitFullscreenToolbarButton.js";export{LanguageToolbarButton}from"./LanguageToolbarButton.js";export{ToolbarButtonGroup}from"./ToolbarButtonGroup.js";export{ShareMenuAction}from"./ShareMenuAction.js";export{ShareToolbarButton}from"./ShareToolbarButton.js";export{UndoToolbarButton}from"./UndoToolbarButton.js";export{RedoToolbarButton}from"./RedoToolbarButton.js";export{MeasurementsToolbarButton}from"./MeasurementsToolbarButton.js";export{HelpToolbarButton}from"./HelpToolbarButton.js";export{AssistantToolbarButton}from"./AssistantToolbarButton.js";export{HelpMenuAction}from"./HelpMenuAction.js";export{LanguageMenuAction}from"./LanguageMenuAction.js";export{MeasurementsMenuAction}from"./MeasurementsMenuAction.js";export{ResetCameraToolbarButton}from"./ResetCameraToolbarButton.js";export{SimpleSummary}from"./SimpleSummary.js";export{ResetUndoListener}from"./ResetUndoListener.js";export{SetAsRecipeButton}from"./SetAsRecipeButton.js";export{LayoutDialog,createLayoutDialog}from"./LayoutDialog.js";export{LayoutFooter,createLayoutFooter}from"./LayoutFooter.js";export{CanvasLoader,createCanvasLoader}from"./CanvasLoader.js";export{AppLoader,createAppLoader}from"./AppLoader.js";export{ToolbarHelp,createToolbarHelp,useToolbarHelpExists}from"./ToolbarHelp.js";export{LayoutToolbarDesktop,createLayoutToolbarDesktop}from"./LayoutToolbarDesktop.js";export{LayoutToolbarDesktopFullScreen,createLayoutToolbarDesktopFullScreen}from"./LayoutToolbarDesktopFullScreen.js";export{LayoutToolbarReadDesktop,createLayoutToolbarReadDesktop}from"./LayoutToolbarReadDesktop.js";export{LayoutToolbarReadDesktopFullScreen,createLayoutToolbarReadDesktopFullScreen}from"./LayoutToolbarReadDesktopFullScreen.js";export{LayoutCustomOwnerUi,createLayoutCustomOwnerUi}from"./LayoutCustomOwnerUi.js";export{LayoutCustomReadUi,createLayoutCustomReadUi}from"./LayoutCustomReadUi.js";export{LayoutAdminUi,createLayoutAdminUi}from"./LayoutAdminUi.js";export{LayoutUserUi,createLayoutUserUi}from"./LayoutUserUi.js";export{ExitToolModeFab}from"./call-to-action/ExitToolModeFab.js";export*from"./svg-throbber-3d/index.js";
|
package/dist/docs/index.json
CHANGED
|
@@ -81,6 +81,12 @@ Phoenix provides built-in toolbar buttons for common operations:
|
|
|
81
81
|
`props.showIndicatorSwitch: false` to hide the Dimension indicators switch. When omitted, the prop falls back to
|
|
82
82
|
`applicationConfig.indicatorSwitch`, then `true`.
|
|
83
83
|
- `helpToolbarButton` - Show help content (supports custom children)
|
|
84
|
+
- `assistantToolbarButton` - Open and close the built-in assistant panel. It renders only in a project whose
|
|
85
|
+
application spec has an `assistant` section. `props.showTitle` defaults to `true`; the label shows on a
|
|
86
|
+
desktop-sized layout only. The default toolbar includes it, in a group of its own, when the spec has an
|
|
87
|
+
`assistant` section. Only the universal layout carries the panel, and the button does not hide itself in a
|
|
88
|
+
layout without it. A custom layout that renders the toolbar therefore defines a `toolbar` component without the
|
|
89
|
+
button, because the default toolbar would add it.
|
|
84
90
|
|
|
85
91
|
### Mobile Toolbar Configuration
|
|
86
92
|
|
|
@@ -102,6 +102,32 @@ configuratorBuilder
|
|
|
102
102
|
.buildConfig()
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
### Hints and the AI assistant
|
|
106
|
+
|
|
107
|
+
In a configurator with the AI assistant, the assistant is told the same hints: they arrive as
|
|
108
|
+
`sideEffects` with the result of its changes and in the dry-runs of recipes and options, so it can
|
|
109
|
+
tell the user what else happened. The hints also explain what the user changed between two messages:
|
|
110
|
+
every message carries a change record of the configuration, and each of its lines ends with the hint
|
|
111
|
+
of the last update that touched it, or with the `updateTag` when the update has none. Set `agentHint`
|
|
112
|
+
beside `hint` when the assistant needs different wording, for example with ids or values a snackbar
|
|
113
|
+
would not show:
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
phx.frontend.updates.DomainEntityModification({
|
|
117
|
+
entityId: oldPlate.id,
|
|
118
|
+
stateDelta: { finish: validMaterial.finish },
|
|
119
|
+
updateTag: 'fix.finish',
|
|
120
|
+
hint: msg`Material finish was adjusted`,
|
|
121
|
+
agentHint: `The finish of ${oldPlate.id} was changed to ${validMaterial.finish}, the only one this material comes in.`,
|
|
122
|
+
})
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
- `agentHint` is a plain string, never shown to the user and not localized.
|
|
126
|
+
- `agentHint: null` keeps the wording from the assistant while the user still gets the `hint`: the
|
|
127
|
+
update is left out of `sideEffects`, and the change record explains its line by the `updateTag`. It
|
|
128
|
+
does not hide the change itself, which the assistant can always read from the configuration.
|
|
129
|
+
- `agentHint` without a `hint` tells only the assistant.
|
|
130
|
+
|
|
105
131
|
## Example
|
|
106
132
|
|
|
107
133
|
Here you can see the live example!
|
|
@@ -628,7 +628,7 @@ Revokes the token on the server and removes it from the credentials file. `--reg
|
|
|
628
628
|
|
|
629
629
|
### `phoenix deploy`
|
|
630
630
|
|
|
631
|
-
Validates the spec, adds the pnpm settings `phoenix init` writes to `pnpm-workspace.yaml` when they are missing, packs and uploads the project, starts its build on the server and follows it until the configurator is live. Before the upload the server compares the domain model with the deployed one: a model that changed under an already deployed model version is refused with the reason, and needs a new model version and a [migration](?path=/docs/phoenix-migrations--docs). Once the build starts it prints `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
|
|
631
|
+
Validates the spec, adds the pnpm settings `phoenix init` writes to `pnpm-workspace.yaml` when they are missing, packs and uploads the project, starts its build on the server and follows it until the configurator is live. Before the upload the server compares the domain model with the deployed one: a model that changed under an already deployed model version is refused with the reason, and needs a new model version and a [migration](?path=/docs/phoenix-migrations--docs). Once the build starts it prints `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link. After `Your configurator is live at <url>` it prints one line for coding agents, which tells them to offer the run evaluation of the `phoenix-feedback` skill once you have nothing more to build; you can ignore it when you run the command yourself. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
|
|
632
632
|
|
|
633
633
|
### `phoenix feedback [message]`
|
|
634
634
|
|
|
@@ -7,6 +7,8 @@ export interface ComponentModification<COMPONENT_TYPE extends SystemComponentTyp
|
|
|
7
7
|
entityId: EntityId;
|
|
8
8
|
updateTag: string;
|
|
9
9
|
hint?: Localizable;
|
|
10
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
11
|
+
agentHint?: string | null;
|
|
10
12
|
componentInstance: ComponentInstance<COMPONENT_TYPE>;
|
|
11
13
|
writableState: WritableStateOfComponent<COMPONENT_TYPE>;
|
|
12
14
|
metadata?: Record<string, unknown>;
|
|
@@ -17,6 +19,8 @@ export interface EphemeralRecordModification<COMPONENT_TYPE extends SystemCompon
|
|
|
17
19
|
entityId: EntityId;
|
|
18
20
|
updateTag: string;
|
|
19
21
|
hint?: Localizable;
|
|
22
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
23
|
+
agentHint?: string | null;
|
|
20
24
|
componentInstance: ComponentInstance<COMPONENT_TYPE>;
|
|
21
25
|
writableState: WritableStateOfComponent<COMPONENT_TYPE>;
|
|
22
26
|
}
|
|
@@ -25,6 +29,8 @@ export interface EphemeralRecordCreation<COMPONENT_TYPE extends SystemComponentT
|
|
|
25
29
|
entityId: EntityId;
|
|
26
30
|
updateTag: string;
|
|
27
31
|
hint?: Localizable;
|
|
32
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
33
|
+
agentHint?: string | null;
|
|
28
34
|
componentInstance: ComponentInstance<COMPONENT_TYPE>;
|
|
29
35
|
initialState: StateOfComponent<COMPONENT_TYPE>;
|
|
30
36
|
}
|
|
@@ -34,6 +40,8 @@ export interface EphemeralRecordDeletion<COMPONENT_TYPE extends SystemComponentT
|
|
|
34
40
|
componentInstance: ComponentInstance<COMPONENT_TYPE>;
|
|
35
41
|
updateTag: string;
|
|
36
42
|
hint?: Localizable;
|
|
43
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
44
|
+
agentHint?: string | null;
|
|
37
45
|
}
|
|
38
46
|
export type DomainEntityStateDelta<ENTITY extends DomainEntity<string>> = Partial<Omit<ENTITY, 'id' | 'type'>>;
|
|
39
47
|
export interface DomainEntityModification<ENTITY extends DomainEntity<string> = DomainEntity<string>> {
|
|
@@ -41,6 +49,8 @@ export interface DomainEntityModification<ENTITY extends DomainEntity<string> =
|
|
|
41
49
|
entityId: ENTITY['id'];
|
|
42
50
|
updateTag: string;
|
|
43
51
|
hint?: Localizable;
|
|
52
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
53
|
+
agentHint?: string | null;
|
|
44
54
|
stateDelta: DomainEntityStateDelta<ENTITY>;
|
|
45
55
|
origin?: ComponentModification<SystemComponentTypeConstraint>;
|
|
46
56
|
}
|
|
@@ -55,6 +65,8 @@ export interface DomainEntityCreation<ENTITY extends DomainEntity<string>, PAREN
|
|
|
55
65
|
collection?: string;
|
|
56
66
|
parentId: PARENT['id'];
|
|
57
67
|
hint?: Localizable;
|
|
68
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
69
|
+
agentHint?: string | null;
|
|
58
70
|
}
|
|
59
71
|
export interface DomainEntityReplacement<ENTITY extends DomainEntity<string>> {
|
|
60
72
|
kind: 'replaceDomainEntity';
|
|
@@ -63,12 +75,16 @@ export interface DomainEntityReplacement<ENTITY extends DomainEntity<string>> {
|
|
|
63
75
|
updateTag: string;
|
|
64
76
|
keepChildren: boolean;
|
|
65
77
|
hint?: Localizable;
|
|
78
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
79
|
+
agentHint?: string | null;
|
|
66
80
|
}
|
|
67
81
|
export interface EntityDeletion<ENTITY extends DomainEntity<string>> {
|
|
68
82
|
kind: 'deleteEntity';
|
|
69
83
|
entityId: EntityId<ENTITY>;
|
|
70
84
|
updateTag: string;
|
|
71
85
|
hint?: Localizable;
|
|
86
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
87
|
+
agentHint?: string | null;
|
|
72
88
|
}
|
|
73
89
|
export type DataUpdate<ENTITY extends DomainEntity<string>, PARENT extends DomainEntity<string>> = EphemeralRecordModification | EphemeralRecordCreation | EphemeralRecordDeletion | DomainEntityModification<ENTITY> | DomainEntityCreation<ENTITY, PARENT> | DomainEntityReplacement<ENTITY> | EntityDeletion<ENTITY>;
|
|
74
90
|
export type StateUpdate<ENTITY extends DomainEntity<string>, PARENT extends DomainEntity<string>> = ComponentModification<SystemComponentTypeConstraint> | DataUpdate<ENTITY, PARENT>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { type AnalyticsSystem, NoopAnalyticsSystem } from './analytics-system/analytics-system.js';
|
|
2
|
-
export { type AnalyticsEvent, AnalyticsEventFactory, AnalyticsEventType, } from './analytics-system/analytics-contracts.js';
|
|
2
|
+
export { type AnalyticsEvent, AnalyticsEventFactory, AnalyticsEventType, type DataLoadedEvent, type InitEvent, type NavigationEvent, type SessionAuthenticatedEvent, type SystemEvent, type UserActionEvent, } from './analytics-system/analytics-contracts.js';
|
|
3
3
|
export { NavigationUpdateTag, isInitialNavigationUpdate, isNavigationUpdate, isInitialViewUpdate, isViewUpdate, isInitialSelectionUpdate, isSelectUpdate, isDeselectUpdate, isInitialFullscreenUpdate, isToggleFullscreenUpdate, isInitialDebugUpdate, isInitialViewportUpdate, isSetViewportUpdate, isInitialDragUpdate, isDragStartUpdate, isDragEndUpdate, isInitialToolUpdate, isToolUpdate, isExportUpdate, } from './navigation-system/navigation-updates.js';
|
|
4
4
|
export { createAutoSelectionTransformer, NavigationSystem, type NavigationSystemContext, } from './navigation-system/navigation-system.js';
|
|
5
5
|
export { createResetSelectionOnNavigationTransformer, createNavigationOnSelectionTransformer, createNavigationOnDeselectTransformer, createSelectParentOnDeselectionTransformer, createNavigationOnSelectionChangeTransformer, } from './navigation-system/selection-transformers.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{CompositeKeyMap as e,assertExistence as t,isEqualArray as i}from"@salsita-ai/common/utils";import{dragStateComponent as o}from"../../components/drag-state-component.js";import{hoverStateComponent as r}from"../../components/hover-state-component.js";import{selectionStateComponent as s}from"../../components/selection-state-component.js";import{getComponentSystemFilterState as n}from"../../components/system-component-filter.js";import{systemVirtualEntityId as a}from"../../components/system-virtual-entity.js";import{systemUpdateFactory as d}from"../../components/updates.js";import{isSystemViewportStateComponentSnapshot as m}from"../../components/viewport-state-component.js";import{isEqualComponentInstance as l}from"../../core/component.js";import{domainEntityTypeFromId as c,isVirtualEntityId as p}from"../../core/model.js";import{projectedEntitiesComponent as h}from"../../system-components/index.js";import{cloneEvalCache as f,createEvalCacheToken as v,getEvalCache as g,setEvalCache as u}from"../../utils/eval-cache.js";import{createCascadeDeletesTransformer as y}from"../relation-transformers/cascade-deletes.js";import{createCascadeRefPruningTransformer as S}from"../relation-transformers/cascade-ref-pruning.js";import{applyUpdates as I}from"./apply-updates.js";import{LifecycleStateSlice as _}from"./lifecycle-state-slice.js";import{mergeReconciliationsUpdates as x,reconcileProjectedEntities as T}from"./reconcile-projected-entities.js";let E={uninitializedError:"StoreSystem is not initialized."},k=v({clone:e=>e}),w=class InvalidInitialStateError extends Error{emission;childError;constructor(e,t,i){let o="";"uncaught"===e.validity.severity&&(o=`: ${e.validity.error.message}`),("fatal"===e.validity.severity||"fixable"===e.validity.severity)&&(o=`: ${e.validity.entityViolations.map(e=>{let i=e.violation.message;return null!=i?t(i):e.violation.type}).join(", ")}`),super(`Initial state is not valid! Severity: ${e.validity.severity}, Cause: ${o}`),this.emission=e,this.childError=i,this.name="InvalidInitialStateError"}},b=(e,t)=>{try{return e()}catch(e){throw t(e),e}};export class StoreSystem{_context;stateSlices;get isInitialized(){return this.committed.isInitialized}_onBeforeCommitHooks=[];committed=new _(E);potentiallyInvalid=new _(E);rendered=new _(E);stagedUpdates=void 0;transformToDataUpdates=(e,t)=>{let i=!1,o=e.map(e=>"modifyComponent"===e.kind?(i=!0,this.componentModificationToDataUpdate(e,t)):e);return i?o:e};createInitialTransformPipe=()=>[{transformer:this.transformToDataUpdates,priority:1/0,registrationToken:{},name:"TransformToDataUpdates"}];transformPipe=this.createInitialTransformPipe();_cascadeDeletesTransformer=(...e)=>(this._cascadeDeletesTransformerMemo??=y(this._context.selectors.getCompositionProjections()))(...e);_cascadeDeletesTransformerMemo;_refPruningTransformer=(...e)=>(this._refPruningTransformerMemo??=S(this._context.selectors.getComponentReader()))(...e);_refPruningTransformerMemo;_deselectOnDeleteTransformer=(e,t)=>{let i=new Set(e.filter(e=>"deleteEntity"===e.kind).map(e=>e.entityId));if(0===i.size)return e;let o=n(t).selectedEntityId;return o&&i.has(o)?[...e,d.EphemeralRecordModification({componentInstance:{entityId:a,componentType:s},updateTag:"AutoDeselectRemovedProjectedEntity",writableState:{selectedEntityId:t.rootEntityId}})]:e};constructor(e){this._context=e,this.stateSlices={committed:this.committed.observable,rendered:this.rendered.observable,potentiallyInvalid:this.potentiallyInvalid.observable}}_validateState=e=>this._context.selectors.getValidationProjections().validateState(e);initialize=()=>{let e=this._context.selectors.getInitialDomainState();this.stagedUpdates=void 0;let t=this._validateState(e),i={kind:"reset",state:e,validity:t,tag:void 0,transformationLog:void 0},o=i;if(!o.validity.valid&&"fatal"===o.validity.severity||"fixable"===o.validity.severity){this._context.domainServicesSelectors.getLogger().debug("Trying to fix initial emission:",o);let e=o.state,{transformedUpdates:t,transformationLog:i}=this.applyTransformers([],e,"committed"),r=I(this.transformToDataUpdates(t,e),e);f(e,r),o={kind:"reset",state:r,validity:this._validateState(r),tag:"fixed",transformationLog:i}}if(!o.validity.valid){if(this._context.domainServicesSelectors.getLogger().error("Invalid initial emission:",{initialEmission:i,fixedEmission:o}),"uncaught"===o.validity.severity)throw new w(o,this._context.domainServicesSelectors.getResolveLocalizable(),o.validity.error??void 0);throw new w(o,this._context.domainServicesSelectors.getResolveLocalizable())}this.committed.next(o),this.rendered.next(o),this.potentiallyInvalid.next(o)};registerTransformer(e,i,o){let r={};return((e,i,o)=>{let r=0;for(;r<e.length&&0>=o(t(e[r]),i);)r++;e.splice(r,0,i)})(this.transformPipe,{registrationToken:r,transformer:i,priority:e,name:o},(e,t)=>e.priority===t.priority?0:e.priority<t.priority?-1:1),()=>{let e=this.transformPipe.findIndex(e=>e.registrationToken===r);-1!==e&&this.transformPipe.splice(e,1)}}onBeforeCommit(e){return this._onBeforeCommitHooks.push(e),()=>{this._onBeforeCommitHooks=this._onBeforeCommitHooks.filter(t=>t!==e)}}componentModificationToDataUpdate=(e,t)=>{let i=e.entityId;if(!p(i)){let t=this._context.selectors.getComponentReaderIndexes().opticMap.get(c(i))?.get(e.componentInstance.componentType)?.get(e.componentInstance.instanceName);if(t?.kind==="simple"){let o=t.write(e.writableState);return{kind:"modifyDomainEntity",entityId:i,updateTag:e.updateTag,stateDelta:o,hint:e.hint,origin:e}}}let o=t.ephemeralRecords.find(t=>l(t.componentInstance,e.componentInstance));if(o)return{kind:"modifyEphemeralRecord",entityId:e.entityId,updateTag:e.updateTag,componentInstance:o.componentInstance,writableState:e.writableState,hint:e.hint};throw Error(`Component ${e.componentInstance.componentType.name} is not attached on entity #${e.entityId}`)};getNewState=(e,t)=>{let i=I(this.transformToDataUpdates(e,t),t);return f(this.rendered.isInitialized?this.rendered.value.state:t,i),i};applyTransformers(e,t,i){let o=this._context.environmentSelectors.getEnvironmentIsDev()?[]:void 0;return{transformedUpdates:this.transformPipe.reduce((e,{transformer:r,name:s})=>{let n,a=o?[]:void 0,d=a?(e,t,i)=>{n=e,a.push({phase:e,message:t,data:i})}:void 0,m=b(()=>r(e,t,i,d),r=>{this._context.domainServicesSelectors.getLogger().error("Error while applying transformer!",{name:s,updates:e,previousState:t,kind:i,transformationLog:o},r instanceof Error?r:Error(String(r)))});return a&&o&&o.push({name:s,status:n??(m===e?"no-event":"apply"),entries:a,updatesIn:e,updatesOut:m}),m},e),transformationLog:o}}_updateProjectedEntities(e,t,o){if(!e.validity.valid)return e;let r=this._context.selectors.getComponentReader().readManyComponents({componentTypes:[h]},e.state),s=g(e.previousState,k);if(s&&i(s,r))return e;let n=0,a=e,d=[];for(;a.validity.valid;){n++;let i=T(a.state.entities,r,t);if(0===i.length)break;if(n>10)throw Error(`Maximum number of reconciliation rounds reached: 10. Projected entities seem to be recursively depending on themselves.
|
|
1
|
+
import{CompositeKeyMap as e,assertExistence as t,isEqualArray as i}from"@salsita-ai/common/utils";import{dragStateComponent as o}from"../../components/drag-state-component.js";import{hoverStateComponent as r}from"../../components/hover-state-component.js";import{selectionStateComponent as s}from"../../components/selection-state-component.js";import{getComponentSystemFilterState as n}from"../../components/system-component-filter.js";import{systemVirtualEntityId as a}from"../../components/system-virtual-entity.js";import{systemUpdateFactory as d}from"../../components/updates.js";import{isSystemViewportStateComponentSnapshot as m}from"../../components/viewport-state-component.js";import{isEqualComponentInstance as l}from"../../core/component.js";import{domainEntityTypeFromId as c,isVirtualEntityId as p}from"../../core/model.js";import{projectedEntitiesComponent as h}from"../../system-components/index.js";import{cloneEvalCache as f,createEvalCacheToken as v,getEvalCache as g,setEvalCache as u}from"../../utils/eval-cache.js";import{createCascadeDeletesTransformer as y}from"../relation-transformers/cascade-deletes.js";import{createCascadeRefPruningTransformer as S}from"../relation-transformers/cascade-ref-pruning.js";import{applyUpdates as I}from"./apply-updates.js";import{LifecycleStateSlice as _}from"./lifecycle-state-slice.js";import{mergeReconciliationsUpdates as x,reconcileProjectedEntities as T}from"./reconcile-projected-entities.js";let E={uninitializedError:"StoreSystem is not initialized."},k=v({clone:e=>e}),w=class InvalidInitialStateError extends Error{emission;childError;constructor(e,t,i){let o="";"uncaught"===e.validity.severity&&(o=`: ${e.validity.error.message}`),("fatal"===e.validity.severity||"fixable"===e.validity.severity)&&(o=`: ${e.validity.entityViolations.map(e=>{let i=e.violation.message;return null!=i?t(i):e.violation.type}).join(", ")}`),super(`Initial state is not valid! Severity: ${e.validity.severity}, Cause: ${o}`),this.emission=e,this.childError=i,this.name="InvalidInitialStateError"}},b=(e,t)=>{try{return e()}catch(e){throw t(e),e}};export class StoreSystem{_context;stateSlices;get isInitialized(){return this.committed.isInitialized}_onBeforeCommitHooks=[];committed=new _(E);potentiallyInvalid=new _(E);rendered=new _(E);stagedUpdates=void 0;transformToDataUpdates=(e,t)=>{let i=!1,o=e.map(e=>"modifyComponent"===e.kind?(i=!0,this.componentModificationToDataUpdate(e,t)):e);return i?o:e};createInitialTransformPipe=()=>[{transformer:this.transformToDataUpdates,priority:1/0,registrationToken:{},name:"TransformToDataUpdates"}];transformPipe=this.createInitialTransformPipe();_cascadeDeletesTransformer=(...e)=>(this._cascadeDeletesTransformerMemo??=y(this._context.selectors.getCompositionProjections()))(...e);_cascadeDeletesTransformerMemo;_refPruningTransformer=(...e)=>(this._refPruningTransformerMemo??=S(this._context.selectors.getComponentReader()))(...e);_refPruningTransformerMemo;_deselectOnDeleteTransformer=(e,t)=>{let i=new Set(e.filter(e=>"deleteEntity"===e.kind).map(e=>e.entityId));if(0===i.size)return e;let o=n(t).selectedEntityId;return o&&i.has(o)?[...e,d.EphemeralRecordModification({componentInstance:{entityId:a,componentType:s},updateTag:"AutoDeselectRemovedProjectedEntity",writableState:{selectedEntityId:t.rootEntityId}})]:e};constructor(e){this._context=e,this.stateSlices={committed:this.committed.observable,rendered:this.rendered.observable,potentiallyInvalid:this.potentiallyInvalid.observable}}_validateState=e=>this._context.selectors.getValidationProjections().validateState(e);initialize=()=>{let e=this._context.selectors.getInitialDomainState();this.stagedUpdates=void 0;let t=this._validateState(e),i={kind:"reset",state:e,validity:t,tag:void 0,transformationLog:void 0},o=i;if(!o.validity.valid&&"fatal"===o.validity.severity||"fixable"===o.validity.severity){this._context.domainServicesSelectors.getLogger().debug("Trying to fix initial emission:",o);let e=o.state,{transformedUpdates:t,transformationLog:i}=this.applyTransformers([],e,"committed"),r=I(this.transformToDataUpdates(t,e),e);f(e,r),o={kind:"reset",state:r,validity:this._validateState(r),tag:"fixed",transformationLog:i}}if(!o.validity.valid){if(this._context.domainServicesSelectors.getLogger().error("Invalid initial emission:",{initialEmission:i,fixedEmission:o}),"uncaught"===o.validity.severity)throw new w(o,this._context.domainServicesSelectors.getResolveLocalizable(),o.validity.error??void 0);throw new w(o,this._context.domainServicesSelectors.getResolveLocalizable())}this.committed.next(o),this.rendered.next(o),this.potentiallyInvalid.next(o)};registerTransformer(e,i,o){let r={};return((e,i,o)=>{let r=0;for(;r<e.length&&0>=o(t(e[r]),i);)r++;e.splice(r,0,i)})(this.transformPipe,{registrationToken:r,transformer:i,priority:e,name:o},(e,t)=>e.priority===t.priority?0:e.priority<t.priority?-1:1),()=>{let e=this.transformPipe.findIndex(e=>e.registrationToken===r);-1!==e&&this.transformPipe.splice(e,1)}}onBeforeCommit(e){return this._onBeforeCommitHooks.push(e),()=>{this._onBeforeCommitHooks=this._onBeforeCommitHooks.filter(t=>t!==e)}}componentModificationToDataUpdate=(e,t)=>{let i=e.entityId;if(!p(i)){let t=this._context.selectors.getComponentReaderIndexes().opticMap.get(c(i))?.get(e.componentInstance.componentType)?.get(e.componentInstance.instanceName);if(t?.kind==="simple"){let o=t.write(e.writableState);return{kind:"modifyDomainEntity",entityId:i,updateTag:e.updateTag,stateDelta:o,hint:e.hint,agentHint:e.agentHint,origin:e}}}let o=t.ephemeralRecords.find(t=>l(t.componentInstance,e.componentInstance));if(o)return{kind:"modifyEphemeralRecord",entityId:e.entityId,updateTag:e.updateTag,componentInstance:o.componentInstance,writableState:e.writableState,hint:e.hint,agentHint:e.agentHint};throw Error(`Component ${e.componentInstance.componentType.name} is not attached on entity #${e.entityId}`)};getNewState=(e,t)=>{let i=I(this.transformToDataUpdates(e,t),t);return f(this.rendered.isInitialized?this.rendered.value.state:t,i),i};applyTransformers(e,t,i){let o=this._context.environmentSelectors.getEnvironmentIsDev()?[]:void 0;return{transformedUpdates:this.transformPipe.reduce((e,{transformer:r,name:s})=>{let n,a=o?[]:void 0,d=a?(e,t,i)=>{n=e,a.push({phase:e,message:t,data:i})}:void 0,m=b(()=>r(e,t,i,d),r=>{this._context.domainServicesSelectors.getLogger().error("Error while applying transformer!",{name:s,updates:e,previousState:t,kind:i,transformationLog:o},r instanceof Error?r:Error(String(r)))});return a&&o&&o.push({name:s,status:n??(m===e?"no-event":"apply"),entries:a,updatesIn:e,updatesOut:m}),m},e),transformationLog:o}}_updateProjectedEntities(e,t,o){if(!e.validity.valid)return e;let r=this._context.selectors.getComponentReader().readManyComponents({componentTypes:[h]},e.state),s=g(e.previousState,k);if(s&&i(s,r))return e;let n=0,a=e,d=[];for(;a.validity.valid;){n++;let i=T(a.state.entities,r,t);if(0===i.length)break;if(n>10)throw Error(`Maximum number of reconciliation rounds reached: 10. Projected entities seem to be recursively depending on themselves.
|
|
2
2
|
If expressions populating 'projectedEntities' components rely on other projected entities, make sure that the dependencies do not have cycles.`);let s=(d=x(d,i)).map(e=>e.dataUpdate),m=this._cascadeDeletesTransformer(s,e.previousState,o,void 0,t),l=this._refPruningTransformer(m,e.previousState,o,void 0,t),c=this._deselectOnDeleteTransformer(l,e.previousState,o,void 0,t);if(!(a=this.prepareStateEmissionWithoutTransformation([...t,...c],e.previousState,o)).validity.valid)return this._context.domainServicesSelectors.getLogger().error("Reconciliation of projected entities led to an invalid state! Reconciliation skipped.",{emission:a}),e;r=this._context.selectors.getComponentReader().readManyComponents({componentTypes:[h]},a.state)}return u(a.state,k,r),a}prepareStateEmission(e,t,i){let{transformedUpdates:o,transformationLog:r}=this.applyTransformers(e,t,i),s=this.prepareStateEmissionWithoutTransformation(o,t,i);return{...this._updateProjectedEntities(s,o,i),transformationLog:r}}emissionCache=new e([Map,WeakMap,WeakMap,WeakMap,WeakMap]);getEmissionCacheKey=(e,t,i)=>[e,t,i,this._context.selectors.getStoreRuntimeDependencies(),this._context.selectors.getExpressionContext()];prepareStateEmissionWithoutTransformation=(e,t,i)=>{let o=this.getEmissionCacheKey(i,t,e),r=this.emissionCache.get(o);if(r)return r;let s=b(()=>this.transformToDataUpdates(e,t),o=>{this._context.domainServicesSelectors.getLogger().error("Error while transforming updates to data updates!",{updates:e,previousState:t,kind:i},o instanceof Error?o:Error(String(o)))}),n=b(()=>I(s,t),o=>{this._context.domainServicesSelectors.getLogger().error("Error while applying updates!",{updates:e,previousState:t,kind:i,dataUpdates:s},o instanceof Error?o:Error(String(o)))});f(this.rendered.isInitialized?this.rendered.value.state:t,n);let a=this._validateState(n);"uncaught"===a.severity&&this._context.domainServicesSelectors.getLogger().error("There was an uncaught validation error:",{updates:e,dataUpdates:s,previousState:t,newState:n,kind:i},a.error);let d={kind:i,previousState:t,state:n,updates:s,validity:a,transformationLog:void 0};return this.emissionCache.set(o,d),d};stage(e,t=!0){this.stagedUpdates=e;let i=this.prepareStateEmission(e,this.committed.value.state,"staged");return t&&this.emit(i),i}emit(e){"staged"===e.kind?e.validity.valid&&this.rendered.nextIfDifferent(e):(e.validity.valid?(this.committed.nextIfDifferent(e),this.rendered.nextIfDifferent(e)):this.rendered.nextIfDifferent(this.committed.value),this.potentiallyInvalid.nextIfDifferent(e))}commit=()=>{if(void 0===this.stagedUpdates)return;let e=this.prepareStateEmission(this.stagedUpdates,this.committed.value.state,"committed"),t=()=>{if(this._onBeforeCommitHooks.some(i=>!1===i(e,t))){this._context.domainServicesSelectors.getLogger().debug("Commit was canceled by one of the onBeforeCommit hooks! Resetting rendered state.",e),this.rollback();return}this.stagedUpdates=void 0,this._context.domainServicesSelectors.getLogger().debug("commit",e),this.emit(e)};t()};commitPrepared=e=>{if("committed"!==e.kind||!e.validity.valid)throw Error(`commitPrepared received a ${e.validity.valid?e.kind:"invalid"} emission, but only a valid committed emission can become the committed state. Prepare the emission with kind "committed" and check its validity before committing it.`);let t=()=>e.previousState===this.committed.value.state;if(!t())return"conflict";let i=()=>{t()?o():this._context.domainServicesSelectors.getLogger().warn("A held commit was dropped, because the committed state changed since it was prepared.",e)},o=()=>this._onBeforeCommitHooks.some(t=>!1===t(e,i))?(this._context.domainServicesSelectors.getLogger().debug("A prepared commit was held by one of the onBeforeCommit hooks.",e),!1):(this._context.domainServicesSelectors.getLogger().debug("commitPrepared",e),this.stagedUpdates=void 0,this.emit(e),!0);return o()?"committed":"held"};rollback=()=>{void 0!==this.stagedUpdates&&(this.stagedUpdates=void 0,this.emit(this.committed.value))};_resetInteractionState(e){return e.ephemeralRecords.some(e=>{let t;return(t=e.componentInstance.componentType)===r||t===o})?{...e,ephemeralRecords:e.ephemeralRecords.map(e=>e.componentInstance.componentType===r?{...e,state:{hoveredEntityId:null}}:e.componentInstance.componentType===o?{...e,state:{draggedEntityId:null}}:e)}:e}_preserveViewportState(e,t){let i=t.ephemeralRecords.find(m),o=e.ephemeralRecords.filter(e=>!m(e));return{...e,ephemeralRecords:i?[...o,i]:o}}reset(e,t){let i=this.committed.value.state,o=this._preserveViewportState(e,i),r=this._resetInteractionState(o),s=this._validateState(r);if(!s.valid)throw Error("Cannot reset to an invalid state");this.stagedUpdates=void 0,this.emit({kind:"reset",state:r,validity:s,tag:t,transformationLog:void 0})}stageAndCommit(e){if(0!==e.length){this.stagedUpdates=e;try{this.commit()}finally{this.stagedUpdates=void 0}}}}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolbar button that opens and closes the built-in assistant panel. The default toolbar of the
|
|
3
|
+
* universal layout lists it, in a group of its own, when the application spec has an `assistant`
|
|
4
|
+
* section; a custom toolbar places it in a `toolbarButtonGroup` like any other button. It renders
|
|
5
|
+
* nothing in a project without an `assistant` section.
|
|
6
|
+
*/
|
|
7
|
+
export interface AssistantToolbarButtonSchema {
|
|
8
|
+
readonly kind: 'assistantToolbarButton';
|
|
9
|
+
readonly props?: {
|
|
10
|
+
/**
|
|
11
|
+
* If true, the title is displayed on a desktop-sized layout; a phone or tablet-sized layout shows
|
|
12
|
+
* the icon only. By default true.
|
|
13
|
+
*/
|
|
14
|
+
readonly showTitle?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* PHX icon name used instead of the default assistant icon.
|
|
17
|
+
*/
|
|
18
|
+
readonly icon?: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export declare const assistantToolbarButtonSchema: {
|
|
22
|
+
readonly type: 'object';
|
|
23
|
+
readonly properties: {
|
|
24
|
+
readonly kind: {
|
|
25
|
+
readonly type: 'string';
|
|
26
|
+
readonly enum: ["assistantToolbarButton"];
|
|
27
|
+
};
|
|
28
|
+
readonly props: {
|
|
29
|
+
readonly type: 'object';
|
|
30
|
+
readonly properties: {
|
|
31
|
+
readonly showTitle: {
|
|
32
|
+
readonly type: 'boolean';
|
|
33
|
+
};
|
|
34
|
+
readonly icon: {
|
|
35
|
+
readonly type: 'string';
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly required: [];
|
|
39
|
+
readonly additionalProperties: false;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly required: ["kind"];
|
|
43
|
+
readonly additionalProperties: false;
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const assistantToolbarButtonSchema={type:"object",properties:{kind:{type:"string",enum:["assistantToolbarButton"]},props:{type:"object",properties:{showTitle:{type:"boolean"},icon:{type:"string"}},required:[],additionalProperties:!1}},required:["kind"],additionalProperties:!1};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { type PhoenixLayoutElement, PhoenixLayoutElementSchema } from './phoenix-layout-element.js';
|
|
2
|
+
export { type AssistantToolbarButtonSchema, assistantToolbarButtonSchema } from './assistant-toolbar-button.js';
|
|
2
3
|
export { type AdminConnectedResourcePageSchema, adminConnectedResourcePageSchema, } from './admin-connected-resource-page.js';
|
|
3
4
|
export { type AdminDataTableActionsSchema, adminDataTableActionsSchema } from './admin-data-table-actions.js';
|
|
4
5
|
export { type AdminDataTablePageSchema, adminDataTablePageSchema } from './admin-data-table-page.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{PhoenixLayoutElementSchema}from"./phoenix-layout-element.js";export{adminConnectedResourcePageSchema}from"./admin-connected-resource-page.js";export{adminDataTableActionsSchema}from"./admin-data-table-actions.js";export{adminDataTablePageSchema}from"./admin-data-table-page.js";export{adminPresetActionsSchema}from"./admin-preset-actions.js";export{adminPresetCategoryActionsSchema}from"./admin-preset-category-actions.js";export{adminPresetCategoryPageSchema}from"./admin-preset-category-page.js";export{adminPresetListPageSchema}from"./admin-preset-list-page.js";export{adminRecipeActionsSchema}from"./admin-recipe-actions.js";export{adminRecipeCollectionPageSchema}from"./admin-recipe-collection-page.js";export{customLayoutElementSchema}from"./custom-layout-element.js";export{enterSummaryButtonSchema}from"./enter-summary-button.js";export{enterFullscreenToolbarButtonSchema}from"./enter-fullscreen-toolbar-button.js";export{exitFullscreenToolbarButtonSchema}from"./exit-fullscreen-toolbar-button.js";export{footerPriceSchema}from"./footer-price.js";export{languageToolbarButtonSchema}from"./language-toolbar-button.js";export{mainFooterActionsSchema}from"./main-footer-actions.js";export{nextStepButtonSchema}from"./next-step-button.js";export{otherActionsSchema}from"./other-actions.js";export{previousStepButtonSchema}from"./previous-step-button.js";export{saveTemplateButtonSchema}from"./save-template-button.js";export{stepLabelSchema}from"./step-label.js";export{stepProgressSchema}from"./step-progress.js";export{shareToolbarButtonSchema}from"./share-toolbar-button.js";export{shareMenuActionSchema}from"./share-menu-action.js";export{toolbarButtonGroupSchema}from"./toolbar-button-group.js";export{undoToolbarButtonSchema}from"./undo-toolbar-button.js";export{redoToolbarButtonSchema}from"./redo-toolbar-button.js";export{resetCameraToolbarButtonSchema}from"./reset-camera-toolbar-button.js";export{measurementsToolbarButtonSchema}from"./measurements-toolbar-button.js";export{helpToolbarButtonSchema}from"./help-toolbar-button.js";export{measurementsMenuActionSchema}from"./measurements-menu-action.js";export{languageMenuActionSchema}from"./language-menu-action.js";export{helpMenuActionSchema}from"./help-menu-action.js";
|
|
1
|
+
export{PhoenixLayoutElementSchema}from"./phoenix-layout-element.js";export{assistantToolbarButtonSchema}from"./assistant-toolbar-button.js";export{adminConnectedResourcePageSchema}from"./admin-connected-resource-page.js";export{adminDataTableActionsSchema}from"./admin-data-table-actions.js";export{adminDataTablePageSchema}from"./admin-data-table-page.js";export{adminPresetActionsSchema}from"./admin-preset-actions.js";export{adminPresetCategoryActionsSchema}from"./admin-preset-category-actions.js";export{adminPresetCategoryPageSchema}from"./admin-preset-category-page.js";export{adminPresetListPageSchema}from"./admin-preset-list-page.js";export{adminRecipeActionsSchema}from"./admin-recipe-actions.js";export{adminRecipeCollectionPageSchema}from"./admin-recipe-collection-page.js";export{customLayoutElementSchema}from"./custom-layout-element.js";export{enterSummaryButtonSchema}from"./enter-summary-button.js";export{enterFullscreenToolbarButtonSchema}from"./enter-fullscreen-toolbar-button.js";export{exitFullscreenToolbarButtonSchema}from"./exit-fullscreen-toolbar-button.js";export{footerPriceSchema}from"./footer-price.js";export{languageToolbarButtonSchema}from"./language-toolbar-button.js";export{mainFooterActionsSchema}from"./main-footer-actions.js";export{nextStepButtonSchema}from"./next-step-button.js";export{otherActionsSchema}from"./other-actions.js";export{previousStepButtonSchema}from"./previous-step-button.js";export{saveTemplateButtonSchema}from"./save-template-button.js";export{stepLabelSchema}from"./step-label.js";export{stepProgressSchema}from"./step-progress.js";export{shareToolbarButtonSchema}from"./share-toolbar-button.js";export{shareMenuActionSchema}from"./share-menu-action.js";export{toolbarButtonGroupSchema}from"./toolbar-button-group.js";export{undoToolbarButtonSchema}from"./undo-toolbar-button.js";export{redoToolbarButtonSchema}from"./redo-toolbar-button.js";export{resetCameraToolbarButtonSchema}from"./reset-camera-toolbar-button.js";export{measurementsToolbarButtonSchema}from"./measurements-toolbar-button.js";export{helpToolbarButtonSchema}from"./help-toolbar-button.js";export{measurementsMenuActionSchema}from"./measurements-menu-action.js";export{languageMenuActionSchema}from"./language-menu-action.js";export{helpMenuActionSchema}from"./help-menu-action.js";
|
|
@@ -8,6 +8,7 @@ import { type AdminPresetCategoryPageSchema } from './admin-preset-category-page
|
|
|
8
8
|
import { type AdminPresetListPageSchema } from './admin-preset-list-page.js';
|
|
9
9
|
import { type AdminRecipeActionsSchema } from './admin-recipe-actions.js';
|
|
10
10
|
import { type AdminRecipeCollectionPageSchema } from './admin-recipe-collection-page.js';
|
|
11
|
+
import { type AssistantToolbarButtonSchema } from './assistant-toolbar-button.js';
|
|
11
12
|
import { type CustomLayoutElementSchema } from './custom-layout-element.js';
|
|
12
13
|
import { type EnterFullscreenToolbarButtonSchema } from './enter-fullscreen-toolbar-button.js';
|
|
13
14
|
import { type EnterSummaryButtonSchema } from './enter-summary-button.js';
|
|
@@ -32,5 +33,5 @@ import { type StepLabelSchema } from './step-label.js';
|
|
|
32
33
|
import { type StepProgressSchema } from './step-progress.js';
|
|
33
34
|
import { type ToolbarButtonGroupSchema } from './toolbar-button-group.js';
|
|
34
35
|
import { type UndoToolbarButtonSchema } from './undo-toolbar-button.js';
|
|
35
|
-
export type PhoenixLayoutElement = CustomLayoutElementSchema | AdminPresetCategoryPageSchema | AdminPresetCategoryActionsSchema | AdminPresetListPageSchema | AdminPresetActionsSchema | AdminRecipeCollectionPageSchema | AdminRecipeActionsSchema | AdminDataTablePageSchema | AdminDataTableActionsSchema | AdminConnectedResourcePageSchema | EnterSummaryButtonSchema | EnterFullscreenToolbarButtonSchema | ExitFullscreenToolbarButtonSchema | FooterPriceSchema | LanguageToolbarButtonSchema | MainFooterActionsSchema | NextStepButtonSchema | OtherActionsSchema | PreviousStepButtonSchema | SaveTemplateButtonSchema | StepLabelSchema | StepProgressSchema | ToolbarButtonGroupSchema | ShareMenuActionSchema | ShareToolbarButtonSchema | UndoToolbarButtonSchema | RedoToolbarButtonSchema | ResetCameraToolbarButtonSchema | MeasurementsToolbarButtonSchema | HelpToolbarButtonSchema | MeasurementsMenuActionSchema | LanguageMenuActionSchema | HelpMenuActionSchema;
|
|
36
|
+
export type PhoenixLayoutElement = CustomLayoutElementSchema | AdminPresetCategoryPageSchema | AdminPresetCategoryActionsSchema | AdminPresetListPageSchema | AdminPresetActionsSchema | AdminRecipeCollectionPageSchema | AdminRecipeActionsSchema | AdminDataTablePageSchema | AdminDataTableActionsSchema | AdminConnectedResourcePageSchema | EnterSummaryButtonSchema | EnterFullscreenToolbarButtonSchema | ExitFullscreenToolbarButtonSchema | FooterPriceSchema | LanguageToolbarButtonSchema | MainFooterActionsSchema | NextStepButtonSchema | OtherActionsSchema | PreviousStepButtonSchema | SaveTemplateButtonSchema | StepLabelSchema | StepProgressSchema | ToolbarButtonGroupSchema | ShareMenuActionSchema | ShareToolbarButtonSchema | UndoToolbarButtonSchema | RedoToolbarButtonSchema | ResetCameraToolbarButtonSchema | MeasurementsToolbarButtonSchema | AssistantToolbarButtonSchema | HelpToolbarButtonSchema | MeasurementsMenuActionSchema | LanguageMenuActionSchema | HelpMenuActionSchema;
|
|
36
37
|
export declare const PhoenixLayoutElementSchema: ExtendedJsonSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{adminConnectedResourcePageSchema as o}from"./admin-connected-resource-page.js";import{adminDataTableActionsSchema as t}from"./admin-data-table-actions.js";import{adminDataTablePageSchema as r}from"./admin-data-table-page.js";import{adminPresetActionsSchema as m}from"./admin-preset-actions.js";import{adminPresetCategoryActionsSchema as e}from"./admin-preset-category-actions.js";import{adminPresetCategoryPageSchema as s}from"./admin-preset-category-page.js";import{adminPresetListPageSchema as a}from"./admin-preset-list-page.js";import{adminRecipeActionsSchema as i}from"./admin-recipe-actions.js";import{adminRecipeCollectionPageSchema as n}from"./admin-recipe-collection-page.js";import{
|
|
1
|
+
import{adminConnectedResourcePageSchema as o}from"./admin-connected-resource-page.js";import{adminDataTableActionsSchema as t}from"./admin-data-table-actions.js";import{adminDataTablePageSchema as r}from"./admin-data-table-page.js";import{adminPresetActionsSchema as m}from"./admin-preset-actions.js";import{adminPresetCategoryActionsSchema as e}from"./admin-preset-category-actions.js";import{adminPresetCategoryPageSchema as s}from"./admin-preset-category-page.js";import{adminPresetListPageSchema as a}from"./admin-preset-list-page.js";import{adminRecipeActionsSchema as i}from"./admin-recipe-actions.js";import{adminRecipeCollectionPageSchema as n}from"./admin-recipe-collection-page.js";import{assistantToolbarButtonSchema as p}from"./assistant-toolbar-button.js";import{customLayoutElementSchema as f}from"./custom-layout-element.js";import{enterFullscreenToolbarButtonSchema as u}from"./enter-fullscreen-toolbar-button.js";import{enterSummaryButtonSchema as j}from"./enter-summary-button.js";import{exitFullscreenToolbarButtonSchema as l}from"./exit-fullscreen-toolbar-button.js";import{footerPriceSchema as b}from"./footer-price.js";import{helpMenuActionSchema as c}from"./help-menu-action.js";import{helpToolbarButtonSchema as d}from"./help-toolbar-button.js";import{languageMenuActionSchema as g}from"./language-menu-action.js";import{languageToolbarButtonSchema as h}from"./language-toolbar-button.js";import{mainFooterActionsSchema as y}from"./main-footer-actions.js";import{measurementsMenuActionSchema as x}from"./measurements-menu-action.js";import{measurementsToolbarButtonSchema as E}from"./measurements-toolbar-button.js";import{nextStepButtonSchema as L}from"./next-step-button.js";import{otherActionsSchema as P}from"./other-actions.js";import{previousStepButtonSchema as v}from"./previous-step-button.js";import{redoToolbarButtonSchema as k}from"./redo-toolbar-button.js";import{resetCameraToolbarButtonSchema as O}from"./reset-camera-toolbar-button.js";import{saveTemplateButtonSchema as S}from"./save-template-button.js";import{shareMenuActionSchema as T}from"./share-menu-action.js";import{shareToolbarButtonSchema as q}from"./share-toolbar-button.js";import{stepLabelSchema as w}from"./step-label.js";import{stepProgressSchema as z}from"./step-progress.js";import{toolbarButtonGroupSchema as A}from"./toolbar-button-group.js";import{undoToolbarButtonSchema as B}from"./undo-toolbar-button.js";export const PhoenixLayoutElementSchema={tsType:"PhoenixLayoutElement",import:[{module:"@salsita-ai/sdk/domain",member:"PhoenixLayoutElement"}],anyOf:[f,s,e,a,m,n,i,r,t,o,j,u,b,h,y,L,P,v,S,w,z,A,l,q,T,B,k,O,E,p,d,x,g,c]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"@monaco-editor/react";import{Box as r,Checkbox as i,FormControlLabel as a,Stack as n,Typography as s}from"@mui/material";import{useState as l}from"react";import{EditorButton as m}from"../common/EditorButton.js";import{jsonEditorOptions as d}from"../common/monaco-config.js";import{useOptionalConfigurator as c,useOptionalDomain as p}from"../hooks/use-optional-runtime.js";import{splitOperations as u}from"./split-operations.js";let h={fontSize:"12px",fontWeight:600,color:"text.secondary"};export const GraphQLPanel=()=>{let f=c()?.graphQLSystem,g=p()?.storeSystem,[x,y]=l("query { root { id type } }"),[b,v]=l(""),[S,k]=l(!1),[j,N]=l(null),[C,w]=l(null),[z,J]=l(!1),O=async()=>{let e=u(x),t=(e=>{if(""===e.trim())return{ok:!0,variables:void 0};try{let t=JSON.parse(e);return"object"!=typeof t||null===t||Array.isArray(t)?{ok:!1,message:"Variables must be a JSON object. Wrap them in {} or clear the field."}:{ok:!0,variables:t}}catch(e){return{ok:!1,message:`Variables are not valid JSON: ${e instanceof Error?e.message:String(e)}. Fix the JSON or clear the field.`}}})(b);if(f){if(w(null),!e.ok)return void N(e.message);if(!t.ok)return void N(t.message);if(S&&!g?.isInitialized)return void N("The configuration is not loaded yet, so there is no state to run against. Run again once the configurator has finished loading.");J(!0);try{let o=e.operations.map(e=>({...e,variables:t.variables})),r=S&&g?await f.prepare(g.stateSlices.committed.value.state,o):void 0,{results:i,committed:a,message:n,sideEffects:s}=r?{results:r.map(({result:e})=>e),committed:!1,message:"Dry run: nothing was committed.",sideEffects:f.readSideEffects(r)}:await f.execute(o),l=i.map((t,o)=>({operationName:e.operations[o]?.operationName??null,...t}));N(JSON.stringify(s.length>0?{results:l,sideEffects:s}:l,null,2)),w(a?"Committed as one undo step.":n??"Nothing was committed.")}finally{J(!1)}}};return t(n,{direction:"column",spacing:1.5,sx:{px:1.5,py:1},children:[e(s,{variant:"subtitle2",sx:h,children:"Query"}),e(r,{component:"div",sx:{height:160,border:"1px solid #dee2e6"},children:e(o,{language:"graphql",value:x,onChange:e=>y(e??""),options:d})}),e(s,{variant:"subtitle2",sx:h,children:"Variables (JSON)"}),e(r,{component:"div",sx:{height:80,border:"1px solid #dee2e6"},children:e(o,{language:"json",value:b,onChange:e=>v(e??""),options:d})}),e(a,{control:e(i,{size:"small",checked:S,onChange:e=>{k(e.target.checked)},sx:{p:.5}}),label:"Dry run",sx:{ml:-.5,mr:0,"& .MuiFormControlLabel-label":{fontSize:"12px",color:"#212529"}}}),e(m,{fullWidth:!0,disabled:!f||z,onClick:()=>void O(),children:f?"Run":"Configurator is not ready"}),null!==C&&e(s,{"data-testid":"graphql-status",sx:{fontSize:"12px",color:"text.secondary"},children:C}),null!==j&&e(r,{component:"pre","data-testid":"graphql-result",sx:{m:0,p:1,fontSize:"12px",backgroundColor:"#f8f9fa",overflow:"auto",whiteSpace:"pre-wrap"},children:j})]})};
|