@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.
Files changed (145) hide show
  1. package/README.md +1 -1
  2. package/dist/baseline.d.ts +11 -0
  3. package/dist/baseline.d.ts.map +1 -1
  4. package/dist/baseline.js +50 -1
  5. package/dist/baseline.js.map +1 -1
  6. package/dist/format.js +1 -1
  7. package/dist/format.js.map +1 -1
  8. package/dist/generated/baseline.d.ts +6 -0
  9. package/dist/generated/baseline.d.ts.map +1 -1
  10. package/dist/generated/baseline.js +494 -38
  11. package/dist/generated/baseline.js.map +1 -1
  12. package/dist/generated/sizes.d.ts.map +1 -1
  13. package/dist/generated/sizes.js +419 -9
  14. package/dist/generated/sizes.js.map +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/rules/abort-controller.d.ts +3 -0
  20. package/dist/rules/abort-controller.d.ts.map +1 -0
  21. package/dist/rules/abort-controller.js +25 -0
  22. package/dist/rules/abort-controller.js.map +1 -0
  23. package/dist/rules/broadcast-channel.d.ts +3 -0
  24. package/dist/rules/broadcast-channel.d.ts.map +1 -0
  25. package/dist/rules/broadcast-channel.js +25 -0
  26. package/dist/rules/broadcast-channel.js.map +1 -0
  27. package/dist/rules/carousel.d.ts.map +1 -1
  28. package/dist/rules/carousel.js +3 -0
  29. package/dist/rules/carousel.js.map +1 -1
  30. package/dist/rules/clipboard.d.ts +3 -0
  31. package/dist/rules/clipboard.d.ts.map +1 -0
  32. package/dist/rules/clipboard.js +32 -0
  33. package/dist/rules/clipboard.js.map +1 -0
  34. package/dist/rules/color-functions.d.ts.map +1 -1
  35. package/dist/rules/color-functions.js +8 -1
  36. package/dist/rules/color-functions.js.map +1 -1
  37. package/dist/rules/compression-streams.d.ts +3 -0
  38. package/dist/rules/compression-streams.d.ts.map +1 -0
  39. package/dist/rules/compression-streams.js +25 -0
  40. package/dist/rules/compression-streams.js.map +1 -0
  41. package/dist/rules/container-queries.d.ts.map +1 -1
  42. package/dist/rules/container-queries.js +1 -0
  43. package/dist/rules/container-queries.js.map +1 -1
  44. package/dist/rules/content-visibility.d.ts.map +1 -1
  45. package/dist/rules/content-visibility.js +8 -1
  46. package/dist/rules/content-visibility.js.map +1 -1
  47. package/dist/rules/date-time-input.d.ts.map +1 -1
  48. package/dist/rules/date-time-input.js +2 -0
  49. package/dist/rules/date-time-input.js.map +1 -1
  50. package/dist/rules/dialog.d.ts.map +1 -1
  51. package/dist/rules/dialog.js +3 -0
  52. package/dist/rules/dialog.js.map +1 -1
  53. package/dist/rules/drag-and-drop.d.ts +3 -0
  54. package/dist/rules/drag-and-drop.d.ts.map +1 -0
  55. package/dist/rules/drag-and-drop.js +29 -0
  56. package/dist/rules/drag-and-drop.js.map +1 -0
  57. package/dist/rules/field-sizing.d.ts.map +1 -1
  58. package/dist/rules/field-sizing.js +7 -1
  59. package/dist/rules/field-sizing.js.map +1 -1
  60. package/dist/rules/focus-visible.d.ts +3 -0
  61. package/dist/rules/focus-visible.d.ts.map +1 -0
  62. package/dist/rules/focus-visible.js +26 -0
  63. package/dist/rules/focus-visible.js.map +1 -0
  64. package/dist/rules/fullscreen.d.ts +3 -0
  65. package/dist/rules/fullscreen.d.ts.map +1 -0
  66. package/dist/rules/fullscreen.js +28 -0
  67. package/dist/rules/fullscreen.js.map +1 -0
  68. package/dist/rules/index.d.ts.map +1 -1
  69. package/dist/rules/index.js +38 -0
  70. package/dist/rules/index.js.map +1 -1
  71. package/dist/rules/intersection-observer.d.ts +3 -0
  72. package/dist/rules/intersection-observer.d.ts.map +1 -0
  73. package/dist/rules/intersection-observer.js +34 -0
  74. package/dist/rules/intersection-observer.js.map +1 -0
  75. package/dist/rules/lazy-loading.d.ts.map +1 -1
  76. package/dist/rules/lazy-loading.js +2 -0
  77. package/dist/rules/lazy-loading.js.map +1 -1
  78. package/dist/rules/line-clamp.d.ts +3 -0
  79. package/dist/rules/line-clamp.d.ts.map +1 -0
  80. package/dist/rules/line-clamp.js +38 -0
  81. package/dist/rules/line-clamp.js.map +1 -0
  82. package/dist/rules/masonry.d.ts.map +1 -1
  83. package/dist/rules/masonry.js +2 -0
  84. package/dist/rules/masonry.js.map +1 -1
  85. package/dist/rules/number-format.d.ts +3 -0
  86. package/dist/rules/number-format.d.ts.map +1 -0
  87. package/dist/rules/number-format.js +25 -0
  88. package/dist/rules/number-format.js.map +1 -0
  89. package/dist/rules/page-visibility.d.ts +3 -0
  90. package/dist/rules/page-visibility.d.ts.map +1 -0
  91. package/dist/rules/page-visibility.js +24 -0
  92. package/dist/rules/page-visibility.js.map +1 -0
  93. package/dist/rules/popover.d.ts.map +1 -1
  94. package/dist/rules/popover.js +2 -0
  95. package/dist/rules/popover.js.map +1 -1
  96. package/dist/rules/relative-time.d.ts +3 -0
  97. package/dist/rules/relative-time.d.ts.map +1 -0
  98. package/dist/rules/relative-time.js +23 -0
  99. package/dist/rules/relative-time.js.map +1 -0
  100. package/dist/rules/resizable-panels.d.ts.map +1 -1
  101. package/dist/rules/resizable-panels.js +6 -1
  102. package/dist/rules/resizable-panels.js.map +1 -1
  103. package/dist/rules/resize-observer.d.ts +3 -0
  104. package/dist/rules/resize-observer.d.ts.map +1 -0
  105. package/dist/rules/resize-observer.js +27 -0
  106. package/dist/rules/resize-observer.js.map +1 -0
  107. package/dist/rules/screen-wake-lock.d.ts +3 -0
  108. package/dist/rules/screen-wake-lock.d.ts.map +1 -0
  109. package/dist/rules/screen-wake-lock.js +23 -0
  110. package/dist/rules/screen-wake-lock.js.map +1 -0
  111. package/dist/rules/scrollbars.d.ts.map +1 -1
  112. package/dist/rules/scrollbars.js +3 -0
  113. package/dist/rules/scrollbars.js.map +1 -1
  114. package/dist/rules/select.d.ts.map +1 -1
  115. package/dist/rules/select.js +10 -1
  116. package/dist/rules/select.js.map +1 -1
  117. package/dist/rules/smooth-scroll.d.ts.map +1 -1
  118. package/dist/rules/smooth-scroll.js +1 -0
  119. package/dist/rules/smooth-scroll.js.map +1 -1
  120. package/dist/rules/speech-recognition.d.ts +3 -0
  121. package/dist/rules/speech-recognition.d.ts.map +1 -0
  122. package/dist/rules/speech-recognition.js +27 -0
  123. package/dist/rules/speech-recognition.js.map +1 -0
  124. package/dist/rules/speech-synthesis.d.ts +3 -0
  125. package/dist/rules/speech-synthesis.d.ts.map +1 -0
  126. package/dist/rules/speech-synthesis.js +22 -0
  127. package/dist/rules/speech-synthesis.js.map +1 -0
  128. package/dist/rules/sticky.d.ts.map +1 -1
  129. package/dist/rules/sticky.js +2 -0
  130. package/dist/rules/sticky.js.map +1 -1
  131. package/dist/rules/structured-clone.d.ts +3 -0
  132. package/dist/rules/structured-clone.d.ts.map +1 -0
  133. package/dist/rules/structured-clone.js +21 -0
  134. package/dist/rules/structured-clone.js.map +1 -0
  135. package/dist/rules/web-bluetooth.d.ts +3 -0
  136. package/dist/rules/web-bluetooth.d.ts.map +1 -0
  137. package/dist/rules/web-bluetooth.js +25 -0
  138. package/dist/rules/web-bluetooth.js.map +1 -0
  139. package/dist/rules/web-share.d.ts +3 -0
  140. package/dist/rules/web-share.d.ts.map +1 -0
  141. package/dist/rules/web-share.js +27 -0
  142. package/dist/rules/web-share.js.map +1 -0
  143. package/dist/schema.js +1 -1
  144. package/dist/schema.js.map +1 -1
  145. package/package.json +2 -2
