@bagelink/vue 1.22.1 → 1.22.3
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/{StructuredEditor-BiBhDIf8.js → StructuredEditor-BlPNKNaT.js} +85 -85
- package/dist/{StructuredEditor-Cdl9_djZ.cjs → StructuredEditor-Bmq1Pxvl.cjs} +1 -1
- package/dist/components/FilterQuery.vue.d.ts +5 -0
- package/dist/components/FilterQuery.vue.d.ts.map +1 -1
- package/dist/components/FilterQueryBuilder.vue.d.ts +47 -0
- package/dist/components/FilterQueryBuilder.vue.d.ts.map +1 -0
- package/dist/components/layout/AppLayout.vue.d.ts.map +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/useKeyboardInset.d.ts +5 -0
- package/dist/composables/useKeyboardInset.d.ts.map +1 -0
- package/dist/core.css +1 -1
- package/dist/dialog/Dialog.vue.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +2 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +303 -302
- package/dist/src-COgNvUzW.cjs +764 -0
- package/dist/{src-lXTK29UB.js → src-EXMOTxie.js} +13250 -13070
- package/dist/src.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/components/FilterQuery.vue +139 -750
- package/src/components/FilterQueryBuilder.vue +797 -0
- package/src/components/layout/AppLayout.vue +3 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useKeyboardInset.ts +89 -0
- package/src/dialog/Dialog.vue +9 -6
- package/src/i18n/locales/en.json +2 -1
- package/src/i18n/locales/he.json +2 -1
- package/dist/src-CyUKZxJV.cjs +0 -764
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
import { ref, provide, onMounted, onUnmounted, computed, watch, useSlots, Comment, Text } from 'vue'
|
|
30
30
|
import type { Slots } from 'vue'
|
|
31
31
|
import { useEscapeKey } from '../../composables/useEscapeKey'
|
|
32
|
+
import { useKeyboardInset } from '../../composables/useKeyboardInset'
|
|
32
33
|
import { usePointerSession } from '../../composables/usePointerSession'
|
|
33
34
|
import { MOBILE_BREAKPOINT } from '../../utils/constants'
|
|
34
35
|
import {
|
|
@@ -188,6 +189,8 @@ const toggleBottom = () => { regions.value.bottom.open = !regions.value.bottom.o
|
|
|
188
189
|
const toggleMenu = toggleStart
|
|
189
190
|
|
|
190
191
|
useEscapeKey(() => { isOpen.value = false }, () => isMobile.value && isOpen.value)
|
|
192
|
+
// Publishes `--bgl-keyboard-inset` for sticky footers / chat composers on iOS.
|
|
193
|
+
useKeyboardInset()
|
|
191
194
|
|
|
192
195
|
function closeOnMobile() {
|
|
193
196
|
if (isMobile.value) { isOpen.value = false }
|
package/src/composables/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { useBoundedRectDrag } from './useBoundedRectDrag'
|
|
|
9
9
|
export type { BoundedRectDragOptions, DragRect } from './useBoundedRectDrag'
|
|
10
10
|
export { useDevice } from './useDevice'
|
|
11
11
|
export { useEscapeKey } from './useEscapeKey'
|
|
12
|
+
export { useKeyboardInset } from './useKeyboardInset'
|
|
12
13
|
export { useExcel } from './useExcel'
|
|
13
14
|
export type { GradientDir, GradientDirProp, GradientProp } from './useGradientVariant'
|
|
14
15
|
export { useGradientVariant } from './useGradientVariant'
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { onMounted, onUnmounted, readonly, ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Tracks the on-screen keyboard via `visualViewport` and publishes
|
|
5
|
+
* `--bgl-keyboard-inset` on `:root` so sticky footers / composers can lift.
|
|
6
|
+
*
|
|
7
|
+
* Gated on an editable focus — fold/unfold on iPhone Duo changes the visual
|
|
8
|
+
* viewport too, and must NOT be treated as a keyboard.
|
|
9
|
+
*
|
|
10
|
+
* Shared across callers (ref-counted install).
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const MIN_KEYBOARD_PX = 80
|
|
14
|
+
const inset = ref(0)
|
|
15
|
+
let subscribers = 0
|
|
16
|
+
let installed = false
|
|
17
|
+
let blurTimer: ReturnType<typeof setTimeout> | undefined
|
|
18
|
+
|
|
19
|
+
function isEditableFocused(): boolean {
|
|
20
|
+
const el = document.activeElement as HTMLElement | null
|
|
21
|
+
if (!el) return false
|
|
22
|
+
const tag = el.tagName
|
|
23
|
+
return tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || el.isContentEditable
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function publish(px: number) {
|
|
27
|
+
inset.value = px
|
|
28
|
+
document.documentElement.style.setProperty('--bgl-keyboard-inset', `${px}px`)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function measure() {
|
|
32
|
+
const vv = window.visualViewport
|
|
33
|
+
if (!vv) {
|
|
34
|
+
publish(0)
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
const visibleBottom = vv.height + vv.offsetTop
|
|
38
|
+
const raw = Math.max(0, window.innerHeight - visibleBottom)
|
|
39
|
+
const next = isEditableFocused() && raw > MIN_KEYBOARD_PX ? Math.round(raw) : 0
|
|
40
|
+
if (next !== inset.value) publish(next)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function onFocusIn() {
|
|
44
|
+
clearTimeout(blurTimer)
|
|
45
|
+
// iOS keyboard animates in — remeasure a few times.
|
|
46
|
+
requestAnimationFrame(measure)
|
|
47
|
+
setTimeout(measure, 120)
|
|
48
|
+
setTimeout(measure, 320)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function onFocusOut() {
|
|
52
|
+
clearTimeout(blurTimer)
|
|
53
|
+
blurTimer = setTimeout(measure, 80)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function install() {
|
|
57
|
+
if (installed || typeof window === 'undefined') return
|
|
58
|
+
installed = true
|
|
59
|
+
window.visualViewport?.addEventListener('resize', measure)
|
|
60
|
+
window.visualViewport?.addEventListener('scroll', measure)
|
|
61
|
+
window.addEventListener('focusin', onFocusIn)
|
|
62
|
+
window.addEventListener('focusout', onFocusOut)
|
|
63
|
+
measure()
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function uninstall() {
|
|
67
|
+
if (!installed) return
|
|
68
|
+
installed = false
|
|
69
|
+
clearTimeout(blurTimer)
|
|
70
|
+
window.visualViewport?.removeEventListener('resize', measure)
|
|
71
|
+
window.visualViewport?.removeEventListener('scroll', measure)
|
|
72
|
+
window.removeEventListener('focusin', onFocusIn)
|
|
73
|
+
window.removeEventListener('focusout', onFocusOut)
|
|
74
|
+
document.documentElement.style.removeProperty('--bgl-keyboard-inset')
|
|
75
|
+
inset.value = 0
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Subscribe to the shared keyboard-inset tracker. Safe to call from many components. */
|
|
79
|
+
export function useKeyboardInset() {
|
|
80
|
+
onMounted(() => {
|
|
81
|
+
subscribers += 1
|
|
82
|
+
install()
|
|
83
|
+
})
|
|
84
|
+
onUnmounted(() => {
|
|
85
|
+
subscribers = Math.max(0, subscribers - 1)
|
|
86
|
+
if (subscribers === 0) uninstall()
|
|
87
|
+
})
|
|
88
|
+
return { inset: readonly(inset) }
|
|
89
|
+
}
|
package/src/dialog/Dialog.vue
CHANGED
|
@@ -172,15 +172,17 @@ defineExpose({ close })
|
|
|
172
172
|
|
|
173
173
|
/* Base dialog styles.
|
|
174
174
|
Height cascade: vh fallback → dvh (tracks iOS chrome / fold) → subtract
|
|
175
|
-
asymmetric safe-area so content clears notch + home indicator on Duo.
|
|
175
|
+
asymmetric safe-area so content clears notch + home indicator on Duo.
|
|
176
|
+
`--bgl-keyboard-inset` (from useKeyboardInset) lifts the dialog above the
|
|
177
|
+
on-screen keyboard without fighting safe-area when the keyboard is closed. */
|
|
176
178
|
dialog {
|
|
177
179
|
border-radius: var(--bgl-card-radius, 12px);
|
|
178
180
|
max-width: var(--dialog-width);
|
|
179
181
|
width: calc(100% - 2rem);
|
|
180
182
|
max-height: calc(100vh - 2rem);
|
|
181
|
-
max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
|
|
183
|
+
max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--bgl-keyboard-inset, 0px));
|
|
182
184
|
margin-top: max(1rem, env(safe-area-inset-top, 0px));
|
|
183
|
-
margin-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
|
|
185
|
+
margin-bottom: max(1rem, env(safe-area-inset-bottom, 0px), var(--bgl-keyboard-inset, 0px));
|
|
184
186
|
background: var(--bgl-popup-bg, #fff);
|
|
185
187
|
color: var(--bgl-popup-text, black);
|
|
186
188
|
}
|
|
@@ -296,11 +298,12 @@ dialog.dialog-bottom {
|
|
|
296
298
|
width: 100%;
|
|
297
299
|
max-width: 100%;
|
|
298
300
|
margin-inline: 0;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
+
/* Lift above the iOS keyboard when `--bgl-keyboard-inset` is set. */
|
|
302
|
+
margin-bottom: var(--bgl-keyboard-inset, 0px);
|
|
303
|
+
padding-bottom: max(env(safe-area-inset-bottom, 0px), 0px);
|
|
301
304
|
padding-left: env(safe-area-inset-left, 0px);
|
|
302
305
|
padding-right: env(safe-area-inset-right, 0px);
|
|
303
|
-
max-height: calc(100dvh - env(safe-area-inset-top, 0px));
|
|
306
|
+
max-height: calc(100dvh - env(safe-area-inset-top, 0px) - var(--bgl-keyboard-inset, 0px));
|
|
304
307
|
box-sizing: border-box;
|
|
305
308
|
}
|
|
306
309
|
}
|
package/src/i18n/locales/en.json
CHANGED