@infuro/cms-core 1.0.33 → 1.0.35

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 (164) hide show
  1. package/README.md +22 -6
  2. package/dist/OrderTrackPage-W3J6WIG2.js +426 -0
  3. package/dist/OrderTrackPage-Z6FCJQYY.cjs +428 -0
  4. package/dist/admin.cjs +34072 -20487
  5. package/dist/admin.d.cts +191 -9
  6. package/dist/admin.d.ts +191 -9
  7. package/dist/admin.js +33913 -20423
  8. package/dist/api.cjs +123 -16508
  9. package/dist/api.d.cts +633 -3
  10. package/dist/api.d.ts +633 -3
  11. package/dist/api.js +14 -16519
  12. package/dist/auth.cjs +196 -955
  13. package/dist/auth.d.cts +201 -42
  14. package/dist/auth.d.ts +201 -42
  15. package/dist/auth.js +4 -888
  16. package/dist/chunk-2XE4X74C.js +29602 -0
  17. package/dist/chunk-3DZRIZOD.cjs +52 -0
  18. package/dist/chunk-3KPNTQBV.cjs +620 -0
  19. package/dist/chunk-46GKADYE.cjs +84 -0
  20. package/dist/chunk-4TRPKBKO.js +589 -0
  21. package/dist/chunk-5ELSW2UP.js +150 -0
  22. package/dist/chunk-6KPQWRFW.js +171 -0
  23. package/dist/chunk-7NMT3GBR.cjs +29 -0
  24. package/dist/chunk-7YIBMQDR.cjs +86 -0
  25. package/dist/chunk-BGJAV67S.cjs +29710 -0
  26. package/dist/chunk-CNTSLED2.cjs +559 -0
  27. package/dist/chunk-CRFV5WJK.js +16 -0
  28. package/dist/chunk-D5FBNKQM.cjs +104 -0
  29. package/dist/chunk-EF2JBPDM.js +114 -0
  30. package/dist/chunk-EQPITOP6.js +543 -0
  31. package/dist/chunk-GO7PPYNU.js +76 -0
  32. package/dist/chunk-HF3L2GIT.cjs +194 -0
  33. package/dist/chunk-J7XHLOLO.js +830 -0
  34. package/dist/chunk-JBRR5UYL.js +87 -0
  35. package/dist/chunk-JC6DLWTE.js +21 -0
  36. package/dist/chunk-JHF4YYRC.cjs +188 -0
  37. package/dist/chunk-JXF23MPG.js +25 -0
  38. package/dist/chunk-MQBT33IV.js +48 -0
  39. package/dist/chunk-N44BJZ4C.cjs +123 -0
  40. package/dist/chunk-OOTLNH63.cjs +18 -0
  41. package/dist/chunk-PAMVINEX.cjs +577 -0
  42. package/dist/chunk-PNOKNSG2.cjs +222 -0
  43. package/dist/chunk-QM733NUK.js +186 -0
  44. package/dist/chunk-R73BKDRO.cjs +90 -0
  45. package/dist/chunk-SHUYVCID.js +4 -0
  46. package/dist/chunk-SYBOCAWB.js +97 -0
  47. package/dist/chunk-TDV6EJHV.js +192 -0
  48. package/dist/chunk-TFUOHI37.cjs +839 -0
  49. package/dist/chunk-TIAEXJLI.cjs +182 -0
  50. package/dist/chunk-UPLVMVRX.cjs +23 -0
  51. package/dist/chunk-USNT2KNT.cjs +6 -0
  52. package/dist/chunk-WEMDMVHQ.js +216 -0
  53. package/dist/chunk-XDSNZUW7.js +564 -0
  54. package/dist/chunk-XQ3QUHWR.cjs +83 -0
  55. package/dist/chunk-XW5ATPRW.cjs +155 -0
  56. package/dist/chunk-ZQ4X6OAU.js +82 -0
  57. package/dist/chunk-ZSVCP6N3.js +83 -0
  58. package/dist/cli.cjs +142 -84
  59. package/dist/cli.js +101 -27
  60. package/dist/email-FKR4FXFI.js +5 -0
  61. package/dist/email-KVKVPNCL.cjs +58 -0
  62. package/dist/email-queue-CGZBVVAS.js +2 -0
  63. package/dist/email-queue-TPZWLTIV.cjs +23 -0
  64. package/dist/erp-config-enabled-CUMQ6N2V.cjs +11 -0
  65. package/dist/erp-config-enabled-T37X7T34.js +2 -0
  66. package/dist/erp-order-invoice-3YISSOWW.js +3 -0
  67. package/dist/erp-order-invoice-ZR5F2KTA.cjs +12 -0
  68. package/dist/event-order-defaults-6E543227.js +2 -0
  69. package/dist/event-order-defaults-DUGDVGJI.cjs +39 -0
  70. package/dist/event-order-notifications-5GSAOYVS.cjs +27 -0
  71. package/dist/event-order-notifications-IIIF23D5.js +10 -0
  72. package/dist/hooks.cjs +259 -132
  73. package/dist/hooks.d.cts +42 -1
  74. package/dist/hooks.d.ts +42 -1
  75. package/dist/hooks.js +234 -91
  76. package/dist/index.cjs +3884 -21070
  77. package/dist/index.d.cts +2255 -749
  78. package/dist/index.d.ts +2255 -749
  79. package/dist/index.js +1925 -19891
  80. package/dist/interpolate-WAKPN56R.cjs +11 -0
  81. package/dist/interpolate-WDUWDF3I.js +2 -0
  82. package/dist/layout-36UFTHC5.cjs +11 -0
  83. package/dist/layout-AOBN26XG.js +2 -0
  84. package/dist/migrations/1778660000004-CreateCustomerAndCustomerContacts.ts +99 -0
  85. package/dist/migrations/1778660000005-AddCustomerIdToVendorCustomers.ts +39 -0
  86. package/dist/migrations/1778660000006-UpdateVendorCustomersContactNullable.ts +36 -0
  87. package/dist/migrations/1778660000007-VendorOwnerCustomerContactsPermission.ts +39 -0
  88. package/dist/migrations/1779300000000-VendorOwnerContactsPermission.ts +39 -0
  89. package/dist/migrations/1779400000000-AddCustomerContactIdToOrders.ts +33 -0
  90. package/dist/migrations/1779400000000-ConvertStatusToEnum.ts +142 -0
  91. package/dist/migrations/1779400000000-SeedDefaultCurrencies.ts +33 -0
  92. package/dist/migrations/1779500000000-VendorRolesAndPermissions.ts +102 -0
  93. package/dist/migrations/1779600000000-VendorRegistrationProfile.ts +52 -0
  94. package/dist/migrations/1779700000000-CollectionIsCatalog.ts +22 -0
  95. package/dist/migrations/1779710000000-CollectionPlatformCatalog.ts +60 -0
  96. package/dist/migrations/1779720000000-ProductCategoryPlatformCatalog.ts +157 -0
  97. package/dist/migrations/1779800000000-EventsAndEventProducts.ts +173 -0
  98. package/dist/migrations/1779810000000-BackfillVendorRoleEventsPermissions.ts +38 -0
  99. package/dist/migrations/1779820000000-FixProductsCategoryForeignKey.ts +70 -0
  100. package/dist/migrations/1779830000000-ProductTitleColumn.ts +32 -0
  101. package/dist/migrations/1779840000000-EventAboutAndVisibilityFields.ts +34 -0
  102. package/dist/migrations/1779850000000-EventCityCountrySplit.ts +43 -0
  103. package/dist/migrations/1779860000000-CreateCombos.ts +140 -0
  104. package/dist/migrations/1780100000000-OrderAttendeesEventId.ts +55 -0
  105. package/dist/migrations/1780110000000-EventContactFormId.ts +49 -0
  106. package/dist/migrations/1780130000000-ProductVariants.ts +54 -0
  107. package/dist/migrations/1780140000000-EventManagementEnhancements.ts +44 -0
  108. package/dist/migrations/1780160000000-EventRegistrationGstProductContactForm.ts +79 -0
  109. package/dist/migrations/1780170000000-ComboCurrencyPrices.ts +20 -0
  110. package/dist/migrations/1781110000000-VendorOwnerCombosPermission.ts +38 -0
  111. package/dist/migrations/1781120000000-RefundPoliciesAndRequests.ts +225 -0
  112. package/dist/migrations/1781130000000-CreateAttendees.ts +44 -0
  113. package/dist/migrations/1781140000000-EventOrderNotifications.ts +29 -0
  114. package/dist/migrations/1781150000000-EventNamedLists.ts +28 -0
  115. package/dist/migrations/1781160000000-RefundPolicyEventTiers.ts +27 -0
  116. package/dist/migrations/1781170000000-EventRefundPolicy.ts +42 -0
  117. package/dist/migrations/1781180000000-RemoveCartItemsUniqueConstraint.ts +15 -0
  118. package/dist/migrations/1781190000000-RenameProductTaxesToProductConfig.ts +84 -0
  119. package/dist/migrations/1781200000000-VendorOwnerProductConfigPermissions.ts +51 -0
  120. package/dist/migrations/1781210000000-VendorRoleProductConfigPermissions.ts +46 -0
  121. package/dist/migrations/helpers/vendor-role-seed.ts +243 -0
  122. package/dist/paid-order-erp-3USEG6WL.js +3 -0
  123. package/dist/paid-order-erp-FSQ3GSXE.cjs +12 -0
  124. package/dist/pg-boss-service-4XF2TQ2E.js +2 -0
  125. package/dist/pg-boss-service-L6MTF4EQ.cjs +15 -0
  126. package/dist/razorpay-KLO2KNCB.js +49 -0
  127. package/dist/razorpay-U23LGY72.cjs +56 -0
  128. package/dist/rbac-debug-db-D7ME7QUY.cjs +35 -0
  129. package/dist/rbac-debug-db-MTCTVNNM.js +33 -0
  130. package/dist/sms-defaults-2NL24H57.js +2 -0
  131. package/dist/sms-defaults-KCOPKQBA.cjs +19 -0
  132. package/dist/stripe-4FD27QVJ.js +51 -0
  133. package/dist/stripe-VU6OEG2D.cjs +57 -0
  134. package/dist/theme.cjs +31 -59
  135. package/dist/theme.d.cts +78 -3
  136. package/dist/theme.d.ts +78 -3
  137. package/dist/theme.js +23 -20
  138. package/dist/vendor-invite-status-77O7ZQ3U.cjs +19 -0
  139. package/dist/vendor-invite-status-PWJ3DE76.js +2 -0
  140. package/dist/whatsapp-queue-3DXA4MXU.js +2 -0
  141. package/dist/whatsapp-queue-KG65MXD5.cjs +15 -0
  142. package/package.json +147 -141
  143. package/dist/admin.cjs.map +0 -1
  144. package/dist/admin.js.map +0 -1
  145. package/dist/api.cjs.map +0 -1
  146. package/dist/api.js.map +0 -1
  147. package/dist/auth.cjs.map +0 -1
  148. package/dist/auth.js.map +0 -1
  149. package/dist/cli.cjs.map +0 -1
  150. package/dist/cli.js.map +0 -1
  151. package/dist/config-DJ5CmQvS.d.cts +0 -8
  152. package/dist/config-DJ5CmQvS.d.ts +0 -8
  153. package/dist/hooks.cjs.map +0 -1
  154. package/dist/hooks.js.map +0 -1
  155. package/dist/index-DWd5Gjc4.d.ts +0 -582
  156. package/dist/index-rZTnpK7y.d.cts +0 -582
  157. package/dist/index.cjs.map +0 -1
  158. package/dist/index.js.map +0 -1
  159. package/dist/theme.cjs.map +0 -1
  160. package/dist/theme.js.map +0 -1
  161. package/dist/types-DCVaXlPV.d.cts +0 -78
  162. package/dist/types-DCVaXlPV.d.ts +0 -78
  163. package/dist/vendor-scope-DTYhJk_I.d.cts +0 -129
  164. package/dist/vendor-scope-DTYhJk_I.d.ts +0 -129
