@bagelink/vue 1.20.70 → 1.20.76

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.20.70",
4
+ "version": "1.20.76",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -63,7 +63,7 @@
63
63
  "@types/signature_pad": "^4.0.0",
64
64
  "vue": "^3.5.43",
65
65
  "vue-component-type-helpers": "^2.2.12",
66
- "@bagelink/sdk": "1.20.70"
66
+ "@bagelink/sdk": "1.20.76"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@bagelink/sdk": "*",
@@ -143,10 +143,14 @@ function pageSheetCss(reset = false): string {
143
143
  box-shadow: 0 1px 5px rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
144
144
  }
145
145
  @media (max-width: 760px) {
146
+ html { background: var(--bgl-gray-20, #e6e6e6); }
146
147
  body {
148
+ /* Stay inset on every side so the gray canvas frames the sheet. */
149
+ width: auto;
147
150
  max-width: none;
148
- margin: 0.5rem auto;
149
- padding: 1.5rem 1rem 2.5rem;
151
+ margin: 0.75rem;
152
+ padding: 1.5rem 1.25rem 2.5rem;
153
+ min-height: calc(100vh - 1.5rem);
150
154
  }
151
155
  }
152
156
  `
@@ -4617,16 +4621,25 @@ min-height: 0;
4617
4621
  overflow-y: auto;
4618
4622
  }
4619
4623
 
4620
- /* Page mode: the iframe shows a white sheet on a muted canvas, so the
4621
- surface behind it must be the same canvas — otherwise a white frame
4622
- shows around the gray. */
4624
+ /* Page mode: the iframe paints its own canvas, so the surface behind it
4625
+ must not add a second background. */
4623
4626
  .rich-text-page {
4624
4627
  background: transparent !important;
4625
4628
  border-color: transparent;
4626
4629
  }
4627
4630
 
4628
4631
  .rich-text-page .content-area {
4629
- background: transparent;
4632
+ background: transparent;
4633
+ }
4634
+
4635
+ /* On mobile the sheet inside the iframe is inset, so the canvas has to
4636
+ continue behind it or the gap reads as white. Desktop is unchanged. */
4637
+ @media (max-width: 760px) {
4638
+ .rich-text-page,
4639
+ .rich-text-page .content-area,
4640
+ .rich-text-page .editableContent {
4641
+ background: var(--bgl-gray-20);
4642
+ }
4630
4643
  }
4631
4644
 
4632
4645
  .fullscreen-mode {
@@ -17,6 +17,8 @@ interface Row {
17
17
  type: string
18
18
  asset?: AssetReference
19
19
  thumb?: string
20
+ /** A previously saved URL string, shown until the editor replaces it with an asset. */
21
+ legacy?: boolean
20
22
  progress?: number
21
23
  success: boolean
22
24
  downloadUrl?: string
@@ -324,7 +326,19 @@ const previewQueue = computed<Row[]>(() => {
324
326
  /** Lab-only: hold the success check on every stored row instead of flashing it. */
325
327
  const previewSuccess = computed(() => props.previewState?.state === 'success')
326
328
 
329
+ function savedUrls(value: unknown): string[] {
330
+ return [value].flat().filter((item): item is string => typeof item === 'string' && item.trim() !== '')
331
+ }
332
+
327
333
  const rows = computed<Row[]>(() => [
334
+ ...savedUrls(props.modelValue).map((url): Row => ({
335
+ key: url,
336
+ label: decodeURIComponent(url.split('/').pop()?.split('?')[0] || 'Image'),
337
+ type: 'image',
338
+ thumb: url,
339
+ success: false,
340
+ legacy: true,
341
+ })),
328
342
  ...values.value.map((value, index): Row => ({
329
343
  key: value.asset_id,
330
344
  label: labelFor(value),
@@ -370,6 +384,15 @@ function srcFor(row: Row) {
370
384
  }
371
385
 
372
386
  function removeRow(row: Row) {
387
+ if (row.legacy) {
388
+ if (!props.multiple) {
389
+ emit('update:modelValue', undefined)
390
+ return
391
+ }
392
+ const next = savedUrls(props.modelValue).filter(url => url !== row.thumb)
393
+ emit('update:modelValue', next.length ? next as unknown as AssetReference[] : undefined)
394
+ return
395
+ }
373
396
  if (row.asset) {
374
397
  const index = row.index
375
398
  ?? values.value.findIndex(value => value.asset_id === row.asset?.asset_id)
@@ -464,7 +487,7 @@ const listStyle = computed<CSSProperties | undefined>(() => {
464
487
  v-for="row in rows" :key="row.key" :label="row.label" :type="row.type"
465
488
  :asset="row.asset" :thumb="row.thumb" :progress="row.progress" :success="row.success"
466
489
  :download-url="row.downloadUrl" :readonly="readonly" :disabled="disabled"
467
- :crop="cropAfterUpload" :icon-weight="iconWeight"
490
+ :crop="cropAfterUpload && !!row.asset" :icon-weight="iconWeight"
468
491
  @remove="removeRow(row)" @replace="pick(row.index)" @crop="cropUploaded(row)"
469
492
  />
470
493
  <span v-if="!rows.length" class="txt-gray txt-12">
@@ -531,7 +554,7 @@ const listStyle = computed<CSSProperties | undefined>(() => {
531
554
  :aria-label="$t('upload.replace')" @click.stop="pick(single.index)"
532
555
  />
533
556
  <Btn
534
- v-if="!disabled && cropAfterUpload && single.type === 'image'"
557
+ v-if="!disabled && cropAfterUpload && single.asset && single.type === 'image'"
535
558
  color="white" frame thin icon="crop"
536
559
  :icon-size="actionIconSize" :icon-mobile-size="actionIconMobileSize"
537
560
  :aria-label="$t('upload.cropExisting')" @click.stop="cropUploaded(single)"
@@ -615,7 +638,7 @@ const listStyle = computed<CSSProperties | undefined>(() => {
615
638
  @click.stop="pick(row.index)"
616
639
  />
617
640
  <Btn
618
- v-if="cropAfterUpload && row.type === 'image'" color="white" frame thin
641
+ v-if="cropAfterUpload && row.asset && row.type === 'image'" color="white" frame thin
619
642
  icon="crop" :aria-label="$t('upload.cropExisting')"
620
643
  :icon-size="actionIconSize" :icon-mobile-size="actionIconMobileSize"
621
644
  @click.stop="cropUploaded(row)"
@@ -646,7 +669,7 @@ const listStyle = computed<CSSProperties | undefined>(() => {
646
669
  v-for="row in rows" :key="row.key" :label="row.label" :type="row.type"
647
670
  :asset="row.asset" :thumb="row.thumb" :progress="row.progress" :success="row.success"
648
671
  :readonly="readonly" :disabled="disabled" :download-url="row.downloadUrl"
649
- :crop="cropAfterUpload" :icon-weight="iconWeight"
672
+ :crop="cropAfterUpload && !!row.asset" :icon-weight="iconWeight"
650
673
  @remove="removeRow(row)" @replace="pick(row.index)" @crop="cropUploaded(row)"
651
674
  />
652
675
  <div v-if="!locked" class="bgl-add-more">
@@ -693,7 +716,7 @@ const listStyle = computed<CSSProperties | undefined>(() => {
693
716
  v-for="row in rows" :key="row.key" :label="row.label" :type="row.type"
694
717
  :asset="row.asset" :thumb="row.thumb" :progress="row.progress" :success="row.success"
695
718
  :readonly="readonly" :disabled="disabled" :download-url="row.downloadUrl"
696
- :crop="cropAfterUpload" :icon-weight="iconWeight"
719
+ :crop="cropAfterUpload && !!row.asset" :icon-weight="iconWeight"
697
720
  @remove="removeRow(row)" @replace="pick(row.index)" @crop="cropUploaded(row)"
698
721
  />
699
722
  </div>
@@ -1267,6 +1267,8 @@ function createFieldFromProperty(
1267
1267
  const arrayConfig: Record<string, any> = { ...config }
1268
1268
  if (xUi.allowAdd !== undefined) arrayConfig.allowAdd = xUi.allowAdd
1269
1269
  if (xUi.allowDelete !== undefined) arrayConfig.allowDelete = xUi.allowDelete
1270
+ if (xUi.allowReorder !== undefined) arrayConfig.allowReorder = xUi.allowReorder
1271
+ if (xUi.collapsible !== undefined) arrayConfig.collapsible = xUi.collapsible
1270
1272
  if (xUi.sortOrder !== undefined) arrayConfig.sortOrder = xUi.sortOrder
1271
1273
  const itemSchema = resolvedProp.items?.type === 'object'
1272
1274
  ? fromJSONSchema(resolvedProp.items as JSONSchemaObject, { loadOptionsSource })