autumn-js 0.0.77 → 0.0.79

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 (197) hide show
  1. package/dist/libraries/backend/express.d.mts +3 -2
  2. package/dist/libraries/backend/express.d.ts +3 -2
  3. package/dist/libraries/backend/express.js +2 -2
  4. package/dist/libraries/backend/express.mjs +2 -2
  5. package/dist/libraries/backend/fastify.d.mts +1 -0
  6. package/dist/libraries/backend/fastify.d.ts +1 -0
  7. package/dist/libraries/backend/fastify.js +19 -0
  8. package/dist/libraries/backend/fastify.mjs +7 -0
  9. package/dist/libraries/backend/hono.d.mts +2 -0
  10. package/dist/libraries/backend/hono.d.ts +2 -0
  11. package/dist/libraries/backend/hono.js +20 -1
  12. package/dist/libraries/backend/hono.mjs +8 -1
  13. package/dist/libraries/backend/react-router.d.mts +1 -1
  14. package/dist/libraries/backend/react-router.d.ts +1 -1
  15. package/dist/libraries/backend/react-router.js +21 -0
  16. package/dist/libraries/backend/react-router.mjs +9 -0
  17. package/dist/libraries/backend/{referralTypes-DiYwS4QY.d.mts → referralTypes-DUHggPfB.d.mts} +126 -126
  18. package/dist/libraries/backend/{referralTypes-CSbCGBim.d.ts → referralTypes-PidjhXlJ.d.ts} +126 -126
  19. package/dist/libraries/backend/supabase.d.mts +1 -0
  20. package/dist/libraries/backend/supabase.d.ts +1 -0
  21. package/dist/libraries/backend/supabase.js +21 -0
  22. package/dist/libraries/backend/supabase.mjs +9 -0
  23. package/dist/libraries/backend/tanstack.d.mts +1 -0
  24. package/dist/libraries/backend/tanstack.d.ts +1 -0
  25. package/dist/libraries/backend/tanstack.js +21 -0
  26. package/dist/libraries/backend/tanstack.mjs +9 -0
  27. package/dist/libraries/backend/utils/withAuth.d.mts +1 -1
  28. package/dist/libraries/backend/utils/withAuth.d.ts +1 -1
  29. package/dist/libraries/react/AutumnContext.d.mts +4 -5
  30. package/dist/libraries/react/AutumnContext.d.ts +4 -5
  31. package/dist/libraries/react/AutumnContext.mjs +7 -7
  32. package/dist/libraries/react/BaseAutumnProvider.css +1264 -0
  33. package/dist/libraries/react/BaseAutumnProvider.d.mts +4 -5
  34. package/dist/libraries/react/BaseAutumnProvider.d.ts +4 -5
  35. package/dist/libraries/react/BaseAutumnProvider.js +2 -1
  36. package/dist/libraries/react/BaseAutumnProvider.mjs +17 -16
  37. package/dist/libraries/react/{ReactAutumnClient-CrkFLuOn.d.mts → ReactAutumnClient-BUpLpfaT.d.mts} +3 -4
  38. package/dist/libraries/react/{ReactAutumnClient-A7x9envm.d.ts → ReactAutumnClient-DykUHFzU.d.ts} +3 -4
  39. package/dist/libraries/react/ReactAutumnProvider.css +1264 -0
  40. package/dist/libraries/react/ReactAutumnProvider.d.mts +1 -1
  41. package/dist/libraries/react/ReactAutumnProvider.d.ts +1 -1
  42. package/dist/libraries/react/ReactAutumnProvider.js +2 -1
  43. package/dist/libraries/react/ReactAutumnProvider.mjs +17 -16
  44. package/dist/libraries/react/{chunk-XXMAVKQ4.mjs → chunk-2E22VDNL.mjs} +2 -2
  45. package/dist/libraries/react/{chunk-FINFVKJY.mjs → chunk-4FM7BXFT.mjs} +23 -19
  46. package/dist/libraries/react/{chunk-UMZA5GHL.mjs → chunk-ANT5FRPE.mjs} +1 -1
  47. package/dist/libraries/react/chunk-OWFX3JFF.mjs +23 -0
  48. package/dist/libraries/react/{chunk-WI6WFW54.mjs → chunk-QMPP4FVB.mjs} +2 -1
  49. package/dist/libraries/react/client/ReactAutumnClient.d.mts +4 -5
  50. package/dist/libraries/react/client/ReactAutumnClient.d.ts +4 -5
  51. package/dist/libraries/react/client/ReactAutumnClient.mjs +6 -6
  52. package/dist/libraries/react/client/clientCompMethods.d.mts +4 -5
  53. package/dist/libraries/react/client/clientCompMethods.d.ts +4 -5
  54. package/dist/libraries/react/client/clientCusMethods.d.mts +4 -5
  55. package/dist/libraries/react/client/clientCusMethods.d.ts +4 -5
  56. package/dist/libraries/react/client/clientEntityMethods.d.mts +4 -5
  57. package/dist/libraries/react/client/clientEntityMethods.d.ts +4 -5
  58. package/dist/libraries/react/client/clientGenMethods.d.mts +4 -5
  59. package/dist/libraries/react/client/clientGenMethods.d.ts +4 -5
  60. package/dist/libraries/react/client/clientProdMethods.d.mts +4 -5
  61. package/dist/libraries/react/client/clientProdMethods.d.ts +4 -5
  62. package/dist/libraries/react/client/clientReferralMethods.d.mts +4 -5
  63. package/dist/libraries/react/client/clientReferralMethods.d.ts +4 -5
  64. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.css +1264 -0
  65. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.mts +1 -2
  66. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.d.ts +1 -2
  67. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.js +2 -1
  68. package/dist/libraries/react/components/attach-dialog/attach-dialog-synced.mjs +17 -16
  69. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.mts +1 -2
  70. package/dist/libraries/react/components/attach-dialog/lib/attach-content.d.ts +1 -2
  71. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.mts +1 -2
  72. package/dist/libraries/react/components/check-dialog/check-dialog-synced.d.ts +1 -2
  73. package/dist/libraries/react/components/check-dialog/check-dialog-synced.mjs +2 -2
  74. package/dist/libraries/react/components/check-dialog/lib/check-content.d.mts +1 -2
  75. package/dist/libraries/react/components/check-dialog/lib/check-content.d.ts +1 -2
  76. package/dist/libraries/react/components/pricing-table/pricing-table-synced.css +1264 -0
  77. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.mts +1 -2
  78. package/dist/libraries/react/components/pricing-table/pricing-table-synced.d.ts +1 -2
  79. package/dist/libraries/react/components/pricing-table/pricing-table-synced.js +19 -2
  80. package/dist/libraries/react/components/pricing-table/pricing-table-synced.mjs +17 -16
  81. package/dist/libraries/react/components/ui/button.d.mts +1 -1
  82. package/dist/libraries/react/components/ui/button.d.ts +1 -1
  83. package/dist/libraries/react/cusTypes-CrTZaKED.d.mts +225 -0
  84. package/dist/libraries/react/cusTypes-CrTZaKED.d.ts +225 -0
  85. package/dist/libraries/react/{entTypes-8gkfAi3g.d.mts → entTypes-C-4aVfR8.d.mts} +1 -1
  86. package/dist/libraries/react/{entTypes-C8jD10M8.d.ts → entTypes-DWKPjkGS.d.ts} +1 -1
  87. package/dist/libraries/react/hooks/handleAllowed.d.mts +2 -2
  88. package/dist/libraries/react/hooks/handleAllowed.d.ts +2 -2
  89. package/dist/libraries/react/hooks/useAutumn.css +1264 -0
  90. package/dist/libraries/react/hooks/useAutumn.d.mts +2 -3
  91. package/dist/libraries/react/hooks/useAutumn.d.ts +2 -3
  92. package/dist/libraries/react/hooks/useAutumn.js +2 -1
  93. package/dist/libraries/react/hooks/useAutumn.mjs +17 -16
  94. package/dist/libraries/react/hooks/useAutumnBase.css +1264 -0
  95. package/dist/libraries/react/hooks/useAutumnBase.d.mts +4 -5
  96. package/dist/libraries/react/hooks/useAutumnBase.d.ts +4 -5
  97. package/dist/libraries/react/hooks/useAutumnBase.js +2 -1
  98. package/dist/libraries/react/hooks/useAutumnBase.mjs +17 -16
  99. package/dist/libraries/react/hooks/useCustomer.css +1264 -0
  100. package/dist/libraries/react/hooks/useCustomer.d.mts +4 -5
  101. package/dist/libraries/react/hooks/useCustomer.d.ts +4 -5
  102. package/dist/libraries/react/hooks/useCustomer.js +2 -1
  103. package/dist/libraries/react/hooks/useCustomer.mjs +17 -16
  104. package/dist/libraries/react/hooks/useCustomerBase.css +1264 -0
  105. package/dist/libraries/react/hooks/useCustomerBase.d.mts +4 -5
  106. package/dist/libraries/react/hooks/useCustomerBase.d.ts +4 -5
  107. package/dist/libraries/react/hooks/useCustomerBase.js +2 -1
  108. package/dist/libraries/react/hooks/useCustomerBase.mjs +17 -16
  109. package/dist/libraries/react/hooks/useEntity.css +1264 -0
  110. package/dist/libraries/react/hooks/useEntity.d.mts +3 -4
  111. package/dist/libraries/react/hooks/useEntity.d.ts +3 -4
  112. package/dist/libraries/react/hooks/useEntity.js +2 -1
  113. package/dist/libraries/react/hooks/useEntity.mjs +17 -16
  114. package/dist/libraries/react/hooks/useEntityBase.css +1264 -0
  115. package/dist/libraries/react/hooks/useEntityBase.d.mts +4 -5
  116. package/dist/libraries/react/hooks/useEntityBase.d.ts +4 -5
  117. package/dist/libraries/react/hooks/useEntityBase.js +2 -1
  118. package/dist/libraries/react/hooks/useEntityBase.mjs +17 -16
  119. package/dist/libraries/react/hooks/usePricingTable.d.mts +1 -2
  120. package/dist/libraries/react/hooks/usePricingTable.d.ts +1 -2
  121. package/dist/libraries/react/hooks/usePricingTable.js +1 -0
  122. package/dist/libraries/react/hooks/usePricingTable.mjs +9 -9
  123. package/dist/libraries/react/hooks/usePricingTableBase.d.mts +4 -5
  124. package/dist/libraries/react/hooks/usePricingTableBase.d.ts +4 -5
  125. package/dist/libraries/react/hooks/usePricingTableBase.js +1 -0
  126. package/dist/libraries/react/hooks/usePricingTableBase.mjs +8 -8
  127. package/dist/libraries/react/hooks/useProductsBase.mjs +7 -7
  128. package/dist/libraries/react/index.d.ts +115 -115
  129. package/dist/libraries/react/index.js +44 -3
  130. package/dist/libraries/react/index.mjs +44 -3
  131. package/dist/libraries/react/{response-DLD-1iva.d.ts → response-D0CcXse-.d.ts} +2 -3
  132. package/dist/libraries/react/{response-BGS7hGc7.d.mts → response-DwYxo3Li.d.mts} +2 -3
  133. package/dist/libraries/react/utils/inject-styles.d.mts +4 -0
  134. package/dist/libraries/react/utils/inject-styles.d.ts +4 -0
  135. package/dist/libraries/react/utils/inject-styles.js +47 -0
  136. package/dist/libraries/react/utils/inject-styles.mjs +10 -0
  137. package/dist/next/{AutumnProvider-BdIwgk_j.d.mts → AutumnProvider-CGdXoZNQ.d.mts} +116 -7
  138. package/dist/next/{AutumnProvider-BdIwgk_j.d.ts → AutumnProvider-CGdXoZNQ.d.ts} +116 -7
  139. package/dist/next/AutumnProvider.d.mts +1 -1
  140. package/dist/next/AutumnProvider.d.ts +1 -1
  141. package/dist/next/client/NextAutumnClient.d.mts +4 -4
  142. package/dist/next/client/NextAutumnClient.d.ts +4 -4
  143. package/dist/next/client/NextAutumnProvider.d.mts +1 -1
  144. package/dist/next/client/NextAutumnProvider.d.ts +1 -1
  145. package/dist/next/client/{clientGenTypes-CXkGuJ6W.d.ts → clientGenTypes-KQqk1H9-.d.mts} +2 -2
  146. package/dist/next/client/{clientGenTypes-Dh9BiE0s.d.mts → clientGenTypes-_eDeut4m.d.ts} +2 -2
  147. package/dist/next/client/clientUtils.d.mts +2 -2
  148. package/dist/next/client/clientUtils.d.ts +2 -2
  149. package/dist/next/client/cusTypes-CSbB7Wu9.d.mts +225 -0
  150. package/dist/next/client/cusTypes-CSbB7Wu9.d.ts +225 -0
  151. package/dist/next/client/{entTypes-C1-bumir.d.mts → entTypes-6xEkbn32.d.mts} +1 -1
  152. package/dist/next/client/{entTypes-CKc2qHBt.d.ts → entTypes-B3R2yjLW.d.ts} +1 -1
  153. package/dist/next/client/error-DHbclCVh.d.mts +17 -0
  154. package/dist/next/client/error-DHbclCVh.d.ts +17 -0
  155. package/dist/next/client/hooks/useAutumn.d.mts +4 -4
  156. package/dist/next/client/hooks/useAutumn.d.ts +4 -4
  157. package/dist/next/client/hooks/useCustomer.d.mts +4 -4
  158. package/dist/next/client/hooks/useCustomer.d.ts +4 -4
  159. package/dist/next/client/hooks/useEntity.d.mts +5 -5
  160. package/dist/next/client/hooks/useEntity.d.ts +5 -5
  161. package/dist/next/client/hooks/usePricingTable.d.mts +2 -2
  162. package/dist/next/client/hooks/usePricingTable.d.ts +2 -2
  163. package/dist/next/client/types.d.mts +2 -2
  164. package/dist/next/client/types.d.ts +2 -2
  165. package/dist/next/index.d.mts +2 -111
  166. package/dist/next/index.d.ts +2 -111
  167. package/dist/next/server/auth/withNextAuth.d.mts +1 -1
  168. package/dist/next/server/auth/withNextAuth.d.ts +1 -1
  169. package/dist/next/server/componentActions.d.mts +1 -1
  170. package/dist/next/server/componentActions.d.ts +1 -1
  171. package/dist/next/server/cusActions.d.mts +1 -121
  172. package/dist/next/server/cusActions.d.ts +1 -121
  173. package/dist/next/server/cusTypes-ASrCF4fa.d.mts +244 -0
  174. package/dist/next/server/cusTypes-ASrCF4fa.d.ts +244 -0
  175. package/dist/next/server/genActions.d.mts +1 -1
  176. package/dist/next/server/genActions.d.ts +1 -1
  177. package/dist/sdk/index.d.mts +130 -130
  178. package/dist/sdk/index.d.ts +130 -130
  179. package/dist/styles/global.css +50 -3
  180. package/package.json +3 -2
  181. package/scripts/css-transform-plugin.js +28 -0
  182. package/scripts/post-build.js +65 -15
  183. package/scripts/sync-registry.ts +10 -0
  184. package/tsup.config.ts +6 -2
  185. package/tsup.dev.config.ts +6 -2
  186. package/dist/libraries/react/checkTypes-Bz2m_2pr.d.ts +0 -112
  187. package/dist/libraries/react/checkTypes-Cjk7BjiU.d.mts +0 -112
  188. package/dist/libraries/react/cusTypes-DNx5bwlw.d.mts +0 -116
  189. package/dist/libraries/react/cusTypes-DNx5bwlw.d.ts +0 -116
  190. package/dist/next/client/checkTypes-BVlLFoUT.d.ts +0 -128
  191. package/dist/next/client/checkTypes-CGZpuidI.d.mts +0 -128
  192. package/dist/next/client/cusTypes-CV5q3GIA.d.mts +0 -116
  193. package/dist/next/client/cusTypes-CV5q3GIA.d.ts +0 -116
  194. package/dist/next/server/cusTypes-Cc8NWXXF.d.mts +0 -124
  195. package/dist/next/server/cusTypes-Cc8NWXXF.d.ts +0 -124
  196. package/dist/libraries/react/{chunk-4CRZJJPY.mjs → chunk-KGHDNAQT.mjs} +17 -17
  197. package/dist/libraries/react/{chunk-27OTS3Q5.mjs → chunk-QJEJ7E65.mjs} +3 -3
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "autumn-js",
3
3
  "description": "Autumn JS Library",
