@opensite/hooks 2.0.0 → 2.0.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.
Files changed (87) hide show
  1. package/dist/browser/opensite-hooks.umd.cjs +1 -1
  2. package/dist/browser/opensite-hooks.umd.js +1 -1
  3. package/dist/browser/opensite-hooks.umd.js.map +1 -1
  4. package/dist/core/index.cjs +7 -0
  5. package/dist/core/index.d.ts +13 -0
  6. package/dist/core/index.js +7 -0
  7. package/dist/core/useOpenGraphExtractor.cjs +59 -0
  8. package/dist/core/useOpenGraphExtractor.d.ts +64 -0
  9. package/dist/core/useOpenGraphExtractor.js +59 -0
  10. package/dist/core/useWebsiteExtractorBase.cjs +153 -0
  11. package/dist/core/useWebsiteExtractorBase.d.ts +9 -0
  12. package/dist/core/useWebsiteExtractorBase.js +153 -0
  13. package/dist/core/useWebsiteLinksExtractor.cjs +16 -0
  14. package/dist/core/useWebsiteLinksExtractor.d.ts +14 -0
  15. package/dist/core/useWebsiteLinksExtractor.js +16 -0
  16. package/dist/core/useWebsiteMetaExtractor.cjs +20 -0
  17. package/dist/core/useWebsiteMetaExtractor.d.ts +12 -0
  18. package/dist/core/useWebsiteMetaExtractor.js +20 -0
  19. package/dist/core/useWebsiteRssExtractor.cjs +15 -0
  20. package/dist/core/useWebsiteRssExtractor.d.ts +12 -0
  21. package/dist/core/useWebsiteRssExtractor.js +15 -0
  22. package/dist/core/useWebsiteSchemaExtractor.cjs +15 -0
  23. package/dist/core/useWebsiteSchemaExtractor.d.ts +11 -0
  24. package/dist/core/useWebsiteSchemaExtractor.js +15 -0
  25. package/dist/core/websiteExtractorService.cjs +66 -0
  26. package/dist/core/websiteExtractorService.d.ts +3 -0
  27. package/dist/core/websiteExtractorService.js +66 -0
  28. package/dist/core/websiteExtractorTypes.cjs +25 -0
  29. package/dist/core/websiteExtractorTypes.d.ts +65 -0
  30. package/dist/core/websiteExtractorTypes.js +25 -0
  31. package/package.json +36 -1
  32. package/dist/hooks/index.cjs +0 -16
  33. package/dist/hooks/index.d.ts +0 -24
  34. package/dist/hooks/index.js +0 -16
  35. package/dist/hooks/useBoolean.cjs +0 -1
  36. package/dist/hooks/useBoolean.d.ts +0 -2
  37. package/dist/hooks/useBoolean.js +0 -1
  38. package/dist/hooks/useCopyToClipboard.cjs +0 -1
  39. package/dist/hooks/useCopyToClipboard.d.ts +0 -2
  40. package/dist/hooks/useCopyToClipboard.js +0 -1
  41. package/dist/hooks/useDebounceCallback.cjs +0 -1
  42. package/dist/hooks/useDebounceCallback.d.ts +0 -2
  43. package/dist/hooks/useDebounceCallback.js +0 -1
  44. package/dist/hooks/useDebounceValue.cjs +0 -1
  45. package/dist/hooks/useDebounceValue.d.ts +0 -2
  46. package/dist/hooks/useDebounceValue.js +0 -1
  47. package/dist/hooks/useEventListener.cjs +0 -1
  48. package/dist/hooks/useEventListener.d.ts +0 -1
  49. package/dist/hooks/useEventListener.js +0 -1
  50. package/dist/hooks/useHover.cjs +0 -1
  51. package/dist/hooks/useHover.d.ts +0 -1
  52. package/dist/hooks/useHover.js +0 -1
  53. package/dist/hooks/useIsClient.cjs +0 -1
  54. package/dist/hooks/useIsClient.d.ts +0 -1
  55. package/dist/hooks/useIsClient.js +0 -1
  56. package/dist/hooks/useIsomorphicLayoutEffect.cjs +0 -1
  57. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +0 -1
  58. package/dist/hooks/useIsomorphicLayoutEffect.js +0 -1
  59. package/dist/hooks/useLocalStorage.cjs +0 -1
  60. package/dist/hooks/useLocalStorage.d.ts +0 -2
  61. package/dist/hooks/useLocalStorage.js +0 -1
  62. package/dist/hooks/useMap.cjs +0 -1
  63. package/dist/hooks/useMap.d.ts +0 -2
  64. package/dist/hooks/useMap.js +0 -1
  65. package/dist/hooks/useMediaQuery.cjs +0 -1
  66. package/dist/hooks/useMediaQuery.d.ts +0 -2
  67. package/dist/hooks/useMediaQuery.js +0 -1
  68. package/dist/hooks/useOnClickOutside.cjs +0 -1
  69. package/dist/hooks/useOnClickOutside.d.ts +0 -1
  70. package/dist/hooks/useOnClickOutside.js +0 -1
  71. package/dist/hooks/usePrevious.cjs +0 -1
  72. package/dist/hooks/usePrevious.d.ts +0 -1
  73. package/dist/hooks/usePrevious.js +0 -1
  74. package/dist/hooks/useResizeObserver.cjs +0 -1
  75. package/dist/hooks/useResizeObserver.d.ts +0 -1
  76. package/dist/hooks/useResizeObserver.js +0 -1
  77. package/dist/hooks/useSessionStorage.cjs +0 -1
  78. package/dist/hooks/useSessionStorage.d.ts +0 -2
  79. package/dist/hooks/useSessionStorage.js +0 -1
  80. package/dist/hooks/useThrottle.cjs +0 -1
  81. package/dist/hooks/useThrottle.d.ts +0 -2
  82. package/dist/hooks/useThrottle.js +0 -1
  83. package/dist/test/setup.cjs +0 -98
  84. package/dist/test/setup.d.ts +0 -5
  85. package/dist/test/setup.js +0 -98
  86. package/dist/test/utils.cjs +0 -73
  87. package/dist/test/utils.js +0 -73
