funuicss 3.7.14 → 3.7.16

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/ui/vista/Vista.js CHANGED
@@ -186,23 +186,19 @@ var Vista = function (localProps) {
186
186
  position: 'relative',
187
187
  width: '100%',
188
188
  maxWidth: mediaSize || '100%',
189
- aspectRatio: '16/9',
190
189
  margin: '0 auto',
190
+ height: 'fit-content',
191
191
  } },
192
- react_1.default.createElement("div", { style: {
193
- position: 'relative',
192
+ react_1.default.createElement("iframe", { src: final.iframeUrl, className: "vista-iframe ".concat(final.mediaCss || ''), style: {
194
193
  width: '100%',
195
- height: '100%',
194
+ height: 'auto',
195
+ aspectRatio: '16/9',
196
+ border: 'none',
197
+ display: 'block', // Crucial for 'height: auto' to work reliably
196
198
  filter: getFilterStyle(final.mediaFilter, final.mediaFilterValue),
197
199
  mixBlendMode: final.mediaBlendMode,
198
- } },
199
- react_1.default.createElement("iframe", { src: final.iframeUrl, className: "vista-iframe ".concat(final.mediaCss || ''), style: {
200
- width: '100%',
201
- height: '100%',
202
- border: 'none',
203
- display: 'block',
204
- }, allowFullScreen: true, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", title: "Vista media content" }),
205
- final.mediaOverlay && react_1.default.createElement("div", { style: overlayStyle })))),
200
+ }, allowFullScreen: true, allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", title: "Vista media content" }),
201
+ final.mediaOverlay && react_1.default.createElement("div", { style: overlayStyle }))),
206
202
  mediaType === 'image' && (final.media || final.mediaUrl) && (react_1.default.createElement("div", { style: { position: 'relative', width: '100%' } },
207
203
  final.media ? (react_1.default.createElement("div", { style: { width: '100%', maxWidth: mediaSize, margin: '0 auto' } }, final.media)) : (react_1.default.createElement("img", { src: final.mediaUrl, alt: final.mediaAlt || 'Vista media', className: final.mediaCss || '', style: mediaStyle, loading: "lazy" })),
208
204
  final.mediaOverlay && react_1.default.createElement("div", { style: overlayStyle })))));
@@ -18,12 +18,26 @@ export interface ComponentConfig {
18
18
  availableVariants: string[];
19
19
  metadata: ComponentMetadata;
20
20
  }
21
+ export interface Asset {
22
+ name: string;
23
+ url: string;
24
+ }
21
25
  export interface ProjectData {
22
26
  components?: {
23
27
  [componentName: string]: {
24
28
  [variantName: string]: ComponentVariant;
25
29
  };
26
30
  };
31
+ variables?: Array<{
32
+ name: string;
33
+ value: string;
34
+ category?: string;
35
+ createdBy?: string;
36
+ createdAt?: number;
37
+ updatedBy?: string;
38
+ updatedAt?: number;
39
+ }>;
40
+ assets?: Asset[];
27
41
  }
