@lumiastream/lumia-types 3.3.7-alpha.6 → 3.3.7-alpha.7

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.
@@ -87,7 +87,7 @@ Include these two helper aliases in your embeddings so the model can quickly map
87
87
  "required": ["type", "label"],
88
88
  "properties": {
89
89
  "type": {
90
- "enum": ["input", "number", "checkbox", "dropdown", "multiselect", "colorpicker", "fontpicker", "slider"]
90
+ "enum": ["input", "textarea", "number", "checkbox", "dropdown", "multiselect", "colorpicker", "fontpicker", "slider", "imageupload", "soundupload", "videoupload", "actionbutton"]
91
91
  },
92
92
  "label": { "type": "string" },
93
93
  "value": {},
@@ -394,7 +394,7 @@ A field object can now contain these properties:
394
394
 
395
395
  | Property | Required | Purpose | Example |
396
396
  | --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
397
- | **`type`** | ✅ | UI control to render. Must be one of the `FieldType` enum values (`input`, `number`, `checkbox`, `dropdown`, `multiselect`, `colorpicker`, `fontpicker`, `slider`). | `"type": "dropdown"` |
397
+ | **`type`** | ✅ | UI control to render. Must be one of the `FieldType` enum values (`input`, `textarea`, `number`, `checkbox`, `dropdown`, `multiselect`, `colorpicker`, `fontpicker`, `slider`, `imageupload`, `soundupload`, `videoupload`, `actionbutton`). | `"type": "dropdown"` |
398
398
  | **`label`** | ✅ | Human-readable name shown in the sidebar. | `"label": "Favorite Color:"` |
399
399
  | **`value`** | ❌ | Default value that appears the first time the user opens the overlay (also pre populates `Overlay.data`). Omit it to leave the field blank/unchecked on first load. | `"value": 18` |
400
400
  | **`options`** | ☑️\* | Key value map of selectable choices. Required **only** for `dropdown`, `multiselect` and `slider`; ignored for other types. For `slider`, `options` supports `step`, `min`, `max`, `prefix`, `suffix`. | `"options": { "step": 5, "min": 0, "max": 100 }` |
@@ -25,9 +25,10 @@ export enum CustomTabs {
25
25
  export enum ConfigsFieldType {
26
26
  /** Text input field */
27
27
  INPUT = 'input',
28
+ /** Multi-line text area for long-form content. */
29
+ TEXTAREA = 'textarea',
28
30
  /** Numeric input field */
29
31
  NUMBER = 'number',
30
- // IMAGE = 'image',
31
32
  /** Boolean checkbox */
32
33
  CHECKBOX = 'checkbox',
33
34
  /** Single-select dropdown menu */
@@ -40,6 +41,15 @@ export enum ConfigsFieldType {
40
41
  FONTPICKER = 'fontpicker',
41
42
  /** Number Slider widget */
42
43
  SLIDER = 'slider',
44
+ /** Image upload picker. Value is the uploaded asset URL. */
45
+ IMAGEUPLOAD = 'imageupload',
46
+ /** Audio upload picker. Value is the uploaded asset URL. */
47
+ SOUNDUPLOAD = 'soundupload',
48
+ /** Video upload picker. Value is the uploaded asset URL. */
49
+ VIDEOUPLOAD = 'videoupload',
50
+ /** Action trigger button. No persisted value; renders a clickable
51
+ * control that custom JS can bind to via `Overlay.on('configAction', …)`. */
52
+ ACTIONBUTTON = 'actionbutton',
43
53
  }
44
54
 
45
55
  /**
@@ -169,6 +179,65 @@ export interface SliderConfigField extends BaseConfigField {
169
179
  options: SliderOptions;
170
180
  }
171
181
 
182
+ /** Multi-line textarea for long-form text input. Supports variables. */
183
+ export interface TextareaConfigField extends BaseConfigField {
184
+ type: ConfigsFieldType.TEXTAREA | 'textarea';
185
+ /** Default text value. Omit to leave blank on first load. */
186
+ value?: string;
187
+ /** Placeholder text shown when the textarea is empty. */
188
+ placeholder?: string;
189
+ /** Visible row count for the textarea. Defaults to 4 in the renderer. */
190
+ rows?: number;
191
+ /**
192
+ * When `true`, renders a variable-enabled textarea. Users can insert Lumia
193
+ * variables (e.g. `{{username}}`) via a picker triggered by a `{}` adornment.
194
+ */
195
+ enableVariables?: boolean;
196
+ /**
197
+ * Curated variable list to surface at the top of the picker. Has no effect
198
+ * unless `enableVariables` is also `true`.
199
+ */
200
+ allowedVariables?: string[];
201
+ }
202
+
203
+ /** Image upload picker. Value is the uploaded asset's URL. */
204
+ export interface ImageuploadConfigField extends BaseConfigField {
205
+ type: ConfigsFieldType.IMAGEUPLOAD | 'imageupload';
206
+ /** Default image URL. */
207
+ value?: string;
208
+ /** Optional comma-separated accept hint, e.g. `image/png,image/jpeg`. */
209
+ accept?: string;
210
+ }
211
+
212
+ /** Audio clip upload picker. Value is the uploaded asset's URL. */
213
+ export interface SounduploadConfigField extends BaseConfigField {
214
+ type: ConfigsFieldType.SOUNDUPLOAD | 'soundupload';
215
+ /** Default audio URL. */
216
+ value?: string;
217
+ /** Optional comma-separated accept hint, e.g. `audio/mpeg,audio/ogg`. */
218
+ accept?: string;
219
+ }
220
+
221
+ /** Video upload picker. Value is the uploaded asset's URL. */
222
+ export interface VideouploadConfigField extends BaseConfigField {
223
+ type: ConfigsFieldType.VIDEOUPLOAD | 'videoupload';
224
+ /** Default video URL. */
225
+ value?: string;
226
+ /** Optional comma-separated accept hint, e.g. `video/mp4,video/webm`. */
227
+ accept?: string;
228
+ }
229
+
230
+ /**
231
+ * Action trigger button. The control surface is a labelled button; clicking it
232
+ * dispatches an event the overlay's custom JS can subscribe to via
233
+ * `Overlay.on('configAction', ({ key }) => …)`. No persisted value.
234
+ */
235
+ export interface ActionbuttonConfigField extends BaseConfigField {
236
+ type: ConfigsFieldType.ACTIONBUTTON | 'actionbutton';
237
+ /** Optional button-text override. Defaults to the field `label`. */
238
+ buttonLabel?: string;
239
+ }
240
+
172
241
  /**
173
242
  * Discriminated union of every config-field shape the renderer accepts.
174
243
  * Use this when typing the `configs` map for a Lumia custom overlay.
@@ -186,13 +255,18 @@ export interface SliderConfigField extends BaseConfigField {
186
255
  */
187
256
  export type ConfigField =
188
257
  | InputConfigField
258
+ | TextareaConfigField
189
259
  | NumberConfigField
190
260
  | CheckboxConfigField
191
261
  | DropdownConfigField
192
262
  | MultiselectConfigField
193
263
  | ColorpickerConfigField
194
264
  | FontpickerConfigField
195
- | SliderConfigField;
265
+ | SliderConfigField
266
+ | ImageuploadConfigField
267
+ | SounduploadConfigField
268
+ | VideouploadConfigField
269
+ | ActionbuttonConfigField;
196
270
 
197
271
  /**
198
272
  * The configs map a custom overlay declares in its Configs tab.
@@ -35,7 +35,7 @@ Source of truth (in order): this file > `gpt-instructions-extended.md` (long-for
35
35
  - **HTML**: body content only. Stable IDs/classes. No inline `<script>` or `<style>`.
36
36
  - **CSS**: stylesheet only. Unquoted CSS variables for colors/sizes/numbers. Quoted only where CSS requires a string (`font-family: "{{font}}";`).
37
37
  - **JS**: top-level JS. Use `Overlay.data` for Data values. Use `textContent`/`createElement`/`appendChild` for any chat, alert, or user-generated text — never `innerHTML` with user input. `fetch` is allowed.
38
- - **Configs**: field types: `input`, `number`, `checkbox`, `dropdown`, `multiselect`, `colorpicker`, `fontpicker`, `slider`. Required: `type`, `label`. Use `value` for defaults. `dropdown`/`multiselect` need `options`. `slider` needs `options.min`/`max` (usually `step`/`prefix`/`suffix`). Use `order` to control sidebar order. Use `visibleIf` for conditional fields. Keys must be machine-friendly (no spaces).
38
+ - **Configs**: field types: `input`, `textarea`, `number`, `checkbox`, `dropdown`, `multiselect`, `colorpicker`, `fontpicker`, `slider`, `imageupload`, `soundupload`, `videoupload`, `actionbutton`. Required: `type`, `label`. Use `value` for defaults. `dropdown`/`multiselect` need `options`. `slider` needs `options.min`/`max` (usually `step`/`prefix`/`suffix`). `imageupload`/`soundupload`/`videoupload` accept an `accept` MIME hint. `actionbutton` has no `value` — bind it via `Overlay.on('configAction', ({ key }) => …)`. Use `order` to control sidebar order. Use `visibleIf` for conditional fields. Keys must be machine-friendly (no spaces).
39
39
  - **Data**: every Configs key must have a matching Data key with a matching default. Data can hold internal values that aren't in Configs (rare).
40
40
 
41
41
  ## Variables
@@ -10,6 +10,7 @@ exports.CustomTabs = {
10
10
  };
11
11
  exports.ConfigsFieldType = {
12
12
  INPUT: "input",
13
+ TEXTAREA: "textarea",
13
14
  NUMBER: "number",
14
15
  CHECKBOX: "checkbox",
15
16
  DROPDOWN: "dropdown",
@@ -17,4 +18,8 @@ exports.ConfigsFieldType = {
17
18
  COLORPICKER: "colorpicker",
18
19
  FONTPICKER: "fontpicker",
19
20
  SLIDER: "slider",
21
+ IMAGEUPLOAD: "imageupload",
22
+ SOUNDUPLOAD: "soundupload",
23
+ VIDEOUPLOAD: "videoupload",
24
+ ACTIONBUTTON: "actionbutton",
20
25
  };
@@ -25,9 +25,10 @@ export enum CustomTabs {
25
25
  export enum ConfigsFieldType {
26
26
  /** Text input field */
27
27
  INPUT = 'input',
28
+ /** Multi-line text area for long-form content. */
29
+ TEXTAREA = 'textarea',
28
30
  /** Numeric input field */
29
31
  NUMBER = 'number',
30
- // IMAGE = 'image',
31
32
  /** Boolean checkbox */
32
33
  CHECKBOX = 'checkbox',
33
34
  /** Single-select dropdown menu */
@@ -40,6 +41,15 @@ export enum ConfigsFieldType {
40
41
  FONTPICKER = 'fontpicker',
41
42
  /** Number Slider widget */
42
43
  SLIDER = 'slider',
44
+ /** Image upload picker. Value is the uploaded asset URL. */
45
+ IMAGEUPLOAD = 'imageupload',
46
+ /** Audio upload picker. Value is the uploaded asset URL. */
47
+ SOUNDUPLOAD = 'soundupload',
48
+ /** Video upload picker. Value is the uploaded asset URL. */
49
+ VIDEOUPLOAD = 'videoupload',
50
+ /** Action trigger button. No persisted value; renders a clickable
51
+ * control that custom JS can bind to via `Overlay.on('configAction', …)`. */
52
+ ACTIONBUTTON = 'actionbutton',
43
53
  }
44
54
 
45
55
  /**
@@ -169,6 +179,65 @@ export interface SliderConfigField extends BaseConfigField {
169
179
  options: SliderOptions;
170
180
  }
171
181
 
182
+ /** Multi-line textarea for long-form text input. Supports variables. */
183
+ export interface TextareaConfigField extends BaseConfigField {
184
+ type: ConfigsFieldType.TEXTAREA | 'textarea';
185
+ /** Default text value. Omit to leave blank on first load. */
186
+ value?: string;
187
+ /** Placeholder text shown when the textarea is empty. */
188
+ placeholder?: string;
189
+ /** Visible row count for the textarea. Defaults to 4 in the renderer. */
190
+ rows?: number;
191
+ /**
192
+ * When `true`, renders a variable-enabled textarea. Users can insert Lumia
193
+ * variables (e.g. `{{username}}`) via a picker triggered by a `{}` adornment.
194
+ */
195
+ enableVariables?: boolean;
196
+ /**
197
+ * Curated variable list to surface at the top of the picker. Has no effect
198
+ * unless `enableVariables` is also `true`.
199
+ */
200
+ allowedVariables?: string[];
201
+ }
202
+
203
+ /** Image upload picker. Value is the uploaded asset's URL. */
204
+ export interface ImageuploadConfigField extends BaseConfigField {
205
+ type: ConfigsFieldType.IMAGEUPLOAD | 'imageupload';
206
+ /** Default image URL. */
207
+ value?: string;
208
+ /** Optional comma-separated accept hint, e.g. `image/png,image/jpeg`. */
209
+ accept?: string;
210
+ }
211
+
212
+ /** Audio clip upload picker. Value is the uploaded asset's URL. */
213
+ export interface SounduploadConfigField extends BaseConfigField {
214
+ type: ConfigsFieldType.SOUNDUPLOAD | 'soundupload';
215
+ /** Default audio URL. */
216
+ value?: string;
217
+ /** Optional comma-separated accept hint, e.g. `audio/mpeg,audio/ogg`. */
218
+ accept?: string;
219
+ }
220
+
221
+ /** Video upload picker. Value is the uploaded asset's URL. */
222
+ export interface VideouploadConfigField extends BaseConfigField {
223
+ type: ConfigsFieldType.VIDEOUPLOAD | 'videoupload';
224
+ /** Default video URL. */
225
+ value?: string;
226
+ /** Optional comma-separated accept hint, e.g. `video/mp4,video/webm`. */
227
+ accept?: string;
228
+ }
229
+
230
+ /**
231
+ * Action trigger button. The control surface is a labelled button; clicking it
232
+ * dispatches an event the overlay's custom JS can subscribe to via
233
+ * `Overlay.on('configAction', ({ key }) => …)`. No persisted value.
234
+ */
235
+ export interface ActionbuttonConfigField extends BaseConfigField {
236
+ type: ConfigsFieldType.ACTIONBUTTON | 'actionbutton';
237
+ /** Optional button-text override. Defaults to the field `label`. */
238
+ buttonLabel?: string;
239
+ }
240
+
172
241
  /**
173
242
  * Discriminated union of every config-field shape the renderer accepts.
174
243
  * Use this when typing the `configs` map for a Lumia custom overlay.
@@ -186,13 +255,18 @@ export interface SliderConfigField extends BaseConfigField {
186
255
  */
187
256
  export type ConfigField =
188
257
  | InputConfigField
258
+ | TextareaConfigField
189
259
  | NumberConfigField
190
260
  | CheckboxConfigField
191
261
  | DropdownConfigField
192
262
  | MultiselectConfigField
193
263
  | ColorpickerConfigField
194
264
  | FontpickerConfigField
195
- | SliderConfigField;
265
+ | SliderConfigField
266
+ | ImageuploadConfigField
267
+ | SounduploadConfigField
268
+ | VideouploadConfigField
269
+ | ActionbuttonConfigField;
196
270
 
197
271
  /**
198
272
  * The configs map a custom overlay declares in its Configs tab.
@@ -8,6 +8,7 @@ export const CustomTabs = {
8
8
 
9
9
  export const ConfigsFieldType = {
10
10
  INPUT: "input",
11
+ TEXTAREA: "textarea",
11
12
  NUMBER: "number",
12
13
  CHECKBOX: "checkbox",
13
14
  DROPDOWN: "dropdown",
@@ -15,5 +16,9 @@ export const ConfigsFieldType = {
15
16
  COLORPICKER: "colorpicker",
16
17
  FONTPICKER: "fontpicker",
17
18
  SLIDER: "slider",
19
+ IMAGEUPLOAD: "imageupload",
20
+ SOUNDUPLOAD: "soundupload",
21
+ VIDEOUPLOAD: "videoupload",
22
+ ACTIONBUTTON: "actionbutton",
18
23
  };
19
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/lumia-types",
3
- "version": "3.3.7-alpha.6",
3
+ "version": "3.3.7-alpha.7",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/esm/index.js",