@flamingo-stack/openframe-frontend-core 0.0.231 → 0.0.232

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.
Files changed (45) hide show
  1. package/dist/{chunk-USACX2O4.js → chunk-5TJUN6ON.js} +2 -2
  2. package/dist/{chunk-3C4GHSLI.js → chunk-CBFXWWS7.js} +19 -2
  3. package/dist/{chunk-3C4GHSLI.js.map → chunk-CBFXWWS7.js.map} +1 -1
  4. package/dist/{chunk-DNRO2BXS.cjs → chunk-KQJXNBIS.cjs} +10 -10
  5. package/dist/{chunk-DNRO2BXS.cjs.map → chunk-KQJXNBIS.cjs.map} +1 -1
  6. package/dist/{chunk-BVLU6HLN.cjs → chunk-LG33WCJY.cjs} +9 -9
  7. package/dist/{chunk-BVLU6HLN.cjs.map → chunk-LG33WCJY.cjs.map} +1 -1
  8. package/dist/{chunk-BAQ6SS32.js → chunk-MQHM7DZZ.js} +2 -2
  9. package/dist/{chunk-R46QCZLS.js → chunk-OYG66WRJ.js} +2 -2
  10. package/dist/{chunk-U2OLWICZ.js → chunk-UTUUCSKU.js} +2 -2
  11. package/dist/{chunk-RL6VQEFT.cjs → chunk-XZHVCPXN.cjs} +7 -7
  12. package/dist/{chunk-RL6VQEFT.cjs.map → chunk-XZHVCPXN.cjs.map} +1 -1
  13. package/dist/{chunk-NFZLQOD7.cjs → chunk-ZHGIILP7.cjs} +25 -25
  14. package/dist/{chunk-NFZLQOD7.cjs.map → chunk-ZHGIILP7.cjs.map} +1 -1
  15. package/dist/{chunk-J3F3LZZI.cjs → chunk-ZMLYGCFD.cjs} +128 -111
  16. package/dist/chunk-ZMLYGCFD.cjs.map +1 -0
  17. package/dist/components/chat/hooks/use-realtime-chunk-processor.d.ts.map +1 -1
  18. package/dist/components/chat/index.cjs +2 -2
  19. package/dist/components/chat/index.js +1 -1
  20. package/dist/components/chat/types/api.types.d.ts +14 -0
  21. package/dist/components/chat/types/api.types.d.ts.map +1 -1
  22. package/dist/components/contact/index.cjs +3 -3
  23. package/dist/components/contact/index.js +2 -2
  24. package/dist/components/features/index.cjs +2 -2
  25. package/dist/components/features/index.js +1 -1
  26. package/dist/components/index.cjs +77 -77
  27. package/dist/components/index.js +4 -4
  28. package/dist/components/navigation/index.cjs +2 -2
  29. package/dist/components/navigation/index.js +1 -1
  30. package/dist/components/onboarding-guides/index.cjs +26 -26
  31. package/dist/components/onboarding-guides/index.js +3 -3
  32. package/dist/components/tickets/index.cjs +64 -64
  33. package/dist/components/tickets/index.js +4 -4
  34. package/dist/components/ui/index.cjs +2 -2
  35. package/dist/components/ui/index.js +1 -1
  36. package/dist/index.cjs +2 -2
  37. package/dist/index.js +1 -1
  38. package/package.json +1 -1
  39. package/src/components/chat/hooks/use-realtime-chunk-processor.ts +28 -0
  40. package/src/components/chat/types/api.types.ts +14 -0
  41. package/dist/chunk-J3F3LZZI.cjs.map +0 -1
  42. /package/dist/{chunk-USACX2O4.js.map → chunk-5TJUN6ON.js.map} +0 -0
  43. /package/dist/{chunk-BAQ6SS32.js.map → chunk-MQHM7DZZ.js.map} +0 -0
  44. /package/dist/{chunk-R46QCZLS.js.map → chunk-OYG66WRJ.js.map} +0 -0
  45. /package/dist/{chunk-U2OLWICZ.js.map → chunk-UTUUCSKU.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  PageShell,
6
6
  SearchInput,
7
7
  StatusFilterComponent
8
- } from "./chunk-3C4GHSLI.js";
8
+ } from "./chunk-CBFXWWS7.js";
9
9
  import {
10
10
  init_next_navigation,
11
11
  usePathname,
@@ -159,4 +159,4 @@ export {
159
159
  DevCardRowSkeleton,
160
160
  DevCardRowSkeletonList
161
161
  };
162
- //# sourceMappingURL=chunk-USACX2O4.js.map
162
+ //# sourceMappingURL=chunk-5TJUN6ON.js.map
@@ -39208,6 +39208,7 @@ function createMessageSegmentAccumulator(callbacks) {
39208
39208
  }
39209
39209
 
39210
39210
  // src/components/chat/hooks/use-realtime-chunk-processor.ts
39211
+ var DIRECT_MODE_ALLOWED = /* @__PURE__ */ new Set(["direct_message", "message_request", "system", "dialog_closed"]);
39211
39212
  function useRealtimeChunkProcessor(options) {
39212
39213
  const {
39213
39214
  callbacks,
@@ -39218,7 +39219,8 @@ function useRealtimeChunkProcessor(options) {
39218
39219
  // Owned by the consumer (e.g. oss-tenant chat client / openframe-frontend
39219
39220
  // tickets view). Default ON so consumers that haven't wired the flag yet
39220
39221
  // get the new batch UI; pass `false` explicitly to fall back to legacy.
39221
- batchApprovalsEnabled = true
39222
+ batchApprovalsEnabled = true,
39223
+ isDirectMode = false
39222
39224
  } = options;
39223
39225
  const accumulatorRef = useRef55(
39224
39226
  createMessageSegmentAccumulator({
@@ -39242,6 +39244,11 @@ function useRealtimeChunkProcessor(options) {
39242
39244
  }, [initialState, callbacks]);
39243
39245
  const isInStreamRef = useRef55(false);
39244
39246
  const hasEverStreamedRef = useRef55(false);
39247
+ const directModeFlagRef = useRef55(isDirectMode);
39248
+ const sawDirectMessageRef = useRef55(false);
39249
+ useEffect63(() => {
39250
+ directModeFlagRef.current = isDirectMode;
39251
+ }, [isDirectMode]);
39245
39252
  const pendingEscalatedRef = useRef55(/* @__PURE__ */ new Map());
39246
39253
  const processChunk = useCallback37(
39247
39254
  (chunk) => {
@@ -39251,6 +39258,15 @@ function useRealtimeChunkProcessor(options) {
39251
39258
  const action = parseChunkToAction(chunk);
39252
39259
  if (!action) return;
39253
39260
  const accumulator = accumulatorRef.current;
39261
+ if (action.action === "direct_message") sawDirectMessageRef.current = true;
39262
+ if ((directModeFlagRef.current || sawDirectMessageRef.current) && !DIRECT_MODE_ALLOWED.has(action.action)) {
39263
+ if (isInStreamRef.current) {
39264
+ isInStreamRef.current = false;
39265
+ callbacks.onStreamEnd?.();
39266
+ accumulator.resetSegments();
39267
+ }
39268
+ return;
39269
+ }
39254
39270
  switch (action.action) {
39255
39271
  case "message_start":
39256
39272
  isInStreamRef.current = true;
@@ -39464,6 +39480,7 @@ function useRealtimeChunkProcessor(options) {
39464
39480
  accumulatorRef.current.reset();
39465
39481
  pendingEscalatedRef.current.clear();
39466
39482
  hasInitializedWithData.current = false;
39483
+ sawDirectMessageRef.current = false;
39467
39484
  }, []);
39468
39485
  const updateApprovalStatus = useCallback37(
39469
39486
  (requestId, status) => {
@@ -43975,4 +43992,4 @@ export {
43975
43992
  LogsList,
43976
43993
  assets
43977
43994
  };
43978
- //# sourceMappingURL=chunk-3C4GHSLI.js.map
43995
+ //# sourceMappingURL=chunk-CBFXWWS7.js.map