@eintrek/erp-shell 0.1.78 → 0.1.79

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/README.md CHANGED
@@ -176,6 +176,13 @@ progress API: `API.md` next to it.
176
176
  shell's adapters), `guide-ui.tsx`, `guide-styles.ts`. Tests:
177
177
  `src/guide/*.test.ts`.
178
178
 
179
+ ### 0.1.79
180
+
181
+ - **The ภารกิจ chip no longer covers dialogs.** The guide layer sits above every
182
+ dialog, and the chip sat at the dialog's bottom right, over its buttons, in
183
+ every app. While an app dialog (Radix dialog or alert dialog) is open, the
184
+ chip is not drawn; it comes back when the dialog closes.
185
+
179
186
  ### 0.1.78
180
187
 
181
188
  - **Every tab shows the "?" menu.** Each tab of an app reads guides/me and
@@ -5855,6 +5855,32 @@ function GuideRuntimeInner({ config, organizationId, code, routing, progress: pr
5855
5855
  dispatchRef.current({ type: "resumeFlow", flow: saved.flow, step: saved.step, context, write: saved.write === true });
5856
5856
  // eslint-disable-next-line react-hooks/exhaustive-deps
5857
5857
  }, [pagesLive, !!state, hasFlows, missionsLive]);
5858
+ // The layer sits above every dialog, and a dialog's buttons sit at its
5859
+ // bottom right, where the chip is: the chip covered them in every app.
5860
+ // While an app dialog is open, the chip is not drawn.
5861
+ const [appDialogShown, setAppDialogShown] = useState(false);
5862
+ useEffect(() => {
5863
+ if (!missionsLive || typeof MutationObserver === "undefined" || typeof document === "undefined" || !document.body)
5864
+ return;
5865
+ let raf = 0;
5866
+ const check = () => {
5867
+ raf = 0;
5868
+ setAppDialogShown(appDialogOpen());
5869
+ };
5870
+ check();
5871
+ const obs = new MutationObserver(records => {
5872
+ if (records.every(r => inGuideLayer(r.target)))
5873
+ return;
5874
+ if (!raf)
5875
+ raf = requestAnimationFrame(check);
5876
+ });
5877
+ obs.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["data-state", "role"] });
5878
+ return () => {
5879
+ obs.disconnect();
5880
+ if (raf)
5881
+ cancelAnimationFrame(raf);
5882
+ };
5883
+ }, [missionsLive]);
5858
5884
  if (!live || !state || !layer || !ctxIdle)
5859
5885
  return null;
5860
5886
  /* ---------------- render ---------------- */
@@ -5962,7 +5988,7 @@ function GuideRuntimeInner({ config, organizationId, code, routing, progress: pr
5962
5988
  .join(", ")
5963
5989
  : undefined,
5964
5990
  }));
5965
- const showChip = missionsLive && chipVisible(state, suite, ctxIdle);
5991
+ const showChip = missionsLive && !appDialogShown && chipVisible(state, suite, ctxIdle);
5966
5992
  // The panel: the missions (when this person has them, and not "คู่มือทุกหน้า"),
5967
5993
  // then the page guides they have.
5968
5994
  const panelMissions = missionsLive && total > 0 && state.panelSection === "all";
@@ -6082,4 +6108,4 @@ function thaiMonthYear(m, opts = {}) {
6082
6108
  }
6083
6109
 
6084
6110
  export { API_EVENT as A, useGuideEntry as B, usePageGuideEntry as C, usePageGuides as D, useSectionGuideValues as E, GUIDE_EVENT_PREFIX as G, SectionGuideButton as S, THAI_MONTHS_SHORT as T, GUIDE_LAYER_ATTRIBUTE as a, GuideErrorBoundary as b, GuideProgressConflict as c, GuideRuntime as d, apiCallDetail as e, emitGuideEvent as f, fillRoute as g, formatBaht as h, guideAnchor as i, guideMenuItems as j, guideMenuShown as k, loadGuides as l, matchApiPath as m, matchRoute as n, openFlow as o, openFlowsPanel as p, openGuidePanel as q, openPageGuide as r, openPagesPanel as s, openSectionGuide as t, reportApiCall as u, reportApiEvent as v, setSectionGuideValues as w, storeGuides as x, thaiMonth as y, thaiMonthYear as z };
6085
- //# sourceMappingURL=format-Wgj2sKpK.esm.js.map
6111
+ //# sourceMappingURL=format-BqUpxbzD.esm.js.map