@todovue/tv-ui 0.1.0 → 0.1.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.
Files changed (48) hide show
  1. package/README.md +20 -20
  2. package/dist/entry.d.ts +2 -2
  3. package/dist/tv-ui.cjs.js +1 -1
  4. package/dist/tv-ui.css +1 -1
  5. package/dist/tv-ui.es.js +50 -49
  6. package/package.json +1 -1
  7. package/dist/.htaccess +0 -8
  8. package/dist/demos/tv-alert/CHANGELOG.md +0 -127
  9. package/dist/demos/tv-alert/README.md +0 -334
  10. package/dist/demos/tv-article/CHANGELOG.md +0 -221
  11. package/dist/demos/tv-article/README.md +0 -258
  12. package/dist/demos/tv-breadcrumbs/CHANGELOG.md +0 -135
  13. package/dist/demos/tv-breadcrumbs/README.md +0 -364
  14. package/dist/demos/tv-button/CHANGELOG.md +0 -158
  15. package/dist/demos/tv-button/README.md +0 -255
  16. package/dist/demos/tv-card/CHANGELOG.md +0 -158
  17. package/dist/demos/tv-card/README.md +0 -332
  18. package/dist/demos/tv-demo/CHANGELOG.md +0 -352
  19. package/dist/demos/tv-demo/README.md +0 -229
  20. package/dist/demos/tv-footer/CHANGELOG.md +0 -67
  21. package/dist/demos/tv-footer/README.md +0 -760
  22. package/dist/demos/tv-hero/CHANGELOG.md +0 -137
  23. package/dist/demos/tv-hero/README.md +0 -410
  24. package/dist/demos/tv-label/CHANGELOG.md +0 -138
  25. package/dist/demos/tv-label/README.md +0 -357
  26. package/dist/demos/tv-menu/CHANGELOG.md +0 -145
  27. package/dist/demos/tv-menu/README.md +0 -389
  28. package/dist/demos/tv-modal/CHANGELOG.md +0 -127
  29. package/dist/demos/tv-modal/README.md +0 -466
  30. package/dist/demos/tv-pagination/CHANGELOG.md +0 -125
  31. package/dist/demos/tv-pagination/README.md +0 -275
  32. package/dist/demos/tv-progress-bar/CHANGELOG.md +0 -84
  33. package/dist/demos/tv-progress-bar/README.md +0 -894
  34. package/dist/demos/tv-relative-time/CHANGELOG.md +0 -122
  35. package/dist/demos/tv-relative-time/README.md +0 -405
  36. package/dist/demos/tv-scroll-top/CHANGELOG.md +0 -69
  37. package/dist/demos/tv-scroll-top/README.md +0 -445
  38. package/dist/demos/tv-search/CHANGELOG.md +0 -155
  39. package/dist/demos/tv-search/README.md +0 -407
  40. package/dist/demos/tv-settings/CHANGELOG.md +0 -94
  41. package/dist/demos/tv-settings/README.md +0 -314
  42. package/dist/demos/tv-sidebar/CHANGELOG.md +0 -229
  43. package/dist/demos/tv-sidebar/README.md +0 -592
  44. package/dist/demos/tv-theme-button/CHANGELOG.md +0 -136
  45. package/dist/demos/tv-theme-button/README.md +0 -392
  46. package/dist/demos/tv-toc/CHANGELOG.md +0 -80
  47. package/dist/demos/tv-toc/README.md +0 -288
  48. package/dist/favicon.ico +0 -0