package/dist/theme.cjs CHANGED
@@ -1,41 +1,11 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ 'use strict';
2
+
3
+ var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
4
+ var React = require('react');
5
+
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
29
7
 
30
- // src/theme/index.ts
31
- var theme_exports = {};
32
- __export(theme_exports, {
33
- PageRenderer: () => PageRenderer,
34
- buildResolver: () => buildResolver,
35
- createTheme: () => createTheme,
36
- getCatalog: () => getCatalog
37
- });
38
- module.exports = __toCommonJS(theme_exports);
8
+ var React__default = /*#__PURE__*/_interopDefault(React);
39
9
 
40
10
  // src/theme/registry.ts
41
11
  function createTheme(config) {
@@ -46,6 +16,7 @@ function createTheme(config) {
46
16
  }
47
17
  return Object.freeze(config);
48
18
  }
19
+ chunkUSNT2KNT_cjs.__name(createTheme, "createTheme");
49
20
  function buildResolver(theme) {
50
21
  const resolver = {};
51
22
  for (const { meta, component } of theme.components) {
@@ -53,6 +24,7 @@ function buildResolver(theme) {
53
24
  }
54
25
  return resolver;
55
26
  }
27
+ chunkUSNT2KNT_cjs.__name(buildResolver, "buildResolver");
56
28
  function getCatalog(theme) {
57
29
  const groups = /* @__PURE__ */ new Map();
58
30
  for (const { meta } of theme.components) {
@@ -65,26 +37,23 @@ function getCatalog(theme) {
65
37
  components
66
38
  }));
67
39
  }
