@meistrari/tela-build 1.100.0 → 1.101.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Latest updates and announcements.
4
4
 
5
+ ## November 9, 2026
6
+
7
+ - [Chat](/templates/chat) `TelaChatFloatingWindow` with `position="left"` offsets its launcher by `--tela-floating-window-inset-left` (default `0px`), so an app with a fixed left sidebar can keep the launcher 16px to the right of it instead of on top of it.
8
+
9
+ ## November 6, 2026
10
+
11
+ - [Skeleton Reveal](/components/skeleton-reveal) is a new component that puts a page or section behind a skeleton measured from its own content, built on [skullet](https://skullet.lochie.me). The first load shows the `#placeholder` slot, later loads draw the layout remembered under `id`, and loads under 150ms show no skeleton. It uses the same `bg-muted` surface and pulse as [Skeleton](/components/skeleton). `forgetSkeletonShapes()` clears the remembered layouts.
12
+
5
13
  ## November 5, 2026
6
14
 
7
15
  - [Chat](/templates/chat#plan) adds `TelaChatPlan` and `TelaChatPlanActions`: a plan the assistant proposes before creating something, with one row per item (or numbered steps) that the user clicks to edit inline, an edit mode to reorder, remove and add steps, and a bar with the submit button, "Edit plan" and a hint. Both are controlled; the host keeps the items and decides what submitting does.
@@ -1710,6 +1710,7 @@ type FloatingWindowTriggerProps = {
1710
1710
  type FloatingWindowProps = {
1711
1711
  closeOnOutsideClick?: boolean // defaults to true; false keeps the window open on outside clicks
1712
1712
  open: boolean
1713
+ position?: 'left' | 'right' // defaults to 'right'; a left launcher is offset by --tela-floating-window-inset-left (e.g. a fixed app sidebar's width)
1713
1714
  contained?: boolean // anchor the launcher to the nearest positioned ancestor instead of the viewport
1714
1715
  triggerLabel?: string // label of the default trigger; ignored when #launcher is provided
1715
1716
  keepMounted?: boolean // defaults to false; keeps the content mounted (hidden) after the first open
@@ -29,7 +29,7 @@ const ChatBody = defineComponent({
29
29
  },
30
30
  })
31
31
 
32
- function mountWindow(props: { open: boolean, keepMounted?: boolean }) {
32
+ function mountWindow(props: { open: boolean, keepMounted?: boolean, position?: 'left' | 'right' }) {
33
33
  const wrapper = mount(FloatingWindow, {
34
34
  props,
35
35
  slots: { default: () => h(ChatBody) },
@@ -70,6 +70,26 @@ describe('floating chat window', () => {
70
70
  document.body.innerHTML = ''
71
71
  })
72
72
 
73
+ it('offsets a left launcher by the host inset so it clears a fixed sidebar', () => {
74
+ // Arrange & Act
75
+ const wrapper = mountWindow({ open: false, position: 'left' })
76
+ const launcher = wrapper.get('[data-tela-floating-window]')
77
+
78
+ // Assert
79
+ expect(launcher.classes()).toContain('left-[calc(16px+var(--tela-floating-window-inset-left,0px))]')
80
+ expect(launcher.classes()).not.toContain('left-16px')
81
+ })
82
+
83
+ it('keeps a right launcher anchored to the viewport edge and scrollbar', () => {
84
+ // Arrange & Act
85
+ const wrapper = mountWindow({ open: false })
86
+ const launcher = wrapper.get('[data-tela-floating-window]')
87
+
88
+ // Assert
89
+ expect(launcher.classes()).toContain('right-[calc(16px+var(--scrollbar-width,0px))]')
90
+ expect(launcher.classes().some(name => name.includes('tela-floating-window-inset-left'))).toBe(false)
91
+ })
92
+
73
93
  it('does not mount the content before the first open', () => {
74
94
  // Arrange & Act
75
95
  mountWindow({ open: false, keepMounted: true })
@@ -302,7 +302,7 @@ function focusEditorIn(content: HTMLElement) {
302
302
  :class="cn(
303
303
  'bottom-16px z-599',
304
304
  contained ? 'absolute' : 'fixed',
305
- position === 'left' ? 'left-16px' : contained ? 'right-16px' : 'right-[calc(16px+var(--scrollbar-width,0px))]',
305
+ position === 'left' ? 'left-[calc(16px+var(--tela-floating-window-inset-left,0px))]' : contained ? 'right-16px' : 'right-[calc(16px+var(--scrollbar-width,0px))]',
306
306
  )"
307
307
  >
308
308
  <div :class="cn('transition-opacity', open ? 'opacity-0 duration-100' : 'duration-160 delay-160')">
@@ -0,0 +1,71 @@
1
+ # TelaSkeletonReveal
2
+
3
+ Puts a page or section behind a skeleton measured from its own content, built on [skullet](https://skullet.lochie.me). The first load shows the `#placeholder` slot. Once the content has appeared, its layout is remembered under `id`, and later loads draw a skeleton in that exact shape, so nothing moves when the content arrives. Loads under 150ms show no skeleton at all.
4
+
5
+ Only the layout is kept, in `localStorage`, never the text. Call `forgetSkeletonShapes()` on sign-out to clear it.
6
+
7
+ Layouts over 20,000 characters of HTML aren't remembered, which a table reaches in a few rows. For those, put the content's own markup in `#placeholder` with sample text, without its data fetching or side effects: it's measured the same way, so the skeleton has the real shape on every load.
8
+
9
+ Use `TelaSkeleton` for a single placeholder block. Use `TelaSkeletonReveal` around content whose shape depends on data, such as a list.
10
+
11
+ ## Examples
12
+
13
+ ### Basic Usage
14
+
15
+ ```vue
16
+ <script setup>
17
+ import { ref } from 'vue'
18
+
19
+ const loading = ref(true)
20
+
21
+ function reload() {
22
+ loading.value = true
23
+ setTimeout(() => loading.value = false, 1200)
24
+ }
25
+
26
+ reload()
27
+ </script>
28
+
29
+ <template>
30
+ <div class="flex flex-col items-start gap-4 w-full">
31
+ <TelaButton variant="secondary" @click="reload">Reload</TelaButton>
32
+ <TelaSkeletonReveal id="docs:reveal" :loading="loading" label="Loading team" class="w-full">
33
+ <template #placeholder>
34
+ <div class="flex flex-col gap-2">
35
+ <TelaSkeleton class="h-40px" />
36
+ <TelaSkeleton class="h-40px" />
37
+ </div>
38
+ </template>
39
+ <div class="flex flex-col gap-2">
40
+ <p class="heading-h4-semibold text-primary">Team</p>
41
+ <p class="body-14-regular text-secondary">Ana Souza, product design</p>
42
+ <p class="body-14-regular text-secondary">Bruno Lima, engineering</p>
43
+ </div>
44
+ </TelaSkeletonReveal>
45
+ </div>
46
+ </template>
47
+ ```
48
+
49
+ ### Without a Placeholder
50
+
51
+ With no `#placeholder`, the first load shows a few generic lines.
52
+
53
+ ```vue
54
+ <TelaSkeletonReveal id="docs:reveal-lines" :loading="true" label="Loading" class="w-full" />
55
+ ```
56
+
57
+ ## Props
58
+
59
+ ```typescript
60
+ type SkeletonRevealProps = {
61
+ loading: boolean
62
+ id: string
63
+ label?: string
64
+ }
65
+ ```
66
+
67
+ ## Accessibility
68
+
69
+ - The wrapper is `aria-busy` while loading
70
+ - The skeleton is `aria-hidden` and `inert`, and `label` is read in its place
71
+ - Under `prefers-reduced-motion` the skeleton holds still and the content appears at once
@@ -0,0 +1,41 @@
1
+ <script setup lang="ts">
2
+ import { Skeleton } from 'skullet/vue'
3
+ import 'skullet/styles.css'
4
+
5
+ defineProps<{
6
+ /** While true the slot isn't rendered, so it can read its data as present */
7
+ loading: boolean
8
+ /** Where the shape is remembered, one per page or section (`page:templates`) */
9
+ id: string
10
+ /** Read to screen readers while it loads */
11
+ label?: string
12
+ }>()
13
+
14
+ const slots = useSlots()
15
+
16
+ // Skullet draws `sample` only when it has no shape remembered under `id`, which is what makes `#placeholder` first-visit only
17
+ const PLACEHOLDER = Symbol('placeholder')
18
+
19
+ // Same look as TelaSkeleton, so the two read as one thing on a page that mixes them
20
+ const theme = {
21
+ '--skullet-base': DT.colors.background.muted,
22
+ '--skullet-animation': 'pulse',
23
+ '--skullet-speed': 'fast',
24
+ '--skullet-radius': '4px',
25
+ }
26
+ </script>
27
+
28
+ <template>
29
+ <Skeleton
30
+ :id="id"
31
+ :data="loading ? null : true"
32
+ :sample="slots.placeholder ? PLACEHOLDER : undefined"
33
+ :label="label"
34
+ :style="theme"
35
+ >
36
+ <template #default="{ data }">
37
+ <slot v-if="data === PLACEHOLDER" name="placeholder" />
38
+ <slot v-else />
39
+ </template>
40
+ </Skeleton>
41
+ </template>
@@ -40,6 +40,7 @@ const rows: TimelineRow[] = [
40
40
  startedAt: new Date('2026-05-04T12:00:00.12Z'),
41
41
  finishedAt: new Date('2026-05-04T12:00:00.344Z'),
42
42
  durationMs: 224,
43
+ children: [],
43
44
  },
44
45
  ],
45
46
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-build",
3
- "version": "1.100.0",
3
+ "version": "1.101.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "app.config.ts",
@@ -60,6 +60,7 @@
60
60
  "remark-stringify": "11.0.0",
61
61
  "scule": "1.3.0",
62
62
  "shiki": "2.5.0",
63
+ "skullet": "0.0.3",
63
64
  "tailwind-merge": "2.5.4",
64
65
  "ts-morph": "22.0.0",
65
66
  "typescript": "5.8.2",
@@ -0,0 +1,2 @@
1
+ // The layouts TelaSkeletonReveal remembers across visits, cleared on sign-out
2
+ export { forgetShapes as forgetSkeletonShapes } from 'skullet'