28
42
  export interface MergedConfig {
29
43
  props: ComponentProps;
@@ -37,34 +51,19 @@ export interface UseComponentConfigReturn extends ComponentConfig {
37
51
  isDefaultVariant: boolean;
38
52
  }
39
53
  /**
40
- * Universal component config getter
41
- *
42
- * @param projectData - The project configuration data
43
- * @param componentName - Name of the component to get config for
44
- * @param variantName - Name of the variant (defaults to 'default')
45
- * @returns Component configuration with metadata
54
+ * Universal component config getter with interpolation
46
55
  */
47
56
  export declare const getComponentConfig: (projectData: ProjectData | null | undefined, componentName: string, variantName?: string) => ComponentConfig;
48
57
  /**
49
- * Merge component config with local props - LOCAL PROPS OVERRIDE CONFIG
50
- *
51
- * @param config - Component configuration from getComponentConfig
52
- * @param localProps - Props passed directly to the component (OVERRIDES CONFIG)
53
- * @returns Merged configuration with metadata
58
+ * Merge component config with local props
54
59
  */
55
- export declare const mergeComponentConfig: (config: ComponentConfig, localProps?: ComponentProps) => MergedConfig;
60
+ export declare const mergeComponentConfig: (config: ComponentConfig, localProps: ComponentProps | undefined, projectData: ProjectData | null | undefined) => MergedConfig;
56
61
  /**
57
- * Hook for easy component config usage with LOCAL PROP OVERRIDE
58
- * Uses useMemo to prevent unnecessary re-computation
59
- *
60
- * @param componentName - Name of the component
61
- * @param variantName - Optional variant name
62
- * @returns Configuration object with helper methods
62
+ * Hook for easy component config usage
63
63
  */
64
64
  export declare const useComponentConfiguration: (componentName: string, variantName?: string) => UseComponentConfigReturn;
65
65
  /**
66
66
  * Hook that directly returns merged props with local override
67
- * Perfect for direct use in components
68
67
  */
69
68
  export declare const useComponentProps: (componentName: string, variantName?: string, localProps?: ComponentProps) => ComponentProps;
70
69
  /**
@@ -75,3 +74,111 @@ export declare const hasComponentVariant: (projectData: ProjectData | null | und
75
74
  * Get all available variants for a component
76
75
  */
77
76
  export declare const getAvailableVariants: (projectData: ProjectData | null | undefined, componentName: string) => string[];
77
+ /**
78
+ * Get all variables from project
79
+ */
80
+ export declare const getProjectVariables: (projectData: ProjectData | null | undefined) => Array<{
81
+ name: string;
82
+ value: string;
83
+ }>;
84
+ /**
85
+ * Get all assets from project
86
+ */
87
+ export declare const getProjectAssets: (projectData: ProjectData | null | undefined) => Asset[];
88
+ /**
89
+ * Hook to get interpolated value for a specific variable or asset reference
90
+ */
91
+ export declare const useValue: (value: string) => string;
92
+ /**
93
+ * Hook to get a specific variable value
94
+ */
95
+ export declare const useVariable: (variableName: string) => string | null;
96
+ /**
97
+ * Hook to get a specific asset
98
+ */
99
+ export declare const useAsset: (assetName: string) => Asset | null;
100
+ /**
101
+ * Hook to get a specific asset URL
102
+ */
103
+ export declare const useAssetUrl: (assetName: string) => string | null;
104
+ /**
105
+ * Check if a value is a variable reference
106
+ */
107
+ export declare const isVariableReference: (value: any) => boolean;
108
+ /**
109
+ * Check if a value is an asset reference
110
+ */
111
+ export declare const isAssetReference: (value: any) => boolean;
112
+ /**
113
+ * Helper to convert variable/asset references for UI display
114
+ */
115
+ export declare const formatReferenceForDisplay: (value: string) => {
116
+ type: "variable" | "asset" | "custom";
117
+ display: string;
118
+ };
119
+ /**
120
+ * Create a variable reference string
121
+ */
122
+ export declare const createVariableReference: (variableName: string) => string;
123
+ /**
124
+ * Create an asset reference string
125
+ */
126
+ export declare const createAssetReference: (assetName: string) => string;
127
+ /**
128
+ * Check if a prop value needs interpolation
129
+ */
130
+ export declare const needsInterpolation: (value: any) => boolean;
131
+ /**
132
+ * Get all references (variables and assets) used in props
133
+ */
134
+ export declare const getUsedReferences: (props: ComponentProps, projectData: ProjectData | null | undefined) => {
135
+ variables: string[];
136
+ assets: string[];
137
+ };
138
+ /**
139
+ * Get asset by name (exported version)
140
+ */
141
+ export declare const getAssetByName: (assetName: string, projectData: ProjectData | null | undefined) => Asset | null;
142
+ /**
143
+ * Get variable by name (exported version)
144
+ */
145
+ export declare const getVariableByName: (variableName: string, projectData: ProjectData | null | undefined) => {
146
+ name: string;
147
+ value: string;
148
+ } | null;
149
+ declare const _default: {
150
+ getComponentConfig: (projectData: ProjectData | null | undefined, componentName: string, variantName?: string) => ComponentConfig;
151
+ mergeComponentConfig: (config: ComponentConfig, localProps: ComponentProps | undefined, projectData: ProjectData | null | undefined) => MergedConfig;
152
+ useComponentConfiguration: (componentName: string, variantName?: string) => UseComponentConfigReturn;
153
+ useComponentProps: (componentName: string, variantName?: string, localProps?: ComponentProps) => ComponentProps;
154
+ hasComponentVariant: (projectData: ProjectData | null | undefined, componentName: string, variantName: string) => boolean;
155
+ getAvailableVariants: (projectData: ProjectData | null | undefined, componentName: string) => string[];
156
+ getProjectVariables: (projectData: ProjectData | null | undefined) => Array<{
157
+ name: string;
158
+ value: string;
159
+ }>;
160
+ getProjectAssets: (projectData: ProjectData | null | undefined) => Asset[];
161
+ useValue: (value: string) => string;
162
+ useVariable: (variableName: string) => string | null;
163
+ useAsset: (assetName: string) => Asset | null;
164
+ useAssetUrl: (assetName: string) => string | null;
165
+ isVariableReference: (value: any) => boolean;
166
+ isAssetReference: (value: any) => boolean;
167
+ formatReferenceForDisplay: (value: string) => {
168
+ type: "variable" | "asset" | "custom";
169
+ display: string;
170
+ };
171
+ createVariableReference: (variableName: string) => string;
172
+ createAssetReference: (assetName: string) => string;
173
+ needsInterpolation: (value: any) => boolean;
174
+ getUsedReferences: (props: ComponentProps, projectData: ProjectData | null | undefined) => {
175
+ variables: string[];
176
+ assets: string[];
177
+ };
178
+ getAssetByName: (assetName: string, projectData: ProjectData | null | undefined) => Asset | null;
179
+ getVariableByName: (variableName: string, projectData: ProjectData | null | undefined) => {
180
+ name: string;
181
+ value: string;
182
+ } | null;
183
+ };
184
+ export default _default;