@yoamigo.com/core 0.1.13 → 0.1.15

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/index.js CHANGED
@@ -168,6 +168,7 @@ var BuilderSelectionManager = class {
168
168
  this.setupScrollResizeListeners();
169
169
  this.setupKeyboardListener();
170
170
  this.setupWheelForwarding();
171
+ this.setupHistoryInterception();
171
172
  this.notifyPageReady();
172
173
  window.addEventListener("popstate", () => this.notifyPageReady());
173
174
  }
@@ -486,6 +487,23 @@ var BuilderSelectionManager = class {
486
487
  }
487
488
  }, { passive: false });
488
489
  }
490
+ /**
491
+ * Intercept History API to detect SPA navigation
492
+ * Catches programmatic navigation (wouter, react-router, etc.)
493
+ * Standard pattern used by analytics tools like Google Analytics
494
+ */
495
+ setupHistoryInterception() {
496
+ const originalPushState = history.pushState.bind(history);
497
+ history.pushState = (...args) => {
498
+ originalPushState(...args);
499
+ this.notifyPageReady();
500
+ };
501
+ const originalReplaceState = history.replaceState.bind(history);
502
+ history.replaceState = (...args) => {
503
+ originalReplaceState(...args);
504
+ this.notifyPageReady();
505
+ };
506
+ }
489
507
  showHoverOverlay(element) {
490
508
  if (!this.hoverOverlay) return;
491
509
  const rect = element.getBoundingClientRect();
@@ -1824,7 +1842,8 @@ body.builder-selector-active .ya-text-editable:hover {
1824
1842
  color: var(--color-secondary, #5C4033);
1825
1843
  }
1826
1844
  .ProseMirror ::selection {
1827
- background: rgba(212, 165, 116, 0.3);
1845
+ background: rgba(212, 165, 116, 0.3) !important;
1846
+ color: inherit !important;
1828
1847
  }
1829
1848
  .ProseMirror p.is-editor-empty:first-child::before {
1830
1849
  content: attr(data-placeholder);
package/dist/lib.js CHANGED
@@ -127,6 +127,7 @@ var BuilderSelectionManager = class {
127
127
  this.setupScrollResizeListeners();
128
128
  this.setupKeyboardListener();
129
129
  this.setupWheelForwarding();
130
+ this.setupHistoryInterception();
130
131
  this.notifyPageReady();
131
132
  window.addEventListener("popstate", () => this.notifyPageReady());
132
133
  }
@@ -445,6 +446,23 @@ var BuilderSelectionManager = class {
445
446
  }
446
447
  }, { passive: false });
447
448
  }
449
+ /**
450
+ * Intercept History API to detect SPA navigation
451
+ * Catches programmatic navigation (wouter, react-router, etc.)
452
+ * Standard pattern used by analytics tools like Google Analytics
453
+ */
454
+ setupHistoryInterception() {
455
+ const originalPushState = history.pushState.bind(history);
456
+ history.pushState = (...args) => {
457
+ originalPushState(...args);
458
+ this.notifyPageReady();
459
+ };
460
+ const originalReplaceState = history.replaceState.bind(history);
461
+ history.replaceState = (...args) => {
462
+ originalReplaceState(...args);
463
+ this.notifyPageReady();
464
+ };
465
+ }
448
466
  showHoverOverlay(element) {
449
467
  if (!this.hoverOverlay) return;
450
468
  const rect = element.getBoundingClientRect();
package/dist/prod.d.ts CHANGED
@@ -9,12 +9,14 @@ interface StaticLinkProps {
9
9
  fieldId: string;
10
10
  href?: string;
11
11
  className?: string;
12
+ /** Inline styles to apply to the link element */
13
+ style?: React.CSSProperties;
12
14
  as?: 'a' | 'span';
13
15
  children?: React.ReactNode;
14
16
  /** Optional click handler called after navigation */
15
17
  onClick?: () => void;
16
18
  }
17
- declare function StaticLink({ fieldId, href: defaultHref, className, as: Component, children, onClick }: StaticLinkProps): react_jsx_runtime.JSX.Element;
19
+ declare function StaticLink({ fieldId, href: defaultHref, className, style, as: Component, children, onClick }: StaticLinkProps): react_jsx_runtime.JSX.Element;
18
20
 
19
21
  /**
20
22
  * SafeHtml (Production) - Renders trusted HTML without sanitization.
package/dist/prod.js CHANGED
@@ -152,7 +152,7 @@ function isInternalPath(path) {
152
152
  if (path.startsWith("mailto:") || path.startsWith("tel:")) return false;
153
153
  return path.startsWith("/");
154
154
  }
155
- function StaticLink({ fieldId, href: defaultHref = "#", className, as: Component = "a", children, onClick }) {
155
+ function StaticLink({ fieldId, href: defaultHref = "#", className, style, as: Component = "a", children, onClick }) {
156
156
  const { getValue, mode } = useContentStore();
157
157
  const [, navigate] = useLocation();
158
158
  const textFieldId = `${fieldId}.text`;
@@ -193,6 +193,7 @@ function StaticLink({ fieldId, href: defaultHref = "#", className, as: Component
193
193
  href: Component === "a" ? href : void 0,
194
194
  onClick: handleClick,
195
195
  className,
196
+ style,
196
197
  "data-ya-restricted": "true",
197
198
  "data-field-id": fieldId,
198
199
  children: hasStoreText || hasStringChildren ? /* @__PURE__ */ jsx5(SafeHtml, { content: storeText || children || "", mode }) : hasReactChildren ? children : null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoamigo.com/core",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Core components, router, and utilities for YoAmigo templates",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",