@40rty/ams-ui 0.4.3 → 0.5.0

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/shell.js CHANGED
@@ -4180,7 +4180,7 @@ function DefaultMobileShell(props) {
4180
4180
  }, [withholdIsland]);
4181
4181
  const pageComposes = props.canvasComposer !== void 0;
4182
4182
  const measuredClearance = islandFaceHeight === null ? MOBILE_CANVAS_BOTTOM_CLEARANCE : islandFaceHeight + ISLAND_CLEARANCE_BREATHING;
4183
- const canvasBottomClearance = withholdIsland && !pageComposes ? 0 : measuredClearance;
4183
+ const canvasBottomClearance = withholdIsland ? 0 : measuredClearance;
4184
4184
  const shellRef = React27.useRef(null);
4185
4185
  const chromeInset = useKeyboardInset(shellRef);
4186
4186
  const restingChromeInset = chromeInset > KEYBOARD_LIKELY_MIN_PX ? 0 : chromeInset;
@@ -4260,7 +4260,7 @@ function DefaultMobileShell(props) {
4260
4260
  ] })
4261
4261
  }
4262
4262
  ),
4263
- pageComposes && /* @__PURE__ */ jsx30(PageComposerDock, { bottom: chromeInset, onHeightChange: setIslandFaceHeight, children: resolveShellSlot(props.canvasComposer, dock) }),
4263
+ pageComposes && !withholdIsland && /* @__PURE__ */ jsx30(PageComposerDock, { bottom: chromeInset, onHeightChange: setIslandFaceHeight, children: resolveShellSlot(props.canvasComposer, dock) }),
4264
4264
  !pageComposes && !withholdIsland && /* @__PURE__ */ jsx30(
4265
4265
  MobileVoiceConsole,
4266
4266
  {
@@ -4334,6 +4334,11 @@ function ShellScaffold(props) {
4334
4334
  };
4335
4335
  const isMobile = useMediaQuery(mq);
4336
4336
  const dock = useDockState(props.reopenDockOnMessage === true, props.canvasComposer === void 0);
4337
+ const [heroEntryClaims, setHeroEntryClaims] = React29.useState(0);
4338
+ const claimHeroEntry = React29.useCallback((delta) => {
4339
+ setHeroEntryClaims((n) => Math.max(0, n + delta));
4340
+ }, []);
4341
+ const heroOwnsEntry = heroEntryClaims > 0;
4337
4342
  const resizable = props.resizableDock === true;
4338
4343
  const [liveWidth, setLiveWidth] = React29.useState(dockWidth);
4339
4344
  const [resizing, setResizing] = React29.useState(false);
@@ -4362,7 +4367,7 @@ function ShellScaffold(props) {
4362
4367
  }
4363
4368
  ) });
4364
4369
  }
4365
- const canvasContent = /* @__PURE__ */ jsx32(ShellDockProvider, { value: dock, children: wrapTransition ? /* @__PURE__ */ jsx32(ConversationTransition, { children: props.canvas }) : props.canvas });
4370
+ const canvasContent = /* @__PURE__ */ jsx32(ShellDockProvider, { value: dock, children: /* @__PURE__ */ jsx32(HeroEntryPointProvider, { claim: claimHeroEntry, claimed: heroOwnsEntry, children: wrapTransition ? /* @__PURE__ */ jsx32(ConversationTransition, { children: props.canvas }) : props.canvas }) });
4366
4371
  return /* @__PURE__ */ jsxs20("div", { style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0, background: "var(--fourty-color-bg)" }, children: [
4367
4372
  props.presenceNotch,
4368
4373
  /* @__PURE__ */ jsxs20("div", { style: { position: "relative", flex: 1, minHeight: 0, background: "var(--fourty-color-bg)" }, children: [
@@ -4382,7 +4387,7 @@ function ShellScaffold(props) {
4382
4387
  },
4383
4388
  children: /* @__PURE__ */ jsxs20("div", { "data-fourty-canvas": "", style: canvasGutterStyle, children: [
4384
4389
  /* @__PURE__ */ jsx32("div", { style: { flex: 1, minHeight: 0 }, children: canvasContent }),
4385
- props.canvasComposer !== void 0 && /* @__PURE__ */ jsx32("div", { "data-fourty-shell-part": "composer", style: { position: "sticky", bottom: 0, zIndex: dockZIndex }, children: resolveShellSlot(props.canvasComposer, dock) }),
4390
+ props.canvasComposer !== void 0 && !heroOwnsEntry && /* @__PURE__ */ jsx32("div", { "data-fourty-shell-part": "composer", style: { position: "sticky", bottom: 0, zIndex: dockZIndex }, children: resolveShellSlot(props.canvasComposer, dock) }),
4386
4391
  props.footer
4387
4392
  ] })
4388
4393
  }
@@ -79,12 +79,14 @@ export declare function HeroEntryPointProvider({ claim, claimed, children, }: {
79
79
  */
80
80
  export declare function useHeroEntryPointVisible(): boolean;
81
81
  /**
82
- * Called by a brand hero for as long as IT is the mobile entry point.
82
+ * Called by a brand hero for as long as IT is the entry point — its own
83
+ * prompt box showing and on screen. The phone's island and a shell's page
84
+ * composer (`canvasComposer`, desktop and phone) stand aside for exactly that
85
+ * long.
83
86
  *
84
- * Pass `false` (desktop, or once the hero's own box has retired) to release.
85
- * Outside the mobile shell there is no provider and this is a no-op, so a
86
- * component can call it unconditionally without knowing which shell it is
87
- * mounted in.
87
+ * Pass `false` once the hero's own box has retired (or scrolled away) to
88
+ * release. Outside a shell there is no provider and this is a no-op, so a
89
+ * component can call it unconditionally without knowing where it is mounted.
88
90
  */
89
91
  export declare function useClaimHeroEntryPoint(active: boolean): void;
90
92
  /**
package/package.json CHANGED
@@ -71,12 +71,12 @@
71
71
  "zod": "^3.23.0"
72
72
  },
73
73
  "peerDependencies": {
74
- "@40rty/ams-sdk": "0.4.3",
74
+ "@40rty/ams-sdk": "0.5.0",
75
75
  "lucide-react": ">=0.400.0",
76
76
  "react": ">=18.0.0",
77
77
  "react-dom": ">=18.0.0"
78
78
  },
79
- "version": "0.4.3",
79
+ "version": "0.5.0",
80
80
  "homepage": "https://docs.40rty.ai",
81
81
  "license": "UNLICENSED",
82
82
  "engines": {