68
-
69
- // src/theme/renderer.ts
70
- var import_react = __toESM(require("react"), 1);
40
+ chunkUSNT2KNT_cjs.__name(getCatalog, "getCatalog");
71
41
  function PageRenderer({ content, theme, navbarConfig, footerConfig }) {
72
42
  const resolver = buildResolver(theme);
73
43
  const NavbarComponent = theme.layout?.navbar?.component;
74
44
  const FooterComponent = theme.layout?.footer?.component;
75
- return import_react.default.createElement(
76
- import_react.default.Fragment,
77
- null,
78
- NavbarComponent && navbarConfig ? import_react.default.createElement(NavbarComponent, navbarConfig) : null,
79
- import_react.default.createElement("main", null, renderNode(content, "ROOT", resolver)),
80
- FooterComponent && footerConfig ? import_react.default.createElement(FooterComponent, footerConfig) : null
81
- );
45
+ return React__default.default.createElement(React__default.default.Fragment, null, NavbarComponent && navbarConfig ? React__default.default.createElement(NavbarComponent, navbarConfig) : null, React__default.default.createElement("main", null, renderNode(content, "ROOT", resolver)), FooterComponent && footerConfig ? React__default.default.createElement(FooterComponent, footerConfig) : null);
82
46
  }
47
+ chunkUSNT2KNT_cjs.__name(PageRenderer, "PageRenderer");
83
48
  function getChildIds(node) {
84
49
  const fromNodes = node.nodes ?? [];
85
50
  const fromLinked = Object.values(node.linkedNodes ?? {});
86
- return [...fromNodes, ...fromLinked];
51
+ return [
52
+ ...fromNodes,
53
+ ...fromLinked
54
+ ];
87
55
  }