4
- "version": "0.0.77",
4
+ "version": "0.0.79",
5
5
  "main": "./dist/index.js",
6
6
  "scripts": {
7
7
  "cli": "tsx src/cli/index.ts",
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
- "publish-beta": "npm run build && npm publish --tag beta",
9
+ "publish-beta": "pnpm publish --tag beta",
10
10
  "build": "rm -rf dist && tsup && node scripts/post-build.js",
11
11
  "dev-old": "tsx scripts/sync-registry.ts sync && (tsx scripts/sync-registry.ts watch & nodemon --watch src --ext ts,tsx,css --exec \"tsup --config tsup.dev.config.ts\")",
12
12
  "dev": "(tsx scripts/sync-registry.ts watch & nodemon --watch src --ext ts,tsx,css --exec \"tsup --config tsup.dev.config.ts && node scripts/post-build.js\")",
@@ -96,6 +96,7 @@
96
96
  "postcss": "^8.5.6",
97
97
  "postcss-nested": "^7.0.2",
98
98
  "postcss-prefix-selector": "^2.1.1",
99
+ "stripe": "^18.3.0",
99
100
  "tailwind-merge": "^2.6.0",
100
101
  "tailwindcss": "^3.4.1",
101
102
  "tailwindcss-animate": "^1.0.7",
@@ -0,0 +1,28 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+
4
+ // esbuild plugin to transform CSS before injection
5
+ export function cssTransformPlugin() {
6
+ return {
7
+ name: 'css-transform',
8
+ setup(build) {
9
+ // Process CSS files before they get injected
10
+ build.onLoad({ filter: /\.css$/ }, async (args) => {
11
+ const cssContent = await fs.promises.readFile(args.path, 'utf8');
12
+
13
+ // Apply the same transformation as post-build.js
14
+ const transformedCss = cssContent.replace(
15
+ /(\*,\n::before,\n::after)/g,
16
+ '.au-root *,\n.au-root ::before,\n.au-root ::after'
17
+ );
18
+
19
+ console.log(`🎨 Transformed CSS: ${path.basename(args.path)}`);
20
+
21
+ return {
22
+ contents: transformedCss,
23
+ loader: 'css'
24
+ };
25
+ });
26
+ }
27
+ };
28
+ }
@@ -3,23 +3,73 @@ const path = require('path');
3
3
 
4
4
  // Post-build processing: replace CSS selectors with .au-root prefix
5
5
  function processCssFiles() {
6
- const cssFilePath = path.join(__dirname, '../dist/styles/global.css');
6
+ const cssFiles = [
7
+ path.join(__dirname, '../dist/styles/global.css'),
8
+ path.join(__dirname, '../dist/libraries/react/index.css')
9
+ ];
7
10
 
8
- if (fs.existsSync(cssFilePath)) {
9
- console.log('📄 Processing CSS file:', cssFilePath);
10
-
11
- const builtCss = fs.readFileSync(cssFilePath, 'utf8');
12
- const updatedCss = builtCss.replace(
13
- /(\*,\n::before,\n::after)/g,
14
- '.au-root *,\n.au-root ::before,\n.au-root ::after'
15
- );
11
+ cssFiles.forEach(cssFilePath => {
12
+ if (fs.existsSync(cssFilePath)) {
13
+ console.log('📄 Processing CSS file:', cssFilePath);
14
+
15
+ const builtCss = fs.readFileSync(cssFilePath, 'utf8');
16
+ const updatedCss = builtCss.replace(
17
+ /(\*,\n::before,\n::after)/g,
18
+ '.au-root *,\n.au-root ::before,\n.au-root ::after'
19
+ );
20
+
21
+ fs.writeFileSync(cssFilePath, updatedCss);
22
+ console.log('✅ CSS selectors updated with .au-root prefix');
23
+ } else {
24
+ console.log('⚠️ CSS file not found:', cssFilePath);
25
+ }
26
+ });
27
+ }
28
+
29
+ // Process injected CSS in JS files
30
+ function processInjectedCss() {
31
+ const reactDir = path.join(__dirname, '../dist/libraries/react');
32
+ const files = fs.readdirSync(reactDir).filter(file =>
33
+ file.endsWith('.js') || file.endsWith('.mjs') || file.endsWith('.cjs')
34
+ );
35
+
36
+ files.forEach(file => {
37
+ const filePath = path.join(reactDir, file);
38
+ const content = fs.readFileSync(filePath, 'utf8');
16
39
 
17
- fs.writeFileSync(cssFilePath, updatedCss);
18
- console.log('✅ CSS selectors updated with .au-root prefix');
19
- } else {
20
- console.log('⚠️ CSS file not found:', cssFilePath);
21
- }
40
+ // Check if this file has styleInject and CSS content
41
+ if (content.includes('styleInject')) {
42
+ let updated = false;
43
+ let updatedContent = content;
44
+
45
+ // Pattern 1: *,\n::before,\n::after (with newlines)
46
+ if (updatedContent.includes('*,\\n::before,\\n::after')) {
47
+ console.log('📄 Processing injected CSS pattern 1 in:', file);
48
+ updatedContent = updatedContent.replace(
49
+ /(\*,\\n::before,\\n::after)/g,
50
+ '.au-root *,\\n.au-root ::before,\\n.au-root ::after'
51
+ );
52
+ updated = true;
53
+ }
54
+
55
+ // Pattern 2: *,::before,::after (without newlines)
56
+ if (updatedContent.includes('*,::before,::after')) {
57
+ console.log('📄 Processing injected CSS pattern 2 in:', file);
58
+ updatedContent = updatedContent.replace(
59
+ /(\*,::before,::after)/g,
60
+ '.au-root *,.au-root ::before,.au-root ::after'
61
+ );
62
+ updated = true;
63
+ }
64
+
65
+ if (updated) {
66
+ fs.writeFileSync(filePath, updatedContent);
67
+ console.log('✅ Injected CSS selectors updated with .au-root prefix');
68
+ }
69
+ }
70
+ });
22
71
  }
23
72
 
24
73
  // Run the processing
25
- processCssFiles();
74
+ processCssFiles();
75
+ processInjectedCss();
@@ -59,6 +59,16 @@ function transformImportsToRegistry(content: string): string {
59
59
  'from "@/registry/$1/$1"'
60
60
  );
61
61
 
62
+ // Remove loading styles import and replace with CSS classes
63
+ if (content.includes('from "@/utils/inject-styles"')) {
64
+ // Remove the import line
65
+ content = content.replace(/import\s+{[^}]*loadingStyles[^}]*}\s+from\s+["']@\/utils\/inject-styles["'];?\s*\n/g, '');
66
+
67
+ // Replace inline styles with CSS classes
68
+ content = content.replace(/style={loadingStyles}/g, 'className="w-full h-full flex justify-center items-center min-h-[300px]"');
69
+ content = content.replace(/style={spinnerStyles}/g, 'className="w-6 h-6 text-zinc-400 animate-spin"');
70
+ }
71
+
62
72
  // Keep @/lib/utils and @/components/ui imports as-is
63
73
 
64
74
  return content;
package/tsup.config.ts CHANGED
@@ -36,8 +36,10 @@ const reactConfigs: Options[] = [
36
36
  external: ["react", "react/jsx-runtime", "react-dom"],
37
37
  bundle: true,
38
38
  banner: {
39
- js: '"use client";\nrequire("../../styles/global.css");',
39
+ // js: '"use client";\nrequire("../../styles/global.css");',
40
+ js: '"use client";',
40
41
  },
42
+ injectStyle: true,
41
43
  esbuildOptions(options) {
42
44
  options.plugins = options.plugins || [];
43
45
  options.plugins.push(alias(pathAliases));
@@ -54,8 +56,10 @@ const reactConfigs: Options[] = [
54
56
  external: ["react", "react/jsx-runtime", "react-dom"],
55
57
  bundle: true,
56
58
  banner: {
57
- js: '"use client";\nimport "../../styles/global.css";',
59
+ // js: '"use client";\nimport "../../styles/global.css";',
60
+ js: '"use client";',
58
61
  },
62
+ injectStyle: true,
59
63
  esbuildOptions(options) {
60
64
  options.plugins = options.plugins || [];
61
65
  options.plugins.push(alias(pathAliases));
@@ -36,8 +36,10 @@ const reactConfigs: Options[] = [
36
36
  external: ["react", "react/jsx-runtime", "react-dom"],
37
37
  bundle: true,
38
38
  banner: {
39
- js: '"use client";\nrequire("../../styles/global.css");',
39
+ // js: '"use client";\nrequire("../../styles/global.css");',
40
+ js: '"use client";',
40
41
  },
42
+ injectStyle: true,
41
43
  esbuildOptions(options) {
42
44
  options.plugins = options.plugins || [];
43
45
  options.plugins.push(alias(pathAliases));
@@ -54,8 +56,10 @@ const reactConfigs: Options[] = [
54
56
  external: ["react", "react/jsx-runtime", "react-dom"],
55
57
  bundle: true,
56
58
  banner: {
57
- js: '"use client";\nimport "../../styles/global.css";',
59
+ // js: '"use client";\nimport "../../styles/global.css";',
60
+ js: '"use client";',
58
61
  },
62
+ injectStyle: true,
59
63
  esbuildOptions(options) {
60
64
  options.plugins = options.plugins || [];
61
65
  options.plugins.push(alias(pathAliases));
@@ -1,112 +0,0 @@
1
- import { I as Infinite, P as ProductItemIntervalType, U as UsageModel, A as AppEnv, F as FreeTrialDuration, g as CoreCustomerFeature, h as UsageModelType } from './cusTypes-DNx5bwlw.js';
2
-
3
- interface ProductItem {
4
- feature_id?: string;
5
- included_usage?: number | typeof Infinite;
6
- interval?: ProductItemIntervalType;
7
- usage_model?: UsageModel;
8
- price?: number;
9
- billing_units?: number;
10
- entity_feature_id?: string;
11
- reset_usage_on_billing?: boolean;
12
- reset_usage_when_enabled?: boolean;
13
- display?: {
14
- primary_text?: string;
15
- secondary_text?: string;
16
- };
17
- }
18
- interface FreeTrial {
19
- duration: FreeTrialDuration;
20
- length: number;
21
- unique_fingerprint: boolean;
22
- trial_available?: boolean;
23
- }
24
- interface Product {
25
- id: string;
26
- created_at: number;
27
- name: string;
28
- env: AppEnv;
29
- is_add_on: boolean;
30
- is_default: boolean;
31
- group: string;
32
- version: number;
33
- items: ProductItem[];
34
- free_trial: FreeTrial | null;
35
- scenario?: ProductScenario;
36
- base_variant_id: string | null;
37
- properties?: {
38
- is_free?: boolean;
39
- is_one_off?: boolean;
40
- interval_group?: string;
41
- };
42
- display?: {
43
- name?: string;
44
- description?: string;
45
- button_text?: string;
46
- recommend_text?: string;
47
- everything_from?: string;
48
- button_url?: string;
49
- };
50
- }
51
-
52
- type CheckFeatureScenario = "usage_limit" | "feature_flag";
53
- interface CheckFeatureResult extends CoreCustomerFeature {
54
- allowed: boolean;
55
- feature_id: string;
56
- customer_id: string;
57
- entity_id?: string;
58
- required_balance: number;
59
- code: string;
60
- preview?: CheckFeaturePreview;
61
- }
62
- interface CheckFeaturePreview {
63
- scenario: CheckFeatureScenario;
64
- title: string;
65
- message: string;
66
- feature_id: string;
67
- feature_name: string;
68
- products: Product[];
69
- }
70
- type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
71
- interface CheckProductResult {
72
- allowed: boolean;
73
- customer_id: string;
74
- product_id: string;
75
- code: string;
76
- status?: string;
77
- preview?: CheckProductPreview;
78
- }
79
- interface CheckProductPreview {
80
- scenario: ProductScenario;
81
- product_id: string;
82
- product_name: string;
83
- recurring: boolean;
84
- error_on_attach?: boolean;
85
- next_cycle_at?: number;
86
- current_product_name?: string;
87
- items?: {
88
- price: string;
89
- description: string;
90
- usage_model?: UsageModelType;
91
- }[];
92
- options?: {
93
- feature_id: string;
94
- feature_name: string;
95
- billing_units: number;
96
- price?: number;
97
- tiers?: {
98
- to: number | string;
99
- amount: number;
100
- }[];
101
- }[];
102
- due_today?: {
103
- price: number;
104
- currency: string;
105
- };
106
- due_next_cycle?: {
107
- price: number;
108
- currency: string;
109
- };
110
- }
111
-
112
- export type { CheckProductPreview as C, Product as P, ProductItem as a, CheckFeaturePreview as b, CheckFeatureResult as c, CheckProductResult as d, ProductScenario as e };
@@ -1,112 +0,0 @@
1
- import { I as Infinite, P as ProductItemIntervalType, U as UsageModel, A as AppEnv, F as FreeTrialDuration, g as CoreCustomerFeature, h as UsageModelType } from './cusTypes-DNx5bwlw.mjs';
2
-
3
- interface ProductItem {
4
- feature_id?: string;
5
- included_usage?: number | typeof Infinite;
6
- interval?: ProductItemIntervalType;
7
- usage_model?: UsageModel;
8
- price?: number;
9
- billing_units?: number;
10
- entity_feature_id?: string;
11
- reset_usage_on_billing?: boolean;
12
- reset_usage_when_enabled?: boolean;
13
- display?: {
14
- primary_text?: string;
15
- secondary_text?: string;
16
- };
17
- }
18
- interface FreeTrial {
19
- duration: FreeTrialDuration;
20
- length: number;
21
- unique_fingerprint: boolean;
22
- trial_available?: boolean;
23
- }
24
- interface Product {
25
- id: string;
26
- created_at: number;
27
- name: string;
28
- env: AppEnv;
29
- is_add_on: boolean;
30
- is_default: boolean;
31
- group: string;
32
- version: number;
33
- items: ProductItem[];
34
- free_trial: FreeTrial | null;
35
- scenario?: ProductScenario;
36
- base_variant_id: string | null;
37
- properties?: {
38
- is_free?: boolean;
39
- is_one_off?: boolean;
40
- interval_group?: string;
41
- };
42
- display?: {
43
- name?: string;
44
- description?: string;
45
- button_text?: string;
46
- recommend_text?: string;
47
- everything_from?: string;
48
- button_url?: string;
49
- };
50
- }
51
-
52
- type CheckFeatureScenario = "usage_limit" | "feature_flag";
53
- interface CheckFeatureResult extends CoreCustomerFeature {
54
- allowed: boolean;
55
- feature_id: string;
56
- customer_id: string;
57
- entity_id?: string;
58
- required_balance: number;
59
- code: string;
60
- preview?: CheckFeaturePreview;
61
- }
62
- interface CheckFeaturePreview {
63
- scenario: CheckFeatureScenario;
64
- title: string;
65
- message: string;
66
- feature_id: string;
67
- feature_name: string;
68
- products: Product[];
69
- }
70
- type ProductScenario = "scheduled" | "active" | "new" | "renew" | "upgrade" | "downgrade" | "cancel";
71
- interface CheckProductResult {
72
- allowed: boolean;
73
- customer_id: string;
74
- product_id: string;
75
- code: string;
76
- status?: string;
77
- preview?: CheckProductPreview;
78
- }
79
- interface CheckProductPreview {
80
- scenario: ProductScenario;
81
- product_id: string;
82
- product_name: string;
83
- recurring: boolean;
84
- error_on_attach?: boolean;
85
- next_cycle_at?: number;
86
- current_product_name?: string;
87
- items?: {
88
- price: string;
89
- description: string;
90
- usage_model?: UsageModelType;
91
- }[];
92
- options?: {
93
- feature_id: string;
94
- feature_name: string;
95
- billing_units: number;
96
- price?: number;
97
- tiers?: {
98
- to: number | string;
99
- amount: number;
100
- }[];
101
- }[];
102
- due_today?: {
103
- price: number;
104
- currency: string;
105
- };
106
- due_next_cycle?: {
107
- price: number;
108
- currency: string;
109
- };
110
- }
111
-
112
- export type { CheckProductPreview as C, Product as P, ProductItem as a, CheckFeaturePreview as b, CheckFeatureResult as c, CheckProductResult as d, ProductScenario as e };
@@ -1,116 +0,0 @@
1
- declare enum AppEnv {
2
- Sandbox = "sandbox",
3
- Live = "live"
4
- }
5
-
6
- declare const Infinite = "inf";
7
- declare enum FreeTrialDuration {
8
- Day = "day"
9
- }
10
- declare enum UsageModel {
11
- Prepaid = "prepaid",
12
- PayPerUse = "pay_per_use"
13
- }
14
- type UsageModelType = "prepaid" | "pay_per_use";
15
- declare enum ProductItemInterval {
16
- Minute = "minute",
17
- Hour = "hour",
18
- Day = "day",
19
- Week = "week",
20
- Month = "month",
21
- Quarter = "quarter",
22
- SemiAnnual = "semi_annual",
23
- Year = "year",
24
- Multiple = "multiple"
25
- }
26
- type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";
27
-
28
- declare enum ProductStatus {
29
- Active = "active",
30
- Expired = "expired",
31
- Trialing = "trialing",
32
- Scheduled = "scheduled",
33
- PastDue = "past_due"
34
- }
35
- type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities";
36
-
37
- interface CoreCustomerFeature {
38
- unlimited?: boolean;
39
- interval?: ProductItemInterval | null;
40
- balance?: number;
41
- usage?: number;
42
- included_usage?: number;
43
- next_reset_at?: number | null;
44
- overage_allowed?: boolean;
45
- breakdown?: {
46
- interval: ProductItemInterval;
47
- balance?: number;
48
- usage?: number;
49
- included_usage?: number;
50
- next_reset_at?: number;
51
- }[];
52
- credit_schema?: {
53
- feature_id: string;
54
- credit_amount: number;
55
- }[];
56
- }
57
- interface CustomerFeature extends CoreCustomerFeature {
58
- id: string;
59
- name: string;
60
- type: "static" | "single_use" | "continuous_use";
61
- }
62
- interface CustomerProduct {
63
- id: string;
64
- name: string | null;
65
- group: string | null;
66
- status: ProductStatus;
67
- started_at: number;
68
- canceled_at: number | null;
69
- subscription_ids?: string[] | null;
70
- current_period_start?: number | null;
71
- current_period_end?: number | null;
72
- trial_ends_at?: number;
73
- entity_id?: string;
74
- is_add_on: boolean;
75
- is_default: boolean;
76
- }
77
- interface Customer {
78
- id: string | null;
79
- created_at: number;
80
- name: string | null;
81
- email: string | null;
82
- fingerprint: string | null;
83
- stripe_id: string | null;
84
- env: AppEnv;
85
- metadata: Record<string, any>;
86
- products: CustomerProduct[];
87
- features: Record<string, CustomerFeature>;
88
- invoices?: CustomerInvoice[];
89
- }
90
- interface CustomerData {
91
- name?: string;
92
- email?: string;
93
- fingerprint?: string;
94
- }
95
- interface CreateCustomerParams {
96
- id?: string | null;
97
- email?: string | null;
98
- name?: string | null;
99
- fingerprint?: string | null;
100
- metadata?: Record<string, any>;
101
- expand?: CustomerExpandOption[];
102
- }
103
- interface BillingPortalResult {
104
- customer_id: string;
105
- url: string;
106
- }
107
- interface CustomerInvoice {
108
- product_ids: string[];
109
- stripe_id: string;
110
- status: string;
111
- total: number;
112
- currency: string;
113
- created_at: number;
114
- }
115
-
116
- export { AppEnv as A, type BillingPortalResult as B, type CustomerData as C, FreeTrialDuration as F, Infinite as I, type ProductItemIntervalType as P, UsageModel as U, type CreateCustomerParams as a, type Customer as b, type CustomerExpandOption as c, type CustomerProduct as d, type CustomerFeature as e, type CustomerInvoice as f, type CoreCustomerFeature as g, type UsageModelType as h };
@@ -1,116 +0,0 @@
1
- declare enum AppEnv {
2
- Sandbox = "sandbox",
3
- Live = "live"
4
- }
5
-
6
- declare const Infinite = "inf";
7
- declare enum FreeTrialDuration {
8
- Day = "day"
9
- }
10
- declare enum UsageModel {
11
- Prepaid = "prepaid",
12
- PayPerUse = "pay_per_use"
13
- }
14
- type UsageModelType = "prepaid" | "pay_per_use";
15
- declare enum ProductItemInterval {
16
- Minute = "minute",
17
- Hour = "hour",
18
- Day = "day",
19
- Week = "week",
20
- Month = "month",
21
- Quarter = "quarter",
22
- SemiAnnual = "semi_annual",
23
- Year = "year",
24
- Multiple = "multiple"
25
- }
26
- type ProductItemIntervalType = "minute" | "hour" | "day" | "week" | "month" | "quarter" | "semi_annual" | "year" | "multiple";
27
-
28
- declare enum ProductStatus {
29
- Active = "active",
30
- Expired = "expired",
31
- Trialing = "trialing",
32
- Scheduled = "scheduled",
33
- PastDue = "past_due"
34
- }
35
- type CustomerExpandOption = "invoices" | "rewards" | "trials_used" | "entities";
36
-
37
- interface CoreCustomerFeature {
38
- unlimited?: boolean;
39
- interval?: ProductItemInterval | null;
40
- balance?: number;
41
- usage?: number;
42
- included_usage?: number;
43
- next_reset_at?: number | null;
44
- overage_allowed?: boolean;
45
- breakdown?: {
46
- interval: ProductItemInterval;
47
- balance?: number;
48
- usage?: number;
49
- included_usage?: number;
50
- next_reset_at?: number;
51
- }[];
52
- credit_schema?: {
53
- feature_id: string;
54
- credit_amount: number;
55
- }[];
56
- }
57
- interface CustomerFeature extends CoreCustomerFeature {
58
- id: string;
59
- name: string;
60
- type: "static" | "single_use" | "continuous_use";
61
- }
62
- interface CustomerProduct {
63
- id: string;
64
- name: string | null;
65
- group: string | null;
66
- status: ProductStatus;
67
- started_at: number;
68
- canceled_at: number | null;
69
- subscription_ids?: string[] | null;
70
- current_period_start?: number | null;
71
- current_period_end?: number | null;
72
- trial_ends_at?: number;
73
- entity_id?: string;
74
- is_add_on: boolean;
75
- is_default: boolean;
76
- }
77
- interface Customer {
78
- id: string | null;
79
- created_at: number;
80
- name: string | null;
81
- email: string | null;
82
- fingerprint: string | null;
83
- stripe_id: string | null;
84
- env: AppEnv;
85
- metadata: Record<string, any>;
86
- products: CustomerProduct[];
87
- features: Record<string, CustomerFeature>;
88
- invoices?: CustomerInvoice[];
89
- }
90
- interface CustomerData {
91
- name?: string;
92
- email?: string;
93
- fingerprint?: string;
94
- }
95
- interface CreateCustomerParams {
96
- id?: string | null;
97
- email?: string | null;
98
- name?: string | null;
99
- fingerprint?: string | null;
100
- metadata?: Record<string, any>;
101
- expand?: CustomerExpandOption[];
102
- }
103
- interface BillingPortalResult {
104
- customer_id: string;
105
- url: string;
106
- }
107
- interface CustomerInvoice {
108
- product_ids: string[];
109
- stripe_id: string;
110
- status: string;
111
- total: number;
112
- currency: string;
113
- created_at: number;
114
- }
115
-
116
- export { AppEnv as A, type BillingPortalResult as B, type CustomerData as C, FreeTrialDuration as F, Infinite as I, type ProductItemIntervalType as P, UsageModel as U, type CreateCustomerParams as a, type Customer as b, type CustomerExpandOption as c, type CustomerProduct as d, type CustomerFeature as e, type CustomerInvoice as f, type CoreCustomerFeature as g, type UsageModelType as h };