@jomae/catalog 0.3.0 → 0.4.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/README.md +1 -1
- package/dist/baseline.d.ts +11 -0
- package/dist/baseline.d.ts.map +1 -1
- package/dist/baseline.js +50 -1
- package/dist/baseline.js.map +1 -1
- package/dist/format.js +1 -1
- package/dist/format.js.map +1 -1
- package/dist/generated/baseline.d.ts +6 -0
- package/dist/generated/baseline.d.ts.map +1 -1
- package/dist/generated/baseline.js +494 -38
- package/dist/generated/baseline.js.map +1 -1
- package/dist/generated/sizes.d.ts.map +1 -1
- package/dist/generated/sizes.js +419 -9
- package/dist/generated/sizes.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/rules/abort-controller.d.ts +3 -0
- package/dist/rules/abort-controller.d.ts.map +1 -0
- package/dist/rules/abort-controller.js +25 -0
- package/dist/rules/abort-controller.js.map +1 -0
- package/dist/rules/broadcast-channel.d.ts +3 -0
- package/dist/rules/broadcast-channel.d.ts.map +1 -0
- package/dist/rules/broadcast-channel.js +25 -0
- package/dist/rules/broadcast-channel.js.map +1 -0
- package/dist/rules/carousel.d.ts.map +1 -1
- package/dist/rules/carousel.js +3 -0
- package/dist/rules/carousel.js.map +1 -1
- package/dist/rules/clipboard.d.ts +3 -0
- package/dist/rules/clipboard.d.ts.map +1 -0
- package/dist/rules/clipboard.js +32 -0
- package/dist/rules/clipboard.js.map +1 -0
- package/dist/rules/color-functions.d.ts.map +1 -1
- package/dist/rules/color-functions.js +8 -1
- package/dist/rules/color-functions.js.map +1 -1
- package/dist/rules/compression-streams.d.ts +3 -0
- package/dist/rules/compression-streams.d.ts.map +1 -0
- package/dist/rules/compression-streams.js +25 -0
- package/dist/rules/compression-streams.js.map +1 -0
- package/dist/rules/container-queries.d.ts.map +1 -1
- package/dist/rules/container-queries.js +1 -0
- package/dist/rules/container-queries.js.map +1 -1
- package/dist/rules/content-visibility.d.ts.map +1 -1
- package/dist/rules/content-visibility.js +8 -1
- package/dist/rules/content-visibility.js.map +1 -1
- package/dist/rules/date-time-input.d.ts.map +1 -1
- package/dist/rules/date-time-input.js +2 -0
- package/dist/rules/date-time-input.js.map +1 -1
- package/dist/rules/dialog.d.ts.map +1 -1
- package/dist/rules/dialog.js +3 -0
- package/dist/rules/dialog.js.map +1 -1
- package/dist/rules/drag-and-drop.d.ts +3 -0
- package/dist/rules/drag-and-drop.d.ts.map +1 -0
- package/dist/rules/drag-and-drop.js +29 -0
- package/dist/rules/drag-and-drop.js.map +1 -0
- package/dist/rules/field-sizing.d.ts.map +1 -1
- package/dist/rules/field-sizing.js +7 -1
- package/dist/rules/field-sizing.js.map +1 -1
- package/dist/rules/focus-visible.d.ts +3 -0
- package/dist/rules/focus-visible.d.ts.map +1 -0
- package/dist/rules/focus-visible.js +26 -0
- package/dist/rules/focus-visible.js.map +1 -0
- package/dist/rules/fullscreen.d.ts +3 -0
- package/dist/rules/fullscreen.d.ts.map +1 -0
- package/dist/rules/fullscreen.js +28 -0
- package/dist/rules/fullscreen.js.map +1 -0
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/index.js +38 -0
- package/dist/rules/index.js.map +1 -1
- package/dist/rules/intersection-observer.d.ts +3 -0
- package/dist/rules/intersection-observer.d.ts.map +1 -0
- package/dist/rules/intersection-observer.js +34 -0
- package/dist/rules/intersection-observer.js.map +1 -0
- package/dist/rules/lazy-loading.d.ts.map +1 -1
- package/dist/rules/lazy-loading.js +2 -0
- package/dist/rules/lazy-loading.js.map +1 -1
- package/dist/rules/line-clamp.d.ts +3 -0
- package/dist/rules/line-clamp.d.ts.map +1 -0
- package/dist/rules/line-clamp.js +38 -0
- package/dist/rules/line-clamp.js.map +1 -0
- package/dist/rules/masonry.d.ts.map +1 -1
- package/dist/rules/masonry.js +2 -0
- package/dist/rules/masonry.js.map +1 -1
- package/dist/rules/number-format.d.ts +3 -0
- package/dist/rules/number-format.d.ts.map +1 -0
- package/dist/rules/number-format.js +25 -0
- package/dist/rules/number-format.js.map +1 -0
- package/dist/rules/page-visibility.d.ts +3 -0
- package/dist/rules/page-visibility.d.ts.map +1 -0
- package/dist/rules/page-visibility.js +24 -0
- package/dist/rules/page-visibility.js.map +1 -0
- package/dist/rules/popover.d.ts.map +1 -1
- package/dist/rules/popover.js +2 -0
- package/dist/rules/popover.js.map +1 -1
- package/dist/rules/relative-time.d.ts +3 -0
- package/dist/rules/relative-time.d.ts.map +1 -0
- package/dist/rules/relative-time.js +23 -0
- package/dist/rules/relative-time.js.map +1 -0
- package/dist/rules/resizable-panels.d.ts.map +1 -1
- package/dist/rules/resizable-panels.js +6 -1
- package/dist/rules/resizable-panels.js.map +1 -1
- package/dist/rules/resize-observer.d.ts +3 -0
- package/dist/rules/resize-observer.d.ts.map +1 -0
- package/dist/rules/resize-observer.js +27 -0
- package/dist/rules/resize-observer.js.map +1 -0
- package/dist/rules/screen-wake-lock.d.ts +3 -0
- package/dist/rules/screen-wake-lock.d.ts.map +1 -0
- package/dist/rules/screen-wake-lock.js +23 -0
- package/dist/rules/screen-wake-lock.js.map +1 -0
- package/dist/rules/scrollbars.d.ts.map +1 -1
- package/dist/rules/scrollbars.js +3 -0
- package/dist/rules/scrollbars.js.map +1 -1
- package/dist/rules/select.d.ts.map +1 -1
- package/dist/rules/select.js +10 -1
- package/dist/rules/select.js.map +1 -1
- package/dist/rules/smooth-scroll.d.ts.map +1 -1
- package/dist/rules/smooth-scroll.js +1 -0
- package/dist/rules/smooth-scroll.js.map +1 -1
- package/dist/rules/speech-recognition.d.ts +3 -0
- package/dist/rules/speech-recognition.d.ts.map +1 -0
- package/dist/rules/speech-recognition.js +27 -0
- package/dist/rules/speech-recognition.js.map +1 -0
- package/dist/rules/speech-synthesis.d.ts +3 -0
- package/dist/rules/speech-synthesis.d.ts.map +1 -0
- package/dist/rules/speech-synthesis.js +22 -0
- package/dist/rules/speech-synthesis.js.map +1 -0
- package/dist/rules/sticky.d.ts.map +1 -1
- package/dist/rules/sticky.js +2 -0
- package/dist/rules/sticky.js.map +1 -1
- package/dist/rules/structured-clone.d.ts +3 -0
- package/dist/rules/structured-clone.d.ts.map +1 -0
- package/dist/rules/structured-clone.js +21 -0
- package/dist/rules/structured-clone.js.map +1 -0
- package/dist/rules/web-bluetooth.d.ts +3 -0
- package/dist/rules/web-bluetooth.d.ts.map +1 -0
- package/dist/rules/web-bluetooth.js +25 -0
- package/dist/rules/web-bluetooth.js.map +1 -0
- package/dist/rules/web-share.d.ts +3 -0
- package/dist/rules/web-share.d.ts.map +1 -0
- package/dist/rules/web-share.js +27 -0
- package/dist/rules/web-share.js.map +1 -0
- package/dist/schema.js +1 -1
- package/dist/schema.js.map +1 -1
- package/package.json +2 -2
package/dist/rules/index.js
CHANGED
|
@@ -1,58 +1,96 @@
|
|
|
1
|
+
import { abortController } from "./abort-controller.js";
|
|
1
2
|
import { accordion } from "./accordion.js";
|
|
2
3
|
import { aspectRatio } from "./aspect-ratio.js";
|
|
4
|
+
import { broadcastChannel } from "./broadcast-channel.js";
|
|
3
5
|
import { carousel } from "./carousel.js";
|
|
6
|
+
import { clipboard } from "./clipboard.js";
|
|
4
7
|
import { colorFunctions } from "./color-functions.js";
|
|
8
|
+
import { compressionStreams } from "./compression-streams.js";
|
|
5
9
|
import { containerQueries } from "./container-queries.js";
|
|
6
10
|
import { contentVisibility } from "./content-visibility.js";
|
|
7
11
|
import { dateTimeInput } from "./date-time-input.js";
|
|
8
12
|
import { dialog } from "./dialog.js";
|
|
9
13
|
import { discreteTransitions } from "./discrete-transitions.js";
|
|
14
|
+
import { dragAndDrop } from "./drag-and-drop.js";
|
|
10
15
|
import { fieldSizing } from "./field-sizing.js";
|
|
11
16
|
import { fluidType } from "./fluid-type.js";
|
|
17
|
+
import { focusVisible } from "./focus-visible.js";
|
|
18
|
+
import { fullscreen } from "./fullscreen.js";
|
|
12
19
|
import { heightAnimation } from "./height-animation.js";
|
|
20
|
+
import { intersectionObserver } from "./intersection-observer.js";
|
|
13
21
|
import { lazyLoading } from "./lazy-loading.js";
|
|
22
|
+
import { lineClamp } from "./line-clamp.js";
|
|
14
23
|
import { masonry } from "./masonry.js";
|
|
24
|
+
import { numberFormat } from "./number-format.js";
|
|
25
|
+
import { pageVisibility } from "./page-visibility.js";
|
|
15
26
|
import { popover } from "./popover.js";
|
|
27
|
+
import { relativeTime } from "./relative-time.js";
|
|
16
28
|
import { resizablePanels } from "./resizable-panels.js";
|
|
29
|
+
import { resizeObserver } from "./resize-observer.js";
|
|
30
|
+
import { screenWakeLock } from "./screen-wake-lock.js";
|
|
17
31
|
import { scrollAnimations } from "./scroll-animations.js";
|
|
18
32
|
import { scrollLock } from "./scroll-lock.js";
|
|
19
33
|
import { scrollbars } from "./scrollbars.js";
|
|
20
34
|
import { select } from "./select.js";
|
|
21
35
|
import { smoothScroll } from "./smooth-scroll.js";
|
|
36
|
+
import { speechRecognition } from "./speech-recognition.js";
|
|
37
|
+
import { speechSynthesis } from "./speech-synthesis.js";
|
|
22
38
|
import { sticky } from "./sticky.js";
|
|
39
|
+
import { structuredCloneRule } from "./structured-clone.js";
|
|
23
40
|
import { textBoxTrim } from "./text-box-trim.js";
|
|
24
41
|
import { textWrapBalance } from "./text-wrap-balance.js";
|
|
25
42
|
import { viewTransitions } from "./view-transitions.js";
|
|
43
|
+
import { webBluetooth } from "./web-bluetooth.js";
|
|
44
|
+
import { webShare } from "./web-share.js";
|
|
26
45
|
/**
|
|
27
46
|
* Every rule in the catalog. Order is not significant: surfaces sort by
|
|
28
47
|
* replaceable weight or support tier, not by position here.
|
|
29
48
|
*/
|
|
30
49
|
export const rules = [
|
|
50
|
+
abortController,
|
|
31
51
|
accordion,
|
|
32
52
|
aspectRatio,
|
|
53
|
+
broadcastChannel,
|
|
33
54
|
carousel,
|
|
55
|
+
clipboard,
|
|
34
56
|
colorFunctions,
|
|
57
|
+
compressionStreams,
|
|
35
58
|
containerQueries,
|
|
36
59
|
contentVisibility,
|
|
37
60
|
dateTimeInput,
|
|
38
61
|
dialog,
|
|
39
62
|
discreteTransitions,
|
|
63
|
+
dragAndDrop,
|
|
40
64
|
fieldSizing,
|
|
41
65
|
fluidType,
|
|
66
|
+
focusVisible,
|
|
67
|
+
fullscreen,
|
|
42
68
|
heightAnimation,
|
|
69
|
+
intersectionObserver,
|
|
43
70
|
lazyLoading,
|
|
71
|
+
lineClamp,
|
|
44
72
|
masonry,
|
|
73
|
+
numberFormat,
|
|
74
|
+
pageVisibility,
|
|
45
75
|
popover,
|
|
76
|
+
relativeTime,
|
|
46
77
|
resizablePanels,
|
|
78
|
+
resizeObserver,
|
|
79
|
+
screenWakeLock,
|
|
47
80
|
scrollAnimations,
|
|
48
81
|
scrollLock,
|
|
49
82
|
scrollbars,
|
|
50
83
|
select,
|
|
51
84
|
smoothScroll,
|
|
85
|
+
speechRecognition,
|
|
86
|
+
speechSynthesis,
|
|
52
87
|
sticky,
|
|
88
|
+
structuredCloneRule,
|
|
53
89
|
textBoxTrim,
|
|
54
90
|
textWrapBalance,
|
|
55
91
|
viewTransitions,
|
|
92
|
+
webBluetooth,
|
|
93
|
+
webShare,
|
|
56
94
|
];
|
|
57
95
|
/** Lookup by rule id. */
|
|
58
96
|
export const rulesById = new Map(rules.map((rule) => [rule.id, rule]));
|
package/dist/rules/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,iBAAiB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,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,UAAU;IACV,UAAU;IACV,MAAM;IACN,YAAY;IACZ,iBAAiB;IACjB,eAAe;IACf,MAAM;IACN,mBAAmB;IACnB,WAAW;IACX,eAAe;IACf,eAAe;IACf,YAAY;IACZ,QAAQ;CACT,CAAC;AAEF,yBAAyB;AACzB,MAAM,CAAC,MAAM,SAAS,GAA8B,IAAI,GAAG,CACzD,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CACrC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAA8B,IAAI,GAAG,CAC9D,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAU,CAAC,CAAC,CAC1E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersection-observer.d.ts","sourceRoot":"","sources":["../../src/rules/intersection-observer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,oBAAoB,EAAE,IAmClC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export const intersectionObserver = {
|
|
2
|
+
id: "intersection-observer",
|
|
3
|
+
title: "Visibility tracking",
|
|
4
|
+
replaces: [
|
|
5
|
+
"react-intersection-observer",
|
|
6
|
+
"react-visibility-sensor",
|
|
7
|
+
"react-in-viewport",
|
|
8
|
+
"svelte-intersection-observer",
|
|
9
|
+
],
|
|
10
|
+
featureIds: ["intersection-observer"],
|
|
11
|
+
native: "IntersectionObserver",
|
|
12
|
+
human: {
|
|
13
|
+
explainer: "These libraries all wrap the same browser API. IntersectionObserver watches an element and calls you back when it crosses a viewport threshold, without a scroll listener recalculating positions on every frame. Calling it directly removes a dependency for something the browser already does off the main thread.",
|
|
14
|
+
snippet: `const observer = new IntersectionObserver(
|
|
15
|
+
(entries) => {
|
|
16
|
+
for (const entry of entries) {
|
|
17
|
+
if (entry.isIntersecting) console.log("visible:", entry.target);
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{ threshold: 0.5 },
|
|
21
|
+
);
|
|
22
|
+
observer.observe(document.querySelector("#target"));`,
|
|
23
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API",
|
|
24
|
+
},
|
|
25
|
+
agent: {
|
|
26
|
+
when: "running code when an element scrolls into or out of view, such as triggering analytics, infinite scroll, or an entrance animation",
|
|
27
|
+
unless: [
|
|
28
|
+
"You want a framework hook's ergonomics, such as a boolean and a ref, rather than managing an observer instance yourself. The library is doing less work than it looks like at that point, but it's still less code at each call site.",
|
|
29
|
+
"You need to track intersection against a scrolling ancestor other than the viewport in a browser old enough to have inconsistent support for the root option.",
|
|
30
|
+
],
|
|
31
|
+
snippet: "new IntersectionObserver((entries) => { ... }, { threshold: 0.5 });",
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=intersection-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intersection-observer.js","sourceRoot":"","sources":["../../src/rules/intersection-observer.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAS;IACxC,EAAE,EAAE,uBAAuB;IAC3B,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE;QACR,6BAA6B;QAC7B,yBAAyB;QACzB,mBAAmB;QACnB,8BAA8B;KAC/B;IACD,UAAU,EAAE,CAAC,uBAAuB,CAAC;IACrC,MAAM,EAAE,sBAAsB;IAC9B,KAAK,EAAE;QACL,SAAS,EACP,wTAAwT;QAC1T,OAAO,EAAE;;;;;;;;qDAQwC;QACjD,MAAM,EACJ,4EAA4E;KAC/E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,mIAAmI;QACzI,MAAM,EAAE;YACN,uOAAuO;YACvO,+JAA+J;SAChK;QACD,OAAO,EACL,qEAAqE;KACxE;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-loading.d.ts","sourceRoot":"","sources":["../../src/rules/lazy-loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"lazy-loading.d.ts","sourceRoot":"","sources":["../../src/rules/lazy-loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,WAAW,EAAE,IAmCzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazy-loading.js","sourceRoot":"","sources":["../../src/rules/lazy-loading.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,gCAAgC;IACvC,QAAQ,EAAE;QACR,OAAO;QACP,WAAW;QACX,kBAAkB;QAClB,gBAAgB;QAChB,iCAAiC;QACjC,SAAS;
|
|
1
|
+
{"version":3,"file":"lazy-loading.js","sourceRoot":"","sources":["../../src/rules/lazy-loading.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAS;IAC/B,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,gCAAgC;IACvC,QAAQ,EAAE;QACR,OAAO;QACP,WAAW;QACX,kBAAkB;QAClB,gBAAgB;QAChB,iCAAiC;QACjC,SAAS;QACT,cAAc;QACd,cAAc;KACf;IACD,UAAU,EAAE,CAAC,cAAc,CAAC;IAC5B,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE;QACL,SAAS,EACP,4XAA4X;QAC9X,OAAO,EAAE;iEACoD;QAC7D,MAAM,EACJ,uEAAuE;KAC1E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,gFAAgF;QACtF,MAAM,EAAE;YACN,gJAAgJ;YAChJ,6GAA6G;YAC7G,0IAA0I;YAC1I,4HAA4H;YAC5H,4GAA4G;SAC7G;QACD,OAAO,EAAE;8CACiC;KAC3C;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-clamp.d.ts","sourceRoot":"","sources":["../../src/rules/line-clamp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,SAAS,EAAE,IAuCvB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const lineClamp = {
|
|
2
|
+
id: "line-clamp",
|
|
3
|
+
title: "Multi-line text truncation",
|
|
4
|
+
replaces: [
|
|
5
|
+
"react-clamp-lines",
|
|
6
|
+
"react-line-clamp",
|
|
7
|
+
"clamp-js",
|
|
8
|
+
"line-clamp",
|
|
9
|
+
"vue-clamp",
|
|
10
|
+
],
|
|
11
|
+
featureIds: [],
|
|
12
|
+
manualBaseline: {
|
|
13
|
+
status: "widely",
|
|
14
|
+
verifiedOn: "2026-09-03",
|
|
15
|
+
note: "web-features tracks the unprefixed line-clamp property under the ID 'line-clamp', which has near-zero real-world support. The -webkit- prefixed form this rule actually recommends has been supported in every major engine for years (Firefox since 68, Safari and Chrome far longer), so the automated resolution would misreport a decades-safe technique as limited availability.",
|
|
16
|
+
},
|
|
17
|
+
native: "-webkit-line-clamp",
|
|
18
|
+
human: {
|
|
19
|
+
explainer: "Truncating text after a fixed number of lines, with an ellipsis, used to mean measuring rendered line height in JavaScript and cutting the string by hand. The line-clamp property does it in CSS, no measuring and no re-running on resize or font load. Only the vendor-prefixed form is safe to use today; the unprefixed property is still landing.",
|
|
20
|
+
snippet: `.excerpt {
|
|
21
|
+
display: -webkit-box;
|
|
22
|
+
-webkit-box-orient: vertical;
|
|
23
|
+
-webkit-line-clamp: 3;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
}`,
|
|
26
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-line-clamp",
|
|
27
|
+
},
|
|
28
|
+
agent: {
|
|
29
|
+
when: "truncating a block of text to a fixed number of lines with an ellipsis",
|
|
30
|
+
unless: [
|
|
31
|
+
"You need to combine this with a display value other than -webkit-box on the same element, since the prefixed property requires it.",
|
|
32
|
+
"You need to know the exact character or word where the text was cut, for something like a 'read more' link that continues from that point.",
|
|
33
|
+
"You're relying on a build tool to add this prefix for you and it doesn't; -webkit-line-clamp still needs to be written by hand, autoprefixer tools do not treat it as one they add automatically in every configuration.",
|
|
34
|
+
],
|
|
35
|
+
snippet: ".excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=line-clamp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-clamp.js","sourceRoot":"","sources":["../../src/rules/line-clamp.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAS;IAC7B,EAAE,EAAE,YAAY;IAChB,KAAK,EAAE,4BAA4B;IACnC,QAAQ,EAAE;QACR,mBAAmB;QACnB,kBAAkB;QAClB,UAAU;QACV,YAAY;QACZ,WAAW;KACZ;IACD,UAAU,EAAE,EAAE;IACd,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,uXAAuX;KAC9X;IACD,MAAM,EAAE,oBAAoB;IAC5B,KAAK,EAAE;QACL,SAAS,EACP,yVAAyV;QAC3V,OAAO,EAAE;;;;;EAKX;QACE,MAAM,EACJ,qEAAqE;KACxE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,wEAAwE;QAC9E,MAAM,EAAE;YACN,oIAAoI;YACpI,4IAA4I;YAC5I,0NAA0N;SAC3N;QACD,OAAO,EACL,2GAA2G;KAC9G;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masonry.d.ts","sourceRoot":"","sources":["../../src/rules/masonry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"masonry.d.ts","sourceRoot":"","sources":["../../src/rules/masonry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,IA2DrB,CAAC"}
|
package/dist/rules/masonry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"masonry.js","sourceRoot":"","sources":["../../src/rules/masonry.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAS;IAC3B,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,iBAAiB;IACxB,QAAQ,EAAE;QACR,mBAAmB;QACnB,gBAAgB;QAChB,yBAAyB;QACzB,OAAO;QACP,qBAAqB;
|
|
1
|
+
{"version":3,"file":"masonry.js","sourceRoot":"","sources":["../../src/rules/masonry.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAS;IAC3B,EAAE,EAAE,aAAa;IACjB,KAAK,EAAE,iBAAiB;IACxB,QAAQ,EAAE;QACR,mBAAmB;QACnB,gBAAgB;QAChB,yBAAyB;QACzB,OAAO;QACP,qBAAqB;QACrB,aAAa;QACb,iBAAiB;KAClB;IACD,UAAU,EAAE,CAAC,SAAS,CAAC;IACvB,MAAM,EAAE,4BAA4B;IACpC,KAAK,EAAE;QACL,SAAS,EACP,wiBAAwiB;QAC1iB,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;EAoBX;QACE,MAAM,EACJ,iFAAiF;KACpF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,uFAAuF;QAC7F,MAAM,EAAE;YACN,8LAA8L;YAC9L,6EAA6E;YAC7E,iEAAiE;YACjE,yHAAyH;SAC1H;QACD,OAAO,EAAE;;;;;;;;EAQX;KACC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-format.d.ts","sourceRoot":"","sources":["../../src/rules/number-format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,IA0B1B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const numberFormat = {
|
|
2
|
+
id: "number-format",
|
|
3
|
+
title: "Locale-aware number and currency formatting",
|
|
4
|
+
replaces: ["numeral", "accounting", "currency.js", "format-number"],
|
|
5
|
+
featureIds: ["intl"],
|
|
6
|
+
native: "Intl.NumberFormat",
|
|
7
|
+
human: {
|
|
8
|
+
explainer: "These libraries hardcode their own thousands separators, currency symbols, and rounding rules, and most ship a single locale by default. Intl.NumberFormat is the same formatting logic the operating system already has: pass a locale and a style, currency, percent, or unit, and it places the symbol, separator, and decimal grouping the way that locale actually expects, with no formatting rules to maintain.",
|
|
9
|
+
snippet: `new Intl.NumberFormat("en-US", {
|
|
10
|
+
style: "currency",
|
|
11
|
+
currency: "USD",
|
|
12
|
+
}).format(1234.5); // "$1,234.50"`,
|
|
13
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat",
|
|
14
|
+
},
|
|
15
|
+
agent: {
|
|
16
|
+
when: "formatting a number as currency, a percentage, a unit, or a locale-correct thousands-grouped number for display",
|
|
17
|
+
unless: [
|
|
18
|
+
"You need safe decimal arithmetic, such as adding money values without floating-point rounding errors. currency.js and accounting.js do that math for you; Intl.NumberFormat only formats a number you already computed correctly.",
|
|
19
|
+
"You need to parse a formatted string back into a number. Intl.NumberFormat is format-only; these libraries often provide the reverse direction too.",
|
|
20
|
+
"You need a custom format pattern, such as a specific abbreviation style, that the options Intl.NumberFormat exposes cannot express.",
|
|
21
|
+
],
|
|
22
|
+
snippet: 'new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(value);',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=number-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-format.js","sourceRoot":"","sources":["../../src/rules/number-format.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,6CAA6C;IACpD,QAAQ,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC;IACnE,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,wZAAwZ;QAC1Z,OAAO,EAAE;;;kCAGqB;QAC9B,MAAM,EACJ,oGAAoG;KACvG;IACD,KAAK,EAAE;QACL,IAAI,EAAE,iHAAiH;QACvH,MAAM,EAAE;YACN,mOAAmO;YACnO,qJAAqJ;YACrJ,qIAAqI;SACtI;QACD,OAAO,EACL,uFAAuF;KAC1F;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-visibility.d.ts","sourceRoot":"","sources":["../../src/rules/page-visibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,IAwB5B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const pageVisibility = {
|
|
2
|
+
id: "page-visibility",
|
|
3
|
+
title: "Tab visibility",
|
|
4
|
+
replaces: ["react-page-visibility", "visibilityjs"],
|
|
5
|
+
featureIds: ["page-visibility"],
|
|
6
|
+
native: "document.visibilityState and the visibilitychange event",
|
|
7
|
+
human: {
|
|
8
|
+
explainer: "These libraries wrap document.visibilityState with framework-friendly plumbing around a value the browser already exposes. Reading it directly tells you whether the tab is the one the person is currently looking at, useful for pausing polling, video, or animation when it isn't.",
|
|
9
|
+
snippet: `document.addEventListener("visibilitychange", () => {
|
|
10
|
+
if (document.visibilityState === "hidden") pausePolling();
|
|
11
|
+
else resumePolling();
|
|
12
|
+
});`,
|
|
13
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event",
|
|
14
|
+
},
|
|
15
|
+
agent: {
|
|
16
|
+
when: "pausing or resuming work, such as polling or video playback, based on whether the tab is visible",
|
|
17
|
+
unless: [
|
|
18
|
+
"You need a framework hook's re-render-on-change ergonomics rather than an event listener you manage yourself.",
|
|
19
|
+
"You need to distinguish a window occluded by another window from a genuinely backgrounded tab. visibilityState only reports the latter.",
|
|
20
|
+
],
|
|
21
|
+
snippet: `document.addEventListener("visibilitychange", () => { ... });`,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=page-visibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-visibility.js","sourceRoot":"","sources":["../../src/rules/page-visibility.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,CAAC,uBAAuB,EAAE,cAAc,CAAC;IACnD,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,yDAAyD;IACjE,KAAK,EAAE;QACL,SAAS,EACP,wRAAwR;QAC1R,OAAO,EAAE;;;IAGT;QACA,MAAM,EACJ,kFAAkF;KACrF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,kGAAkG;QACxG,MAAM,EAAE;YACN,+GAA+G;YAC/G,yIAAyI;SAC1I;QACD,OAAO,EAAE,+DAA+D;KACzE;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/rules/popover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/rules/popover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,IAgErB,CAAC"}
|
package/dist/rules/popover.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/rules/popover.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAS;IAC3B,EAAE,EAAE,4BAA4B;IAChC,KAAK,EAAE,kCAAkC;IACzC,QAAQ,EAAE;QACR,oBAAoB;QACpB,wBAAwB;QACxB,kBAAkB;QAClB,gBAAgB;QAChB,WAAW;QACX,UAAU;QACV,gBAAgB;QAChB,cAAc;QACd,eAAe;
|
|
1
|
+
{"version":3,"file":"popover.js","sourceRoot":"","sources":["../../src/rules/popover.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAS;IAC3B,EAAE,EAAE,4BAA4B;IAChC,KAAK,EAAE,kCAAkC;IACzC,QAAQ,EAAE;QACR,oBAAoB;QACpB,wBAAwB;QACxB,kBAAkB;QAClB,gBAAgB;QAChB,WAAW;QACX,UAAU;QACV,gBAAgB;QAChB,cAAc;QACd,eAAe;QACf,cAAc;QACd,WAAW;KACZ;IACD,UAAU,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC;IAC7C,MAAM,EAAE,6CAA6C;IACrD,KAAK,EAAE;QACL,SAAS,EACP,ugBAAugB;QACzgB,OAAO,EAAE;;;;;;;;;;;;;;;;;;SAkBJ;QACL,OAAO,EAAE,6CAA6C;QACtD,MAAM,EAAE,8DAA8D;KACvE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,oEAAoE;QAC1E,MAAM,EAAE;YACN,4KAA4K;YAC5K,iIAAiI;YACjI,0DAA0D;YAC1D,iHAAiH;YACjH,uEAAuE;SACxE;QACD,OAAO,EAAE;;;;;;;;;;SAUJ;KACN;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relative-time.d.ts","sourceRoot":"","sources":["../../src/rules/relative-time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,IAwB1B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const relativeTime = {
|
|
2
|
+
id: "relative-time",
|
|
3
|
+
title: "Relative time formatting",
|
|
4
|
+
replaces: ["javascript-time-ago", "timeago.js", "react-timeago"],
|
|
5
|
+
featureIds: ["intl-relative-time-format"],
|
|
6
|
+
native: "Intl.RelativeTimeFormat",
|
|
7
|
+
human: {
|
|
8
|
+
explainer: 'These libraries hardcode the phrasing for every locale they support: "5 minutes ago", "in 2 days", and all the plural and grammar rules behind them. Intl.RelativeTimeFormat is that same locale data, shipped inside the browser and kept current by the platform instead of a dependency you update by hand.',
|
|
9
|
+
snippet: `const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
10
|
+
rtf.format(-5, "minute"); // "5 minutes ago"`,
|
|
11
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat",
|
|
12
|
+
},
|
|
13
|
+
agent: {
|
|
14
|
+
when: 'formatting a timestamp as relative text, such as "5 minutes ago" or "in 2 days"',
|
|
15
|
+
unless: [
|
|
16
|
+
'You need the value to keep ticking on its own, updating from "5 seconds ago" to "6 seconds ago" without a re-render you trigger yourself. Intl.RelativeTimeFormat only formats a value you pass it once; the scheduling these libraries add is still real code.',
|
|
17
|
+
'You need to pick the unit automatically from a raw millisecond difference. Intl.RelativeTimeFormat takes a number and a unit you already chose, such as "day" or "hour", not a duration it breaks down for you.',
|
|
18
|
+
"You need a locale Intl's relative-time data doesn't cover well on your target browsers, or offline locale data bundled ahead of time.",
|
|
19
|
+
],
|
|
20
|
+
snippet: 'new Intl.RelativeTimeFormat("en", { numeric: "auto" }).format(-5, "minute");',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=relative-time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relative-time.js","sourceRoot":"","sources":["../../src/rules/relative-time.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,CAAC,qBAAqB,EAAE,YAAY,EAAE,eAAe,CAAC;IAChE,UAAU,EAAE,CAAC,2BAA2B,CAAC;IACzC,MAAM,EAAE,yBAAyB;IACjC,KAAK,EAAE;QACL,SAAS,EACP,gTAAgT;QAClT,OAAO,EAAE;6CACgC;QACzC,MAAM,EACJ,0GAA0G;KAC7G;IACD,KAAK,EAAE;QACL,IAAI,EAAE,iFAAiF;QACvF,MAAM,EAAE;YACN,iQAAiQ;YACjQ,iNAAiN;YACjN,uIAAuI;SACxI;QACD,OAAO,EACL,8EAA8E;KACjF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable-panels.d.ts","sourceRoot":"","sources":["../../src/rules/resizable-panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"resizable-panels.d.ts","sourceRoot":"","sources":["../../src/rules/resizable-panels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,IAkC7B,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export const resizablePanels = {
|
|
2
2
|
id: "resizable-panels",
|
|
3
3
|
title: "Resizable panels",
|
|
4
|
-
replaces: [
|
|
4
|
+
replaces: [
|
|
5
|
+
"react-resizable-panels",
|
|
6
|
+
"re-resizable",
|
|
7
|
+
"react-split-pane",
|
|
8
|
+
"splitpanes",
|
|
9
|
+
],
|
|
5
10
|
featureIds: ["resize"],
|
|
6
11
|
native: "resize",
|
|
7
12
|
human: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable-panels.js","sourceRoot":"","sources":["../../src/rules/resizable-panels.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,kBAAkB;IACzB,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"resizable-panels.js","sourceRoot":"","sources":["../../src/rules/resizable-panels.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,kBAAkB;IACzB,QAAQ,EAAE;QACR,wBAAwB;QACxB,cAAc;QACd,kBAAkB;QAClB,YAAY;KACb;IACD,UAAU,EAAE,CAAC,QAAQ,CAAC;IACtB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE;QACL,SAAS,EACP,ubAAub;QACzb,OAAO,EAAE;;;;;EAKX;QACE,MAAM,EAAE,yDAAyD;KAClE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6EAA6E;QACnF,MAAM,EAAE;YACN,mOAAmO;YACnO,+JAA+J;YAC/J,6JAA6J;YAC7J,mJAAmJ;YACnJ,uJAAuJ;SACxJ;QACD,OAAO,EACL,sFAAsF;KACzF;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-observer.d.ts","sourceRoot":"","sources":["../../src/rules/resize-observer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,IA0B5B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const resizeObserver = {
|
|
2
|
+
id: "resize-observer",
|
|
3
|
+
title: "Element resize tracking",
|
|
4
|
+
replaces: ["resize-observer-polyfill", "@juggle/resize-observer"],
|
|
5
|
+
featureIds: ["resize-observer"],
|
|
6
|
+
native: "ResizeObserver",
|
|
7
|
+
human: {
|
|
8
|
+
explainer: "These polyfills exist because ResizeObserver had gaps in browser support. That gap closed years ago: every major engine ships it natively now. Calling it directly watches an element's box for size changes and calls you back, with no listener on window resize and no manual layout math.",
|
|
9
|
+
snippet: `const observer = new ResizeObserver((entries) => {
|
|
10
|
+
for (const entry of entries) {
|
|
11
|
+
console.log(entry.contentBoxSize);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
observer.observe(document.querySelector("#panel"));`,
|
|
15
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver",
|
|
16
|
+
},
|
|
17
|
+
agent: {
|
|
18
|
+
when: "running code when an element's own box changes size, not just the viewport",
|
|
19
|
+
unless: [
|
|
20
|
+
"You need a framework hook's ergonomics, such as a ref and a reactive size value, rather than managing an observer instance yourself.",
|
|
21
|
+
"You're targeting an engine old enough that the polyfill's manual measurement fallback is still doing real work.",
|
|
22
|
+
"You need devicePixelContentBoxSize specifically. That entry is still limited to Chromium engines.",
|
|
23
|
+
],
|
|
24
|
+
snippet: "new ResizeObserver((entries) => { ... }).observe(el);",
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=resize-observer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-observer.js","sourceRoot":"","sources":["../../src/rules/resize-observer.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,yBAAyB;IAChC,QAAQ,EAAE,CAAC,0BAA0B,EAAE,yBAAyB,CAAC;IACjE,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE;QACL,SAAS,EACP,+RAA+R;QACjS,OAAO,EAAE;;;;;oDAKuC;QAChD,MAAM,EAAE,iEAAiE;KAC1E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4EAA4E;QAClF,MAAM,EAAE;YACN,sIAAsI;YACtI,iHAAiH;YACjH,mGAAmG;SACpG;QACD,OAAO,EAAE,uDAAuD;KACjE;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-wake-lock.d.ts","sourceRoot":"","sources":["../../src/rules/screen-wake-lock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,cAAc,EAAE,IAuB5B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const screenWakeLock = {
|
|
2
|
+
id: "screen-wake-lock",
|
|
3
|
+
title: "Keeping the screen awake",
|
|
4
|
+
replaces: ["nosleep.js", "react-use-wake-lock"],
|
|
5
|
+
featureIds: ["screen-wake-lock"],
|
|
6
|
+
native: 'navigator.wakeLock.request("screen")',
|
|
7
|
+
human: {
|
|
8
|
+
explainer: "nosleep.js kept the screen on with a trick: playing a silent, invisible video, because there was no direct way to ask for this. The Wake Lock API asks directly, and releases automatically when the tab is backgrounded rather than needing you to remember to stop the video yourself.",
|
|
9
|
+
snippet: `const lock = await navigator.wakeLock.request("screen");
|
|
10
|
+
// later, or automatically when the tab backgrounds
|
|
11
|
+
await lock.release();`,
|
|
12
|
+
mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API",
|
|
13
|
+
},
|
|
14
|
+
agent: {
|
|
15
|
+
when: "keeping the screen from sleeping while a page is active, such as during a recipe, presentation, or workout",
|
|
16
|
+
unless: [
|
|
17
|
+
"You support Safari before version 16.4, or need the lock to survive the tab losing focus. The platform releases it automatically the moment the tab backgrounds, with no way to opt out.",
|
|
18
|
+
"You need this in a non-secure (non-HTTPS) context, where the API isn't available at all.",
|
|
19
|
+
],
|
|
20
|
+
snippet: `const lock = await navigator.wakeLock.request("screen");`,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=screen-wake-lock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen-wake-lock.js","sourceRoot":"","sources":["../../src/rules/screen-wake-lock.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,cAAc,GAAS;IAClC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAC/C,UAAU,EAAE,CAAC,kBAAkB,CAAC;IAChC,MAAM,EAAE,sCAAsC;IAC9C,KAAK,EAAE;QACL,SAAS,EACP,0RAA0R;QAC5R,OAAO,EAAE;;sBAES;QAClB,MAAM,EACJ,uEAAuE;KAC1E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4GAA4G;QAClH,MAAM,EAAE;YACN,0LAA0L;YAC1L,0FAA0F;SAC3F;QACD,OAAO,EAAE,0DAA0D;KACpE;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbars.d.ts","sourceRoot":"","sources":["../../src/rules/scrollbars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"scrollbars.d.ts","sourceRoot":"","sources":["../../src/rules/scrollbars.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,UAAU,EAAE,IA+CxB,CAAC"}
|
package/dist/rules/scrollbars.js
CHANGED
|
@@ -9,6 +9,9 @@ export const scrollbars = {
|
|
|
9
9
|
"overlayscrollbars",
|
|
10
10
|
"overlayscrollbars-react",
|
|
11
11
|
"perfect-scrollbar",
|
|
12
|
+
"vue-perfect-scrollbar",
|
|
13
|
+
"overlayscrollbars-vue",
|
|
14
|
+
"ngx-perfect-scrollbar",
|
|
12
15
|
],
|
|
13
16
|
featureIds: ["scrollbar-width", "scrollbar-color", "scrollbar-gutter"],
|
|
14
17
|
native: "scrollbar-width, scrollbar-color and scrollbar-gutter",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbars.js","sourceRoot":"","sources":["../../src/rules/scrollbars.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE;QACR,yBAAyB;QACzB,2BAA2B;QAC3B,WAAW;QACX,iBAAiB;QACjB,mBAAmB;QACnB,yBAAyB;QACzB,mBAAmB;
|
|
1
|
+
{"version":3,"file":"scrollbars.js","sourceRoot":"","sources":["../../src/rules/scrollbars.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAS;IAC9B,EAAE,EAAE,mBAAmB;IACvB,KAAK,EAAE,mBAAmB;IAC1B,QAAQ,EAAE;QACR,yBAAyB;QACzB,2BAA2B;QAC3B,WAAW;QACX,iBAAiB;QACjB,mBAAmB;QACnB,yBAAyB;QACzB,mBAAmB;QACnB,uBAAuB;QACvB,uBAAuB;QACvB,uBAAuB;KACxB;IACD,UAAU,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,kBAAkB,CAAC;IACtE,MAAM,EAAE,uDAAuD;IAC/D,KAAK,EAAE;QACL,SAAS,EACP,wdAAwd;QAC1d,OAAO,EAAE;;;;;;;;;;EAUX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,gGAAgG;QACtG,MAAM,EAAE;YACN,iMAAiM;YACjM,yGAAyG;YACzG,6HAA6H;YAC7H,iHAAiH;SAClH;QACD,OAAO,EAAE;;;;EAIX;KACC;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/rules/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../src/rules/select.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,IA+DpB,CAAC"}
|
package/dist/rules/select.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
export const select = {
|
|
2
2
|
id: "customizable-select",
|
|
3
3
|
title: "Custom select menus",
|
|
4
|
-
replaces: [
|
|
4
|
+
replaces: [
|
|
5
|
+
"react-select",
|
|
6
|
+
"choices.js",
|
|
7
|
+
"select2",
|
|
8
|
+
"tom-select",
|
|
9
|
+
"vue-select",
|
|
10
|
+
"vue-multiselect",
|
|
11
|
+
"@ng-select/ng-select",
|
|
12
|
+
"svelte-select",
|
|
13
|
+
],
|
|
5
14
|
featureIds: ["customizable-select"],
|
|
6
15
|
native: "appearance: base-select on <select>",
|
|
7
16
|
human: {
|
package/dist/rules/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/rules/select.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,qBAAqB;IACzB,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/rules/select.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,qBAAqB;IACzB,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE;QACR,cAAc;QACd,YAAY;QACZ,SAAS;QACT,YAAY;QACZ,YAAY;QACZ,iBAAiB;QACjB,sBAAsB;QACtB,eAAe;KAChB;IACD,UAAU,EAAE,CAAC,qBAAqB,CAAC;IACnC,MAAM,EAAE,qCAAqC;IAC7C,KAAK,EAAE;QACL,SAAS,EACP,+YAA+Y;QACjZ,OAAO,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;SA0BJ;QACL,MAAM,EAAE,6DAA6D;KACtE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,4EAA4E;QAClF,MAAM,EAAE;YACN,0LAA0L;YAC1L,qFAAqF;YACrF,gLAAgL;YAChL,qEAAqE;SACtE;QACD,OAAO,EAAE;;;;;;SAMJ;KACN;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smooth-scroll.d.ts","sourceRoot":"","sources":["../../src/rules/smooth-scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"smooth-scroll.d.ts","sourceRoot":"","sources":["../../src/rules/smooth-scroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,YAAY,EAAE,IA0C1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smooth-scroll.js","sourceRoot":"","sources":["../../src/rules/smooth-scroll.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,uCAAuC;IAC9C,QAAQ,EAAE;QACR,cAAc;QACd,uBAAuB;QACvB,0BAA0B;QAC1B,eAAe;QACf,SAAS;
|
|
1
|
+
{"version":3,"file":"smooth-scroll.js","sourceRoot":"","sources":["../../src/rules/smooth-scroll.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,uCAAuC;IAC9C,QAAQ,EAAE;QACR,cAAc;QACd,uBAAuB;QACvB,0BAA0B;QAC1B,eAAe;QACf,SAAS;QACT,cAAc;KACf;IACD,UAAU,EAAE,CAAC,iBAAiB,CAAC;IAC/B,MAAM,EAAE,gDAAgD;IACxD,KAAK,EAAE;QACL,SAAS,EACP,mYAAmY;QACrY,OAAO,EAAE;;;;;;;;;;EAUX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,6DAA6D;QACnE,MAAM,EAAE;YACN,mHAAmH;YACnH,6GAA6G;YAC7G,gFAAgF;YAChF,8KAA8K;SAC/K;QACD,OAAO,EAAE;;;kCAGqB;KAC/B;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speech-recognition.d.ts","sourceRoot":"","sources":["../../src/rules/speech-recognition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,iBAAiB,EAAE,IA2B/B,CAAC"}
|