@meistrari/tela-build 1.100.0 → 1.101.0
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,10 @@
|
|
|
2
2
|
|
|
3
3
|
Latest updates and announcements.
|
|
4
4
|
|
|
5
|
+
## November 6, 2026
|
|
6
|
+
|
|
7
|
+
- [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.
|
|
8
|
+
|
|
5
9
|
## November 5, 2026
|
|
6
10
|
|
|
7
11
|
- [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.
|
|
@@ -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>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meistrari/tela-build",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.101.0",
|
|
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",
|