@ecomiq/storefront 1.1.9 → 2.0.1

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 (134) hide show
  1. package/README.md +30 -415
  2. package/bin/ecomiq.mjs +165 -0
  3. package/package.json +72 -94
  4. package/src/api-proxy.ts +194 -0
  5. package/src/auth/create-storefront-auth.ts +35 -0
  6. package/src/auth/ecomiq-oauth-password-client.ts +26 -0
  7. package/src/auth/ecomiq-oauth-password-constants.ts +26 -0
  8. package/src/auth/ecomiq-oauth-password-plugin.ts +299 -0
  9. package/src/auth/ecomiq-oauth-password-types.ts +25 -0
  10. package/src/auth/ecomiq-storefront-sign-in.ts +47 -0
  11. package/src/auth/env.ts +7 -0
  12. package/src/cart-session.ts +241 -0
  13. package/src/client.ts +48 -0
  14. package/src/codegen.mjs +704 -0
  15. package/src/components/checkout/cart-sync.ts +143 -0
  16. package/src/components/checkout/checkout-external-update-banner.tsx +15 -0
  17. package/src/components/checkout/checkout-form-controls.tsx +139 -0
  18. package/src/components/checkout/checkout-line-items.tsx +43 -0
  19. package/src/components/checkout/checkout-order-summary.tsx +156 -0
  20. package/src/components/checkout/checkout-payment-section.tsx +215 -0
  21. package/src/components/checkout/checkout-session-view.tsx +240 -0
  22. package/src/components/checkout/checkout-shipping-address-section.tsx +266 -0
  23. package/src/components/checkout/checkout-shipping-section.tsx +90 -0
  24. package/src/components/checkout/checkout-states.tsx +73 -0
  25. package/src/components/checkout/form-schema.ts +229 -0
  26. package/src/components/checkout/format.ts +27 -0
  27. package/src/components/checkout/index.ts +51 -0
  28. package/src/components/checkout/types.ts +43 -0
  29. package/src/components/checkout/use-checkout-geo.ts +50 -0
  30. package/src/components/checkout/use-checkout-session.ts +583 -0
  31. package/src/components/hero.tsx +291 -0
  32. package/src/config.d.ts +69 -0
  33. package/src/config.mjs +165 -0
  34. package/src/index.ts +274 -0
  35. package/src/link.tsx +2 -0
  36. package/src/pages/checkout.$checkoutId.tsx +60 -0
  37. package/src/pages/checkout.tsx +31 -0
  38. package/src/pages/thank-you.tsx +53 -0
  39. package/src/providers/auth.tsx +69 -0
  40. package/src/providers/cart.tsx +275 -0
  41. package/src/providers/ecomiq.ts +137 -0
  42. package/src/providers/index.ts +26 -0
  43. package/src/public-config.ts +44 -0
  44. package/src/review-submission.ts +89 -0
  45. package/src/runtime/context.ts +1 -0
  46. package/src/runtime/default-layout.tsx +80 -0
  47. package/src/runtime/head.ts +126 -0
  48. package/src/runtime/page.tsx +82 -0
  49. package/src/runtime/postcss-browser-stub.mjs +5 -0
  50. package/src/server-config-store.ts +26 -0
  51. package/src/server.ts +279 -0
  52. package/src/styles.css +76 -0
  53. package/src/ui/badge.tsx +32 -0
  54. package/src/ui/button.tsx +31 -0
  55. package/src/ui/card.tsx +31 -0
  56. package/src/ui/carousel.tsx +218 -0
  57. package/src/ui/cn.ts +6 -0
  58. package/src/ui/index.ts +8 -0
  59. package/src/ui/separator.tsx +6 -0
  60. package/src/ui/skeleton.tsx +6 -0
  61. package/src/ui/storefront-error.tsx +49 -0
  62. package/src/utils.ts +36 -0
  63. package/src/vite-inline.mjs +135 -0
  64. package/templates/__root.tsx +77 -0
  65. package/templates/router.tsx +19 -0
  66. package/dist/chunk-64GLOWMJ.js +0 -216
  67. package/dist/chunk-64GLOWMJ.js.map +0 -1
  68. package/dist/chunk-AKD5IDEB.js +0 -177
  69. package/dist/chunk-AKD5IDEB.js.map +0 -1
  70. package/dist/chunk-EFEVJJWF.js +0 -1345
  71. package/dist/chunk-EFEVJJWF.js.map +0 -1
  72. package/dist/chunk-NAJQB5DN.js +0 -155
  73. package/dist/chunk-NAJQB5DN.js.map +0 -1
  74. package/dist/chunk-OABDGTBI.js +0 -253
  75. package/dist/chunk-OABDGTBI.js.map +0 -1
  76. package/dist/chunk-Q4U5OEUT.js +0 -21
  77. package/dist/chunk-Q4U5OEUT.js.map +0 -1
  78. package/dist/chunk-S7CPZ4UE.js +0 -6
  79. package/dist/chunk-S7CPZ4UE.js.map +0 -1
  80. package/dist/chunks/client.css +0 -984
  81. package/dist/chunks/client.css.map +0 -1
  82. package/dist/chunks/client.d.ts +0 -10759
  83. package/dist/chunks/client.js +0 -5398
  84. package/dist/chunks/client.js.map +0 -1
  85. package/dist/chunks/config.d.ts +0 -31
  86. package/dist/chunks/config.js +0 -5
  87. package/dist/chunks/config.js.map +0 -1
  88. package/dist/chunks/core-public.d.ts +0 -130
  89. package/dist/chunks/core-public.js +0 -92
  90. package/dist/chunks/core-public.js.map +0 -1
  91. package/dist/chunks/server-nextjs.d.ts +0 -33
  92. package/dist/chunks/server-nextjs.js +0 -59
  93. package/dist/chunks/server-nextjs.js.map +0 -1
  94. package/dist/chunks/server-tanstack.d.ts +0 -22
  95. package/dist/chunks/server-tanstack.js +0 -40
  96. package/dist/chunks/server-tanstack.js.map +0 -1
  97. package/dist/collection-DU7gREXS.d.ts +0 -4062
  98. package/dist/ecomiq-oauth-password-plugin-B_gMdGuc.d.ts +0 -3631
  99. package/dist/ecomiq-shell-ui-SWIFLQVM.js +0 -8
  100. package/dist/ecomiq-shell-ui-SWIFLQVM.js.map +0 -1
  101. package/dist/index.d.ts +0 -9
  102. package/dist/index.js +0 -1
  103. package/dist/index.js.map +0 -1
  104. package/dist/index.server.d.ts +0 -9
  105. package/dist/index.server.js +0 -8
  106. package/dist/index.server.js.map +0 -1
  107. package/dist/nextjs/api.d.ts +0 -45
  108. package/dist/nextjs/api.js +0 -32
  109. package/dist/nextjs/api.js.map +0 -1
  110. package/dist/nextjs/globals.css +0 -13
  111. package/dist/nextjs.d.ts +0 -2
  112. package/dist/nextjs.js +0 -2
  113. package/dist/nextjs.js.map +0 -1
  114. package/dist/nextjs.server.d.ts +0 -18
  115. package/dist/nextjs.server.js +0 -1
  116. package/dist/nextjs.server.js.map +0 -1
  117. package/dist/postcss.config.mjs +0 -6
  118. package/dist/react/checkout-page.css +0 -855
  119. package/dist/react/client.css +0 -984
  120. package/dist/react/payment-provider.css +0 -91
  121. package/dist/react/thank-you-page.css +0 -105
  122. package/dist/react.d.ts +0 -1
  123. package/dist/react.js +0 -2
  124. package/dist/react.js.map +0 -1
  125. package/dist/store-proxy-handler-CNzKlTFA.d.ts +0 -10
  126. package/dist/tanstack/api.d.ts +0 -41
  127. package/dist/tanstack/api.js +0 -30
  128. package/dist/tanstack/api.js.map +0 -1
  129. package/dist/tanstack.d.ts +0 -1
  130. package/dist/tanstack.js +0 -2
  131. package/dist/tanstack.js.map +0 -1
  132. package/dist/tanstack.server.d.ts +0 -18
  133. package/dist/tanstack.server.js +0 -1
  134. package/dist/tanstack.server.js.map +0 -1
