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