@bagelink/vue 1.15.188 → 1.15.192

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.
@@ -12,14 +12,34 @@ export interface RegionState {
12
12
  /** Expanded (reserves full `size`) vs collapsed/hidden (reserves `collapsedSize`). */
13
13
  open: boolean
14
14
  /**
15
- * push → reserves room; center content is inset by `size` (or `collapsedSize`).
16
- * overlay → floats above center; reserves nothing (floating/full chat, mobile drawer).
15
+ * push → AppLayout renders a real IN-FLOW, reserved-width box in the row and
16
+ * the child fills it (`width/height: 100%`). Single source of truth for
17
+ * the size; AppLayout owns the box + resize. No `fixed`/margin trick.
18
+ * overlay → the child floats `position: fixed` above the center and reserves
19
+ * nothing (mobile sidebar drawer, floating/full chat).
17
20
  */
18
21
  mode: 'push' | 'overlay'
19
22
  /** Inline-size for start/end, block-size for top/bottom. Any CSS length. */
20
23
  size: string
21
24
  /** Size when `open === false`. `'0'` fully collapses the region away. */
22
25
  collapsedSize: string
26
+ /**
27
+ * What kind of thing occupies this region. Lets consumers tell an actual
28
+ * navigation sidebar apart from another panel that merely docks into the same
29
+ * rail (e.g. a chat dock in `start`). AppContent's menu-toggle only appears for
30
+ * a real `'sidebar'`. Default undefined (treated as a sidebar for back-compat).
31
+ */
32
+ role?: 'sidebar' | 'dock'
33
+ /**
34
+ * Opt in to drag-resize (start/end only). AppLayout renders a thin handle on
35
+ * the region's inner edge and mutates `size` live during the drag, clamped to
36
+ * `[minSize, maxSize]`. `size` MUST be a px value (e.g. '440px') while resizable.
37
+ */
38
+ resizable?: boolean
39
+ /** Min resize bound (px string, e.g. '320px'). Defaults to '0'. */
40
+ minSize?: string
41
+ /** Max resize bound (px string, e.g. '900px'). Defaults to '100vw' worth of px. */
42
+ maxSize?: string
23
43
  }
24
44
 
25
45
  export type RegionPatch = Partial<RegionState>
@@ -27,6 +27,7 @@ export type FormFieldType =
27
27
  export interface SelectOption {
28
28
  label: string
29
29
  value: string
30
+ imgSrc?: string
30
31
  }
31
32
 
32
33
  export interface FormFieldValidation {
@@ -83,6 +84,10 @@ export interface FormField {
83
84
  radioAlign?: 'start' | 'center' | 'end'
84
85
  /** Lay radio options out horizontally (inline) instead of stacked. */
85
86
  radioInline?: boolean
87
+ /** Size of radio options. */
88
+ radioSize?: 's' | 'm' | 'l'
89
+ /** Align the content inside inline radio options. */
90
+ radioTextAlign?: 'left' | 'center' | 'right'
86
91
  textIcon?: string
87
92
  textIconStart?: string
88
93
  validation?: FormFieldValidation
@@ -110,6 +115,10 @@ export interface JSONSchemaProperty {
110
115
  condition?: string
111
116
  /** Field kept in form data / submitted but never displayed. */
112
117
  hidden?: boolean
118
+ /** Vertical alignment of radio option content. */
119
+ radioAlign?: 'start' | 'center' | 'end'
120
+ /** Horizontal alignment of radio option text. */
121
+ radioTextAlign?: 'left' | 'center' | 'right'
113
122
  [key: string]: any
114
123
  }
115
124
  'x-field-type'?: FormFieldType
@@ -136,6 +145,8 @@ export interface JSONSchemaProperty {
136
145
  'x-radio-hide-radio'?: boolean
137
146
  'x-radio-align'?: 'start' | 'center' | 'end'
138
147
  'x-radio-inline'?: boolean
148
+ 'x-radio-size'?: 's' | 'm' | 'l'
149
+ 'x-radio-text-align'?: 'left' | 'center' | 'right'
139
150
  'x-text-icon'?: string
140
151
  'x-text-icon-start'?: string
141
152
  'x-hide-label'?: boolean
@@ -241,8 +252,10 @@ export function schemaToFields(schema: JSONSchemaObject | undefined): FormField[
241
252
  rangeMulti: prop['x-range-multi'],
242
253
  radioThin: prop['x-radio-thin'],
243
254
  radioHideRadio: prop['x-radio-hide-radio'],
244
- radioAlign: prop['x-radio-align'],
255
+ radioAlign: prop['x-ui']?.radioAlign ?? prop['x-radio-align'],
245
256
  radioInline: prop['x-radio-inline'],
257
+ radioSize: prop['x-radio-size'],
258
+ radioTextAlign: prop['x-ui']?.radioTextAlign ?? prop['x-radio-text-align'],
246
259
  textIcon: prop['x-text-icon'],
247
260
  textIconStart: prop['x-text-icon-start'],
248
261
  validation: Object.keys(validation).length > 0 ? validation : undefined,
@@ -377,8 +390,10 @@ export function fieldsToSchema(fields: FormField[]): JSONSchemaObject {
377
390
  if (field.rangeMulti === true) prop['x-range-multi'] = true
378
391
  if (field.radioThin === true) prop['x-radio-thin'] = true
379
392
  if (field.radioHideRadio === true) prop['x-radio-hide-radio'] = true
380
- if (field.radioAlign) prop['x-radio-align'] = field.radioAlign
393
+ if (field.radioAlign) prop['x-ui'] = { ...prop['x-ui'], radioAlign: field.radioAlign }
381
394
  if (field.radioInline === true) prop['x-radio-inline'] = true
395
+ if (field.radioSize) prop['x-radio-size'] = field.radioSize
396
+ if (field.radioTextAlign) prop['x-ui'] = { ...prop['x-ui'], radioTextAlign: field.radioTextAlign }
382
397
  if (field.textIcon) prop['x-text-icon'] = field.textIcon
383
398
  if (field.textIconStart) prop['x-text-icon-start'] = field.textIconStart
384
399
 
@@ -259,6 +259,15 @@ export type { ShowdownConverter, ShowdownOptions } from './showdown'
259
259
 
260
260
  const URL_REGEX = /^https?:\/\/|^\/\/|^blob:|^data:/
261
261
 
262
+ // Base URL for uploaded files. Defaults to the public file server, but can be
263
+ // overridden per-app (e.g. to '/files' to route through a dev/prod proxy).
264
+ let fileBaseUrl = 'https://files.bagel.design'
265
+
266
+ /** Override the base URL used to resolve uploaded file path keys. */
267
+ export function setFileBaseUrl(baseUrl: string): void {
268
+ fileBaseUrl = baseUrl.replace(/\/$/, '')
269
+ }
270
+
262
271
  export function pathKeyToURL(pathKey?: string | null): string | undefined {
263
272
  if (pathKey == null || pathKey === '') {
264
273
  return undefined
@@ -284,10 +293,8 @@ export function pathKeyToURL(pathKey?: string | null): string | undefined {
284
293
  return `/${pathKey}`
285
294
  }
286
295
 
287
- // For uploaded files, use the default file server
288
- // TODO: Make this configurable via SDK init
289
- const baseUrl = 'https://files.bagel.design'
290
- return `${baseUrl}/${pathKey}`
296
+ // For uploaded files, use the configured file server (see setFileBaseUrl)
297
+ return `${fileBaseUrl}/${pathKey}`
291
298
  }
292
299
 
293
300
  export function getNestedValue(obj: any, path?: string, defaultValue: any = undefined): any {