@drjoshcsimmons/scl 0.1.7 → 0.1.8

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 (126) hide show
  1. package/dist/index100.js +30 -30
  2. package/dist/index101.js +10 -647
  3. package/dist/index102.js +8 -180
  4. package/dist/index103.js +54 -24
  5. package/dist/index104.js +30 -15
  6. package/dist/index105.js +48 -6
  7. package/dist/index106.js +14 -11
  8. package/dist/index107.js +48 -21
  9. package/dist/index108.js +30 -9
  10. package/dist/index109.js +30 -38
  11. package/dist/index11.js +2 -2
  12. package/dist/index110.js +649 -17
  13. package/dist/index111.js +30 -206
  14. package/dist/index112.js +9 -22
  15. package/dist/index113.js +40 -392
  16. package/dist/index114.js +48 -2
  17. package/dist/index115.js +6 -53
  18. package/dist/index116.js +11 -64
  19. package/dist/index117.js +203 -22
  20. package/dist/index118.js +20 -27
  21. package/dist/index119.js +400 -5
  22. package/dist/index12.js +1 -1
  23. package/dist/index120.js +21 -2
  24. package/dist/index121.js +9 -2
  25. package/dist/index122.js +38 -5
  26. package/dist/index123.js +18 -3
  27. package/dist/index124.js +45 -21
  28. package/dist/index125.js +2 -113
  29. package/dist/index126.js +52 -15
  30. package/dist/index127.js +58 -518
  31. package/dist/index128.js +23 -126
  32. package/dist/index129.js +28 -133
  33. package/dist/index13.js +2 -2
  34. package/dist/index130.js +5 -65
  35. package/dist/index131.js +2 -69
  36. package/dist/index132.js +2 -9
  37. package/dist/index133.js +5 -14
  38. package/dist/index134.js +3 -66
  39. package/dist/index135.js +23 -3
  40. package/dist/index136.js +110 -20
  41. package/dist/index137.js +15 -12
  42. package/dist/index138.js +519 -22
  43. package/dist/index139.js +127 -4
  44. package/dist/index14.js +2 -2
  45. package/dist/index140.js +133 -22
  46. package/dist/index141.js +67 -0
  47. package/dist/index142.js +71 -0
  48. package/dist/index143.js +11 -0
  49. package/dist/index144.js +16 -0
  50. package/dist/index145.js +68 -0
  51. package/dist/index146.js +6 -0
  52. package/dist/index147.js +25 -0
  53. package/dist/index148.js +25 -0
  54. package/dist/index149.js +15 -0
  55. package/dist/index15.js +2 -2
  56. package/dist/index150.js +30 -0
  57. package/dist/index151.js +7 -0
  58. package/dist/index17.js +4 -4
  59. package/dist/index18.js +2 -2
  60. package/dist/index20.js +2 -2
  61. package/dist/index21.js +1 -1
  62. package/dist/index22.js +1 -1
  63. package/dist/index23.js +2 -2
  64. package/dist/index24.js +1 -1
  65. package/dist/index25.js +4 -4
  66. package/dist/index26.js +1 -1
  67. package/dist/index27.js +3 -3
  68. package/dist/index29.js +1 -1
  69. package/dist/index31.js +1 -1
  70. package/dist/index33.js +1 -1
  71. package/dist/index36.js +2 -2
  72. package/dist/index37.js +1 -1
  73. package/dist/index4.js +2 -2
  74. package/dist/index45.js +237 -33
  75. package/dist/index46.js +11 -237
  76. package/dist/index47.js +530 -11
  77. package/dist/index48.js +228 -60
  78. package/dist/index49.js +32 -124
  79. package/dist/index5.js +1 -1
  80. package/dist/index50.js +234 -58
  81. package/dist/index51.js +11 -260
  82. package/dist/index52.js +73 -12
  83. package/dist/index53.js +130 -12
  84. package/dist/index54.js +125 -9
  85. package/dist/index55.js +56 -856
  86. package/dist/index56.js +254 -9
  87. package/dist/index57.js +72 -215
  88. package/dist/index58.js +260 -11
  89. package/dist/index59.js +5 -4
  90. package/dist/index6.js +1 -1
  91. package/dist/index60.js +839 -97
  92. package/dist/index61.js +9 -22
  93. package/dist/index62.js +9 -254
  94. package/dist/index63.js +298 -224
  95. package/dist/index64.js +12 -161
  96. package/dist/index65.js +100 -417
  97. package/dist/index66.js +202 -313
  98. package/dist/index67.js +11 -18
  99. package/dist/index68.js +227 -508
  100. package/dist/index69.js +16 -247
  101. package/dist/index7.js +1 -1
  102. package/dist/index70.js +21 -129
  103. package/dist/index71.js +160 -30
  104. package/dist/index72.js +311 -216
  105. package/dist/index73.js +417 -64
  106. package/dist/index74.js +30 -309
  107. package/dist/index75.js +5 -5
  108. package/dist/index77.js +1 -1
  109. package/dist/index8.js +1 -1
  110. package/dist/index81.js +1 -1
  111. package/dist/index84.js +65 -51
  112. package/dist/index87.js +4 -30
  113. package/dist/index88.js +178 -10
  114. package/dist/index89.js +24 -53
  115. package/dist/index9.js +2 -2
  116. package/dist/index90.js +5 -124
  117. package/dist/index91.js +115 -125
  118. package/dist/index92.js +14 -13
  119. package/dist/index93.js +126 -60
  120. package/dist/index94.js +217 -13
  121. package/dist/index95.js +12 -7
  122. package/dist/index96.js +47 -49
  123. package/dist/index97.js +50 -4
  124. package/dist/index98.js +8 -218
  125. package/dist/index99.js +54 -5
  126. package/package.json +19 -11
