@bagelink/vue 1.20.36 → 1.20.43
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/components/Image.vue.d.ts +2 -0
- package/dist/components/Image.vue.d.ts.map +1 -1
- package/dist/components/charts/StatCard.vue.d.ts +3 -0
- package/dist/components/charts/StatCard.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/composables/useCommands.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts +10 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/utils/commands.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/utils/htmlFormat.d.ts +33 -0
- package/dist/components/form/inputs/RichText/utils/htmlFormat.d.ts.map +1 -0
- package/dist/components/form/inputs/RichText/utils/viewMode.d.ts +4 -0
- package/dist/components/form/inputs/RichText/utils/viewMode.d.ts.map +1 -0
- package/dist/components/form/inputs/Upload/AssetUploadInput.vue.d.ts +146 -2
- package/dist/components/form/inputs/Upload/AssetUploadInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts +78 -1
- package/dist/components/form/inputs/Upload/UploadInput.vue.d.ts.map +1 -1
- package/dist/components/lightbox/Lightbox.vue.d.ts.map +1 -1
- package/dist/core.css +2 -2
- package/dist/index.cjs +82 -54
- package/dist/index.css +1 -1
- package/dist/index.mjs +11484 -11207
- package/dist/style.css +2 -2
- package/package.json +2 -2
- package/src/components/Image.vue +8 -0
- package/src/components/charts/StatCard.vue +7 -1
- package/src/components/form/inputs/DateInput.vue +1 -1
- package/src/components/form/inputs/DatePicker.vue +5 -1
- package/src/components/form/inputs/RichText/composables/useCommands.ts +3 -2
- package/src/components/form/inputs/RichText/editor.css +25 -6
- package/src/components/form/inputs/RichText/index.vue +59 -14
- package/src/components/form/inputs/RichText/utils/commands.ts +3 -2
- package/src/components/form/inputs/RichText/utils/htmlFormat.ts +268 -0
- package/src/components/form/inputs/RichText/utils/viewMode.ts +28 -0
- package/src/components/form/inputs/Upload/AssetUploadInput.vue +7 -3
- package/src/components/form/inputs/Upload/UploadInput.vue +2 -1
- package/src/components/lightbox/Lightbox.vue +18 -12
- package/src/styles/rich-content.css +31 -5
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import type { UploadInputProps } from '../../../../types/BagelForm'
|
|
3
3
|
import { Btn, IMAGE_FORMATS_REGEXP, Icon, Card, Image, pathKeyToURL, Loading, useI18n, resolveI18n } from '../../../../index'
|
|
4
4
|
import { watch, computed, ref, useSlots } from 'vue'
|
|
5
|
+
import type { Slots } from 'vue'
|
|
5
6
|
import { useFileDropzone } from '../../../file-drop/useFileDropzone'
|
|
6
7
|
import { useFileUpload } from './useFileUpload'
|
|
7
8
|
import { useBagelInputShell } from '../bagelInputShell'
|
|
@@ -33,7 +34,7 @@ const props = withDefaults(defineProps<UploadInputProps & { previewState?: impor
|
|
|
33
34
|
const emit = defineEmits(['update:modelValue', 'addFileStart', 'uploadError'])
|
|
34
35
|
|
|
35
36
|
const { $t } = useI18n()
|
|
36
|
-
const slots = useSlots()
|
|
37
|
+
const slots: Slots = useSlots()
|
|
37
38
|
const {
|
|
38
39
|
fileQueue,
|
|
39
40
|
pathKeys,
|
|
@@ -165,18 +165,24 @@ defineExpose({ open, close })
|
|
|
165
165
|
padding: 0;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
|
|
169
|
-
width
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
.bgl-lightbox:has(.vid_short)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
height:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
168
|
+
/* Shorts are portrait (9:16). Size the frame from the available HEIGHT and let the
|
|
169
|
+
width follow from the aspect ratio — pinning a width (90vw) and clamping only the
|
|
170
|
+
height distorts the frame into a wider box, which makes YouTube letterbox the
|
|
171
|
+
vertical clip with black bars on both sides. */
|
|
172
|
+
.bgl-lightbox-overlay:has(.vid_short) .bgl-lightbox-item .lightbox-video,
|
|
173
|
+
.bgl-lightbox-overlay:has(.vid_short) .bgl-lightbox-item .lightbox-video iframe {
|
|
174
|
+
width: auto;
|
|
175
|
+
height: 100%;
|
|
176
|
+
max-width: none;
|
|
177
|
+
max-height: none;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.bgl-lightbox-overlay:has(.vid_short) .bgl-lightbox-item .lightbox-video iframe {
|
|
181
|
+
aspect-ratio: 9 / 16;
|
|
182
|
+
/* On narrow screens the height-driven width would exceed the viewport, so cap the
|
|
183
|
+
height instead (90vw wide → ×16/9 = 160vw tall) — the width then re-derives from
|
|
184
|
+
the ratio, keeping a true 9:16 frame. */
|
|
185
|
+
max-height: min(100%, 160vw);
|
|
180
186
|
}
|
|
181
187
|
|
|
182
188
|
.lightbox-image {
|
|
@@ -37,26 +37,52 @@ figure[data-media-type='video'] video {
|
|
|
37
37
|
|
|
38
38
|
figure.align-full {
|
|
39
39
|
float: none;
|
|
40
|
-
|
|
40
|
+
/* A block box that follows a float starts at the float's top, so a full-width
|
|
41
|
+
figure would paint its box (and its edit badge) over the floated media while
|
|
42
|
+
its image stays below. Clearing forces the new row the width implies. */
|
|
43
|
+
clear: both;
|
|
44
|
+
width: 100%;
|
|
41
45
|
max-width: 100%;
|
|
42
46
|
margin-inline: 0;
|
|
43
47
|
}
|
|
44
48
|
|
|
49
|
+
/* Floats only share a line while their outer widths fit. The gap is reserved
|
|
50
|
+
*inside* the 50% instead of being added on top of it, so a pair of opposing
|
|
51
|
+
floats fits exactly once:
|
|
52
|
+
2 × (50% - gap) + 2 × gap = 100%
|
|
53
|
+
Without that, 50% + gap twice always overflows and the second figure drops to
|
|
54
|
+
the next line. The extra 1px absorbs sub-pixel rounding.
|
|
55
|
+
`!important` is deliberately absent so an explicit width from the author (the
|
|
56
|
+
inline style written from `data-width`) still wins. */
|
|
45
57
|
figure.align-start,
|
|
46
58
|
figure.align-end {
|
|
47
|
-
|
|
48
|
-
|
|
59
|
+
--rich-figure-gap: 1.25em;
|
|
60
|
+
width: 50%;
|
|
61
|
+
max-width: calc(50% - var(--rich-figure-gap) - 1px);
|
|
49
62
|
margin-block: 0.25em 0.75em;
|
|
50
63
|
}
|
|
51
64
|
|
|
52
65
|
figure.align-start {
|
|
53
66
|
float: inline-start;
|
|
54
|
-
margin-inline: 0
|
|
67
|
+
margin-inline: 0 var(--rich-figure-gap);
|
|
55
68
|
}
|
|
56
69
|
|
|
57
70
|
figure.align-end {
|
|
58
71
|
float: inline-end;
|
|
59
|
-
margin-inline:
|
|
72
|
+
margin-inline: var(--rich-figure-gap) 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Floated figures take themselves out of flow, so a wrapper whose only children
|
|
76
|
+
are floats collapses to zero height and whatever follows is painted on top of
|
|
77
|
+
them. `flow-root` establishes a block formatting context without clipping the
|
|
78
|
+
overlapping badges or captions. */
|
|
79
|
+
p:has(> figure.align-start),
|
|
80
|
+
p:has(> figure.align-end),
|
|
81
|
+
li:has(> figure.align-start),
|
|
82
|
+
li:has(> figure.align-end),
|
|
83
|
+
div:has(> figure.align-start),
|
|
84
|
+
div:has(> figure.align-end) {
|
|
85
|
+
display: flow-root;
|
|
60
86
|
}
|
|
61
87
|
|
|
62
88
|
.video-responsive {
|