@@ -1,258 +0,0 @@
1
- <p align="center"><img width="150" src="https://res.cloudinary.com/dcdfhi8qz/image/upload/v1763663056/uqqtkgp1lg3xdplutpga.png" alt="TODOvue logo"></p>
2
-
3
- # TODOvue Article (TvArticle)
4
- A Vue 3 component to display rich article content with polished typography, optional cover image, metadata (date, reading time, tags), and copyable heading anchors. Works in SPA and SSR (e.g., Nuxt 4) and injects styles automatically.
5
-
6
- [![npm](https://img.shields.io/npm/v/@todovue/tv-article.svg)](https://www.npmjs.com/package/@todovue/tv-article)
7
- [![npm downloads](https://img.shields.io/npm/dm/@todovue/tv-article.svg)](https://www.npmjs.com/package/@todovue/tv-article)
8
- [![npm total downloads](https://img.shields.io/npm/dt/@todovue/tv-article.svg)](https://www.npmjs.com/package/@todovue/tv-article)
9
- ![License](https://img.shields.io/github/license/TODOvue/tv-article)
10
- ![Release Date](https://img.shields.io/github/release-date/TODOvue/tv-article)
11
- ![Bundle Size](https://img.shields.io/bundlephobia/minzip/@todovue/tv-article)
12
- ![Node Version](https://img.shields.io/node/v/@todovue/tv-article)
13
- ![Last Commit](https://img.shields.io/github/last-commit/TODOvue/tv-article)
14
- ![Stars](https://img.shields.io/github/stars/TODOvue/tv-article?style=social)
15
- > Demo: https://ui.todovue.blog/article
16
-
17
- ## Table of Contents
18
- - [Features](#features)
19
- - [Installation](#installation)
20
- - [Quick Start (SPA)](#quick-start-spa)
21
- - [Nuxt 4 / SSR Usage](#nuxt-4--ssr-usage)
22
- - [Component Registration Options](#component-registration-options)
23
- - [Props](#props)
24
- - [Events](#events)
25
- - [Slots](#slots)
26
- - [Customization (Styles / UI)](#customization-styles--ui)
27
- - [Accessibility](#accessibility)
28
- - [SSR Notes](#ssr-notes)
29
- - [Examples](#examples)
30
- - [Development](#development)
31
- - [Contributing](#contributing)
32
- - [License](#license)
33
-
34
- ## Features
35
- - Polished prose typography for long content (paragraphs, lists, tables, quotes, code, images, etc.).
36
- - H2–H4 headings get a “copy link” anchor button with localized feedback text.
37
- - Optional metadata: date (rendered with relative-time component), reading time (estimated or forced), and colored tags.
38
- - Cover image with `loading`, `decoding`, `fetchpriority` and aspect ratio control.
39
- - Configurable layout: centered container and prose width (`sm`, `base`, `md`, `lg`, `full`).
40
- - Slots for header/before/after/footer; default slot used when `content.body` is not provided.
41
- - External links safety: open in a new tab with `rel="noopener noreferrer"` automatically.
42
- - CSS auto-injected via JS: no manual CSS import required.
43
-
44
- Internal deps: uses `@todovue/tv-label` (tags) and `@todovue/tv-relative-time` (date). You only need to install `@todovue/tv-article`.
45
-
46
- ## Installation
47
- Using npm:
48
- ```bash
49
- npm install @todovue/tv-article
50
- ```
51
- Using yarn:
52
- ```bash
53
- yarn add @todovue/tv-article
54
- ```
55
- Using pnpm:
56
- ```bash
57
- pnpm add @todovue/tv-article
58
- ```
59
- Peer: Vue ^3.
60
-
61
- ## Quick Start (SPA)
62
- **Important**: You must explicitly import the stylesheet in your application.
63
-
64
- Global registration (main.js / main.ts):
65
- ```js
66
- import { createApp } from 'vue'
67
- import App from './App.vue'
68
-
69
- import { TvArticle } from '@todovue/tv-article'
70
- import '@todovue/tv-article/style.css' // import styles
71
- import '@todovue/tv-label/style.css' // tv-article depends on tv-label
72
-
73
- const app = createApp(App)
74
- app.component('TvArticle', TvArticle)
75
- app.mount('#app')
76
- ```
77
- Local import inside a component:
78
- ```vue
79
- <script setup>
80
- import { TvArticle } from '@todovue/tv-article'
81
- import '@todovue/tv-article/style.css'
82
-
83
- const article = {
84
- title: 'Introduction to Vue 3',
85
- description: 'Key concepts and the Composition API',
86
- date: '2025-10-15',
87
- readingTime: 8, // optional; if missing, it is estimated from body
88
- tags: [ 'Vue', { tag: 'JavaScript', color: '#F7DF1E' } ],
89
- body: `
90
- <h2 id="what-is-vue">What is Vue?</h2>
91
- <p>Provide safe HTML to v-html…</p>
92
- `
93
- }
94
- </script>
95
-
96
- <template>
97
- <TvArticle :content="article" lang="en"></TvArticle>
98
- </template>
99
- ```
100
-
101
- ## Nuxt 4 / SSR Usage
102
- Create a plugin file: `plugins/tv-article.client.ts` (or without suffix; SSR-safe since DOM access happens in `onMounted`):
103
- ```ts
104
- // nuxt.config.ts
105
- export default defineNuxtConfig({
106
- modules: [
107
- '@todovue/tv-card/nuxt'
108
- ]
109
- })
110
- ```
111
- Use anywhere:
112
- ```vue
113
- <TvArticle :content="{ title: 'Post', body: '<p>Hello</p>' }"></TvArticle>
114
- ```
115
-
116
- ## Component Registration Options
117
- | Approach | When to use |
118
- |------------------------------------------|------------------------------------------------|
119
- | Global via `app.use(TvArticle)` | Many usages across app / design system install |
120
- | Local named import `{ TvArticle }` | Isolated or code-split contexts |
121
- | Direct default import `import TvArticle` | Single usage or manual registration |
122
-
123
- ## Props
124
- All content is expected to be safe HTML for `content.body` (it is rendered via `v-html`).
125
-
126
- - Prop: `content` (Object) [default: `{ title: '', body: '' }`]
127
- - title: string
128
- - description: string
129
- - date: string | Date (rendered relatively via `@todovue/tv-relative-time`)
130
- - readingTime: number (minutes; if omitted, estimated at ~200 wpm)
131
- - tags: Array<string | { tag: string, color?: string }>
132
- - cover: string (image URL)
133
- - coverAlt: string
134
- - coverCaption: string
135
- - body: string (HTML)
136
-
137
- - Prop: `ui` (Object) [defaults below]
138
- - showTitle: boolean (true)
139
- - showMeta: boolean (true)
140
- - showCover: boolean (true)
141
- - center: boolean (true)
142
- - proseSize: 'sm' | 'base' | 'md' | 'lg' | 'full' ('full')
143
- - coverLoading: 'lazy' | 'eager' ('lazy')
144
- - coverDecoding: 'async' | 'sync' ('async')
145
- - coverFetchPriority: 'auto' | 'high' | 'low' ('auto')
146
- - coverAspect: string | null (e.g., '16 / 9')
147
-
148
- - Prop: `lang` (String) [default: 'en']
149
- - Affects reading time text and anchor button labels ('en', 'es', 'fr', 'pt').
150
-
151
- ## Events
152
- | Event (kebab) | Payload | Description |
153
- |------------------|---------------------|--------------------------------------------|
154
- | `anchor-copied` | `string` (anchorId) | Emitted when a heading link is copied |
155
-
156
- Usage:
157
- ```vue
158
- <TvArticle @anchor-copied="onCopied"></TvArticle>
159
- ```
160
- ```js
161
- function onCopied(id) {
162
- console.log('Anchor copied:', id)
163
- }
164
- ```
165
-
166
- ## Slots
167
- - `header`: Replace the entire header (title, description, meta, cover). If not provided, TvArticle renders the header based on `ui` and `content`.
168
- - `before`: Content before the article body.
169
- - `after`: Content after the article body.
170
- - `footer`: Footer area (author, share, etc.).
171
- - default: When `content.body` is missing, the default slot is rendered inside the prose container.
172
-
173
- ## Customization (Styles / UI)
174
- - Styles: the package injects CSS automatically when you import the component (no extra CSS import needed).
175
- - Layout: control width with `ui.proseSize` and centering with `ui.center`.
176
- - Cover: adjust `ui.coverAspect`, `coverLoading`, `coverDecoding`, and `coverFetchPriority`.
177
- - Tags: `content.tags` accepts strings or `{ tag, color }` objects.
178
- - For deeper theming, override the `.tv-article*` classes in your app.
179
-
180
- ## Accessibility
181
- - `aria-labelledby` is applied to `<article>` when a title is present.
182
- - Anchor button on H2–H4 with localized `aria-label`/`title` and copied feedback.
183
- - External links are marked with `target="_blank"` and `rel="noopener noreferrer"` for safety.
184
-
185
- ## SSR Notes
186
- - No DOM access during `setup`; enhancements (anchors/links) happen in `onMounted`, making it SSR-safe.
187
- - Styles are injected on the client via JS; no need to import CSS manually.
188
-
189
- ## Examples
190
- Basic:
191
- ```vue
192
- <TvArticle :content="{
193
- title: 'Introduction to Vue 3',
194
- date: '2025-10-15',
195
- readingTime: 8,
196
- tags: ['Vue', 'JavaScript'],
197
- body: '<h2 id=&quot;what-is&quot;>What is it?</h2><p>…</p>'
198
- }" lang="en"></TvArticle>
199
- ```
200
- With cover and aspect ratio:
201
- ```vue
202
- <TvArticle
203
- :content="{
204
- title: 'Nuxt Content Guide',
205
- description: 'Build blogs and docs',
206
- date: '2025-10-20',
207
- readingTime: 12,
208
- tags: ['Nuxt', 'Markdown'],
209
- cover: 'https://images.unsplash.com/photo-1499750310107-5fef28a66643?w=1200&h=675&fit=crop',
210
- coverAlt: 'Laptop with code',
211
- coverCaption: 'Content with cover image',
212
- body: '<h2 id=&quot;intro&quot;>Introduction</h2><p>…</p>'
213
- }"
214
- :ui="{ coverAspect: '16 / 9', center: true }"
215
- ></TvArticle>
216
- ```
217
- Custom UI + footer slot:
218
- ```vue
219
- <TvArticle
220
- :content="{ title: 'Typography', body: '<h2 id=&quot;h2&quot;>H2</h2><p>…</p>' }"
221
- :ui="{ proseSize: 'lg', center: true }"
222
- @anchor-copied="id => console.log(id)"
223
- >
224
- <template #footer>
225
- <hr />
226
- <small>Author: TvArticle Team</small>
227
- </template>
228
- </TvArticle>
229
- ```
230
- Minimal:
231
- ```vue
232
- <TvArticle :content="{ title: 'Minimal', body: '<p>Only content</p>' }" :ui="{ showMeta: false, showCover: false, proseSize: 'base' }"></TvArticle>
233
- ```
234
-
235
- ## Development
236
- ```bash
237
- git clone https://github.com/TODOvue/tv-article.git
238
- cd tv-article
239
- npm install
240
- npm run dev # demo playground with Vite
241
- npm run build # library build (ESM/CJS + d.ts)
242
- npm run build:demo # demo site build (dist-demo)
243
- ```
244
- The library marks `vue` as external and generates `dist/tv-article.es.js`, `dist/tv-article.cjs.js`, `dist/tv-article.css`, and type definitions.
245
-
246
- ### Notes
247
- - `content.body` is rendered with `v-html`: provide sanitized HTML if it comes from Markdown or external sources.
248
- - Reading time falls back to an estimation of ~200 wpm when `readingTime` is not provided.
249
- - Supported internal locales for UI text: `en`, `es`, `fr`, `pt`.
250
-
251
- ## Contributing
252
- PRs and issues welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md).
253
-
254
- ## License
255
- MIT © TODOvue
256
-
257
- ### Attributions
258
- Crafted for the TODOvue component ecosystem
@@ -1,135 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `@todovue/tv-breadcrumbs` will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [1.1.4] - 2026-01-27
9
-
10
- ### Changed
11
- - Simplified the file list in `package.json` to include only essential assets.
12
- - Simplified the build configuration by removing demo-specific logic.
13
- - Enhanced GitHub Actions workflows to automate npm package publishing and GitHub release creation.
14
- - Moved the `@todovue/tv-demo` component import from main.js to `Demo.vue` to localize its usage.
15
- - Updated build commands to include `README.md` and `CHANGELOG.md` files in the public directory during the build process.
16
-
17
- ### Added
18
- - Included the `src` directory in the `package.json` files list to ensure component source files are bundled in the package distribution.
19
-
20
- ### Removed
21
- - Eliminated the global import of the `@todovue/tv-demo` component from `main.js`.
22
-
23
- ### Dependencies
24
- - Updated `@todovue/tv-demo` to `^1.4.11`.
25
- - Updated `vue` to `^3.5.27`.
26
- - Updated `sass` to `^1.97.3`.
27
-
28
- ## [1.1.3] - 2026-01-20
29
-
30
- ### Added
31
- - Added support for icons in breadcrumb items via the `icon` property.
32
- - Added interactive dropdown for truncated items (when using `maxItems`), allowing users to access hidden links.
33
- - Added `activeLink` prop to optionally render the current page item as a clickable link.
34
-
35
- ### Dependencies
36
- - Updated the `@todovue/tv-demo` dependency to `^1.4.4`.
37
- - Updated the `sass` dependency to `^1.97.2`.
38
- - Updated the `vite` dependency to `^7.3.1`.
39
-
40
- ## [1.1.2] - 2025-12-27
41
-
42
- ### Added
43
- - Added automatic publishing to the TODOvue cPanel in `release.yml` for each release, simplifying package distribution and updates.
44
- - Added `package-lock.json` to the repository to ensure dependency consistency and facilitate version management across development and production environments.
45
-
46
- ### Changed
47
- - Changed the `base` option in `vite.config.js` for website deployment in cpanel.
48
-
49
- ### Fixed
50
- - Fixed repository URL in `package.json` to point to the correct GitHub repository.
51
- - Fixed the token configuration used to generate the package in the GitHub Actions workflow `release.yml`.
52
-
53
- ### Dependencies
54
- - Updated dependency versions in `package.json` to maintain compatibility and benefit from improvements and bug fixes in the used libraries.
55
-
56
- ## [1.1.1] - 2025-11-24
57
-
58
- ### Changed
59
- - Updated background and text colors for dark and light themes to improve readability and visual comfort.
60
- - Removed `_variables.scss` file as it is no longer needed.
61
-
62
- ### Dependencies
63
- - Updated the `@todovue/tv-demo` dependency to `^1.2.2` to ensure compatibility with the latest changes.
64
-
65
- ## [1.1.0] - 2025-11-21
66
-
67
- ### Added
68
- - Added `nux.js` configuration file for Nuxt 4 integration.
69
- - Added `tsconfig.json` for proper type checking during build.
70
- - Create `global.d.ts` to declare module for TypeScript users.
71
- - Added Nuxt module for automatic style injection and auto-registration of the `TvBreadcrumbs` component.
72
- - The `@todovue/tv-breadcrumbs` component is now externalized from the final build, reducing bundle size.
73
- - Added `CHANGELOG.md` in script to generate demo and documentation site.
74
-
75
- ### Dependencies
76
- - Updated the `@todovue/tv-demo` dependency to `^1.2.1` to ensure compatibility with the latest changes.
77
-
78
- ## [1.0.1] - 2025-11-15
79
-
80
- ### Changed
81
- - Styles are now served as a separate CSS file (`dist/tv-breadcrumbs.css`) generated by Vite during the build process.
82
- - Users must now explicitly import the stylesheet in their application:
83
- - For Vue/Vite SPA: `import '@todovue/tv-breadcrumbs/style.css'` in `main.ts`
84
- - For Nuxt 3/4: Add `'@todovue/tv-breadcrumbs/style.css'` to the `css` array in `nuxt.config.ts`
85
-
86
- ### Added
87
- - Added `sideEffects` field to `package.json` to support proper tree-shaking with CSS files.
88
- - Added `./style.css` export path in `package.json` for explicit CSS imports.
89
- - Improved SSR/SSG compatibility, especially for Nuxt 3/4 applications.
90
-
91
- ### Dependencies
92
- - Removed dependency on `vite-plugin-css-injected-by-js` from `devDependencies`
93
-
94
- ## [1.0.0] - 2025-11-08
95
-
96
- ### Added
97
- - Initial release of TvBreadcrumbs component
98
- - Manual breadcrumb items via `items` prop
99
- - Auto-generation mode from Vue Router routes (`autoGenerate` prop)
100
- - Custom separator support via `separator` prop (default: `›`)
101
- - Max items control with ellipsis collapse (`maxItems` prop)
102
- - Customizable home label for auto-generated breadcrumbs (`homeLabel` prop)
103
- - ARIA accessibility label customization (`ariaLabel` prop)
104
- - `item-click` event emitted when breadcrumb item is clicked
105
- - `navigate` event emitted when router navigation occurs
106
- - Three customizable slots:
107
- - `item` - Customize breadcrumb link rendering
108
- - `current` - Customize current (last) item rendering
109
- - `separator` - Customize separator rendering
110
- - Full Vue Router integration with automatic detection
111
- - Route meta breadcrumb support (string, array, or function)
112
- - Disabled item state support
113
- - Full ARIA accessibility support:
114
- - Semantic HTML structure (`<nav>`, `<ol>`, `<li>`)
115
- - `aria-current="page"` for current item
116
- - `aria-disabled` for disabled items
117
- - `aria-hidden` for separators
118
- - Schema.org structured data markup for SEO
119
- - SSR-ready implementation (works with Nuxt 3)
120
- - BEM-style CSS classes for easy customization
121
- - Keyboard navigation support
122
- - Responsive SCSS styling
123
- - TypeScript definitions
124
- - Plugin installation support
125
- - Composable architecture with `useBreadcrumb`
126
- - Auto-normalization of breadcrumb items
127
- - Path segment humanization (converts kebab-case to Title Case)
128
-
129
- [1.1.4]: https://github.com/TODOvue/tv-breadcrumbs/pull/7/files
130
- [1.1.3]: https://github.com/TODOvue/tv-breadcrumbs/pull/6/files
131
- [1.1.2]: https://github.com/TODOvue/tv-breadcrumbs/pull/5/files
132
- [1.1.1]: https://github.com/TODOvue/tv-breadcrumbs/pull/4/files
133
- [1.1.0]: https://github.com/TODOvue/tv-breadcrumbs/pull/3/files
134
- [1.0.1]: https://github.com/TODOvue/tv-breadcrumbs/pull/2/files
135
- [1.0.0]: https://github.com/TODOvue/tv-breadcrumbs/pull/1/files