@gram-ai/elements 1.3.0 → 1.5.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.
- package/dist/elements.cjs +11 -11
- package/dist/elements.css +1 -1
- package/dist/elements.js +1215 -1123
- package/dist/index.d.ts +1 -1
- package/dist/{models-DBbuJvSc.js → models-cel0aeUV.js} +13 -13
- package/dist/server.cjs +33 -33
- package/dist/server.js +9637 -9636
- package/dist/types/index.d.ts +29 -2
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -147,20 +147,45 @@ export interface Suggestion {
|
|
|
147
147
|
label: string;
|
|
148
148
|
action: string;
|
|
149
149
|
}
|
|
150
|
+
type ModalDimension = {
|
|
151
|
+
width: number | `${number}%`;
|
|
152
|
+
height: number | `${number}%`;
|
|
153
|
+
maxHeight?: number | `${number}%`;
|
|
154
|
+
};
|
|
155
|
+
export type ModalTriggerPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
150
156
|
export interface ModalConfig {
|
|
151
157
|
/**
|
|
152
158
|
* Whether to open the modal window by default.
|
|
153
159
|
*/
|
|
154
160
|
defaultOpen?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* The position of the modal trigger
|
|
163
|
+
*
|
|
164
|
+
* @default 'bottom-right'
|
|
165
|
+
*/
|
|
166
|
+
position?: ModalTriggerPosition;
|
|
155
167
|
/**
|
|
156
168
|
* The icon to use for the modal window.
|
|
157
169
|
* Receives the current state of the modal window.
|
|
158
170
|
*/
|
|
159
171
|
icon?: (state: 'open' | 'closed' | undefined) => ReactNode;
|
|
160
172
|
/**
|
|
161
|
-
*
|
|
173
|
+
* Whether the modal can be expanded to full screen.
|
|
174
|
+
*/
|
|
175
|
+
expandable?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* The dimensions for the modal window.
|
|
162
178
|
*/
|
|
163
|
-
|
|
179
|
+
dimensions?: {
|
|
180
|
+
/**
|
|
181
|
+
* The default dimensions for the modal window.
|
|
182
|
+
*/
|
|
183
|
+
default: ModalDimension;
|
|
184
|
+
/**
|
|
185
|
+
* The expanded dimensions for the modal window.
|
|
186
|
+
*/
|
|
187
|
+
expanded?: Pick<ModalDimension, 'width' | 'height'>;
|
|
188
|
+
};
|
|
164
189
|
}
|
|
165
190
|
export interface ComposerConfig {
|
|
166
191
|
/**
|
|
@@ -178,6 +203,8 @@ export type ElementsContextType = {
|
|
|
178
203
|
config: ElementsConfig;
|
|
179
204
|
setModel: (model: Model) => void;
|
|
180
205
|
model: Model;
|
|
206
|
+
isExpanded: boolean;
|
|
207
|
+
setIsExpanded: (isExpanded: boolean) => void;
|
|
181
208
|
};
|
|
182
209
|
declare const ContentSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
183
210
|
type: z.ZodLiteral<"text">;
|
package/package.json
CHANGED