@e-llm-studio/instant-learning 1.3.29 → 1.3.31-alpha.1

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 (70) hide show
  1. package/dist/cjs/features/IL-OTJ/ILOTJ.js +6 -1
  2. package/dist/cjs/features/IL-OTJ/ILOTJ.js.map +1 -1
  3. package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +2 -0
  4. package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js.map +1 -1
  5. package/dist/cjs/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js.map +1 -1
  6. package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +12 -2
  7. package/dist/cjs/features/IL-OTJ/_components/ChatComponents/ChatComponent.js.map +1 -1
  8. package/dist/cjs/features/IL-OTJ/_components/hooks/usePendingEditHighlight.js +30 -2
  9. package/dist/cjs/features/IL-OTJ/_components/hooks/usePendingEditHighlight.js.map +1 -1
  10. package/dist/cjs/features/LearningManagement/LearningManagement.js.map +1 -1
  11. package/dist/cjs/features/LearningManagement/LearningTemplateLayout.js.map +1 -1
  12. package/dist/cjs/features/LearningManagement/RuleContent/RuleContent.js.map +1 -1
  13. package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js +4 -1
  14. package/dist/cjs/features/LearningManagement/components/InstantLearningModal.js.map +1 -1
  15. package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js +3 -0
  16. package/dist/cjs/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
  17. package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -0
  18. package/dist/cjs/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js.map +1 -1
  19. package/dist/cjs/schema-driven/components/GroupEditRow.js +2 -2
  20. package/dist/cjs/schema-driven/components/GroupEditRow.js.map +1 -1
  21. package/dist/cjs/schema-driven/components/VariantListField.js +2 -1
  22. package/dist/cjs/schema-driven/components/VariantListField.js.map +1 -1
  23. package/dist/cjs/schema-driven/primitives/Accordion.js +2 -1
  24. package/dist/cjs/schema-driven/primitives/Accordion.js.map +1 -1
  25. package/dist/features/IL-OTJ/ILOTJ.js +6 -1
  26. package/dist/features/IL-OTJ/ILOTJ.js.map +1 -1
  27. package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js +2 -0
  28. package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.js.map +1 -1
  29. package/dist/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.js.map +1 -1
  30. package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js +12 -2
  31. package/dist/features/IL-OTJ/_components/ChatComponents/ChatComponent.js.map +1 -1
  32. package/dist/features/IL-OTJ/_components/hooks/usePendingEditHighlight.js +30 -2
  33. package/dist/features/IL-OTJ/_components/hooks/usePendingEditHighlight.js.map +1 -1
  34. package/dist/features/LearningManagement/LearningManagement.js.map +1 -1
  35. package/dist/features/LearningManagement/LearningTemplateLayout.js.map +1 -1
  36. package/dist/features/LearningManagement/RuleContent/RuleContent.js.map +1 -1
  37. package/dist/features/LearningManagement/components/InstantLearningModal.js +4 -1
  38. package/dist/features/LearningManagement/components/InstantLearningModal.js.map +1 -1
  39. package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js +3 -0
  40. package/dist/features/LearningManagement/components/InstantLearningModalDynamic.js.map +1 -1
  41. package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js +1 -0
  42. package/dist/plugins/ValueTypes/Default/DefaultTeachMeRenderer.js.map +1 -1
  43. package/dist/schema-driven/components/GroupEditRow.js +2 -2
  44. package/dist/schema-driven/components/GroupEditRow.js.map +1 -1
  45. package/dist/schema-driven/components/VariantListField.js +2 -1
  46. package/dist/schema-driven/components/VariantListField.js.map +1 -1
  47. package/dist/schema-driven/primitives/Accordion.js +2 -1
  48. package/dist/schema-driven/primitives/Accordion.js.map +1 -1
  49. package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts +1 -0
  50. package/dist/types/src/features/IL-OTJ/ILOTJ.d.ts.map +1 -1
  51. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMePlugin.d.ts.map +1 -1
  52. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts +2 -0
  53. package/dist/types/src/features/IL-OTJ/ValueTypeWrappers/TeachMeWrapper.d.ts.map +1 -1
  54. package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts +2 -0
  55. package/dist/types/src/features/IL-OTJ/_components/ChatComponents/ChatComponent.d.ts.map +1 -1
  56. package/dist/types/src/features/IL-OTJ/_components/hooks/usePendingEditHighlight.d.ts.map +1 -1
  57. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts +2 -0
  58. package/dist/types/src/features/LearningManagement/LearningManagement.d.ts.map +1 -1
  59. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts +2 -0
  60. package/dist/types/src/features/LearningManagement/LearningTemplateLayout.d.ts.map +1 -1
  61. package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts +2 -0
  62. package/dist/types/src/features/LearningManagement/RuleContent/RuleContent.d.ts.map +1 -1
  63. package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts +2 -0
  64. package/dist/types/src/features/LearningManagement/components/InstantLearningModal.d.ts.map +1 -1
  65. package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts +2 -0
  66. package/dist/types/src/features/LearningManagement/components/InstantLearningModalDynamic.d.ts.map +1 -1
  67. package/dist/types/src/plugins/ValueTypes/Default/DefaultTeachMeRenderer.d.ts.map +1 -1
  68. package/dist/types/src/schema-driven/components/VariantListField.d.ts.map +1 -1
  69. package/dist/types/src/schema-driven/primitives/Accordion.d.ts.map +1 -1
  70. package/package.json +3 -3
