@gemboss/gem-framework 0.9.0 → 0.9.2
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/README.md +6 -0
- package/dist/SOURCE.json +2 -2
- package/dist/gem-runtime.js +8 -1
- package/dist/index.js +8 -1
- package/dist/plugins/reveal-on-scroll.js +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,12 @@ Từ 0.8.2 mỗi module có `.d.ts` cạnh nó (`mount(root?: ParentNode | null,
|
|
|
73
73
|
|
|
74
74
|
## Nhật ký thay đổi
|
|
75
75
|
|
|
76
|
+
- **0.9.2** (06/10/2026): `reveal-on-scroll` bỏ qua `data-gem-reveal="none"` và `"default"` (hai giá trị "không áp gì" của
|
|
77
|
+
knob reveal): section hiện ngay, không ẩn chờ cuộn. Trước đó section đặt `none` vẫn bị ẩn như mọi section reveal.
|
|
78
|
+
- **0.9.1** (06/10/2026): plugin `reveal-on-scroll` không còn giấu section khách đang thấy. Section đã nằm trong màn hình
|
|
79
|
+
lúc tải được hiện tại chỗ (trước đó bị đặt `ready` rồi mới hiện lại, nên phần đầu trang chớp tắt), và khi trình
|
|
80
|
+
duyệt bật `prefers-reduced-motion: reduce` mọi section hiện ngay, không ẩn chờ cuộn. Hai luật lấy từ
|
|
81
|
+
`components/revealOnScroll.js` của gemsite, để gemsite dùng được plugin của gói.
|
|
76
82
|
- **0.9.0** (05/10/2026): `claimIn` (và mọi cổng dùng nó: `fabricatedProofInSource`, làn mã sinh theme của
|
|
77
83
|
`check-fabricated-proof`) bắt lời hứa phí ship bằng 0 không có chữ "free" (`shippingZeroPromiseIn`: tách câu, bỏ ký hiệu đầu dòng, đòi CẢ câu khớp
|
|
78
84
|
một dạng có tên):
|
package/dist/SOURCE.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@gemboss/gem-framework",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"gemtheme_sha": "
|
|
3
|
+
"version": "0.9.2",
|
|
4
|
+
"gemtheme_sha": "3fa982d1fd2a1c77df8c2d706abe8d5d4b509508",
|
|
5
5
|
"gemtheme_dirty": false,
|
|
6
6
|
"framework_version": "0.1.0"
|
|
7
7
|
}
|
package/dist/gem-runtime.js
CHANGED
|
@@ -847,7 +847,13 @@
|
|
|
847
847
|
const nodes = document.querySelectorAll('[data-gem-reveal], .gem-reveal');
|
|
848
848
|
let bound = 0;
|
|
849
849
|
const reveal = (node) => { node.dataset.gemRevealState = 'in'; };
|
|
850
|
-
|
|
850
|
+
// Reduced motion and no IntersectionObserver land on the same answer: show everything now (from gemsite revealOnScroll.js).
|
|
851
|
+
const reduce = typeof target.matchMedia === 'function' && target.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
852
|
+
if (reduce || !target.IntersectionObserver) { nodes.forEach(reveal); api.emit('gem:reveal:ready', { source: 'gem-runtime', count: 0 }); return; }
|
|
853
|
+
// Above the fold the browser has already painted the section: writing 'ready' would blink it out and back in.
|
|
854
|
+
// `none` and `default` are the knob's "apply nothing" values; the attribute is still written, so skip them here.
|
|
855
|
+
const off = (node) => { const v = node.getAttribute ? node.getAttribute('data-gem-reveal') : null; return v === 'none' || v === 'default'; };
|
|
856
|
+
const inViewport = (node) => { if (!node.getBoundingClientRect) return true; const r = node.getBoundingClientRect(); const h = target.innerHeight || (document.documentElement && document.documentElement.clientHeight) || 0; return r.top < h && r.bottom > 0; };
|
|
851
857
|
const observer = new target.IntersectionObserver((entries, obs) => {
|
|
852
858
|
entries.forEach((entry) => {
|
|
853
859
|
if (!entry.isIntersecting) return;
|
|
@@ -858,6 +864,7 @@
|
|
|
858
864
|
}, { threshold: 0.12, rootMargin: '0px 0px -40px 0px' });
|
|
859
865
|
nodes.forEach((node) => {
|
|
860
866
|
if (!mark(node, 'reveal-on-scroll')) return;
|
|
867
|
+
if (off(node) || inViewport(node)) { reveal(node); bound += 1; return; }
|
|
861
868
|
if (!node.dataset.gemRevealState) node.dataset.gemRevealState = 'ready';
|
|
862
869
|
observer.observe(node);
|
|
863
870
|
bound += 1;
|
package/dist/index.js
CHANGED
|
@@ -5098,7 +5098,13 @@ var revealOnScrollPluginRegistrationLines = [
|
|
|
5098
5098
|
" const nodes = document.querySelectorAll('[data-gem-reveal], .gem-reveal');",
|
|
5099
5099
|
" let bound = 0;",
|
|
5100
5100
|
" const reveal = (node) => { node.dataset.gemRevealState = 'in'; };",
|
|
5101
|
-
"
|
|
5101
|
+
" // Reduced motion and no IntersectionObserver land on the same answer: show everything now (from gemsite revealOnScroll.js).",
|
|
5102
|
+
" const reduce = typeof target.matchMedia === 'function' && target.matchMedia('(prefers-reduced-motion: reduce)').matches;",
|
|
5103
|
+
" if (reduce || !target.IntersectionObserver) { nodes.forEach(reveal); api.emit('gem:reveal:ready', { source: 'gem-runtime', count: 0 }); return; }",
|
|
5104
|
+
" // Above the fold the browser has already painted the section: writing 'ready' would blink it out and back in.",
|
|
5105
|
+
' // `none` and `default` are the knob\'s "apply nothing" values; the attribute is still written, so skip them here.',
|
|
5106
|
+
" const off = (node) => { const v = node.getAttribute ? node.getAttribute('data-gem-reveal') : null; return v === 'none' || v === 'default'; };",
|
|
5107
|
+
" const inViewport = (node) => { if (!node.getBoundingClientRect) return true; const r = node.getBoundingClientRect(); const h = target.innerHeight || (document.documentElement && document.documentElement.clientHeight) || 0; return r.top < h && r.bottom > 0; };",
|
|
5102
5108
|
" const observer = new target.IntersectionObserver((entries, obs) => {",
|
|
5103
5109
|
" entries.forEach((entry) => {",
|
|
5104
5110
|
" if (!entry.isIntersecting) return;",
|
|
@@ -5109,6 +5115,7 @@ var revealOnScrollPluginRegistrationLines = [
|
|
|
5109
5115
|
" }, { threshold: 0.12, rootMargin: '0px 0px -40px 0px' });",
|
|
5110
5116
|
" nodes.forEach((node) => {",
|
|
5111
5117
|
" if (!mark(node, 'reveal-on-scroll')) return;",
|
|
5118
|
+
" if (off(node) || inViewport(node)) { reveal(node); bound += 1; return; }",
|
|
5112
5119
|
" if (!node.dataset.gemRevealState) node.dataset.gemRevealState = 'ready';",
|
|
5113
5120
|
" observer.observe(node);",
|
|
5114
5121
|
" bound += 1;",
|
|
@@ -10,7 +10,13 @@ function install({ document, window, target, mark, canListen, listen: __gemListe
|
|
|
10
10
|
const nodes = document.querySelectorAll('[data-gem-reveal], .gem-reveal');
|
|
11
11
|
let bound = 0;
|
|
12
12
|
const reveal = (node) => { node.dataset.gemRevealState = 'in'; };
|
|
13
|
-
|
|
13
|
+
// Reduced motion and no IntersectionObserver land on the same answer: show everything now (from gemsite revealOnScroll.js).
|
|
14
|
+
const reduce = typeof target.matchMedia === 'function' && target.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
15
|
+
if (reduce || !target.IntersectionObserver) { nodes.forEach(reveal); api.emit('gem:reveal:ready', { source: 'gem-runtime', count: 0 }); return; }
|
|
16
|
+
// Above the fold the browser has already painted the section: writing 'ready' would blink it out and back in.
|
|
17
|
+
// `none` and `default` are the knob's "apply nothing" values; the attribute is still written, so skip them here.
|
|
18
|
+
const off = (node) => { const v = node.getAttribute ? node.getAttribute('data-gem-reveal') : null; return v === 'none' || v === 'default'; };
|
|
19
|
+
const inViewport = (node) => { if (!node.getBoundingClientRect) return true; const r = node.getBoundingClientRect(); const h = target.innerHeight || (document.documentElement && document.documentElement.clientHeight) || 0; return r.top < h && r.bottom > 0; };
|
|
14
20
|
const observer = new target.IntersectionObserver((entries, obs) => {
|
|
15
21
|
entries.forEach((entry) => {
|
|
16
22
|
if (!entry.isIntersecting) return;
|
|
@@ -21,6 +27,7 @@ function install({ document, window, target, mark, canListen, listen: __gemListe
|
|
|
21
27
|
}, { threshold: 0.12, rootMargin: '0px 0px -40px 0px' });
|
|
22
28
|
nodes.forEach((node) => {
|
|
23
29
|
if (!mark(node, 'reveal-on-scroll')) return;
|
|
30
|
+
if (off(node) || inViewport(node)) { reveal(node); bound += 1; return; }
|
|
24
31
|
if (!node.dataset.gemRevealState) node.dataset.gemRevealState = 'ready';
|
|
25
32
|
observer.observe(node);
|
|
26
33
|
bound += 1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gemboss/gem-framework",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "gem-framework của GemTheme (CSS, runtime, token, bộ kiểm) cộng đúng bộ kiểm section gemtheme dùng khi duyệt. Build từ gemtheme, không sửa ở đây.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|