@@ -0,0 +1,27 @@
1
+ export const speechRecognition = {
2
+ id: "speech-recognition",
3
+ title: "Voice input",
4
+ replaces: ["annyang", "react-speech-recognition"],
5
+ featureIds: ["speech-recognition"],
6
+ native: "SpeechRecognition",
7
+ human: {
8
+ explainer: "annyang and react-speech-recognition both wrap the same underlying API, adding phrase matching or restart-on-silence logic around it. The API itself lets a page listen for speech and get back a transcript, with no server round-trip for the recognition step in Chromium's implementation.",
9
+ snippet: `const recognition = new SpeechRecognition();
10
+ recognition.onresult = (event) => {
11
+ console.log(event.results[0][0].transcript);
12
+ };
13
+ recognition.start();`,
14
+ mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition",
15
+ },
16
+ agent: {
17
+ when: "capturing a speech-to-text transcript directly in the browser",
18
+ unless: [
19
+ "You need this outside Chrome or Edge. No other engine ships SpeechRecognition, so this is Chromium-only in practice today.",
20
+ "You need continuous recognition that automatically restarts after the browser's built-in silence timeout. That restart logic is exactly what these libraries still add.",
21
+ "You need offline recognition. Chrome's implementation sends audio to Google's servers for transcription.",
22
+ ],
23
+ snippet: `const recognition = new SpeechRecognition();
24
+ recognition.start();`,
25
+ },
26
+ };
27
+ //# sourceMappingURL=speech-recognition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speech-recognition.js","sourceRoot":"","sources":["../../src/rules/speech-recognition.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAS;IACrC,EAAE,EAAE,oBAAoB;IACxB,KAAK,EAAE,aAAa;IACpB,QAAQ,EAAE,CAAC,SAAS,EAAE,0BAA0B,CAAC;IACjD,UAAU,EAAE,CAAC,oBAAoB,CAAC;IAClC,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,gSAAgS;QAClS,OAAO,EAAE;;;;qBAIQ;QACjB,MAAM,EACJ,oEAAoE;KACvE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,+DAA+D;QACrE,MAAM,EAAE;YACN,4HAA4H;YAC5H,yKAAyK;YACzK,0GAA0G;SAC3G;QACD,OAAO,EAAE;qBACQ;KAClB;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from "../schema.ts";
2
+ export declare const speechSynthesis: Rule;
3
+ //# sourceMappingURL=speech-synthesis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speech-synthesis.d.ts","sourceRoot":"","sources":["../../src/rules/speech-synthesis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,eAAe,EAAE,IAqB7B,CAAC"}
@@ -0,0 +1,22 @@
1
+ export const speechSynthesis = {
2
+ id: "speech-synthesis",
3
+ title: "Text to speech",
4
+ replaces: ["speak-tts", "react-text-to-speech"],
5
+ featureIds: ["speech-synthesis"],
6
+ native: "SpeechSynthesis and SpeechSynthesisUtterance",
7
+ human: {
8
+ explainer: "speak-tts is a queueing and promise layer over the browser's own SpeechSynthesis API. The browser already exposes every installed system voice and a speaking queue; the wrapper mostly makes calling it feel more like a promise.",
9
+ snippet: `const utterance = new SpeechSynthesisUtterance("Hello there");
10
+ speechSynthesis.speak(utterance);`,
11
+ mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis",
12
+ },
13
+ agent: {
14
+ when: "reading text aloud with the browser's own text-to-speech engine",
15
+ unless: [
16
+ "You need a specific voice bundled with your app rather than whatever the person's operating system happens to have installed. Voice availability and quality vary by device.",
17
+ "You need the callback-based API wrapped in a promise, or queueing logic across multiple utterances. The library still saves real code there.",
18
+ ],
19
+ snippet: "speechSynthesis.speak(new SpeechSynthesisUtterance(text));",
20
+ },
21
+ };
22
+ //# sourceMappingURL=speech-synthesis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speech-synthesis.js","sourceRoot":"","sources":["../../src/rules/speech-synthesis.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAS;IACnC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,gBAAgB;IACvB,QAAQ,EAAE,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAC/C,UAAU,EAAE,CAAC,kBAAkB,CAAC;IAChC,MAAM,EAAE,8CAA8C;IACtD,KAAK,EAAE;QACL,SAAS,EACP,oOAAoO;QACtO,OAAO,EAAE;kCACqB;QAC9B,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,iEAAiE;QACvE,MAAM,EAAE;YACN,8KAA8K;YAC9K,8IAA8I;SAC/I;QACD,OAAO,EAAE,4DAA4D;KACtE;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../../src/rules/sticky.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,IAuCpB,CAAC"}
1
+ {"version":3,"file":"sticky.d.ts","sourceRoot":"","sources":["../../src/rules/sticky.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,MAAM,EAAE,IAyCpB,CAAC"}
@@ -7,6 +7,8 @@ export const sticky = {
7
7
  "react-sticky",
8
8
  "sticky-kit",
9
9
  "stickybits",
10
+ "vue-sticky-directive",
11
+ "vue-sticky",
10
12
  ],
11
13
  featureIds: ["sticky-positioning"],
12
14
  native: "position: sticky",
@@ -1 +1 @@
1
- {"version":3,"file":"sticky.js","sourceRoot":"","sources":["../../src/rules/sticky.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,oBAAoB;IACxB,KAAK,EAAE,6BAA6B;IACpC,QAAQ,EAAE;QACR,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,YAAY;KACb;IACD,UAAU,EAAE,CAAC,oBAAoB,CAAC;IAClC,MAAM,EAAE,kBAAkB;IAC1B,KAAK,EAAE;QACL,SAAS,EACP,iaAAia;QACna,OAAO,EAAE;;;;;;;;;;;EAWX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,0EAA0E;QAChF,MAAM,EAAE;YACN,iLAAiL;YACjL,kLAAkL;YAClL,qFAAqF;SACtF;QACD,OAAO,EAAE;6DACgD;KAC1D;CACF,CAAC"}
1
+ {"version":3,"file":"sticky.js","sourceRoot":"","sources":["../../src/rules/sticky.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,MAAM,GAAS;IAC1B,EAAE,EAAE,oBAAoB;IACxB,KAAK,EAAE,6BAA6B;IACpC,QAAQ,EAAE;QACR,WAAW;QACX,YAAY;QACZ,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,sBAAsB;QACtB,YAAY;KACb;IACD,UAAU,EAAE,CAAC,oBAAoB,CAAC;IAClC,MAAM,EAAE,kBAAkB;IAC1B,KAAK,EAAE;QACL,SAAS,EACP,iaAAia;QACna,OAAO,EAAE;;;;;;;;;;;EAWX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,0EAA0E;QAChF,MAAM,EAAE;YACN,iLAAiL;YACjL,kLAAkL;YAClL,qFAAqF;SACtF;QACD,OAAO,EAAE;6DACgD;KAC1D;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from "../schema.ts";
2
+ export declare const structuredCloneRule: Rule;
3
+ //# sourceMappingURL=structured-clone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured-clone.d.ts","sourceRoot":"","sources":["../../src/rules/structured-clone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,mBAAmB,EAAE,IAoBjC,CAAC"}
@@ -0,0 +1,21 @@
1
+ export const structuredCloneRule = {
2
+ id: "structured-clone",
3
+ title: "Deep cloning",
4
+ replaces: ["lodash.clonedeep", "rfdc", "clone", "klona"],
5
+ featureIds: ["structured-clone"],
6
+ native: "structuredClone()",
7
+ human: {
8
+ explainer: "These packages walk an object graph by hand, copying nested arrays and objects one property at a time so the copy shares no references with the original. A global function now does the same job: structuredClone() copies arrays, plain objects, Maps, Sets, and dates in one call, no walking required.",
9
+ snippet: "const copy = structuredClone(original);",
10
+ mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/structuredClone",
11
+ },
12
+ agent: {
13
+ when: "deep-copying plain data such as arrays, objects, Maps, Sets, and dates",
14
+ unless: [
15
+ "You need to clone functions, DOM nodes, or class instances with prototypes. structuredClone throws on all three, where lodash's version silently drops what it can't handle instead.",
16
+ "You need to clone something containing a value structuredClone doesn't support, such as an Error's custom properties beyond message and name.",
17
+ ],
18
+ snippet: "const copy = structuredClone(original);",
19
+ },
20
+ };
21
+ //# sourceMappingURL=structured-clone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured-clone.js","sourceRoot":"","sources":["../../src/rules/structured-clone.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,mBAAmB,GAAS;IACvC,EAAE,EAAE,kBAAkB;IACtB,KAAK,EAAE,cAAc;IACrB,QAAQ,EAAE,CAAC,kBAAkB,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;IACxD,UAAU,EAAE,CAAC,kBAAkB,CAAC;IAChC,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,4SAA4S;QAC9S,OAAO,EAAE,yCAAyC;QAClD,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,wEAAwE;QAC9E,MAAM,EAAE;YACN,sLAAsL;YACtL,+IAA+I;SAChJ;QACD,OAAO,EAAE,yCAAyC;KACnD;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from "../schema.ts";
2
+ export declare const webBluetooth: Rule;
3
+ //# sourceMappingURL=web-bluetooth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-bluetooth.d.ts","sourceRoot":"","sources":["../../src/rules/web-bluetooth.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 webBluetooth = {
2
+ id: "web-bluetooth",
3
+ title: "Bluetooth device access",
4
+ replaces: ["@capacitor-community/bluetooth-le", "cordova-plugin-ble-central"],
5
+ featureIds: ["web-bluetooth"],
6
+ native: "navigator.bluetooth.requestDevice()",
7
+ human: {
8
+ explainer: "Talking to a Bluetooth peripheral from a web app used to mean wrapping the page in a native shell such as Cordova or Capacitor and reaching for a plugin that called into the operating system's own Bluetooth stack. A page running directly in a supporting browser can request a device, connect to its GATT services, and read or write characteristics with no native wrapper at all. This is a narrower case than most of this catalog. It replaces the native-app packaging step these plugins exist for, rather than a JavaScript library doing work the browser could already do.",
9
+ snippet: `const device = await navigator.bluetooth.requestDevice({
10
+ acceptAllDevices: true,
11
+ });
12
+ const server = await device.gatt.connect();`,
13
+ mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API",
14
+ },
15
+ agent: {
16
+ when: "connecting to a Bluetooth Low Energy device directly from a web page",
17
+ unless: [
18
+ "You need to support iOS in any browser. Apple has stated it has no plans to implement Web Bluetooth. That gap is permanent for iPhone and iPad users.",
19
+ "You need background scanning or a connection that survives the tab closing. The API only works while the page is open.",
20
+ "You are already shipping a native app shell for other reasons. The plugin ecosystem is more mature for background operation and OS-level pairing UI.",
21
+ ],
22
+ snippet: "await navigator.bluetooth.requestDevice({ acceptAllDevices: true });",
23
+ },
24
+ };
25
+ //# sourceMappingURL=web-bluetooth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-bluetooth.js","sourceRoot":"","sources":["../../src/rules/web-bluetooth.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAS;IAChC,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,yBAAyB;IAChC,QAAQ,EAAE,CAAC,mCAAmC,EAAE,4BAA4B,CAAC;IAC7E,UAAU,EAAE,CAAC,eAAe,CAAC;IAC7B,MAAM,EAAE,qCAAqC;IAC7C,KAAK,EAAE;QACL,SAAS,EACP,4jBAA4jB;QAC9jB,OAAO,EAAE;;;4CAG+B;QACxC,MAAM,EACJ,oEAAoE;KACvE;IACD,KAAK,EAAE;QACL,IAAI,EAAE,sEAAsE;QAC5E,MAAM,EAAE;YACN,uJAAuJ;YACvJ,wHAAwH;YACxH,sJAAsJ;SACvJ;QACD,OAAO,EACL,sEAAsE;KACzE;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Rule } from "../schema.ts";
2
+ export declare const webShare: Rule;
3
+ //# sourceMappingURL=web-share.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-share.d.ts","sourceRoot":"","sources":["../../src/rules/web-share.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,eAAO,MAAM,QAAQ,EAAE,IA2BtB,CAAC"}
@@ -0,0 +1,27 @@
1
+ export const webShare = {
2
+ id: "web-share",
3
+ title: "Sharing to other apps",
4
+ replaces: ["react-share", "vue-social-sharing", "ngx-sharebuttons"],
5
+ featureIds: ["share"],
6
+ native: "navigator.share()",
7
+ human: {
8
+ explainer: "A share library renders a row of buttons, each pointing at one network's own share-intent URL, so the page decides where the content can go. navigator.share() opens the operating system's own share sheet instead, the same one every native app uses, and lets the person pick where it goes.",
9
+ snippet: `async function share() {
10
+ await navigator.share({
11
+ title: document.title,
12
+ url: location.href,
13
+ });
14
+ }`,
15
+ mdnUrl: "https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share",
16
+ },
17
+ agent: {
18
+ when: "letting someone share the current page or a piece of content to whatever app they choose",
19
+ unless: [
20
+ "You need a button for one specific network, such as a fixed Twitter/X or LinkedIn share link. The OS share sheet lists whatever apps the person has installed, not a chosen set.",
21
+ "You support Firefox on desktop. It has never shipped the Web Share API outside Android.",
22
+ "You need to share a file the person doesn't already have a URL for. That needs the file-sharing variant of the API, which has narrower browser support again.",
23
+ ],
24
+ snippet: "await navigator.share({ title: document.title, url: location.href });",
25
+ },
26
+ };
27
+ //# sourceMappingURL=web-share.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-share.js","sourceRoot":"","sources":["../../src/rules/web-share.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAS;IAC5B,EAAE,EAAE,WAAW;IACf,KAAK,EAAE,uBAAuB;IAC9B,QAAQ,EAAE,CAAC,aAAa,EAAE,oBAAoB,EAAE,kBAAkB,CAAC;IACnE,UAAU,EAAE,CAAC,OAAO,CAAC;IACrB,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE;QACL,SAAS,EACP,kSAAkS;QACpS,OAAO,EAAE;;;;;EAKX;QACE,MAAM,EAAE,kEAAkE;KAC3E;IACD,KAAK,EAAE;QACL,IAAI,EAAE,0FAA0F;QAChG,MAAM,EAAE;YACN,kLAAkL;YAClL,yFAAyF;YACzF,+JAA+J;SAChK;QACD,OAAO,EACL,uEAAuE;KAC1E;CACF,CAAC"}
package/dist/schema.js CHANGED
@@ -60,7 +60,7 @@ export const ruleSchema = z
60
60
  human: z.object({
61
61
  /** 2 to 4 sentences of prose. */
62
62
  explainer: z.string().min(1),
63
- /** Copy-pasteable CSS or HTML. */
63
+ /** Copy-pasteable CSS, HTML, or JavaScript. */
64
64
  snippet: z.string().min(1),
65
65
  /** A live demo or a post that walks through it. */
66
66
  demoUrl: z.url().optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IACzC,QAAQ;IACR,OAAO;IACP,SAAS;IACT,SAAS;CACV,CAAC,CAAC;AAGH,MAAM,OAAO,GAAG,CAAC;KACd,MAAM,EAAE;KACR,KAAK,CAAC,qBAAqB,EAAE,kCAAkC,CAAC,CAAC;AAEpE,MAAM,IAAI,GAAG,CAAC;KACX,MAAM,EAAE;KACR,KAAK,CA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EAAE,EAAE,CAAC;QAC5C,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACzB,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;gBACnB,OAAO,EAAE,sBAAsB,IAAI,CAAC,EAAE,GAAG;aAC1C,CAAC,CAAC;QACL,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAErB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChC,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,KAAK,EAAE,CAAC;gBACV,GAAG,CAAC,QAAQ,CAAC;oBACX,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC;oBACzB,OAAO,EAAE,IAAI,GAAG,iCAAiC,KAAK,2FAA2F;iBAClJ,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,8EAA8E;AAC9E,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@jomae/catalog",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
- "description": "The rule catalog behind youmightnotneed. Maps npm packages to the modern CSS and HTML that replaces them.",
5
+ "description": "The rule catalog behind youmightnotneed. Maps npm packages to the CSS, HTML, or Web API that replaces them.",
6
6
  "license": "MIT",
7
7
  "author": "Johannes Maendle",
8
8
  "homepage": "https://youmightnotneed-web.vercel.app",