@leavepulse/ui 0.72.4 → 0.72.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, useModel, ref, useId, watch, openBlock, createElementBlock, mergeProps, unref, createElementVNode, withModifiers, toDisplayString, createVNode, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps, normalizeClass, createBlock, createCommentVNode, mergeModels } from "vue";
|
|
1
|
+
import { defineComponent, computed, useModel, ref, useId, onMounted, watch, openBlock, createElementBlock, mergeProps, unref, createElementVNode, withModifiers, toDisplayString, createVNode, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps, normalizeClass, withDirectives, vShow, createBlock, Teleport, createCommentVNode, mergeModels } from "vue";
|
|
2
2
|
import { useLabels } from "../composables/useLpConfig.js";
|
|
3
3
|
import { _ as _sfc_main$6 } from "./LpBottomNav-CbNQQPuL.js";
|
|
4
4
|
import { _ as _sfc_main$2 } from "./LpButton-CFb44IjC.js";
|
|
@@ -11,10 +11,6 @@ const _hoisted_1 = ["href"];
|
|
|
11
11
|
const _hoisted_2 = { class: "flex min-w-0 flex-1 flex-col" };
|
|
12
12
|
const _hoisted_3 = { class: "relative flex h-16 shrink-0 items-center gap-3 border-b border-line bg-surface px-4 md:px-6" };
|
|
13
13
|
const _hoisted_4 = { class: "truncate text-lg font-semibold" };
|
|
14
|
-
const _hoisted_5 = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "min-h-0 flex-1 overflow-hidden"
|
|
17
|
-
};
|
|
18
14
|
const __default__ = { inheritAttrs: false };
|
|
19
15
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
20
16
|
...__default__,
|
|
@@ -80,6 +76,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
80
76
|
() => props.labels
|
|
81
77
|
);
|
|
82
78
|
const scrollArea = ref(null);
|
|
79
|
+
const bleedId = `lp-shell-bleed-${useId()}`;
|
|
80
|
+
const mounted = ref(false);
|
|
81
|
+
onMounted(() => mounted.value = true);
|
|
82
|
+
const bleeding = computed(() => props.fullBleed && mounted.value);
|
|
83
83
|
const mainId = `lp-main-${useId()}`;
|
|
84
84
|
function skipToMain() {
|
|
85
85
|
document.getElementById(mainId)?.focus();
|
|
@@ -237,20 +237,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
237
237
|
tabindex: "-1",
|
|
238
238
|
class: "flex min-h-0 flex-1 flex-col outline-none"
|
|
239
239
|
}, [
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
240
|
+
withDirectives(createElementVNode("div", {
|
|
241
|
+
id: bleedId,
|
|
242
|
+
class: "min-h-0 flex-1 overflow-hidden"
|
|
243
|
+
}, null, 512), [
|
|
244
|
+
[vShow, bleeding.value]
|
|
245
|
+
]),
|
|
246
|
+
withDirectives(createVNode(_sfc_main$5, {
|
|
244
247
|
ref_key: "scrollArea",
|
|
245
248
|
ref: scrollArea,
|
|
246
249
|
class: "min-h-0 flex-1",
|
|
247
250
|
"content-class": unref(mergeClass)("px-4 py-6 md:px-6", __props.contentClass)
|
|
248
251
|
}, {
|
|
249
252
|
default: withCtx(() => [
|
|
250
|
-
|
|
253
|
+
(openBlock(), createBlock(Teleport, {
|
|
254
|
+
to: `#${bleedId}`,
|
|
255
|
+
disabled: !bleeding.value,
|
|
256
|
+
defer: ""
|
|
257
|
+
}, [
|
|
258
|
+
renderSlot(_ctx.$slots, "default")
|
|
259
|
+
], 8, ["to", "disabled"]))
|
|
251
260
|
]),
|
|
252
261
|
_: 3
|
|
253
|
-
}, 8, ["content-class"])
|
|
262
|
+
}, 8, ["content-class"]), [
|
|
263
|
+
[vShow, !bleeding.value]
|
|
264
|
+
])
|
|
254
265
|
]),
|
|
255
266
|
__props.bottomNav ? (openBlock(), createBlock(_sfc_main$6, {
|
|
256
267
|
key: 0,
|
|
@@ -187,8 +187,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
187
187
|
'header-actions'?: (props: {}) => any;
|
|
188
188
|
} & {
|
|
189
189
|
default?: (props: {}) => any;
|
|
190
|
-
} & {
|
|
191
|
-
default?: (props: {}) => any;
|
|
192
190
|
} & {
|
|
193
191
|
overlays?: (props: {}) => any;
|
|
194
192
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { _ as _3 } from "./chunks/LpMapPicker-DRGgh89B.js";
|
|
|
4
4
|
import { OSM_TILES, createNominatimProvider, emptyAddress, formatAddress, project, tileUrl, unproject } from "./components/address.js";
|
|
5
5
|
import { _ as _4 } from "./chunks/LpActionBar-BP1ld7-S.js";
|
|
6
6
|
import { _ as _5 } from "./chunks/LpAlert-n5XPAZfv.js";
|
|
7
|
-
import { _ as _6 } from "./chunks/LpAppShell-
|
|
7
|
+
import { _ as _6 } from "./chunks/LpAppShell-DMSJg18Q.js";
|
|
8
8
|
import { _ as _7 } from "./chunks/LpAutocomplete-DOu7FN5P.js";
|
|
9
9
|
import { _ as _8 } from "./chunks/LpAvatar-Cg6Az3wz.js";
|
|
10
10
|
import { _ as _9 } from "./chunks/LpBadge-wUYLN4U9.js";
|
package/package.json
CHANGED
|
@@ -31,7 +31,7 @@ export default { inheritAttrs: false }
|
|
|
31
31
|
* Overlays that aren't part of the frame (command palette, toaster) live in the
|
|
32
32
|
* host next to <LpAppShell>.
|
|
33
33
|
*/
|
|
34
|
-
import { computed, ref, useId, watch } from "vue"
|
|
34
|
+
import { computed, onMounted, ref, useId, watch } from "vue"
|
|
35
35
|
import { useLabels } from "../composables/useLpConfig"
|
|
36
36
|
import LpBottomNav from "./LpBottomNav.vue"
|
|
37
37
|
import LpButton from "./LpButton.vue"
|
|
@@ -180,6 +180,10 @@ const text = useLabels(
|
|
|
180
180
|
* a scrolled page landed mid-way down the next one.
|
|
181
181
|
*/
|
|
182
182
|
const scrollArea = ref<{ viewportEl: HTMLElement | null } | null>(null)
|
|
183
|
+
const bleedId = `lp-shell-bleed-${useId()}`
|
|
184
|
+
const mounted = ref(false)
|
|
185
|
+
onMounted(() => (mounted.value = true))
|
|
186
|
+
const bleeding = computed(() => props.fullBleed && mounted.value)
|
|
183
187
|
const mainId = `lp-main-${useId()}`
|
|
184
188
|
|
|
185
189
|
// Focus instead of following the hash, which a router would treat as a navigation.
|
|
@@ -348,18 +352,23 @@ const { class: rootClass, attrs: rest } = useMergedAttrs(
|
|
|
348
352
|
</header>
|
|
349
353
|
|
|
350
354
|
<!-- full-bleed: page owns the whole region (canvas/map); otherwise the
|
|
351
|
-
single scroll region with padding.
|
|
355
|
+
single scroll region with padding. The page is rendered once and
|
|
356
|
+
moved between the two by a teleport rather than drawn in two
|
|
357
|
+
branches: switching branches remounted the whole page, so a section
|
|
358
|
+
tab going from a full-bleed page to a padded one cut instead of
|
|
359
|
+
playing its transition, and lost the page's state. Until mount the
|
|
360
|
+
page stays in the scroll region, which is what a server render has. -->
|
|
352
361
|
<main :id="mainId" tabindex="-1" class="flex min-h-0 flex-1 flex-col outline-none">
|
|
353
|
-
<div v-
|
|
354
|
-
<slot />
|
|
355
|
-
</div>
|
|
362
|
+
<div v-show="bleeding" :id="bleedId" class="min-h-0 flex-1 overflow-hidden" />
|
|
356
363
|
<LpScrollArea
|
|
357
|
-
v-
|
|
364
|
+
v-show="!bleeding"
|
|
358
365
|
ref="scrollArea"
|
|
359
366
|
class="min-h-0 flex-1"
|
|
360
367
|
:content-class="mergeClass('px-4 py-6 md:px-6', contentClass)"
|
|
361
368
|
>
|
|
362
|
-
<
|
|
369
|
+
<Teleport :to="`#${bleedId}`" :disabled="!bleeding" defer>
|
|
370
|
+
<slot />
|
|
371
|
+
</Teleport>
|
|
363
372
|
</LpScrollArea>
|
|
364
373
|
</main>
|
|
365
374
|
<LpBottomNav
|