@bagelink/vue 1.22.1 → 1.22.5

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.
Files changed (43) hide show
  1. package/dist/{StructuredEditor-BiBhDIf8.js → StructuredEditor-1mcyEtzh.js} +143 -143
  2. package/dist/{StructuredEditor-Cdl9_djZ.cjs → StructuredEditor-yW9FO5Tn.cjs} +1 -1
  3. package/dist/components/FilterQuery.vue.d.ts +5 -0
  4. package/dist/components/FilterQuery.vue.d.ts.map +1 -1
  5. package/dist/components/FilterQueryBuilder.vue.d.ts +47 -0
  6. package/dist/components/FilterQueryBuilder.vue.d.ts.map +1 -0
  7. package/dist/components/Icon/baseline.d.ts +14 -0
  8. package/dist/components/Icon/baseline.d.ts.map +1 -0
  9. package/dist/components/index.d.ts +1 -0
  10. package/dist/components/index.d.ts.map +1 -1
  11. package/dist/components/layout/AppLayout.vue.d.ts.map +1 -1
  12. package/dist/composables/index.d.ts +1 -0
  13. package/dist/composables/index.d.ts.map +1 -1
  14. package/dist/composables/useKeyboardInset.d.ts +5 -0
  15. package/dist/composables/useKeyboardInset.d.ts.map +1 -0
  16. package/dist/core.css +1 -1
  17. package/dist/dialog/Dialog.vue.d.ts.map +1 -1
  18. package/dist/i18n/index.d.ts +2 -0
  19. package/dist/i18n/index.d.ts.map +1 -1
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.mjs +312 -310
  24. package/dist/src-BHNIZfpF.cjs +764 -0
  25. package/dist/{src-lXTK29UB.js → src-CtOtibj7.js} +13464 -13199
  26. package/dist/src.css +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/utils/useKeyboardInset.d.ts +7 -0
  29. package/dist/utils/useKeyboardInset.d.ts.map +1 -0
  30. package/package.json +3 -3
  31. package/src/components/FilterQuery.vue +139 -750
  32. package/src/components/FilterQueryBuilder.vue +797 -0
  33. package/src/components/Icon/baseline.ts +80 -0
  34. package/src/components/index.ts +1 -0
  35. package/src/components/layout/AppLayout.vue +3 -1
  36. package/src/composables/index.ts +1 -0
  37. package/src/composables/useKeyboardInset.ts +89 -0
  38. package/src/dialog/Dialog.vue +15 -6
  39. package/src/i18n/locales/en.json +2 -1
  40. package/src/i18n/locales/he.json +2 -1
  41. package/src/index.ts +1 -0
  42. package/src/utils/useKeyboardInset.ts +36 -0
  43. package/dist/src-CyUKZxJV.cjs +0 -764
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Material Symbols the Vue controls paint themselves, not from a prop.
3
+ *
4
+ * A Blox SSG subset is harvested from prerendered HTML plus `icon:"name"`
5
+ * literals. Selects, date fields, password toggles and the rich-text toolbar
6
+ * choose their glyph in a ternary or computed (`open ? 'unfold_less' :
7
+ * 'unfold_more'`), so the harvest never sees it and the subset font draws the
8
+ * ligature as plain text. These names are always requested, on every site.
9
+ *
10
+ * Keep this to icons a control renders with no configuration. Icons that only
11
+ * appear because a caller passed `icon="…"` are harvested from that call site.
12
+ */
13
+ export const BASELINE_MATERIAL_ICONS = [
14
+ 'add',
15
+ 'add_column_left',
16
+ 'add_column_right',
17
+ 'add_link',
18
+ 'add_row_above',
19
+ 'add_row_below',
20
+ 'align_horizontal_left',
21
+ 'align_horizontal_right',
22
+ 'arrow_downward',
23
+ 'arrow_upward',
24
+ 'autorenew',
25
+ 'block',
26
+ 'calendar_month',
27
+ 'call_split',
28
+ 'check',
29
+ 'check_box_outline_blank',
30
+ 'check_circle',
31
+ 'chevron_left',
32
+ 'chevron_right',
33
+ 'close',
34
+ 'collapse_all',
35
+ 'content_copy',
36
+ 'crop',
37
+ 'delete',
38
+ 'delete_sweep',
39
+ 'download',
40
+ 'draft',
41
+ 'drag_indicator',
42
+ 'expand_all',
43
+ 'expand_less',
44
+ 'expand_more',
45
+ 'find_replace',
46
+ 'fit_screen',
47
+ 'format_align_center',
48
+ 'format_align_justify',
49
+ 'format_align_left',
50
+ 'format_align_right',
51
+ 'format_bold',
52
+ 'format_italic',
53
+ 'format_list_bulleted_add',
54
+ 'format_textdirection_l_to_r',
55
+ 'format_textdirection_r_to_l',
56
+ 'format_underlined',
57
+ 'keyboard_return',
58
+ 'link_off',
59
+ 'match_case',
60
+ 'match_word',
61
+ 'more_vert',
62
+ 'open_in_new',
63
+ 'open_with',
64
+ 'regular_expression',
65
+ 'remove',
66
+ 'search',
67
+ 'select_all',
68
+ 'select_check_box',
69
+ 'table_chart',
70
+ 'table_edit',
71
+ 'text_select_move_down',
72
+ 'unfold_less',
73
+ 'unfold_more',
74
+ 'upload',
75
+ 'upload_2',
76
+ 'visibility',
77
+ 'visibility_off',
78
+ 'warning',
79
+ 'width_full',
80
+ ] as const
@@ -33,6 +33,7 @@ export { default as FloatingPanel } from './FloatingPanel.vue'
33
33
  export * from './form'