@@ -1,73 +0,0 @@
1
- /**
2
- * Test utilities for React hook testing
3
- */
4
- import { render } from "@testing-library/react";
5
- /**
6
- * Custom render function that wraps components with providers if needed
7
- */
8
- function customRender(ui, options) {
9
- return render(ui, { ...options });
10
- }
11
- // Re-export everything from testing-library
12
- export * from "@testing-library/react";
13
- // Override render with our custom version
14
- export { customRender as render };
15
- /**
16
- * Helper to wait for a specific amount of time
17
- * Useful for testing debounce/throttle hooks
18
- */
19
- export function wait(ms) {
20
- return new Promise((resolve) => setTimeout(resolve, ms));
21
- }
22
- /**
23
- * Helper to mock matchMedia with specific matches value
24
- */
25
- export function mockMatchMedia(matches) {
26
- Object.defineProperty(window, "matchMedia", {
27
- writable: true,
28
- value: (query) => ({
29
- matches,
30
- media: query,
31
- onchange: null,
32
- addListener: () => { },
33
- removeListener: () => { },
34
- addEventListener: () => { },
35
- removeEventListener: () => { },
36
- dispatchEvent: () => false,
37
- }),
38
- });
39
- }
40
- /**
41
- * Helper to create a mock storage event
42
- */
43
- export function createStorageEvent(key, newValue, storageArea = localStorage) {
44
- return new StorageEvent("storage", {
45
- key,
46
- newValue,
47
- oldValue: null,
48
- storageArea,
49
- url: window.location.href,
50
- });
51
- }
52
- /**
53
- * Helper to create a mock resize observer entry
54
- */
55
- export function createResizeObserverEntry(target, width, height) {
56
- return {
57
- target,
58
- contentRect: {
59
- width,
60
- height,
61
- top: 0,
62
- right: width,
63
- bottom: height,
64
- left: 0,
65
- x: 0,
66
- y: 0,
67
- toJSON: () => ({}),
68
- },
69
- borderBoxSize: [{ blockSize: height, inlineSize: width }],
70
- contentBoxSize: [{ blockSize: height, inlineSize: width }],
71
- devicePixelContentBoxSize: [{ blockSize: height, inlineSize: width }],
72
- };
73
- }
@@ -1,73 +0,0 @@
1
- /**
2
- * Test utilities for React hook testing
3
- */
4
- import { render } from "@testing-library/react";
5
- /**
6
- * Custom render function that wraps components with providers if needed
7
- */
8
- function customRender(ui, options) {
9
- return render(ui, { ...options });
10
- }
11
- // Re-export everything from testing-library
12
- export * from "@testing-library/react";
13
- // Override render with our custom version
14
- export { customRender as render };
15
- /**
16
- * Helper to wait for a specific amount of time
17
- * Useful for testing debounce/throttle hooks
18
- */
19
- export function wait(ms) {
20
- return new Promise((resolve) => setTimeout(resolve, ms));
21
- }
22
- /**
23
- * Helper to mock matchMedia with specific matches value
24
- */
25
- export function mockMatchMedia(matches) {
26
- Object.defineProperty(window, "matchMedia", {
27
- writable: true,
28
- value: (query) => ({
29
- matches,
30
- media: query,
31
- onchange: null,
32
- addListener: () => { },
33
- removeListener: () => { },
34
- addEventListener: () => { },
35
- removeEventListener: () => { },
36
- dispatchEvent: () => false,
37
- }),
38
- });
39
- }
40
- /**
41
- * Helper to create a mock storage event
42
- */
43
- export function createStorageEvent(key, newValue, storageArea = localStorage) {
44
- return new StorageEvent("storage", {
45
- key,
46
- newValue,
47
- oldValue: null,
48
- storageArea,
49
- url: window.location.href,
50
- });
51
- }
52
- /**
53
- * Helper to create a mock resize observer entry
54
- */
55
- export function createResizeObserverEntry(target, width, height) {
56
- return {
57
- target,
58
- contentRect: {
59
- width,
60
- height,
61
- top: 0,
62
- right: width,
63
- bottom: height,
64
- left: 0,
65
- x: 0,
66
- y: 0,
67
- toJSON: () => ({}),
68
- },
69
- borderBoxSize: [{ blockSize: height, inlineSize: width }],
70
- contentBoxSize: [{ blockSize: height, inlineSize: width }],
71
- devicePixelContentBoxSize: [{ blockSize: height, inlineSize: width }],
72
- };
73
- }