@yoamigo.com/core 0.2.2 → 0.3.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.
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React__default, { ReactNode } from 'react';
2
+ import React$1, { ReactNode } from 'react';
3
3
 
4
4
  type EditMode = 'read-only' | 'inline-edit';
5
5
  interface ContentStore {
@@ -28,9 +28,9 @@ interface YaLinkProps {
28
28
  href?: string;
29
29
  className?: string;
30
30
  /** Inline styles to apply to the link element */
31
- style?: React__default.CSSProperties;
31
+ style?: React$1.CSSProperties;
32
32
  as?: 'a' | 'span';
33
- children?: React__default.ReactNode;
33
+ children?: React$1.ReactNode;
34
34
  /** Available pages for href dropdown (injected by template) */
35
35
  availablePages?: PageInfo[];
36
36
  /** Optional click handler called after navigation */
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as React$1 from 'react';
3
- import React__default, { ReactNode, CSSProperties } from 'react';
4
- export { C as ContentStoreProviderProd, d as MarkdownText, e as MarkdownTextProps, P as PageInfo, b as StaticImage, c as StaticImageProps, M as StaticText, S as StaticTextProps, Y as YaLink, f as YaLinkProps, u as useContentStoreProd } from './MarkdownText-kV5IiAma.js';
2
+ import React$1, { ReactNode, CSSProperties } from 'react';
3
+ export { C as ContentStoreProviderProd, d as MarkdownText, e as MarkdownTextProps, P as PageInfo, b as StaticImage, c as StaticImageProps, M as StaticText, S as StaticTextProps, Y as YaLink, f as YaLinkProps, u as useContentStoreProd } from './MarkdownText-BUTYfqXS.js';
5
4
  export { Link, LinkProps, NavigateFunction, Router, RouterProps, useNavigate } from './router.js';
6
5
  export { Route, Switch, useParams } from 'wouter';
7
6
  export { A as AssetResolverFn, C as ContentRegistry, c as contentRegistry, a as getAllContent, g as getContent, h as hasContent, r as registerContent, b as resolveAssetUrl, s as setAssetResolver } from './asset-resolver-BnIvDkVv.js';
8
7
  export { i as initBuilderSelection } from './builder-selection-CYP91nRu.js';
9
8
 
10
9
  type EditMode = 'read-only' | 'inline-edit';
10
+ type ChangeSource = 'user' | 'ai' | 'initial';
11
11
  interface PageInfo {
12
12
  path: string;
13
13
  label: string;
@@ -17,7 +17,8 @@ interface ActiveFieldCallbacks {
17
17
  }
18
18
  interface ContentStore {
19
19
  getValue: (fieldId: string) => string;
20
- setValue: (fieldId: string, value: string) => void;
20
+ setValue: (fieldId: string, value: string, source?: ChangeSource) => void;
21
+ getChangeSource: (fieldId: string) => ChangeSource;
21
22
  mode: EditMode;
22
23
  setMode: (mode: EditMode) => void;
23
24
  subscribe: (listener: () => void) => () => void;
@@ -45,7 +46,7 @@ interface YaTextProps {
45
46
  className?: string;
46
47
  as?: YaTextElement;
47
48
  /** Optional fallback content (used if fieldId not in store) */
48
- children?: React__default.ReactNode;
49
+ children?: React$1.ReactNode;
49
50
  }
50
51
  declare module '@tiptap/core' {
51
52
  interface Commands<ReturnType> {
@@ -203,17 +204,18 @@ interface SafeTriangleBelowProps {
203
204
  isVisible: boolean;
204
205
  /** Called when mouse leaves the safe zone */
205
206
  onLeave?: () => void;
207
+ /** Called when mouse stays inside the safe zone (cancels hide timeout) */
208
+ onStayInside?: () => void;
206
209
  }
207
210
  /**
208
- * SafeTriangleBelow creates a dynamic SVG triangle between the cursor and a popover
209
- * that appears below the trigger, preventing the popover from closing when users
210
- * move diagonally toward it.
211
+ * SafeTriangleBelow creates a safe zone between a trigger element and a popover,
212
+ * preventing the popover from closing when users move their mouse through the gap.
211
213
  *
212
- * Based on the "Safe Triangle" pattern:
213
- * @see https://www.smashingmagazine.com/2023/08/better-context-menus-safe-triangles/
214
+ * The safe zone is a bounding box around both elements. Mouse position is tracked
215
+ * and onLeave is called when the mouse exits this zone.
214
216
  *
215
- * This variant is for popovers that appear BELOW the trigger (vs SafeTriangle which
216
- * is for tooltips appearing to the RIGHT).
217
+ * The SVG visualization is purely for debugging (pointer-events: none) -
218
+ * all mouse tracking is done via position checking, allowing clicks to pass through.
217
219
  *
218
220
  * Usage:
219
221
  * ```tsx
@@ -225,7 +227,7 @@ interface SafeTriangleBelowProps {
225
227
  * />
226
228
  * ```
227
229
  */
228
- declare function SafeTriangleBelow({ triggerRef, popoverRef, isVisible, onLeave, }: SafeTriangleBelowProps): React$1.ReactPortal | null;
230
+ declare function SafeTriangleBelow({ triggerRef, popoverRef, isVisible, onLeave, onStayInside, }: SafeTriangleBelowProps): null;
229
231
 
230
232
  /**
231
233
  * Animation state for a single field
@@ -643,6 +645,7 @@ interface UseSafeTriangleReturn<T extends HTMLElement, U extends HTMLElement> {
643
645
  popoverRef: React.RefObject<U | null>;
644
646
  isVisible: boolean;
645
647
  onLeave: () => void;
648
+ onStayInside: () => void;
646
649
  };
647
650
  /** Manually show the popover */
648
651
  show: () => void;