widetorah-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 +155 -0
- package/dist/embed.esm.js +965 -0
- package/dist/embed.min.js +564 -0
- package/dist/index.d.ts +27 -0
- package/package.json +38 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 WideHoly
|
|
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,155 @@
|
|
|
1
|
+
# widetorah-embed
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/widetorah-embed)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.npmjs.com/package/widetorah-embed)
|
|
6
|
+
[](https://bundlephobia.com/package/widetorah-embed)
|
|
7
|
+
|
|
8
|
+
Embed WideTorah scripture widgets on any website. **Zero dependencies**, Shadow DOM style isolation, 3 built-in themes (light, dark, sepia), and automatic daily verse updates. Each widget includes a "Powered by WideTorah" backlink.
|
|
9
|
+
|
|
10
|
+
> **Try the interactive widget builder at [widget.widetorah.com](https://widget.widetorah.com)**
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
```html
|
|
15
|
+
<!-- Place widget div where you want it to appear -->
|
|
16
|
+
<div data-widetorah="verse" data-ref="Genesis 1:1" data-theme="light"></div>
|
|
17
|
+
|
|
18
|
+
<!-- Load the embed script once, anywhere on the page -->
|
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/widetorah-embed@1/dist/embed.min.js"></script>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
That's it. The widget will load, fetch the verse from the WideTorah API, and render it with full style isolation.
|
|
23
|
+
|
|
24
|
+
## Widget Types
|
|
25
|
+
|
|
26
|
+
| Type | Usage |
|
|
27
|
+
|------|-------|
|
|
28
|
+
| Verse Card | `<div data-widetorah="verse" data-ref="..." data-theme="light"></div>` |
|
|
29
|
+
| Chapter Card | `<div data-widetorah="chapter" data-ref="..."></div>` |
|
|
30
|
+
| Comparison Card | `<div data-widetorah="compare" data-a="..." data-b="..."></div>` |
|
|
31
|
+
| Verse of the Day | `<div data-widetorah="votd" data-theme="light"></div>` |
|
|
32
|
+
| Search Box | `<div data-widetorah="search" data-placeholder="..."></div>` |
|
|
33
|
+
|
|
34
|
+
## Widget Options
|
|
35
|
+
|
|
36
|
+
| Attribute | Values | Default | Description |
|
|
37
|
+
|-----------|--------|---------|-------------|
|
|
38
|
+
| `data-widetorah` | verse, chapter, person, compare, votd, search | required | Widget type |
|
|
39
|
+
| `data-ref` | "2:255" | — | Verse/chapter reference |
|
|
40
|
+
| `data-slug` | "moses", "paul" | — | Person slug (person widget only) |
|
|
41
|
+
| `data-a` | verse ref | — | First verse for comparison |
|
|
42
|
+
| `data-b` | verse ref | — | Second verse for comparison |
|
|
43
|
+
| `data-theme` | light, dark, sepia | light | Visual theme |
|
|
44
|
+
| `data-size` | default, compact | default | Widget size |
|
|
45
|
+
| `data-translation` | jps, etc. | jps | Translation code |
|
|
46
|
+
| `data-show-original` | true, false | false | Show original language text |
|
|
47
|
+
| `data-placeholder` | any string | "Search Torah…" | Search box placeholder |
|
|
48
|
+
|
|
49
|
+
## Themes
|
|
50
|
+
|
|
51
|
+
```html
|
|
52
|
+
<!-- Light (default) -->
|
|
53
|
+
<div data-widetorah="votd" data-theme="light"></div>
|
|
54
|
+
|
|
55
|
+
<!-- Dark -->
|
|
56
|
+
<div data-widetorah="votd" data-theme="dark"></div>
|
|
57
|
+
|
|
58
|
+
<!-- Sepia (warm, book-like) -->
|
|
59
|
+
<div data-widetorah="votd" data-theme="sepia"></div>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## CDN Options
|
|
63
|
+
|
|
64
|
+
### jsDelivr (recommended — global CDN, auto-updates with npm)
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<script src="https://cdn.jsdelivr.net/npm/widetorah-embed@1/dist/embed.min.js"></script>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### R2 CDN (widetorah.com hosted)
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<script src="https://cdn.widetorah.com/embed.min.js"></script>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### npm (for bundlers)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npm install widetorah-embed
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
import 'widetorah-embed';
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Examples
|
|
87
|
+
|
|
88
|
+
### Verse of the Day
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<div data-widetorah="votd" data-theme="light"></div>
|
|
92
|
+
<script src="https://cdn.jsdelivr.net/npm/widetorah-embed@1/dist/embed.min.js"></script>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Verse with Original Language
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<div data-widetorah="verse"
|
|
99
|
+
data-ref="1:1"
|
|
100
|
+
data-show-original="true"
|
|
101
|
+
data-theme="sepia">
|
|
102
|
+
</div>
|
|
103
|
+
<script src="https://cdn.jsdelivr.net/npm/widetorah-embed@1/dist/embed.min.js"></script>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Compact Verse of the Day (sidebar use)
|
|
107
|
+
|
|
108
|
+
```html
|
|
109
|
+
<div data-widetorah="votd" data-theme="light" data-size="compact"></div>
|
|
110
|
+
<script src="https://cdn.jsdelivr.net/npm/widetorah-embed@1/dist/embed.min.js"></script>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Search Box
|
|
114
|
+
|
|
115
|
+
```html
|
|
116
|
+
<div data-widetorah="search" data-placeholder="Search Torah…"></div>
|
|
117
|
+
<script src="https://cdn.jsdelivr.net/npm/widetorah-embed@1/dist/embed.min.js"></script>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Technical Details
|
|
121
|
+
|
|
122
|
+
- **Shadow DOM**: Complete style isolation — no CSS conflicts with your site
|
|
123
|
+
- **Zero dependencies**: No jQuery, React, or any external library
|
|
124
|
+
- **System fonts**: No Google Fonts request — loads instantly
|
|
125
|
+
- **CORS**: WideTorah API has CORS enabled for all origins
|
|
126
|
+
- **Caching**: Verse of the Day cached in localStorage (refreshes daily)
|
|
127
|
+
- **MutationObserver**: Works with dynamically added elements (SPAs)
|
|
128
|
+
- **Bundle size**: ~5KB gzipped
|
|
129
|
+
|
|
130
|
+
## Learn More About Torah
|
|
131
|
+
|
|
132
|
+
Visit [widetorah.com](https://widetorah.com) — WideTorah is a comprehensive Torah reference with full text, translations, and study tools.
|
|
133
|
+
|
|
134
|
+
- **API docs**: [widetorah.com/developers/](https://widetorah.com/developers/)
|
|
135
|
+
- **Widget builder**: [widget.widetorah.com](https://widget.widetorah.com)
|
|
136
|
+
- **npm package**: [npmjs.com/package/widetorah-embed](https://www.npmjs.com/package/widetorah-embed)
|
|
137
|
+
|
|
138
|
+
## WideHoly Scripture Family
|
|
139
|
+
|
|
140
|
+
Part of [WideHoly](https://wideholy.com) — Scripture for everyone.
|
|
141
|
+
|
|
142
|
+
| Site | Domain | Scripture |
|
|
143
|
+
|------|--------|-----------|
|
|
144
|
+
| **WideBible** | [widebible.com](https://widebible.com) | Bible verses, chapters, people |
|
|
145
|
+
| **WideQuran** | [widequran.com](https://widequran.com) | Quran verses, surahs |
|
|
146
|
+
| **WideTorah** | [widetorah.com](https://widetorah.com) | Torah verses, portions |
|
|
147
|
+
| **WideGita** | [widegita.com](https://widegita.com) | Bhagavad Gita verses |
|
|
148
|
+
| **WideSutra** | [widesutra.com](https://widesutra.com) | Buddhist sutras, teachings |
|
|
149
|
+
| **WideHoly** | [wideholy.com](https://wideholy.com) | Multi-religion scripture hub |
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT — see [LICENSE](./LICENSE).
|
|
154
|
+
|
|
155
|
+
Built with ❤️ by [WideHoly](https://wideholy.com).
|