@@ -7,6 +7,7 @@ var React = require('react');
7
7
  const STYLE_ELEMENT_ID = "bpa-pending-edit-highlight-styles";
8
8
  const PULSE_CLASS = "bpa-pending-edit--pulse";
9
9
  const RING_CLASS = "bpa-pending-edit";
10
+ const ACTION_PULSE_CLASS = "bpa-pending-edit-action--pulse";
10
11
  const PULSE_DURATION_MS = 3e3;
11
12
  const STYLES = `
12
13
  @keyframes bpa-pending-edit-pulse {
@@ -24,8 +25,18 @@ const STYLES = `
24
25
  .${PULSE_CLASS} {
25
26
  animation: bpa-pending-edit-pulse 1s ease-in-out 3;
26
27
  }
28
+ @keyframes bpa-pending-edit-action-pulse {
29
+ 0%, 100% { box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.65); transform: scale(1); }
30
+ 50% { box-shadow: 0 0 0 8px rgba(194, 65, 12, 0); transform: scale(1.025); }
31
+ }
32
+ .${ACTION_PULSE_CLASS} {
33
+ animation: bpa-pending-edit-action-pulse 1s ease-in-out 3;
34
+ position: relative;
35
+ z-index: 1;
36
+ }
27
37
  @media (prefers-reduced-motion: reduce) {
28
38
  .${PULSE_CLASS} { animation: none; box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.15); }
39
+ .${ACTION_PULSE_CLASS} { animation: none; box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.25); }
29
40
  }