56
+ chunkUSNT2KNT_cjs.__name(getChildIds, "getChildIds");
88
57
  function renderNode(json, nodeId, resolver) {
89
58
  const node = json[nodeId];
90
59
  if (!node) return null;
@@ -93,21 +62,24 @@ function renderNode(json, nodeId, resolver) {
93
62
  const childIds = getChildIds(node);
94
63
  const children = childIds.map((childId) => renderNode(json, childId, resolver));
95
64
  if (Component) {
96
- return import_react.default.createElement(Component, { key: nodeId, ...node.props }, children);
65
+ return React__default.default.createElement(Component, {
66
+ key: nodeId,
67
+ ...node.props
68
+ }, children);
97
69
  }
98
70
  const tag = node.props?.is ?? "div";
99
71
  const props = node.props ?? {};
100
- const safeProps = { key: nodeId };
72
+ const safeProps = {
73
+ key: nodeId
74
+ };
101
75
  if (props.className != null) safeProps.className = props.className;
102
76
  if (props.style != null) safeProps.style = props.style;
103
77
  if (props.id != null) safeProps.id = props.id;
104
- return import_react.default.createElement(tag, safeProps, children);
78
+ return React__default.default.createElement(tag, safeProps, children);
105
79
  }
106
- // Annotate the CommonJS export names for ESM import in node:
107
- 0 && (module.exports = {
108
- PageRenderer,
109
- buildResolver,
110
- createTheme,
111
- getCatalog
112
- });
113
- //# sourceMappingURL=theme.cjs.map
80
+ chunkUSNT2KNT_cjs.__name(renderNode, "renderNode");
81
+
82
+ exports.PageRenderer = PageRenderer;
83
+ exports.buildResolver = buildResolver;
84
+ exports.createTheme = createTheme;
85
+ exports.getCatalog = getCatalog;
package/dist/theme.d.cts CHANGED
@@ -1,7 +1,82 @@
1
- import { C as ComponentMeta, c as ThemeConfig, a as NavbarConfig, F as FooterConfig } from './types-DCVaXlPV.cjs';
2
- export { L as LayoutConfig, N as NavItem, P as PropDefinition, b as PropType, T as ThemeComponent } from './types-DCVaXlPV.cjs';
3
1
  import React$1 from 'react';
4
2
 
3
+ type PropType = 'text' | 'textarea' | 'richtext' | 'image' | 'color' | 'select' | 'number' | 'boolean' | 'url' | 'entity';
4
+ interface PropDefinition {
5
+ name: string;
6
+ label: string;
7
+ type: PropType;
8
+ options?: {
9
+ label: string;
10
+ value: string;
11
+ }[];
12
+ entity?: string;
13
+ displayField?: string;
14
+ required?: boolean;
15
+ }
16
+ interface ComponentMeta {
17
+ name: string;
18
+ label: string;
19
+ category: string;
20
+ icon: string;
21
+ description: string;
22
+ defaultProps: Record<string, any>;
23
+ props?: PropDefinition[];
24
+ canContainChildren?: boolean;
25
+ }
26
+ interface ThemeComponent {
27
+ meta: ComponentMeta;
28
+ component: React.ComponentType<any>;
29
+ }
30
+ interface NavItem {
31
+ id: string;
32
+ label: string;
33
+ url: string;
34
+ openInNewTab?: boolean;
35
+ /** When set, url is derived from the linked page slug. */
36
+ pageId?: number;
37
+ children?: NavItem[];
38
+ }
39
+ interface NavbarConfig {
40
+ logo: string;
41
+ items: NavItem[];
42
+ ctaLabel?: string;
43
+ ctaUrl?: string;
44
+ /** Optional variant for theme-specific layout (e.g. "page2"). */
45
+ variant?: string;
46
+ }
47
+ interface FooterConfig {
48
+ copyright: string;
49
+ columns: {
50
+ title: string;
51
+ links: {
52
+ label: string;
53
+ url: string;
54
+ }[];
55
+ }[];
56
+ socialLinks: {
57
+ icon: string;
58
+ url: string;
59
+ }[];
60
+ /** When set, footer shows this logo (e.g. same as navbar). */
61
+ logo?: string;
62
+ }
63
+ interface LayoutConfig {
64
+ navbar?: {
65
+ component: React.ComponentType<NavbarConfig>;
66
+ };
67
+ footer?: {
68
+ component: React.ComponentType<FooterConfig>;
69
+ fields: PropDefinition[];
70
+ defaults: Record<string, any>;
71
+ };
72
+ }
73
+ interface ThemeConfig {
74
+ name: string;
75
+ label: string;
76
+ components: ThemeComponent[];
77
+ layout?: LayoutConfig;
78
+ }
79
+
5
80
  declare function createTheme(config: ThemeConfig): ThemeConfig;
6
81
  declare function buildResolver(theme: ThemeConfig): Record<string, React.ComponentType<any>>;
7
82
  interface CatalogGroup {
@@ -29,4 +104,4 @@ declare function PageRenderer({ content, theme, navbarConfig, footerConfig }: Pa
29
104
  children?: React$1.ReactNode | undefined;
30
105
  }>;
31
106
 
32
- export { type CatalogGroup, ComponentMeta, FooterConfig, NavbarConfig, PageRenderer, ThemeConfig, buildResolver, createTheme, getCatalog };
107
+ export { type CatalogGroup, type ComponentMeta, type FooterConfig, type LayoutConfig, type NavItem, type NavbarConfig, PageRenderer, type PropDefinition, type PropType, type ThemeComponent, type ThemeConfig, buildResolver, createTheme, getCatalog };
package/dist/theme.d.ts CHANGED
@@ -1,7 +1,82 @@
1
- import { C as ComponentMeta, c as ThemeConfig, a as NavbarConfig, F as FooterConfig } from './types-DCVaXlPV.js';
2
- export { L as LayoutConfig, N as NavItem, P as PropDefinition, b as PropType, T as ThemeComponent } from './types-DCVaXlPV.js';
3
1
  import React$1 from 'react';
4
2
 
3
+ type PropType = 'text' | 'textarea' | 'richtext' | 'image' | 'color' | 'select' | 'number' | 'boolean' | 'url' | 'entity';
4
+ interface PropDefinition {
5
+ name: string;
6
+ label: string;
7
+ type: PropType;
8
+ options?: {
9
+ label: string;
10
+ value: string;
11
+ }[];
12
+ entity?: string;
13
+ displayField?: string;
14
+ required?: boolean;
15
+ }
16
+ interface ComponentMeta {
17
+ name: string;
18
+ label: string;
19
+ category: string;
20
+ icon: string;
21
+ description: string;
22
+ defaultProps: Record<string, any>;
23
+ props?: PropDefinition[];
24
+ canContainChildren?: boolean;
25
+ }
26
+ interface ThemeComponent {
27
+ meta: ComponentMeta;
28
+ component: React.ComponentType<any>;
29
+ }
30
+ interface NavItem {
31
+ id: string;
32
+ label: string;
33
+ url: string;
34
+ openInNewTab?: boolean;
35
+ /** When set, url is derived from the linked page slug. */
36
+ pageId?: number;
37
+ children?: NavItem[];
38
+ }
39
+ interface NavbarConfig {
40
+ logo: string;
41
+ items: NavItem[];
42
+ ctaLabel?: string;
43
+ ctaUrl?: string;
44
+ /** Optional variant for theme-specific layout (e.g. "page2"). */
45
+ variant?: string;
46
+ }
47
+ interface FooterConfig {
48
+ copyright: string;
49
+ columns: {
50
+ title: string;
51
+ links: {
52
+ label: string;
53
+ url: string;
54
+ }[];
55
+ }[];
56
+ socialLinks: {
57
+ icon: string;
58
+ url: string;
59
+ }[];
60
+ /** When set, footer shows this logo (e.g. same as navbar). */
61
+ logo?: string;
62
+ }
63
+ interface LayoutConfig {
64
+ navbar?: {
65
+ component: React.ComponentType<NavbarConfig>;
66
+ };
67
+ footer?: {
68
+ component: React.ComponentType<FooterConfig>;
69
+ fields: PropDefinition[];
70
+ defaults: Record<string, any>;
71
+ };
72
+ }
73
+ interface ThemeConfig {
74
+ name: string;
75
+ label: string;
76
+ components: ThemeComponent[];
77
+ layout?: LayoutConfig;
78
+ }
79
+
5
80
  declare function createTheme(config: ThemeConfig): ThemeConfig;
6
81
  declare function buildResolver(theme: ThemeConfig): Record<string, React.ComponentType<any>>;
7
82
  interface CatalogGroup {
@@ -29,4 +104,4 @@ declare function PageRenderer({ content, theme, navbarConfig, footerConfig }: Pa
29
104
  children?: React$1.ReactNode | undefined;
30
105
  }>;
31
106
 
32
- export { type CatalogGroup, ComponentMeta, FooterConfig, NavbarConfig, PageRenderer, ThemeConfig, buildResolver, createTheme, getCatalog };
107
+ export { type CatalogGroup, type ComponentMeta, type FooterConfig, type LayoutConfig, type NavItem, type NavbarConfig, PageRenderer, type PropDefinition, type PropType, type ThemeComponent, type ThemeConfig, buildResolver, createTheme, getCatalog };
package/dist/theme.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { __name } from './chunk-SHUYVCID.js';
2
+ import React from 'react';
3
+
1
4
  // src/theme/registry.ts
2
5
  function createTheme(config) {
3
6
  const names = config.components.map((c) => c.meta.name);
@@ -7,6 +10,7 @@ function createTheme(config) {
7
10
  }
8
11
  return Object.freeze(config);
9
12
  }
13
+ __name(createTheme, "createTheme");
10
14
  function buildResolver(theme) {
11
15
  const resolver = {};
12
16
  for (const { meta, component } of theme.components) {
@@ -14,6 +18,7 @@ function buildResolver(theme) {
14
18
  }
15
19
  return resolver;
16
20
  }
21
+ __name(buildResolver, "buildResolver");
17
22
  function getCatalog(theme) {
18
23
  const groups = /* @__PURE__ */ new Map();
19
24
  for (const { meta } of theme.components) {
@@ -26,26 +31,23 @@ function getCatalog(theme) {
26
31
  components
27
32
  }));
28
33
  }
29
-
30
- // src/theme/renderer.ts
31
- import React from "react";
34
+ __name(getCatalog, "getCatalog");
32
35
  function PageRenderer({ content, theme, navbarConfig, footerConfig }) {
33
36
  const resolver = buildResolver(theme);
34
37
  const NavbarComponent = theme.layout?.navbar?.component;
35
38
  const FooterComponent = theme.layout?.footer?.component;
36
- return React.createElement(
37
- React.Fragment,
38
- null,
39
- NavbarComponent && navbarConfig ? React.createElement(NavbarComponent, navbarConfig) : null,
40
- React.createElement("main", null, renderNode(content, "ROOT", resolver)),
41
- FooterComponent && footerConfig ? React.createElement(FooterComponent, footerConfig) : null
42
- );
39
+ return React.createElement(React.Fragment, null, NavbarComponent && navbarConfig ? React.createElement(NavbarComponent, navbarConfig) : null, React.createElement("main", null, renderNode(content, "ROOT", resolver)), FooterComponent && footerConfig ? React.createElement(FooterComponent, footerConfig) : null);
43
40
  }
41
+ __name(PageRenderer, "PageRenderer");
44
42
  function getChildIds(node) {
45
43
  const fromNodes = node.nodes ?? [];
46
44
  const fromLinked = Object.values(node.linkedNodes ?? {});
47
- return [...fromNodes, ...fromLinked];
45
+ return [
46
+ ...fromNodes,
47
+ ...fromLinked
48
+ ];
48
49
  }
50
+ __name(getChildIds, "getChildIds");
49
51
  function renderNode(json, nodeId, resolver) {
50
52
  const node = json[nodeId];
51
53
  if (!node) return null;
@@ -54,20 +56,21 @@ function renderNode(json, nodeId, resolver) {
54
56
  const childIds = getChildIds(node);
55
57
  const children = childIds.map((childId) => renderNode(json, childId, resolver));
56
58
  if (Component) {
57
- return React.createElement(Component, { key: nodeId, ...node.props }, children);
59
+ return React.createElement(Component, {
60
+ key: nodeId,
61
+ ...node.props
62
+ }, children);
58
63
  }
59
64
  const tag = node.props?.is ?? "div";
60
65
  const props = node.props ?? {};
61
- const safeProps = { key: nodeId };
66
+ const safeProps = {
67
+ key: nodeId
68
+ };
62
69
  if (props.className != null) safeProps.className = props.className;
63
70
  if (props.style != null) safeProps.style = props.style;
64
71
  if (props.id != null) safeProps.id = props.id;
65
72
  return React.createElement(tag, safeProps, children);
66
73
  }
67
- export {
68
- PageRenderer,
69
- buildResolver,
70
- createTheme,
71
- getCatalog
72
- };
73
- //# sourceMappingURL=theme.js.map
74
+ __name(renderNode, "renderNode");
75
+
76
+ export { PageRenderer, buildResolver, createTheme, getCatalog };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ var chunk7NMT3GBR_cjs = require('./chunk-7NMT3GBR.cjs');
4
+ require('./chunk-USNT2KNT.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "inviteStatusForActivation", {
9
+ enumerable: true,
10
+ get: function () { return chunk7NMT3GBR_cjs.inviteStatusForActivation; }
11
+ });
12
+ Object.defineProperty(exports, "markVendorInviteAcceptedForUser", {
13
+ enumerable: true,
14
+ get: function () { return chunk7NMT3GBR_cjs.markVendorInviteAcceptedForUser; }
15
+ });
16
+ Object.defineProperty(exports, "markVendorInvitePendingForUser", {
17
+ enumerable: true,
18
+ get: function () { return chunk7NMT3GBR_cjs.markVendorInvitePendingForUser; }
19
+ });
@@ -0,0 +1,2 @@
1
+ export { inviteStatusForActivation, markVendorInviteAcceptedForUser, markVendorInvitePendingForUser } from './chunk-JXF23MPG.js';
2
+ import './chunk-SHUYVCID.js';
@@ -0,0 +1,2 @@
1
+ export { queueWhatsApp, registerWhatsAppQueueProcessor } from './chunk-ZSVCP6N3.js';
2
+ import './chunk-SHUYVCID.js';
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var chunk7YIBMQDR_cjs = require('./chunk-7YIBMQDR.cjs');
4
+ require('./chunk-USNT2KNT.cjs');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "queueWhatsApp", {
9
+ enumerable: true,
10
+ get: function () { return chunk7YIBMQDR_cjs.queueWhatsApp; }
11
+ });
12
+ Object.defineProperty(exports, "registerWhatsAppQueueProcessor", {
13
+ enumerable: true,
14
+ get: function () { return chunk7YIBMQDR_cjs.registerWhatsAppQueueProcessor; }
15
+ });