vinofyi-embed 1.0.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/LICENSE +21 -0
- package/README.md +173 -0
- package/dist/embed.esm.js +1723 -0
- package/dist/embed.min.js +840 -0
- package/dist/index.d.ts +27 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FYIPedia
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# vinofyi-embed
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/vinofyi-embed)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.npmjs.com/package/vinofyi-embed)
|
|
6
|
+
[](https://bundlephobia.com/package/vinofyi-embed)
|
|
7
|
+
|
|
8
|
+
Embed **VinoFYI** beverage widgets — wines, recipes, glossary terms, and interactive tools — on any website. **8 widget types**, zero dependencies, Shadow DOM style isolation, 4 built-in themes (light, dark, sepia, auto), and live data from the [VinoFYI](https://vinofyi.com) database.
|
|
9
|
+
|
|
10
|
+
Every widget includes a "Powered by VinoFYI" backlink directing readers to the full beverage reference.
|
|
11
|
+
|
|
12
|
+
> **Try the interactive widget builder at [widget.vinofyi.com](https://widget.vinofyi.com)**
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<!-- Place widget div where you want it to appear -->
|
|
18
|
+
<div data-vinofyi="recipe" data-slug="wines" data-theme="light"></div>
|
|
19
|
+
|
|
20
|
+
<!-- Load the embed script once, anywhere on the page -->
|
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/vinofyi-embed@1/dist/embed.min.js"></script>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
That's it. The widget fetches data from the VinoFYI API and renders with full style isolation.
|
|
25
|
+
|
|
26
|
+
## Widget Types
|
|
27
|
+
|
|
28
|
+
| Type | Usage | Description |
|
|
29
|
+
|------|-------|-------------|
|
|
30
|
+
| `recipe` | `<div data-vinofyi="recipe" data-slug="..."></div>` | Recipe/entity card — ingredients, technique, ABV, glass type |
|
|
31
|
+
| `compare` | `<div data-vinofyi="compare" data-slug="..."></div>` | Side-by-side comparison of beverages or styles |
|
|
32
|
+
| `glossary` | `<div data-vinofyi="glossary" data-slug="..."></div>` | Glossary term definition with cross-references |
|
|
33
|
+
| `faq` | `<div data-vinofyi="faq" data-slug="..."></div>` | FAQ accordion for common beverage questions |
|
|
34
|
+
| `guide` | `<div data-vinofyi="guide" data-slug="..."></div>` | Tasting, brewing, or pairing guide summary |
|
|
35
|
+
| `ingredient` | `<div data-vinofyi="ingredient" data-slug="..."></div>` | Ingredient/variety card — spirit, grape, hop, coffee origin |
|
|
36
|
+
| `pairing` | `<div data-vinofyi="pairing" data-slug="..."></div>` | Food pairing suggestions — "What goes with...?" |
|
|
37
|
+
| `search` | `<div data-vinofyi="search" data-slug="..."></div>` | Search box linking to the full beverage database |
|
|
38
|
+
|
|
39
|
+
## Widget Options
|
|
40
|
+
|
|
41
|
+
| Attribute | Values | Default | Description |
|
|
42
|
+
|-----------|--------|---------|-------------|
|
|
43
|
+
| `data-vinofyi` | recipe, compare, glossary, faq, guide, ingredient, pairing, search | required | Widget type |
|
|
44
|
+
| `data-slug` | e.g. "wines" | — | Entity slug from the VinoFYI database |
|
|
45
|
+
| `data-theme` | light, dark, sepia, auto | light | Visual theme (`auto` follows OS preference) |
|
|
46
|
+
| `data-style` | modern, classic | modern | Widget design style |
|
|
47
|
+
| `data-size` | default, compact, large | default | Widget size |
|
|
48
|
+
| `data-placeholder` | any string | "Search Wines..." | Search box placeholder |
|
|
49
|
+
|
|
50
|
+
## Themes
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<!-- Light (default) -->
|
|
54
|
+
<div data-vinofyi="recipe" data-slug="wines" data-theme="light"></div>
|
|
55
|
+
|
|
56
|
+
<!-- Dark -->
|
|
57
|
+
<div data-vinofyi="recipe" data-slug="wines" data-theme="dark"></div>
|
|
58
|
+
|
|
59
|
+
<!-- Sepia -->
|
|
60
|
+
<div data-vinofyi="recipe" data-slug="wines" data-theme="sepia"></div>
|
|
61
|
+
|
|
62
|
+
<!-- Auto — follows OS dark/light preference -->
|
|
63
|
+
<div data-vinofyi="recipe" data-slug="wines" data-theme="auto"></div>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Web Components (Custom Elements)
|
|
67
|
+
|
|
68
|
+
As an alternative to `data-*` attributes, you can use native HTML custom elements:
|
|
69
|
+
|
|
70
|
+
```html
|
|
71
|
+
<!-- Custom element form -->
|
|
72
|
+
<vinofyi-recipe slug="wines" theme="light"></vinofyi-recipe>
|
|
73
|
+
<vinofyi-compare slugs="wines,other-slug"></vinofyi-compare>
|
|
74
|
+
<vinofyi-search placeholder="Search Wines..."></vinofyi-search>
|
|
75
|
+
|
|
76
|
+
<script src="https://cdn.jsdelivr.net/npm/vinofyi-embed@1/dist/embed.min.js"></script>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Use `style-variant` (not `style`) to avoid conflicts with the HTML reserved `style` attribute.
|
|
80
|
+
|
|
81
|
+
## Examples
|
|
82
|
+
|
|
83
|
+
### Recipe Card
|
|
84
|
+
|
|
85
|
+
```html
|
|
86
|
+
<div data-vinofyi="recipe" data-slug="wines" data-theme="light"></div>
|
|
87
|
+
<script src="https://cdn.jsdelivr.net/npm/vinofyi-embed@1/dist/embed.min.js"></script>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Side-by-Side Comparison
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<div data-vinofyi="compare" data-slugs="wines,other-slug"></div>
|
|
94
|
+
<script src="https://cdn.jsdelivr.net/npm/vinofyi-embed@1/dist/embed.min.js"></script>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Search Box
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<div data-vinofyi="search" data-placeholder="Search Wines..."></div>
|
|
101
|
+
<script src="https://cdn.jsdelivr.net/npm/vinofyi-embed@1/dist/embed.min.js"></script>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Glossary Term
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<div data-vinofyi="glossary" data-slug="example-term" data-theme="light"></div>
|
|
108
|
+
<script src="https://cdn.jsdelivr.net/npm/vinofyi-embed@1/dist/embed.min.js"></script>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## CDN Options
|
|
112
|
+
|
|
113
|
+
### jsDelivr (recommended — global CDN, auto-updates with npm)
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<script src="https://cdn.jsdelivr.net/npm/vinofyi-embed@1/dist/embed.min.js"></script>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Specific version (production stability)
|
|
120
|
+
|
|
121
|
+
```html
|
|
122
|
+
<script src="https://cdn.jsdelivr.net/npm/vinofyi-embed@1.0.0/dist/embed.min.js"></script>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### npm (for bundlers)
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm install vinofyi-embed
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
import 'vinofyi-embed';
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Technical Details
|
|
136
|
+
|
|
137
|
+
- **Shadow DOM**: Complete style isolation — no CSS conflicts with your site
|
|
138
|
+
- **Zero dependencies**: No jQuery, React, or any external library
|
|
139
|
+
- **Geist Sans**: Body text uses Geist Sans for a clean, modern look
|
|
140
|
+
- **System fonts**: Fallback to system-ui — no extra font requests
|
|
141
|
+
- **CORS**: VinoFYI API has CORS enabled for all origins
|
|
142
|
+
- **MutationObserver**: Works with dynamically added elements (SPAs)
|
|
143
|
+
- **IntersectionObserver**: Lazy loading — widgets only fetch when entering viewport (200px margin)
|
|
144
|
+
- **Bundle size**: ~10-16KB gzipped (per-site build — only includes tools available on VinoFYI)
|
|
145
|
+
|
|
146
|
+
## Learn More About Wines
|
|
147
|
+
|
|
148
|
+
Visit [vinofyi.com](https://vinofyi.com) — VinoFYI is a comprehensive wines reference with recipes, tasting notes, interactive tools, and beverage guides.
|
|
149
|
+
|
|
150
|
+
- **API docs**: [vinofyi.com/developers/](https://vinofyi.com/developers/)
|
|
151
|
+
- **Widget builder**: [widget.vinofyi.com](https://widget.vinofyi.com)
|
|
152
|
+
- **npm package**: [npmjs.com/package/vinofyi-embed](https://www.npmjs.com/package/vinofyi-embed)
|
|
153
|
+
- **GitHub**: [github.com/fyipedia/vinofyi-embed](https://github.com/fyipedia/vinofyi-embed)
|
|
154
|
+
|
|
155
|
+
## Beverage FYI Family
|
|
156
|
+
|
|
157
|
+
Part of [FYIPedia](https://fyipedia.com) — open-source developer tools ecosystem. Beverage FYI covers world beverages — cocktails, wine, beer, whiskey, sake, tea, and coffee.
|
|
158
|
+
|
|
159
|
+
| Site | Domain | Focus | Package |
|
|
160
|
+
|------|--------|-------|---------|
|
|
161
|
+
| CocktailFYI | [cocktailfyi.com](https://cocktailfyi.com) | 636 cocktails, ABV, calories, flavor profiles, glass types | [npm](https://www.npmjs.com/package/cocktailfyi-embed) |
|
|
162
|
+
| **VinoFYI** | [vinofyi.com](https://vinofyi.com) | Wines, grapes, regions, wineries, food pairings | **[npm](https://www.npmjs.com/package/vinofyi-embed)** |
|
|
163
|
+
| BeerFYI | [beerfyi.com](https://beerfyi.com) | 113 beer styles, hops, malts, yeast, BJCP guide | [npm](https://www.npmjs.com/package/beerfyi-embed) |
|
|
164
|
+
| BrewFYI | [brewfyi.com](https://brewfyi.com) | 72 coffee varieties, roasting, 21 brew methods | [npm](https://www.npmjs.com/package/brewfyi-embed) |
|
|
165
|
+
| WhiskeyFYI | [whiskeyfyi.com](https://whiskeyfyi.com) | 2,200+ whiskey expressions, distilleries, regions | [npm](https://www.npmjs.com/package/whiskeyfyi-embed) |
|
|
166
|
+
| TeaFYI | [teafyi.com](https://teafyi.com) | 60+ tea varieties, teaware, brewing guides | [npm](https://www.npmjs.com/package/teafyi-embed) |
|
|
167
|
+
| NihonshuFYI | [nihonshufyi.com](https://nihonshufyi.com) | 80 sake, rice varieties, 50 breweries | [npm](https://www.npmjs.com/package/nihonshufyi-embed) |
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT — see [LICENSE](./LICENSE).
|
|
172
|
+
|
|
173
|
+
Built with care by [FYIPedia](https://fyipedia.com).
|