30
41
  `;
31
42
  const ensureStyles = () => {
@@ -38,27 +49,44 @@ const ensureStyles = () => {
38
49
  function usePendingEditHighlight(pendingEditId) {
39
50
  const nudgeRef = React.useRef(0);
40
51
  const targetRef = React.useRef(null);
52
+ const actionRef = React.useRef(null);
41
53
  const timerRef = React.useRef(null);
42
54
  const clearHighlight = () => {
43
- var _a;
55
+ var _a, _b;
44
56
  if (timerRef.current) {
45
57
  clearTimeout(timerRef.current);
46
58
  timerRef.current = null;
47
59
  }
48
60
  (_a = targetRef.current) == null ? void 0 : _a.classList.remove(PULSE_CLASS, RING_CLASS);
61
+ (_b = actionRef.current) == null ? void 0 : _b.classList.remove(ACTION_PULSE_CLASS);
49
62
  targetRef.current = null;
63
+ actionRef.current = null;
50
64
  };
51
65
  const run = (id) => {
52
66
  ensureStyles();
53
67
  requestAnimationFrame(() => {
68
+ var _a, _b;
54
69
  const el = document.querySelector(`[data-edit-id="${id}"]`);
55
70
  if (!el) return;
56
71
  clearHighlight();
57
72
  targetRef.current = el;
58
73
  el.classList.add(RING_CLASS, PULSE_CLASS);
59
- el.scrollIntoView({ behavior: "smooth", block: "center" });
74
+ const actionRow = el.querySelector("[data-pending-edit-actions]");
75
+ const primaryAction = (_a = el.querySelector("[data-pending-edit-primary-action]")) != null ? _a : Array.from(el.querySelectorAll("button")).find(
76
+ (button) => {
77
+ var _a2, _b2;
78
+ return /^(save|apply|done)$/i.test((_b2 = (_a2 = button.textContent) == null ? void 0 : _a2.trim()) != null ? _b2 : "");
79
+ }
80
+ );
81
+ const scrollTarget = (_b = actionRow != null ? actionRow : primaryAction) != null ? _b : el;
82
+ scrollTarget.scrollIntoView({ behavior: "smooth", block: "center" });
83
+ if (primaryAction) {
84
+ actionRef.current = primaryAction;
85
+ primaryAction.classList.add(ACTION_PULSE_CLASS);
86
+ }
60
87
  timerRef.current = setTimeout(() => {
61
88
  el.classList.remove(PULSE_CLASS);
89
+ primaryAction == null ? void 0 : primaryAction.classList.remove(ACTION_PULSE_CLASS);
62
90
  timerRef.current = null;
63
91
  }, PULSE_DURATION_MS);
64
92
  });
@@ -1 +1 @@
1
- {"version":3,"file":"usePendingEditHighlight.js","sources":["../../../../../../src/features/IL-OTJ/_components/hooks/usePendingEditHighlight.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n// The \"Pending - Changes not applied yet\" warning renders inline inside whichever\n// section owns the open edit session, and that section is often scrolled out of view\n// (or buried under a long variant accordion) by the time the user clicks away — so the\n// click just feels dead. This hook makes the block announce itself: it scrolls the\n// pending section into view and pulses a glow around it for ~3s, then leaves a soft\n// ring behind for as long as the edit stays pending.\n//\n// It works purely off the `data-edit-id` markers the sections already render, so every\n// pending-capable surface (rule setup, groups, variants, condition rows) is covered by\n// mounting this once next to the `pendingEditId` state.\n\nconst STYLE_ELEMENT_ID = 'bpa-pending-edit-highlight-styles';\nconst PULSE_CLASS = 'bpa-pending-edit--pulse';\nconst RING_CLASS = 'bpa-pending-edit';\nconst PULSE_DURATION_MS = 3000;\n\nconst STYLES = `\n@keyframes bpa-pending-edit-pulse {\n 0% { box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.40); outline-color: rgba(194, 65, 12, 0.95); }\n 50% { box-shadow: 0 0 0 8px rgba(194, 65, 12, 0.00); outline-color: rgba(194, 65, 12, 0.35); }\n 100% { box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.40); outline-color: rgba(194, 65, 12, 0.95); }\n}\n.${RING_CLASS} {\n /* outline (not border) so the ring never shifts the accordion's layout */\n outline: 2px solid rgba(194, 65, 12, 0.55);\n outline-offset: 2px;\n border-radius: 10px;\n transition: box-shadow 200ms ease, outline-color 200ms ease;\n}\n.${PULSE_CLASS} {\n animation: bpa-pending-edit-pulse 1s ease-in-out 3;\n}\n@media (prefers-reduced-motion: reduce) {\n .${PULSE_CLASS} { animation: none; box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.15); }\n}\n`;\n\nconst ensureStyles = () => {\n if (typeof document === 'undefined' || document.getElementById(STYLE_ELEMENT_ID)) return;\n const style = document.createElement('style');\n style.id = STYLE_ELEMENT_ID;\n style.textContent = STYLES;\n document.head.appendChild(style);\n};\n\nexport function usePendingEditHighlight(pendingEditId: string | null | undefined) {\n // Bumped on every outside click so a *repeated* click on an already-pending section\n // replays the pulse (the id itself doesn't change, so it can't drive the effect).\n const nudgeRef = useRef(0);\n const targetRef = useRef<HTMLElement | null>(null);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearHighlight = () => {\n if (timerRef.current) { clearTimeout(timerRef.current); timerRef.current = null; }\n targetRef.current?.classList.remove(PULSE_CLASS, RING_CLASS);\n targetRef.current = null;\n };\n\n const run = (id: string) => {\n ensureStyles();\n // The pending section can mount/expand in the same tick the flag flips, so wait a\n // frame before querying — otherwise we scroll to a node that is about to move.\n requestAnimationFrame(() => {\n const el = document.querySelector<HTMLElement>(`[data-edit-id=\"${id}\"]`);\n if (!el) return;\n clearHighlight();\n targetRef.current = el;\n el.classList.add(RING_CLASS, PULSE_CLASS);\n el.scrollIntoView({ behavior: 'smooth', block: 'center' });\n timerRef.current = setTimeout(() => {\n el.classList.remove(PULSE_CLASS); // keep the soft ring while still pending\n timerRef.current = null;\n }, PULSE_DURATION_MS);\n });\n };\n\n useEffect(() => {\n if (!pendingEditId) { clearHighlight(); return; }\n run(pendingEditId);\n return clearHighlight;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pendingEditId, nudgeRef.current]);\n\n // Call from the outside-click handler to replay the pulse when the section is already\n // pending — returns nothing, it just re-runs the highlight for the current id.\n const pulsePendingEdit = (id?: string | null) => {\n const target = id || pendingEditId;\n if (!target) return;\n nudgeRef.current += 1;\n run(target);\n };\n\n return { pulsePendingEdit };\n}\n\nexport default usePendingEditHighlight;\n"],"names":["useRef","useEffect"],"mappings":";;;;;;AAaA,MAAM,gBAAmB,GAAA,mCAAA,CAAA;AACzB,MAAM,WAAc,GAAA,yBAAA,CAAA;AACpB,MAAM,UAAa,GAAA,kBAAA,CAAA;AACnB,MAAM,iBAAoB,GAAA,GAAA,CAAA;AAE1B,MAAM,MAAS,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,EAMZ,UAAU,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,EAOV,WAAW,CAAA;AAAA;AAAA;AAAA;AAAA,GAAA,EAIT,WAAW,CAAA;AAAA;AAAA,CAAA,CAAA;AAIhB,MAAM,eAAe,MAAM;AACzB,EAAA,IAAI,OAAO,QAAa,KAAA,WAAA,IAAe,QAAS,CAAA,cAAA,CAAe,gBAAgB,CAAG,EAAA,OAAA;AAClF,EAAM,MAAA,KAAA,GAAQ,QAAS,CAAA,aAAA,CAAc,OAAO,CAAA,CAAA;AAC5C,EAAA,KAAA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,eAAe,EAAE,QAAA,EAAU,QAAU,EAAA,KAAA,EAAO,UAAU,CAAA,CAAA;AACzD,MAAS,QAAA,CAAA,OAAA,GAAU,WAAW,MAAM;AAClC,QAAG,EAAA,CAAA,SAAA,CAAU,OAAO,WAAW,CAAA,CAAA;AAC/B,QAAA,QAAA,CAAS,OAAU,GAAA,IAAA,CAAA;AAAA,SAClB,iBAAiB,CAAA,CAAA;AAAA,KACrB,CAAA,CAAA;AAAA,GACH,CAAA;AAEA,EAAAC,eAAA,CAAU,MAAM;AACd,IAAA,IAAI,CAAC,aAAe,EAAA;AAAE,MAAe,cAAA,EAAA,CAAA;AAAG,MAAA,OAAA;AAAA,KAAQ;AAChD,IAAA,GAAA,CAAI,aAAa,CAAA,CAAA;AACjB,IAAO,OAAA,cAAA,CAAA;AAAA,GAEN,EAAA,CAAC,aAAe,EAAA,QAAA,CAAS,OAAO,CAAC,CAAA,CAAA;AAIpC,EAAM,MAAA,gBAAA,GAAmB,CAAC,EAAuB,KAAA;AAC/C,IAAA,MAAM,SAAS,EAAM,IAAA,aAAA,CAAA;AACrB,IAAA,IAAI,CAAC,MAAQ,EAAA,OAAA;AACb,IAAA,QAAA,CAAS,OAAW,IAAA,CAAA,CAAA;AACpB,IAAA,GAAA,CAAI,MAAM,CAAA,CAAA;AAAA,GACZ,CAAA;AAEA,EAAA,OAAO,EAAE,gBAAiB,EAAA,CAAA;AAC5B;;;;;"}
1
+ {"version":3,"file":"usePendingEditHighlight.js","sources":["../../../../../../src/features/IL-OTJ/_components/hooks/usePendingEditHighlight.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\n\n// The \"Pending - Changes not applied yet\" warning renders inline inside whichever\n// section owns the open edit session, and that section is often scrolled out of view\n// (or buried under a long variant accordion) by the time the user clicks away — so the\n// click just feels dead. This hook makes the block announce itself: it scrolls the\n// pending section into view and pulses a glow around it for ~3s, then leaves a soft\n// ring behind for as long as the edit stays pending.\n//\n// It works purely off the `data-edit-id` markers the sections already render, so every\n// pending-capable surface (rule setup, groups, variants, condition rows) is covered by\n// mounting this once next to the `pendingEditId` state.\n\nconst STYLE_ELEMENT_ID = 'bpa-pending-edit-highlight-styles';\nconst PULSE_CLASS = 'bpa-pending-edit--pulse';\nconst RING_CLASS = 'bpa-pending-edit';\nconst ACTION_PULSE_CLASS = 'bpa-pending-edit-action--pulse';\nconst PULSE_DURATION_MS = 3000;\n\nconst STYLES = `\n@keyframes bpa-pending-edit-pulse {\n 0% { box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.40); outline-color: rgba(194, 65, 12, 0.95); }\n 50% { box-shadow: 0 0 0 8px rgba(194, 65, 12, 0.00); outline-color: rgba(194, 65, 12, 0.35); }\n 100% { box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.40); outline-color: rgba(194, 65, 12, 0.95); }\n}\n.${RING_CLASS} {\n /* outline (not border) so the ring never shifts the accordion's layout */\n outline: 2px solid rgba(194, 65, 12, 0.55);\n outline-offset: 2px;\n border-radius: 10px;\n transition: box-shadow 200ms ease, outline-color 200ms ease;\n}\n.${PULSE_CLASS} {\n animation: bpa-pending-edit-pulse 1s ease-in-out 3;\n}\n@keyframes bpa-pending-edit-action-pulse {\n 0%, 100% { box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.65); transform: scale(1); }\n 50% { box-shadow: 0 0 0 8px rgba(194, 65, 12, 0); transform: scale(1.025); }\n}\n.${ACTION_PULSE_CLASS} {\n animation: bpa-pending-edit-action-pulse 1s ease-in-out 3;\n position: relative;\n z-index: 1;\n}\n@media (prefers-reduced-motion: reduce) {\n .${PULSE_CLASS} { animation: none; box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.15); }\n .${ACTION_PULSE_CLASS} { animation: none; box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.25); }\n}\n`;\n\nconst ensureStyles = () => {\n if (typeof document === 'undefined' || document.getElementById(STYLE_ELEMENT_ID)) return;\n const style = document.createElement('style');\n style.id = STYLE_ELEMENT_ID;\n style.textContent = STYLES;\n document.head.appendChild(style);\n};\n\nexport function usePendingEditHighlight(pendingEditId: string | null | undefined) {\n // Bumped on every outside click so a *repeated* click on an already-pending section\n // replays the pulse (the id itself doesn't change, so it can't drive the effect).\n const nudgeRef = useRef(0);\n const targetRef = useRef<HTMLElement | null>(null);\n const actionRef = useRef<HTMLElement | null>(null);\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const clearHighlight = () => {\n if (timerRef.current) { clearTimeout(timerRef.current); timerRef.current = null; }\n targetRef.current?.classList.remove(PULSE_CLASS, RING_CLASS);\n actionRef.current?.classList.remove(ACTION_PULSE_CLASS);\n targetRef.current = null;\n actionRef.current = null;\n };\n\n const run = (id: string) => {\n ensureStyles();\n // The pending section can mount/expand in the same tick the flag flips, so wait a\n // frame before querying — otherwise we scroll to a node that is about to move.\n requestAnimationFrame(() => {\n const el = document.querySelector<HTMLElement>(`[data-edit-id=\"${id}\"]`);\n if (!el) return;\n clearHighlight();\n targetRef.current = el;\n el.classList.add(RING_CLASS, PULSE_CLASS);\n\n // An unsaved edit is actionable only from its Save/Cancel controls. Prefer the\n // explicitly marked action row; the semantic fallback keeps older field editors\n // useful until they add the marker.\n const actionRow = el.querySelector<HTMLElement>('[data-pending-edit-actions]');\n const primaryAction = el.querySelector<HTMLElement>('[data-pending-edit-primary-action]')\n ?? Array.from(el.querySelectorAll<HTMLElement>('button')).find((button) =>\n /^(save|apply|done)$/i.test(button.textContent?.trim() ?? ''),\n );\n const scrollTarget = actionRow ?? primaryAction ?? el;\n\n scrollTarget.scrollIntoView({ behavior: 'smooth', block: 'center' });\n if (primaryAction) {\n actionRef.current = primaryAction;\n primaryAction.classList.add(ACTION_PULSE_CLASS);\n }\n timerRef.current = setTimeout(() => {\n el.classList.remove(PULSE_CLASS); // keep the soft ring while still pending\n primaryAction?.classList.remove(ACTION_PULSE_CLASS);\n timerRef.current = null;\n }, PULSE_DURATION_MS);\n });\n };\n\n useEffect(() => {\n if (!pendingEditId) { clearHighlight(); return; }\n run(pendingEditId);\n return clearHighlight;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pendingEditId, nudgeRef.current]);\n\n // Call from the outside-click handler to replay the pulse when the section is already\n // pending — returns nothing, it just re-runs the highlight for the current id.\n const pulsePendingEdit = (id?: string | null) => {\n const target = id || pendingEditId;\n if (!target) return;\n nudgeRef.current += 1;\n run(target);\n };\n\n return { pulsePendingEdit };\n}\n\nexport default usePendingEditHighlight;\n"],"names":["useRef","_a","_b","useEffect"],"mappings":";;;;;;AAaA,MAAM,gBAAmB,GAAA,mCAAA,CAAA;AACzB,MAAM,WAAc,GAAA,yBAAA,CAAA;AACpB,MAAM,UAAa,GAAA,kBAAA,CAAA;AACnB,MAAM,kBAAqB,GAAA,gCAAA,CAAA;AAC3B,MAAM,iBAAoB,GAAA,GAAA,CAAA;AAE1B,MAAM,MAAS,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,EAMZ,UAAU,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,EAOV,WAAW,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA,EAOX,kBAAkB,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAAA,EAMhB,WAAW,CAAA;AAAA,GAAA,EACX,kBAAkB,CAAA;AAAA;AAAA,CAAA,CAAA;AAIvB,MAAM,eAAe,MAAM;AACzB,EAAA,IAAI,OAAO,QAAa,KAAA,WAAA,IAAe,QAAS,CAAA,cAAA,CAAe,gBAAgB,CAAG,EAAA,OAAA;AAClF,EAAM,MAAA,KAAA,GAAQ,QAAS,CAAA,aAAA,CAAc,OAAO,CAAA,CAAA;AAC5C,EAAA,KAAA,CAAM,EAAK,GAAA,gBAAA,CAAA;AACX,EAAA,KAAA,CAAM,WAAc,GAAA,MAAA,CAAA;AACpB,EAAS,QAAA,CAAA,IAAA,CAAK,YAAY,KAAK,CAAA,CAAA;AACjC,CAAA,CAAA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