@@ -1,8 +0,0 @@
1
- // src/npm/stubs/ecomiq-shell-ui.tsx
2
- function EcomiqShellUi() {
3
- return null;
4
- }
5
-
6
- export { EcomiqShellUi };
7
- //# sourceMappingURL=ecomiq-shell-ui-SWIFLQVM.js.map
8
- //# sourceMappingURL=ecomiq-shell-ui-SWIFLQVM.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/npm/stubs/ecomiq-shell-ui.tsx"],"names":[],"mappings":";AACO,SAAS,aAAA,GAAgB;AAC9B,EAAA,OAAO,IAAA;AACT","file":"ecomiq-shell-ui-SWIFLQVM.js","sourcesContent":["/** Stub npm: `withShellUi` no incluye modales del monorepo en el tarball publicado. */\nexport function EcomiqShellUi() {\n return null;\n}\n"]}
package/dist/index.d.ts DELETED
@@ -1,9 +0,0 @@
1
- export type { EcomiqConfig } from "./chunks/config";
2
- export {
3
- EcomiqConfigSchema,
4
- loadEcomiqConfig,
5
- clearEcomiqConfigCache,
6
- resolvePublicStoreKey,
7
- hasEcomiqSlugStoreConfig,
8
- } from "./chunks/config";
9
- export * from "./chunks/core-public";
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- export * from "./chunks/core-public.js";
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- export type { EcomiqConfig } from "./chunks/config";
2
- export {
3
- EcomiqConfigSchema,
4
- loadEcomiqConfig,
5
- clearEcomiqConfigCache,
6
- resolvePublicStoreKey,
7
- hasEcomiqSlugStoreConfig,
8
- } from "./chunks/config";
9
- export * from "./chunks/core-public";
@@ -1,8 +0,0 @@
1
- export {
2
- EcomiqConfigSchema,
3
- loadEcomiqConfig,
4
- clearEcomiqConfigCache,
5
- resolvePublicStoreKey,
6
- hasEcomiqSlugStoreConfig,
7
- } from "./chunks/config.js";
8
- export * from "./chunks/core-public.js";
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,45 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
- import { S as StoreProxyHandlerConfig } from '../store-proxy-handler-CNzKlTFA.js';
3
-
4
- type StoreApiHandlerConfig = StoreProxyHandlerConfig;
5
- /**
6
- * Crea los handlers de ruta para montar la API de store como proxy en Next.js App Router.
7
- *
8
- * ```ts
9
- * // app/api/store/[...path]/route.ts
10
- * import { toNextJsStoreApiHandler } from "@ecomiq/storefront/nextjs/api";
11
- *
12
- * export const { GET, POST, PUT, PATCH, DELETE } = toNextJsStoreApiHandler({
13
- * apiBaseUrl: process.env.STOREFRONT_API_URL,
14
- * });
15
- * ```
16
- */
17
- declare function toNextJsStoreApiHandler(config?: StoreApiHandlerConfig): {
18
- GET: (request: NextRequest, context: {
19
- params: Promise<{
20
- path?: string[];
21
- }>;
22
- }) => Promise<NextResponse>;
23
- POST: (request: NextRequest, context: {
24
- params: Promise<{
25
- path?: string[];
26
- }>;
27
- }) => Promise<NextResponse>;
28
- PUT: (request: NextRequest, context: {
29
- params: Promise<{
30
- path?: string[];
31
- }>;
32
- }) => Promise<NextResponse>;
33
- PATCH: (request: NextRequest, context: {
34
- params: Promise<{
35
- path?: string[];
36
- }>;
37
- }) => Promise<NextResponse>;
38
- DELETE: (request: NextRequest, context: {
39
- params: Promise<{
40
- path?: string[];
41
- }>;
42
- }) => Promise<NextResponse>;
43
- };
44
-
45
- export { type StoreApiHandlerConfig, toNextJsStoreApiHandler };
@@ -1,32 +0,0 @@
1
- import { handleStoreProxyRequest } from '../chunk-AKD5IDEB.js';
2
- import '../chunk-S7CPZ4UE.js';
3
- import '../chunk-Q4U5OEUT.js';
4
- import { NextResponse } from 'next/server';
5
-
6
- function toNextJsStoreApiHandler(config = {}) {
7
- const handler = async (request, context) => {
8
- const params = await context.params;
9
- const pathSegments = params.path ?? [];
10
- const response = await handleStoreProxyRequest(
11
- request,
12
- pathSegments,
13
- config
14
- );
15
- return new NextResponse(response.body, {
16
- status: response.status,
17
- statusText: response.statusText,
18
- headers: response.headers
19
- });
20
- };
21
- return {
22
- GET: handler,
23
- POST: handler,
24
- PUT: handler,
25
- PATCH: handler,
26
- DELETE: handler
27
- };
28
- }
29
-
30
- export { toNextJsStoreApiHandler };
31
- //# sourceMappingURL=api.js.map
32
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/react/frameworks/nextjs/api/store-handler.ts"],"names":[],"mappings":";;;;;AAqBO,SAAS,uBAAA,CAAwB,MAAA,GAAgC,EAAC,EAAG;AAC1E,EAAA,MAAM,OAAA,GAAU,OACd,OAAA,EACA,OAAA,KAC0B;AAC1B,IAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,MAAA;AAC7B,IAAA,MAAM,YAAA,GAAe,MAAA,CAAO,IAAA,IAAQ,EAAC;AACrC,IAAA,MAAM,WAAW,MAAM,uBAAA;AAAA,MACrB,OAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA,KACF;AACA,IAAA,OAAO,IAAI,YAAA,CAAa,QAAA,CAAS,IAAA,EAAM;AAAA,MACrC,QAAQ,QAAA,CAAS,MAAA;AAAA,MACjB,YAAY,QAAA,CAAS,UAAA;AAAA,MACrB,SAAS,QAAA,CAAS;AAAA,KACnB,CAAA;AAAA,EACH,CAAA;AAEA,EAAA,OAAO;AAAA,IACL,GAAA,EAAK,OAAA;AAAA,IACL,IAAA,EAAM,OAAA;AAAA,IACN,GAAA,EAAK,OAAA;AAAA,IACL,KAAA,EAAO,OAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AACF","file":"api.js","sourcesContent":["import type { NextRequest } from \"next/server\";\nimport { NextResponse } from \"next/server\";\nimport {\n handleStoreProxyRequest,\n type StoreProxyHandlerConfig,\n} from \"../../../../core/server/store-proxy-handler\";\n\nexport type StoreApiHandlerConfig = StoreProxyHandlerConfig;\n\n/**\n * Crea los handlers de ruta para montar la API de store como proxy en Next.js App Router.\n *\n * ```ts\n * // app/api/store/[...path]/route.ts\n * import { toNextJsStoreApiHandler } from \"@ecomiq/storefront/nextjs/api\";\n *\n * export const { GET, POST, PUT, PATCH, DELETE } = toNextJsStoreApiHandler({\n * apiBaseUrl: process.env.STOREFRONT_API_URL,\n * });\n * ```\n */\nexport function toNextJsStoreApiHandler(config: StoreApiHandlerConfig = {}) {\n const handler = async (\n request: NextRequest,\n context: { params: Promise<{ path?: string[] }> },\n ): Promise<NextResponse> => {\n const params = await context.params;\n const pathSegments = params.path ?? [];\n const response = await handleStoreProxyRequest(\n request,\n pathSegments,\n config,\n );\n return new NextResponse(response.body, {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n });\n };\n\n return {\n GET: handler,\n POST: handler,\n PUT: handler,\n PATCH: handler,\n DELETE: handler,\n };\n}\n\nexport { handleStoreProxyRequest } from \"../../../../core/server/store-proxy-handler\";\n"]}
@@ -1,13 +0,0 @@
1
- /**
2
- * Estilos mínimos para consumidores npm.
3
- * La app define su propio design system y componentes.
4
- */
5
- @import "tailwindcss";
6
-
7
- @source "../react/shell/components/product-variant-selector/";
8
-
9
- @layer base {
10
- * {
11
- border-color: var(--border, currentColor);
12
- }
13
- }
package/dist/nextjs.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./chunks/server-nextjs";
2
- export * from "./react";
package/dist/nextjs.js DELETED
@@ -1,2 +0,0 @@
1
- "use client";
2
- export * from "./react.js";
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,18 +0,0 @@
1
- export * from "./chunks/server-nextjs";
2
- export type {
3
- StorefrontSettings,
4
- StorefrontStore,
5
- StorefrontCmsSettings,
6
- StorefrontCmsPage,
7
- StorefrontProduct,
8
- StorefrontFacet,
9
- StorefrontSearchFilter,
10
- StorefrontProductDetail,
11
- StorefrontProductsResponse,
12
- StorefrontProductsParamsInput,
13
- StorefrontVariant,
14
- StorefrontCollection,
15
- StorefrontCollectionDetail,
16
- StorefrontPageDetail,
17
- StorefrontPageListItem,
18
- } from "./chunks/core-public";
@@ -1 +0,0 @@
1
- export * from "./chunks/server-nextjs.js";
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- export default {
2
- plugins: {
3
- '@tailwindcss/postcss': {},
4
- autoprefixer: {},
5
- },
6
- };