@yoamigo.com/core 0.1.15 → 0.2.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +89 -4
  2. package/dist/index.js +1007 -103
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React, { ReactNode } from 'react';
2
+ import React, { ReactNode, CSSProperties } from 'react';
3
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';
4
4
  export { Link, LinkProps, NavigateFunction, Router, RouterProps, useNavigate } from './router.js';
5
5
  export { Route, Switch, useParams } from 'wouter';
@@ -26,8 +26,7 @@ interface ContentStore {
26
26
  clearActiveField: () => void;
27
27
  getPages: () => PageInfo[];
28
28
  }
29
- interface ContentStoreContextType extends ContentStore {
30
- }
29
+ type ContentStoreContextType = ContentStore;
31
30
  type ContentStoreMode = EditMode;
32
31
  declare function useContentStore(): ContentStoreContextType;
33
32
  interface ContentStoreProviderProps {
@@ -89,6 +88,92 @@ interface YaImageProps {
89
88
  declare function serializeImageValue(value: ImageFieldValue): string;
90
89
  declare function YaImage({ fieldId, className, alt, objectFit: propObjectFit, objectPosition: propObjectPosition, loading, fallbackSrc, fallbackAlt, }: YaImageProps): react_jsx_runtime.JSX.Element;
91
90
 
91
+ interface VideoFieldValue {
92
+ /** Video source type */
93
+ type: 'upload' | 'youtube' | 'vimeo';
94
+ /** Video URL (for upload) or video ID (for embeds) */
95
+ src: string;
96
+ /** Poster image URL */
97
+ poster?: string;
98
+ /** Autoplay video (requires muted for browser policy) */
99
+ autoplay?: boolean;
100
+ /** Mute video audio */
101
+ muted?: boolean;
102
+ /** Loop video playback */
103
+ loop?: boolean;
104
+ /** Show video controls */
105
+ controls?: boolean;
106
+ /** Play inline on mobile (prevent fullscreen hijack) */
107
+ playsinline?: boolean;
108
+ /** Preload strategy */
109
+ preload?: 'none' | 'metadata' | 'auto';
110
+ /** CSS object-fit */
111
+ objectFit?: 'cover' | 'contain' | 'fill';
112
+ /** CSS aspect-ratio (e.g., "16/9") */
113
+ aspectRatio?: string;
114
+ /** Start playback at this time (seconds) */
115
+ startTime?: number;
116
+ /** End playback at this time (seconds) */
117
+ endTime?: number;
118
+ }
119
+ interface YaVideoProps {
120
+ fieldId: string;
121
+ className?: string;
122
+ /** Default aspect ratio from props */
123
+ aspectRatio?: string;
124
+ /** Default object-fit */
125
+ objectFit?: 'cover' | 'contain' | 'fill';
126
+ /** Loading strategy */
127
+ loading?: 'lazy' | 'eager';
128
+ /** Fallback for backward compatibility */
129
+ fallbackSrc?: string;
130
+ /** Fallback poster image */
131
+ fallbackPoster?: string;
132
+ }
133
+ /**
134
+ * Serialize video field value for storage
135
+ */
136
+ declare function serializeVideoValue(value: VideoFieldValue): string;
137
+ declare function YaVideo({ fieldId, className, aspectRatio: propAspectRatio, objectFit: propObjectFit, loading, fallbackSrc, fallbackPoster, }: YaVideoProps): react_jsx_runtime.JSX.Element;
138
+
139
+ interface BackgroundImageConfig {
140
+ src: string;
141
+ objectFit?: 'cover' | 'contain' | 'fill';
142
+ objectPosition?: string;
143
+ focalPoint?: {
144
+ x: number;
145
+ y: number;
146
+ };
147
+ }
148
+ interface OverlayConfig {
149
+ color: string;
150
+ opacity: number;
151
+ }
152
+ interface BackgroundConfig {
153
+ type: 'none' | 'color' | 'image';
154
+ backgroundColor?: string;
155
+ backgroundImage?: BackgroundImageConfig;
156
+ overlay?: OverlayConfig;
157
+ }
158
+ interface YaContainerProps {
159
+ fieldId: string;
160
+ className?: string;
161
+ style?: CSSProperties;
162
+ as?: 'section' | 'div' | 'article' | 'header' | 'footer' | 'main' | 'aside';
163
+ children: ReactNode;
164
+ /** Fallback background config if not in store */
165
+ defaultBackground?: BackgroundConfig;
166
+ }
167
+ /**
168
+ * Parse background config from content store
169
+ */
170
+ declare function parseBackgroundConfig(value: string): BackgroundConfig;
171
+ /**
172
+ * Serialize background config for storage
173
+ */
174
+ declare function serializeBackgroundConfig(config: BackgroundConfig): string;
175
+ declare function YaContainer({ fieldId, className, style, as: Tag, children, defaultBackground, }: YaContainerProps): react_jsx_runtime.JSX.Element;
176
+
92
177
  /**
93
178
  * SafeHtml Component - Secure HTML Renderer
94
179
  *
@@ -495,4 +580,4 @@ interface AnimatedTextOptions {
495
580
  */
496
581
  declare function useAnimatedText(fieldId: string, content: string, options?: AnimatedTextOptions): AnimatedTextResult;
497
582
 
498
- export { type AIEditContextValue, AIEditProvider, type AnimatedTextOptions, type AnimatedTextResult, type AnimationConfig, type AnimationMetadata, type AnimationOptions, type AnimationPhase, type AnimationResult, type AnimationState, type AnimationStrategy, type ContentStoreContextType, type ContentStoreMode, ContentStoreProvider, type ImageFieldValue, type ImageValue, type LinkValue, SafeHtml, type SafeHtmlProps, type TextAnimationMetadata, type TextDiff, YaImage, type YaImageProps, YaText, type YaTextProps, buildIntermediateText, calculateAnimationTiming, computeTextDiff, containsHtml, getTextCursorPosition, imageCrossfadeStrategy, linkTransitionStrategy, serializeImageValue, stripHtml, textTypingStrategy, useAIEditAnimation, useAIEditContext, useAIEditContextOptional, useAnimatedText, useContentStore };
583
+ export { type AIEditContextValue, AIEditProvider, type AnimatedTextOptions, type AnimatedTextResult, type AnimationConfig, type AnimationMetadata, type AnimationOptions, type AnimationPhase, type AnimationResult, type AnimationState, type AnimationStrategy, type BackgroundConfig, type BackgroundImageConfig, type ContentStoreContextType, type ContentStoreMode, ContentStoreProvider, type ImageFieldValue, type ImageValue, type LinkValue, type OverlayConfig, SafeHtml, type SafeHtmlProps, type TextAnimationMetadata, type TextDiff, type VideoFieldValue, YaContainer, type YaContainerProps, YaImage, type YaImageProps, YaText, type YaTextProps, YaVideo, type YaVideoProps, buildIntermediateText, calculateAnimationTiming, computeTextDiff, containsHtml, getTextCursorPosition, imageCrossfadeStrategy, linkTransitionStrategy, parseBackgroundConfig, serializeBackgroundConfig, serializeImageValue, serializeVideoValue, stripHtml, textTypingStrategy, useAIEditAnimation, useAIEditContext, useAIEditContextOptional, useAnimatedText, useContentStore };