package/dist/index99.js CHANGED
@@ -1,8 +1,57 @@
1
- import * as u from "react";
2
- function t(r) {
3
- const e = u.useRef({ value: r, previous: r });
4
- return u.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
1
+ import * as i from "react";
2
+ import { jsx as _ } from "react/jsx-runtime";
3
+ function $(e, x = []) {
4
+ let o = [];
5
+ function f(r, n) {
6
+ const t = i.createContext(n);
7
+ t.displayName = r + "Context";
8
+ const c = o.length;
9
+ o = [...o, n];
10
+ const m = (a) => {
11
+ var l;
12
+ const { scope: s, children: C, ...p } = a, d = ((l = s == null ? void 0 : s[e]) == null ? void 0 : l[c]) || t, v = i.useMemo(() => p, Object.values(p));
13
+ return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
14
+ };
15
+ m.displayName = r + "Provider";
16
+ function S(a, s) {
17
+ var d;
18
+ const C = ((d = s == null ? void 0 : s[e]) == null ? void 0 : d[c]) || t, p = i.useContext(C);
19
+ if (p) return p;
20
+ if (n !== void 0) return n;
21
+ throw new Error(`\`${a}\` must be used within \`${r}\``);
22
+ }
23
+ return [m, S];
24
+ }
25
+ const u = () => {
26
+ const r = o.map((n) => i.createContext(n));
27
+ return function(t) {
28
+ const c = (t == null ? void 0 : t[e]) || r;
29
+ return i.useMemo(
30
+ () => ({ [`__scope${e}`]: { ...t, [e]: c } }),
31
+ [t, c]
32
+ );
33
+ };
34
+ };
35
+ return u.scopeName = e, [f, h(u, ...x)];
36
+ }
37
+ function h(...e) {
38
+ const x = e[0];
39
+ if (e.length === 1) return x;
40
+ const o = () => {
41
+ const f = e.map((u) => ({
42
+ useScope: u(),
43
+ scopeName: u.scopeName
44
+ }));
45
+ return function(r) {
46
+ const n = f.reduce((t, { useScope: c, scopeName: m }) => {
47
+ const a = c(r)[`__scope${m}`];
48
+ return { ...t, ...a };
49
+ }, {});
50
+ return i.useMemo(() => ({ [`__scope${x.scopeName}`]: n }), [n]);
51
+ };
52
+ };
53
+ return o.scopeName = x.scopeName, o;
5
54
  }
6
55
  export {
7
- t as usePrevious
56
+ $ as createContextScope
8
57
  };
package/package.json CHANGED
@@ -1,11 +1,18 @@
1
1
  {
2
2
  "name": "@drjoshcsimmons/scl",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/jcpsimmons/scl"
8
8
  },
9
+ "pnpm": {
10
+ "overrides": {
11
+ "lru-cache": "^10.0.0",
12
+ "semver": "^7.6.0",
13
+ "browserslist": "^4.24.0"
14
+ }
15
+ },
9
16
  "main": "./dist/index.js",
10
17
  "module": "./dist/index.js",
11
18
  "types": "./dist/index.d.ts",
@@ -22,6 +29,16 @@
22
29
  "sideEffects": [
23
30
  "**/*.css"
24
31
  ],
32
+ "scripts": {
33
+ "dev": "storybook dev -p 6006",
34
+ "build": "tsc && vite build && cp src/styles/globals.css dist/globals.css",
35
+ "build:storybook": "storybook build -o storybook-static",
36
+ "test": "vitest",
37
+ "test:coverage": "vitest --coverage",
38
+ "lint": "eslint src --ext .ts,.tsx",
39
+ "typecheck": "tsc --noEmit",
40
+ "prepublishOnly": "npm run build"
41
+ },
25
42
  "peerDependencies": {
26
43
  "react": "^18.0.0 || ^19.0.0",
27
44
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -120,14 +137,5 @@
120
137
  "@lezer/highlight": "^1.2.3",
121
138
  "@replit/codemirror-vim": "^6.3.0",
122
139
  "@vercel/analytics": "^1.6.1"
123
- },
124
- "scripts": {
125
- "dev": "storybook dev -p 6006",
126
- "build": "tsc && vite build && cp src/styles/globals.css dist/globals.css",
127
- "build:storybook": "storybook build -o storybook-static",
128
- "test": "vitest",
129
- "test:coverage": "vitest --coverage",
130
- "lint": "eslint src --ext .ts,.tsx",
131
- "typecheck": "tsc --noEmit"
132
140
  }
133
- }
141
+ }