cablefyi-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 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,158 @@
1
+ # cablefyi-embed
2
+
3
+ [![npm](https://img.shields.io/npm/v/cablefyi-embed)](https://www.npmjs.com/package/cablefyi-embed)
4
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue)](https://www.typescriptlang.org/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
6
+ [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](https://www.npmjs.com/package/cablefyi-embed)
7
+
8
+ Embed **CableFYI** widgets — cables, glossary terms, interactive tools, and inline elements — on any website. **9 widget types**, zero dependencies, Shadow DOM style isolation, 4 built-in themes (light, dark, sepia, auto), 2 styles (modern, clean), and live data from the [CableFYI](https://cablefyi.com) database.
9
+
10
+ Every widget includes a "Powered by CableFYI" backlink directing readers to the full reference.
11
+
12
+ > **Try the interactive widget builder at [widget.cablefyi.com](https://widget.cablefyi.com)**
13
+
14
+ ## Quick Start
15
+
16
+ ```html
17
+ <!-- Place widget div where you want it to appear -->
18
+ <div data-cablefyi="entity" data-slug="cables" data-theme="light"></div>
19
+
20
+ <!-- Load the embed script once, anywhere on the page -->
21
+ <script src="https://cdn.jsdelivr.net/npm/cablefyi-embed@1/dist/embed.min.js"></script>
22
+ ```
23
+
24
+ That's it. The widget fetches data from the CableFYI API and renders with full style isolation.
25
+
26
+ ## Widget Types
27
+
28
+ | Type | Usage | Description |
29
+ |------|-------|-------------|
30
+ | `entity` | `<div data-cablefyi="entity" data-slug="..."></div>` | Entity detail card — cable, ASN, or status code |
31
+ | `glossary` | `<div data-cablefyi="glossary" data-slug="..."></div>` | Glossary term definition with cross-references |
32
+ | `search` | `<div data-cablefyi="search" data-slug="..."></div>` | Search box linking to the full database |
33
+ | `compare` | `<div data-cablefyi="compare" data-slug="..."></div>` | Side-by-side entity comparison |
34
+ | `faq` | `<div data-cablefyi="faq" data-slug="..."></div>` | FAQ accordion with expand/collapse |
35
+ | `connector` | `<div data-cablefyi="connector" data-slug="..."></div>` | Connector type card — pin count, reversible, form factor |
36
+ | `standard` | `<div data-cablefyi="standard" data-slug="..."></div>` | Standard/protocol card — speed, power, video |
37
+ | `compatibility` | `<div data-cablefyi="compatibility" data-slug="..."></div>` | Connector A <-> B compatibility check (adapter needed?) |
38
+ | `speed-bar` | `<div data-cablefyi="speed-bar" data-slug="..."></div>` | Inline data rate visualization bar (Gbps) |
39
+
40
+ ## Widget Options
41
+
42
+ | Attribute | Values | Default | Description |
43
+ |-----------|--------|---------|-------------|
44
+ | `data-cablefyi` | entity, compare, glossary, search, faq, [tools] | required | Widget type |
45
+ | `data-slug` | e.g. "cables" | — | Entity slug from the CableFYI database |
46
+ | `data-theme` | light, dark, sepia, auto | light | Visual theme (`auto` follows OS preference) |
47
+ | `data-style-variant` | modern, clean | modern | Widget design style |
48
+ | `data-size` | default, compact, large | default | Widget size |
49
+ | `data-placeholder` | any string | "Search Cables..." | Search box placeholder |
50
+
51
+ ## Themes
52
+
53
+ ```html
54
+ <!-- Light (default) -->
55
+ <div data-cablefyi="entity" data-slug="cables" data-theme="light"></div>
56
+
57
+ <!-- Dark -->
58
+ <div data-cablefyi="entity" data-slug="cables" data-theme="dark"></div>
59
+
60
+ <!-- Sepia -->
61
+ <div data-cablefyi="entity" data-slug="cables" data-theme="sepia"></div>
62
+
63
+ <!-- Auto — follows OS dark/light preference -->
64
+ <div data-cablefyi="entity" data-slug="cables" data-theme="auto"></div>
65
+ ```
66
+
67
+ ## Styles
68
+
69
+ ```html
70
+ <!-- Modern (default) — gradient header, rounded cards, accent colors -->
71
+ <div data-cablefyi="entity" data-slug="cables" data-style-variant="modern"></div>
72
+
73
+ <!-- Clean — minimal borders, data-first aesthetic -->
74
+ <div data-cablefyi="entity" data-slug="cables" data-style-variant="clean"></div>
75
+ ```
76
+
77
+ ## Web Components (Custom Elements)
78
+
79
+ ```html
80
+ <cablefyi-entity slug="cables" theme="light"></cablefyi-entity>
81
+ <cablefyi-compare slug-a="item-a" slug-b="item-b"></cablefyi-compare>
82
+ <cablefyi-search placeholder="Search Cables..."></cablefyi-search>
83
+
84
+ <script src="https://cdn.jsdelivr.net/npm/cablefyi-embed@1/dist/embed.min.js"></script>
85
+ ```
86
+
87
+ Use `style-variant` (not `style`) to avoid conflicts with the HTML reserved `style` attribute.
88
+
89
+ ## CDN Options
90
+
91
+ ### jsDelivr (recommended)
92
+
93
+ ```html
94
+ <script src="https://cdn.jsdelivr.net/npm/cablefyi-embed@1/dist/embed.min.js"></script>
95
+ ```
96
+
97
+ ### Specific version
98
+
99
+ ```html
100
+ <script src="https://cdn.jsdelivr.net/npm/cablefyi-embed@1.0.0/dist/embed.min.js"></script>
101
+ ```
102
+
103
+ ### npm (for bundlers)
104
+
105
+ ```bash
106
+ npm install cablefyi-embed
107
+ ```
108
+
109
+ ```javascript
110
+ import 'cablefyi-embed';
111
+ ```
112
+
113
+ ## Technical Details
114
+
115
+ - **Shadow DOM**: Complete style isolation — no CSS conflicts with your site
116
+ - **Zero dependencies**: No jQuery, React, or any external library
117
+ - **2 styles**: Modern (accent gradients) and Clean (minimal, data-first)
118
+ - **4 themes**: Light, Dark, Sepia, Auto (OS preference detection)
119
+ - **CORS**: CableFYI API has CORS enabled for all origins
120
+ - **MutationObserver**: Works with dynamically added elements (SPAs)
121
+ - **IntersectionObserver**: Lazy loading — widgets only fetch when entering viewport (200px margin)
122
+ - **Rich Snippets**: DefinedTerm JSON-LD injected for glossary widgets
123
+ - **Bundle size**: Tree-shaken per site — only includes tools available on CableFYI
124
+
125
+ ## Learn More About Cables
126
+
127
+ Visit [cablefyi.com](https://cablefyi.com) — CableFYI is a comprehensive cables reference with interactive tools, guides, and developer resources.
128
+
129
+ - **API docs**: [cablefyi.com/developers/](https://cablefyi.com/developers/)
130
+ - **Widget builder**: [widget.cablefyi.com](https://widget.cablefyi.com)
131
+ - **npm package**: [npmjs.com/package/cablefyi-embed](https://www.npmjs.com/package/cablefyi-embed)
132
+ - **GitHub**: [github.com/fyipedia/cablefyi-embed](https://github.com/fyipedia/cablefyi-embed)
133
+
134
+ ## Network FYI Family
135
+
136
+ Part of [FYIPedia](https://fyipedia.com) — open-source developer tools ecosystem. Network FYI covers cables, IP networks, and protocol status codes. Hub: [wirefyi.com](https://wirefyi.com).
137
+
138
+ | Site | Domain | Focus | Package |
139
+ |------|--------|-------|---------|
140
+ | **CableFYI** | [cablefyi.com](https://cablefyi.com) | 151 cables, connectors, standards, compatibility | **[npm](https://www.npmjs.com/package/cablefyi-embed)** |
141
+ | IPFYI | [ipfyi.com](https://ipfyi.com) | ASN, ISP, IP ranges, network infrastructure | [npm](https://www.npmjs.com/package/ipfyi-embed) |
142
+ | StatusCodeFYI | [statuscodefyi.com](https://statuscodefyi.com) | HTTP/SMTP/gRPC status codes, protocols, debugging | [npm](https://www.npmjs.com/package/statuscodefyi-embed) |
143
+ | TLDFYI | [tldfyi.com](https://tldfyi.com) | TLD registry, domain extensions (coming soon) | Coming soon |
144
+
145
+ ## FYIPedia Developer Tools
146
+
147
+ | Package | PyPI | npm | Description |
148
+ |---------|------|-----|-------------|
149
+ | colorfyi | [PyPI](https://pypi.org/project/colorfyi/) | [npm](https://www.npmjs.com/package/@fyipedia/colorfyi) | Color conversion, WCAG contrast, harmonies — [colorfyi.com](https://colorfyi.com) |
150
+ | emojifyi | [PyPI](https://pypi.org/project/emojifyi/) | [npm](https://www.npmjs.com/package/emojifyi) | Emoji encoding & metadata for 3,953 emojis — [emojifyi.com](https://emojifyi.com) |
151
+ | unitfyi | [PyPI](https://pypi.org/project/unitfyi/) | [npm](https://www.npmjs.com/package/unitfyi) | Unit conversion, 220 units — [unitfyi.com](https://unitfyi.com) |
152
+ | fyipedia | [PyPI](https://pypi.org/project/fyipedia/) | — | Unified CLI for all FYI tools — [fyipedia.com](https://fyipedia.com) |
153
+
154
+ ## License
155
+
156
+ MIT — see [LICENSE](./LICENSE).
157
+
158
+ Built with care by [FYIPedia](https://fyipedia.com).