34
34
  export { default as Icon } from './Icon/Icon.vue'
35
35
  export { FONT_AWESOME_BRANDS_ICONS, MATERIAL_ICONS } from './Icon/constants'
36
+ export { BASELINE_MATERIAL_ICONS } from './Icon/baseline'
36
37
  export { default as IframeVue } from './IframeVue.vue'
37
38
  export { default as Image } from './Image.vue'
38
39
  export * from './layout'
@@ -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 }
@@ -450,7 +453,6 @@ const slotBind = computed(() => ({ isOpen, isMobile, toggleMenu, closeOnMobile }
450
453
  </template>
451
454
 
452
455
  <style scoped>
453
-
454
456
  /* Root is a column: [top band] · [start|center|end row] · [bottom band].
455
457
  Safe-area uses physical left/right (not a single inline shorthand) — iPhone Duo
456
458
  insets are often asymmetric across the fold. `svh` keeps the shell stable while
@@ -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
+ }
@@ -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
  }
@@ -235,6 +237,12 @@ animation: fade-out 0.15s ease-in forwards;
235
237
  }
236
238
 
237
239
  /* Dialog position animations */
240
+ /* Center vertically. The base `dialog` rule sets explicit margin-top/bottom,
241
+ which cancels the UA `margin: auto` centering and pins the dialog to the top. */
242
+ dialog.dialog-center {
243
+ margin-block: auto;
244
+ }
245
+
238
246
  dialog.dialog-center[open] {
239
247
  animation: scale-fade-in 0.2s ease-out;
240
248
  }
@@ -296,11 +304,12 @@ dialog.dialog-bottom {
296
304
  width: 100%;
297
305
  max-width: 100%;
298
306
  margin-inline: 0;
299
- margin-bottom: 0;
300
- padding-bottom: env(safe-area-inset-bottom, 0px);
307
+ /* Lift above the iOS keyboard when `--bgl-keyboard-inset` is set. */
308
+ margin-bottom: var(--bgl-keyboard-inset, 0px);
309
+ padding-bottom: max(env(safe-area-inset-bottom, 0px), 0px);
301
310
  padding-left: env(safe-area-inset-left, 0px);
302
311
  padding-right: env(safe-area-inset-right, 0px);
303
- max-height: calc(100dvh - env(safe-area-inset-top, 0px));
312
+ max-height: calc(100dvh - env(safe-area-inset-top, 0px) - var(--bgl-keyboard-inset, 0px));
304
313
  box-sizing: border-box;
305
314
  }
306
315
  }
@@ -118,7 +118,8 @@
118
118
  "buttons": {
119
119
  "addCondition": "Add condition",
120
120
  "clearAll": "Clear all",
121
- "save": "Save"
121
+ "save": "Save",
122
+ "done": "Done"
122
123
  }
123
124
  },
124
125
  "multiStep": {
@@ -118,7 +118,8 @@
118
118
  "buttons": {
119
119
  "addCondition": "הוספת תנאי",
120
120
  "clearAll": "נקה הכל",
121
- "save": "שמירה"
121
+ "save": "שמירה",
122
+ "done": "סיום"
122
123
  }
123
124
  },
124
125
  "multiStep": {
package/src/index.ts CHANGED
@@ -42,3 +42,4 @@ export * from './utils/elementUtils'
42
42
  export * from './utils/filterRef'
43
43
  export * from './utils/ipapi'
44
44
  export * from './utils/useSearch'
45
+ export { useKeyboardInset } from './utils/useKeyboardInset'
@@ -0,0 +1,36 @@
1
+ import { onBeforeUnmount, onMounted, readonly, ref } from 'vue'
2
+
3
+ const inset = ref(0)
4
+ let listeners = 0
5
+ let cleanup: (() => void) | null = null
6
+
7
+ /** Subscribe to the shared keyboard-inset tracker. Safe to call from many components. */
8
+ export function useKeyboardInset(): { inset: Readonly<typeof inset> } {
9
+ onMounted(() => {
10
+ listeners += 1
11
+ if (cleanup) return
12
+ if (typeof window === 'undefined' || !('visualViewport' in window)) return
13
+ const viewport = window.visualViewport
14
+ if (!viewport) return
15
+ const base = viewport.height
16
+ const onResize = () => {
17
+ inset.value = Math.max(0, Math.round(base - viewport.height))
18
+ document.documentElement.style.setProperty('--bgl-keyboard-inset', `${inset.value}px`)
19
+ }
20
+ viewport.addEventListener('resize', onResize)
21
+ cleanup = () => {
22
+ viewport.removeEventListener('resize', onResize)
23
+ document.documentElement.style.removeProperty('--bgl-keyboard-inset')
24
+ inset.value = 0
25
+ cleanup = null
26
+ }
27
+ })
28
+ onBeforeUnmount(() => {
29
+ listeners -= 1
30
+ if (listeners <= 0 && cleanup) {
31
+ cleanup()
32
+ listeners = 0
33
+ }
34
+ })
35
+ return { inset: readonly(inset) }
36
+ }