@fluid-app/rep-core 0.1.15 → 0.1.17

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 (128) hide show
  1. package/dist/data-sources/DataAwareWidget.cjs.map +1 -1
  2. package/dist/data-sources/DataAwareWidget.d.cts +6 -20
  3. package/dist/data-sources/DataAwareWidget.d.cts.map +1 -1
  4. package/dist/data-sources/DataAwareWidget.d.mts +6 -20
  5. package/dist/data-sources/DataAwareWidget.d.mts.map +1 -1
  6. package/dist/data-sources/DataAwareWidget.mjs.map +1 -1
  7. package/dist/data-sources/ErrorState.cjs.map +1 -1
  8. package/dist/data-sources/ErrorState.d.cts +2 -2
  9. package/dist/data-sources/ErrorState.d.cts.map +1 -1
  10. package/dist/data-sources/ErrorState.d.mts +2 -2
  11. package/dist/data-sources/ErrorState.d.mts.map +1 -1
  12. package/dist/data-sources/ErrorState.mjs.map +1 -1
  13. package/dist/data-sources/context.cjs.map +1 -1
  14. package/dist/data-sources/context.d.cts +2 -3
  15. package/dist/data-sources/context.d.cts.map +1 -1
  16. package/dist/data-sources/context.d.mts +2 -3
  17. package/dist/data-sources/context.d.mts.map +1 -1
  18. package/dist/data-sources/context.mjs.map +1 -1
  19. package/dist/data-sources/fetchers/api.d.cts +3 -3
  20. package/dist/data-sources/fetchers/api.d.mts +3 -3
  21. package/dist/data-sources/fetchers/custom.d.cts +10 -10
  22. package/dist/data-sources/fetchers/custom.d.mts +10 -10
  23. package/dist/data-sources/fetchers/static.d.cts +20 -20
  24. package/dist/data-sources/fetchers/static.d.cts.map +1 -1
  25. package/dist/data-sources/fetchers/static.d.mts +20 -20
  26. package/dist/data-sources/fetchers/static.d.mts.map +1 -1
  27. package/dist/data-sources/preview-context.cjs.map +1 -1
  28. package/dist/data-sources/preview-context.d.cts +1 -3
  29. package/dist/data-sources/preview-context.d.cts.map +1 -1
  30. package/dist/data-sources/preview-context.d.mts +1 -3
  31. package/dist/data-sources/preview-context.d.mts.map +1 -1
  32. package/dist/data-sources/preview-context.mjs.map +1 -1
  33. package/dist/data-sources/registry-context.cjs.map +1 -1
  34. package/dist/data-sources/registry-context.d.cts +14 -15
  35. package/dist/data-sources/registry-context.d.cts.map +1 -1
  36. package/dist/data-sources/registry-context.d.mts +14 -15
  37. package/dist/data-sources/registry-context.d.mts.map +1 -1
  38. package/dist/data-sources/registry-context.mjs.map +1 -1
  39. package/dist/data-sources/registry.cjs.map +1 -1
  40. package/dist/data-sources/registry.d.cts +4 -4
  41. package/dist/data-sources/registry.d.cts.map +1 -1
  42. package/dist/data-sources/registry.d.mts +4 -4
  43. package/dist/data-sources/registry.d.mts.map +1 -1
  44. package/dist/data-sources/registry.mjs.map +1 -1
  45. package/dist/data-sources/transformers.d.cts +3 -3
  46. package/dist/data-sources/transformers.d.mts +3 -3
  47. package/dist/data-sources/types.d.cts +1 -1
  48. package/dist/data-sources/types.d.mts +1 -1
  49. package/dist/data-sources/use-widget-data.d.cts +4 -4
  50. package/dist/data-sources/use-widget-data.d.cts.map +1 -1
  51. package/dist/data-sources/use-widget-data.d.mts +4 -4
  52. package/dist/data-sources/use-widget-data.d.mts.map +1 -1
  53. package/dist/{index-Bxe_LIi8.d.cts → index-Bgv8HUpo.d.cts} +36 -77
  54. package/dist/index-Bgv8HUpo.d.cts.map +1 -0
  55. package/dist/{index-CCAu2n19.d.mts → index-Ka_HOwpb.d.mts} +36 -77
  56. package/dist/index-Ka_HOwpb.d.mts.map +1 -0
  57. package/dist/registries/index.cjs.map +1 -1
  58. package/dist/registries/index.d.cts +86 -86
  59. package/dist/registries/index.d.cts.map +1 -1
  60. package/dist/registries/index.d.mts +86 -86
  61. package/dist/registries/index.d.mts.map +1 -1
  62. package/dist/registries/index.mjs.map +1 -1
  63. package/dist/shell/AppShellLayout.cjs.map +1 -1
  64. package/dist/shell/AppShellLayout.d.cts +15 -16
  65. package/dist/shell/AppShellLayout.d.cts.map +1 -1
  66. package/dist/shell/AppShellLayout.d.mts +15 -16
  67. package/dist/shell/AppShellLayout.d.mts.map +1 -1
  68. package/dist/shell/AppShellLayout.mjs.map +1 -1
  69. package/dist/shell/ScreenHeader.cjs.map +1 -1
  70. package/dist/shell/ScreenHeader.d.cts +2 -2
  71. package/dist/shell/ScreenHeader.d.cts.map +1 -1
  72. package/dist/shell/ScreenHeader.d.mts +2 -2
  73. package/dist/shell/ScreenHeader.d.mts.map +1 -1
  74. package/dist/shell/ScreenHeader.mjs.map +1 -1
  75. package/dist/shell/ScreenHeaderContext.cjs.map +1 -1
  76. package/dist/shell/ScreenHeaderContext.d.cts +17 -18
  77. package/dist/shell/ScreenHeaderContext.d.cts.map +1 -1
  78. package/dist/shell/ScreenHeaderContext.d.mts +17 -18
  79. package/dist/shell/ScreenHeaderContext.d.mts.map +1 -1
  80. package/dist/shell/ScreenHeaderContext.mjs.map +1 -1
  81. package/dist/shell/ThemeModeContext.cjs.map +1 -1
  82. package/dist/shell/ThemeModeContext.d.cts +2 -3
  83. package/dist/shell/ThemeModeContext.d.cts.map +1 -1
  84. package/dist/shell/ThemeModeContext.d.mts +2 -3
  85. package/dist/shell/ThemeModeContext.d.mts.map +1 -1
  86. package/dist/shell/ThemeModeContext.mjs.map +1 -1
  87. package/dist/shell/sidebar.cjs.map +1 -1
  88. package/dist/shell/sidebar.d.cts +47 -37
  89. package/dist/shell/sidebar.d.cts.map +1 -1
  90. package/dist/shell/sidebar.d.mts +47 -37
  91. package/dist/shell/sidebar.d.mts.map +1 -1
  92. package/dist/shell/sidebar.mjs +32 -32
  93. package/dist/shell/sidebar.mjs.map +1 -1
  94. package/dist/shell/use-mobile.cjs.map +1 -1
  95. package/dist/shell/use-mobile.mjs.map +1 -1
  96. package/dist/theme/index.cjs +1 -0
  97. package/dist/theme/index.cjs.map +1 -1
  98. package/dist/theme/index.d.cts +54 -54
  99. package/dist/theme/index.d.cts.map +1 -1
  100. package/dist/theme/index.d.mts +54 -54
  101. package/dist/theme/index.d.mts.map +1 -1
  102. package/dist/theme/index.mjs +1 -0
  103. package/dist/theme/index.mjs.map +1 -1
  104. package/dist/types/index.d.cts +3 -3
  105. package/dist/types/index.d.mts +3 -3
  106. package/dist/{types-ByG6Xy3C.d.mts → types-27AHMek-.d.cts} +4 -4
  107. package/dist/{types-ByG6Xy3C.d.mts.map → types-27AHMek-.d.cts.map} +1 -1
  108. package/dist/types-BXFX9bXp.cjs.map +1 -1
  109. package/dist/types-Bjmd7Fdx.mjs.map +1 -1
  110. package/dist/{types-BIXtQlHB.d.cts → types-C5Zs5V3E.d.mts} +29 -29
  111. package/dist/types-C5Zs5V3E.d.mts.map +1 -0
  112. package/dist/{types-Ctu-Zio6.d.cts → types-CeCPKvOv.d.mts} +4 -4
  113. package/dist/{types-Ctu-Zio6.d.cts.map → types-CeCPKvOv.d.mts.map} +1 -1
  114. package/dist/{types-C5OFJy-O.d.mts → types-DrzvahW8.d.cts} +29 -29
  115. package/dist/types-DrzvahW8.d.cts.map +1 -0
  116. package/dist/{widget-schema--PY1uMWx.d.cts → widget-schema-BKZgsNG7.d.mts} +59 -59
  117. package/dist/widget-schema-BKZgsNG7.d.mts.map +1 -0
  118. package/dist/{widget-schema-YkD5p3v4.d.mts → widget-schema-BSX2fVhW.d.cts} +59 -59
  119. package/dist/widget-schema-BSX2fVhW.d.cts.map +1 -0
  120. package/dist/widget-utils/index.d.cts +20 -20
  121. package/dist/widget-utils/index.d.mts +20 -20
  122. package/package.json +1 -1
  123. package/dist/index-Bxe_LIi8.d.cts.map +0 -1
  124. package/dist/index-CCAu2n19.d.mts.map +0 -1
  125. package/dist/types-BIXtQlHB.d.cts.map +0 -1
  126. package/dist/types-C5OFJy-O.d.mts.map +0 -1
  127. package/dist/widget-schema--PY1uMWx.d.cts.map +0 -1
  128. package/dist/widget-schema-YkD5p3v4.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DataAwareWidget.cjs","names":["useWidgetData","ErrorState"],"sources":["../../src/data-sources/DataAwareWidget.tsx"],"sourcesContent":["import { memo, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { WidgetSchema } from \"../types/widget-schema\";\nimport { useWidgetData } from \"./use-widget-data\";\nimport { ErrorState } from \"./ErrorState\";\n\nexport interface DataAwareWidgetProps {\n widget: WidgetSchema;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Component: ComponentType<any>;\n /** Additional props to pass through (e.g., edit mode callbacks) */\n additionalProps?: Record<string, unknown>;\n /** Custom loading component */\n loadingComponent?: ReactNode;\n /** Custom error component */\n errorComponent?: (error: Error) => ReactNode;\n /** Base URL for API calls (e.g., \"https://api.fluid.app/api\") */\n baseUrl?: string | undefined;\n}\n\n// Empty object constant to avoid creating new references\nconst EMPTY_OBJECT: Record<string, unknown> = {};\n\n/**\n * Wrapper component that resolves data sources before rendering the widget.\n * Merges resolved data with static props.\n */\nfunction DataAwareWidgetImpl({\n widget,\n Component,\n additionalProps,\n loadingComponent,\n errorComponent,\n baseUrl,\n}: DataAwareWidgetProps) {\n // Use stable empty object if no additionalProps provided\n const stableAdditionalProps = additionalProps ?? EMPTY_OBJECT;\n const { data, isLoading, error } = useWidgetData(widget, { baseUrl });\n\n // Merge static props with resolved data\n // Data takes precedence (allows overriding defaults)\n // Memoized to prevent unnecessary child re-renders\n // Note: Must be called before any early returns to satisfy Rules of Hooks\n const mergedProps = useMemo(\n () => ({\n ...widget.props,\n ...data,\n ...stableAdditionalProps,\n }),\n [widget.props, data, stableAdditionalProps],\n );\n\n // Show loading state\n if (isLoading && widget.dataSource?.loading?.showSkeleton !== false) {\n if (loadingComponent) {\n return <>{loadingComponent}</>;\n }\n // Default skeleton - can be customized\n return (\n <div\n className=\"bg-muted animate-pulse rounded-md\"\n style={{ minHeight: 100 }}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n\n // Show error state (if no fallback was applied)\n if (error && !data) {\n if (errorComponent) {\n return <>{errorComponent(error)}</>;\n }\n // Default error display\n return <ErrorState />;\n }\n\n return <Component {...mergedProps} />;\n}\n\n/**\n * Memoized wrapper component that resolves data sources before rendering the widget.\n * Prevents re-renders when parent re-renders but props haven't changed.\n */\nexport const DataAwareWidget = memo(DataAwareWidgetImpl);\n"],"mappings":";;;;;;;AAoBA,MAAM,eAAwC,EAAE;;;;;AAMhD,SAAS,oBAAoB,EAC3B,QACA,WACA,iBACA,kBACA,gBACA,WACuB;CAEvB,MAAM,wBAAwB,mBAAmB;CACjD,MAAM,EAAE,MAAM,WAAW,UAAUA,qCAAAA,cAAc,QAAQ,EAAE,SAAS,CAAC;CAMrE,MAAM,eAAA,GAAA,MAAA,gBACG;EACL,GAAG,OAAO;EACV,GAAG;EACH,GAAG;EACJ,GACD;EAAC,OAAO;EAAO;EAAM;EAAsB,CAC5C;AAGD,KAAI,aAAa,OAAO,YAAY,SAAS,iBAAiB,OAAO;AACnE,MAAI,iBACF,QAAO,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,UAAG,kBAAoB,CAAA;AAGhC,SACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,WAAU;GACV,OAAO,EAAE,WAAW,KAAK;aAEzB,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cAAU;IAAiB,CAAA;GACvC,CAAA;;AAKV,KAAI,SAAS,CAAC,MAAM;AAClB,MAAI,eACF,QAAO,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,UAAG,eAAe,MAAM,EAAI,CAAA;AAGrC,SAAO,iBAAA,GAAA,kBAAA,KAACC,gCAAAA,YAAD,EAAc,CAAA;;AAGvB,QAAO,iBAAA,GAAA,kBAAA,KAAC,WAAD,EAAW,GAAI,aAAe,CAAA;;;;;;AAOvC,MAAa,mBAAA,GAAA,MAAA,MAAuB,oBAAoB"}
1
+ {"version":3,"file":"DataAwareWidget.cjs","names":["useWidgetData","ErrorState"],"sources":["../../src/data-sources/DataAwareWidget.tsx"],"sourcesContent":["import type React from \"react\";\nimport { memo, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { WidgetSchema } from \"../types/widget-schema\";\nimport { useWidgetData } from \"./use-widget-data\";\nimport { ErrorState } from \"./ErrorState\";\n\nexport interface DataAwareWidgetProps {\n widget: WidgetSchema;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Component: ComponentType<any>;\n /** Additional props to pass through (e.g., edit mode callbacks) */\n additionalProps?: Record<string, unknown>;\n /** Custom loading component */\n loadingComponent?: ReactNode;\n /** Custom error component */\n errorComponent?: (error: Error) => ReactNode;\n /** Base URL for API calls (e.g., \"https://api.fluid.app/api\") */\n baseUrl?: string | undefined;\n}\n\n// Empty object constant to avoid creating new references\nconst EMPTY_OBJECT: Record<string, unknown> = {};\n\n/**\n * Wrapper component that resolves data sources before rendering the widget.\n * Merges resolved data with static props.\n */\nfunction DataAwareWidgetImpl({\n widget,\n Component,\n additionalProps,\n loadingComponent,\n errorComponent,\n baseUrl,\n}: DataAwareWidgetProps): React.JSX.Element | null {\n // Use stable empty object if no additionalProps provided\n const stableAdditionalProps = additionalProps ?? EMPTY_OBJECT;\n const { data, isLoading, error } = useWidgetData(widget, { baseUrl });\n\n // Merge static props with resolved data\n // Data takes precedence (allows overriding defaults)\n // Memoized to prevent unnecessary child re-renders\n // Note: Must be called before any early returns to satisfy Rules of Hooks\n const mergedProps = useMemo(\n () => ({\n ...widget.props,\n ...data,\n ...stableAdditionalProps,\n }),\n [widget.props, data, stableAdditionalProps],\n );\n\n // Show loading state\n if (isLoading && widget.dataSource?.loading?.showSkeleton !== false) {\n if (loadingComponent) {\n return <>{loadingComponent}</>;\n }\n // Default skeleton - can be customized\n return (\n <div\n className=\"bg-muted animate-pulse rounded-md\"\n style={{ minHeight: 100 }}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n\n // Show error state (if no fallback was applied)\n if (error && !data) {\n if (errorComponent) {\n return <>{errorComponent(error)}</>;\n }\n // Default error display\n return <ErrorState />;\n }\n\n return <Component {...mergedProps} />;\n}\n\n/**\n * Memoized wrapper component that resolves data sources before rendering the widget.\n * Prevents re-renders when parent re-renders but props haven't changed.\n */\nexport const DataAwareWidget: React.NamedExoticComponent<DataAwareWidgetProps> =\n memo(DataAwareWidgetImpl);\n"],"mappings":";;;;;;;AAqBA,MAAM,eAAwC,EAAE;;;;;AAMhD,SAAS,oBAAoB,EAC3B,QACA,WACA,iBACA,kBACA,gBACA,WACiD;CAEjD,MAAM,wBAAwB,mBAAmB;CACjD,MAAM,EAAE,MAAM,WAAW,UAAUA,qCAAAA,cAAc,QAAQ,EAAE,SAAS,CAAC;CAMrE,MAAM,eAAA,GAAA,MAAA,gBACG;EACL,GAAG,OAAO;EACV,GAAG;EACH,GAAG;EACJ,GACD;EAAC,OAAO;EAAO;EAAM;EAAsB,CAC5C;AAGD,KAAI,aAAa,OAAO,YAAY,SAAS,iBAAiB,OAAO;AACnE,MAAI,iBACF,QAAO,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,UAAG,kBAAoB,CAAA;AAGhC,SACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;GACE,WAAU;GACV,OAAO,EAAE,WAAW,KAAK;aAEzB,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,WAAU;cAAU;IAAiB,CAAA;GACvC,CAAA;;AAKV,KAAI,SAAS,CAAC,MAAM;AAClB,MAAI,eACF,QAAO,iBAAA,GAAA,kBAAA,KAAA,kBAAA,UAAA,EAAA,UAAG,eAAe,MAAM,EAAI,CAAA;AAGrC,SAAO,iBAAA,GAAA,kBAAA,KAACC,gCAAAA,YAAD,EAAc,CAAA;;AAGvB,QAAO,iBAAA,GAAA,kBAAA,KAAC,WAAD,EAAW,GAAI,aAAe,CAAA;;;;;;AAOvC,MAAa,mBAAA,GAAA,MAAA,MACN,oBAAoB"}
@@ -1,7 +1,5 @@
1
- import { a as WidgetSchema } from "../widget-schema--PY1uMWx.cjs";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import * as react from "react";
4
- import { ComponentType, ReactNode } from "react";
1
+ import { a as WidgetSchema } from "../widget-schema-BSX2fVhW.cjs";
2
+ import React, { ComponentType, ReactNode } from "react";
5
3
 
6
4
  //#region src/data-sources/DataAwareWidget.d.ts
7
5
  interface DataAwareWidgetProps {
@@ -17,22 +15,10 @@ interface DataAwareWidgetProps {
17
15
  baseUrl?: string | undefined;
18
16
  }
19
17
  /**
20
- * Wrapper component that resolves data sources before rendering the widget.
21
- * Merges resolved data with static props.
22
- */
23
- declare function DataAwareWidgetImpl({
24
- widget,
25
- Component,
26
- additionalProps,
27
- loadingComponent,
28
- errorComponent,
29
- baseUrl
30
- }: DataAwareWidgetProps): react_jsx_runtime0.JSX.Element;
31
- /**
32
- * Memoized wrapper component that resolves data sources before rendering the widget.
33
- * Prevents re-renders when parent re-renders but props haven't changed.
34
- */
35
- declare const DataAwareWidget: react.MemoExoticComponent<typeof DataAwareWidgetImpl>;
18
+ * Memoized wrapper component that resolves data sources before rendering the widget.
19
+ * Prevents re-renders when parent re-renders but props haven't changed.
20
+ */
21
+ declare const DataAwareWidget: React.NamedExoticComponent<DataAwareWidgetProps>;
36
22
  //#endregion
37
23
  export { DataAwareWidget, DataAwareWidgetProps };
38
24
  //# sourceMappingURL=DataAwareWidget.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataAwareWidget.d.cts","names":[],"sources":["../../src/data-sources/DataAwareWidget.tsx"],"mappings":";;;;;;UAKiB,oBAAA;EACf,MAAA,EAAQ,YAAA;EAER,SAAA,EAAW,aAAA;;EAEX,eAAA,GAAkB,MAAA;EALiB;EAOnC,gBAAA,GAAmB,SAAA;EANX;EAQR,cAAA,IAAkB,KAAA,EAAO,KAAA,KAAU,SAAA;EAJjB;EAMlB,OAAA;AAAA;;;;;iBAUO,mBAAA,CAAA;EACP,MAAA;EACA,SAAA;EACA,eAAA;EACA,gBAAA;EACA,cAAA;EACA;AAAA,GACC,oBAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;cAkDV,eAAA,EAAe,KAAA,CAAA,mBAAA,QAAA,mBAAA"}
1
+ {"version":3,"file":"DataAwareWidget.d.cts","names":[],"sources":["../../src/data-sources/DataAwareWidget.tsx"],"mappings":";;;;UAMiB,oBAAA;EACf,MAAA,EAAQ,YAAA;EAER,SAAA,EAAW,aAAA;;EAEX,eAAA,GAAkB,MAAA;;EAElB,gBAAA,GAAmB,SAAA;;EAEnB,cAAA,IAAkB,KAAA,EAAO,KAAA,KAAU,SAAA;;EAEnC,OAAA;AAAA;;;;;cAmEW,eAAA,EAAiB,KAAA,CAAM,oBAAA,CAAqB,oBAAA"}
@@ -1,7 +1,5 @@
1
- import { a as WidgetSchema } from "../widget-schema-YkD5p3v4.mjs";
2
- import * as react from "react";
3
- import { ComponentType, ReactNode } from "react";
4
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import { a as WidgetSchema } from "../widget-schema-BKZgsNG7.mjs";
2
+ import React, { ComponentType, ReactNode } from "react";
5
3
 
6
4
  //#region src/data-sources/DataAwareWidget.d.ts
7
5
  interface DataAwareWidgetProps {
@@ -17,22 +15,10 @@ interface DataAwareWidgetProps {
17
15
  baseUrl?: string | undefined;
18
16
  }
19
17
  /**
20
- * Wrapper component that resolves data sources before rendering the widget.
21
- * Merges resolved data with static props.
22
- */
23
- declare function DataAwareWidgetImpl({
24
- widget,
25
- Component,
26
- additionalProps,
27
- loadingComponent,
28
- errorComponent,
29
- baseUrl
30
- }: DataAwareWidgetProps): react_jsx_runtime0.JSX.Element;
31
- /**
32
- * Memoized wrapper component that resolves data sources before rendering the widget.
33
- * Prevents re-renders when parent re-renders but props haven't changed.
34
- */
35
- declare const DataAwareWidget: react.MemoExoticComponent<typeof DataAwareWidgetImpl>;
18
+ * Memoized wrapper component that resolves data sources before rendering the widget.
19
+ * Prevents re-renders when parent re-renders but props haven't changed.
20
+ */
21
+ declare const DataAwareWidget: React.NamedExoticComponent<DataAwareWidgetProps>;
36
22
  //#endregion
37
23
  export { DataAwareWidget, DataAwareWidgetProps };
38
24
  //# sourceMappingURL=DataAwareWidget.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataAwareWidget.d.mts","names":[],"sources":["../../src/data-sources/DataAwareWidget.tsx"],"mappings":";;;;;;UAKiB,oBAAA;EACf,MAAA,EAAQ,YAAA;EAER,SAAA,EAAW,aAAA;;EAEX,eAAA,GAAkB,MAAA;EALiB;EAOnC,gBAAA,GAAmB,SAAA;EANX;EAQR,cAAA,IAAkB,KAAA,EAAO,KAAA,KAAU,SAAA;EAJjB;EAMlB,OAAA;AAAA;;;;;iBAUO,mBAAA,CAAA;EACP,MAAA;EACA,SAAA;EACA,eAAA;EACA,gBAAA;EACA,cAAA;EACA;AAAA,GACC,oBAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;cAkDV,eAAA,EAAe,KAAA,CAAA,mBAAA,QAAA,mBAAA"}
1
+ {"version":3,"file":"DataAwareWidget.d.mts","names":[],"sources":["../../src/data-sources/DataAwareWidget.tsx"],"mappings":";;;;UAMiB,oBAAA;EACf,MAAA,EAAQ,YAAA;EAER,SAAA,EAAW,aAAA;;EAEX,eAAA,GAAkB,MAAA;;EAElB,gBAAA,GAAmB,SAAA;;EAEnB,cAAA,IAAkB,KAAA,EAAO,KAAA,KAAU,SAAA;;EAEnC,OAAA;AAAA;;;;;cAmEW,eAAA,EAAiB,KAAA,CAAM,oBAAA,CAAqB,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataAwareWidget.mjs","names":[],"sources":["../../src/data-sources/DataAwareWidget.tsx"],"sourcesContent":["import { memo, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { WidgetSchema } from \"../types/widget-schema\";\nimport { useWidgetData } from \"./use-widget-data\";\nimport { ErrorState } from \"./ErrorState\";\n\nexport interface DataAwareWidgetProps {\n widget: WidgetSchema;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Component: ComponentType<any>;\n /** Additional props to pass through (e.g., edit mode callbacks) */\n additionalProps?: Record<string, unknown>;\n /** Custom loading component */\n loadingComponent?: ReactNode;\n /** Custom error component */\n errorComponent?: (error: Error) => ReactNode;\n /** Base URL for API calls (e.g., \"https://api.fluid.app/api\") */\n baseUrl?: string | undefined;\n}\n\n// Empty object constant to avoid creating new references\nconst EMPTY_OBJECT: Record<string, unknown> = {};\n\n/**\n * Wrapper component that resolves data sources before rendering the widget.\n * Merges resolved data with static props.\n */\nfunction DataAwareWidgetImpl({\n widget,\n Component,\n additionalProps,\n loadingComponent,\n errorComponent,\n baseUrl,\n}: DataAwareWidgetProps) {\n // Use stable empty object if no additionalProps provided\n const stableAdditionalProps = additionalProps ?? EMPTY_OBJECT;\n const { data, isLoading, error } = useWidgetData(widget, { baseUrl });\n\n // Merge static props with resolved data\n // Data takes precedence (allows overriding defaults)\n // Memoized to prevent unnecessary child re-renders\n // Note: Must be called before any early returns to satisfy Rules of Hooks\n const mergedProps = useMemo(\n () => ({\n ...widget.props,\n ...data,\n ...stableAdditionalProps,\n }),\n [widget.props, data, stableAdditionalProps],\n );\n\n // Show loading state\n if (isLoading && widget.dataSource?.loading?.showSkeleton !== false) {\n if (loadingComponent) {\n return <>{loadingComponent}</>;\n }\n // Default skeleton - can be customized\n return (\n <div\n className=\"bg-muted animate-pulse rounded-md\"\n style={{ minHeight: 100 }}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n\n // Show error state (if no fallback was applied)\n if (error && !data) {\n if (errorComponent) {\n return <>{errorComponent(error)}</>;\n }\n // Default error display\n return <ErrorState />;\n }\n\n return <Component {...mergedProps} />;\n}\n\n/**\n * Memoized wrapper component that resolves data sources before rendering the widget.\n * Prevents re-renders when parent re-renders but props haven't changed.\n */\nexport const DataAwareWidget = memo(DataAwareWidgetImpl);\n"],"mappings":";;;;;AAoBA,MAAM,eAAwC,EAAE;;;;;AAMhD,SAAS,oBAAoB,EAC3B,QACA,WACA,iBACA,kBACA,gBACA,WACuB;CAEvB,MAAM,wBAAwB,mBAAmB;CACjD,MAAM,EAAE,MAAM,WAAW,UAAU,cAAc,QAAQ,EAAE,SAAS,CAAC;CAMrE,MAAM,cAAc,eACX;EACL,GAAG,OAAO;EACV,GAAG;EACH,GAAG;EACJ,GACD;EAAC,OAAO;EAAO;EAAM;EAAsB,CAC5C;AAGD,KAAI,aAAa,OAAO,YAAY,SAAS,iBAAiB,OAAO;AACnE,MAAI,iBACF,QAAO,oBAAA,UAAA,EAAA,UAAG,kBAAoB,CAAA;AAGhC,SACE,oBAAC,OAAD;GACE,WAAU;GACV,OAAO,EAAE,WAAW,KAAK;aAEzB,oBAAC,QAAD;IAAM,WAAU;cAAU;IAAiB,CAAA;GACvC,CAAA;;AAKV,KAAI,SAAS,CAAC,MAAM;AAClB,MAAI,eACF,QAAO,oBAAA,UAAA,EAAA,UAAG,eAAe,MAAM,EAAI,CAAA;AAGrC,SAAO,oBAAC,YAAD,EAAc,CAAA;;AAGvB,QAAO,oBAAC,WAAD,EAAW,GAAI,aAAe,CAAA;;;;;;AAOvC,MAAa,kBAAkB,KAAK,oBAAoB"}
1
+ {"version":3,"file":"DataAwareWidget.mjs","names":[],"sources":["../../src/data-sources/DataAwareWidget.tsx"],"sourcesContent":["import type React from \"react\";\nimport { memo, useMemo, type ComponentType, type ReactNode } from \"react\";\nimport type { WidgetSchema } from \"../types/widget-schema\";\nimport { useWidgetData } from \"./use-widget-data\";\nimport { ErrorState } from \"./ErrorState\";\n\nexport interface DataAwareWidgetProps {\n widget: WidgetSchema;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Component: ComponentType<any>;\n /** Additional props to pass through (e.g., edit mode callbacks) */\n additionalProps?: Record<string, unknown>;\n /** Custom loading component */\n loadingComponent?: ReactNode;\n /** Custom error component */\n errorComponent?: (error: Error) => ReactNode;\n /** Base URL for API calls (e.g., \"https://api.fluid.app/api\") */\n baseUrl?: string | undefined;\n}\n\n// Empty object constant to avoid creating new references\nconst EMPTY_OBJECT: Record<string, unknown> = {};\n\n/**\n * Wrapper component that resolves data sources before rendering the widget.\n * Merges resolved data with static props.\n */\nfunction DataAwareWidgetImpl({\n widget,\n Component,\n additionalProps,\n loadingComponent,\n errorComponent,\n baseUrl,\n}: DataAwareWidgetProps): React.JSX.Element | null {\n // Use stable empty object if no additionalProps provided\n const stableAdditionalProps = additionalProps ?? EMPTY_OBJECT;\n const { data, isLoading, error } = useWidgetData(widget, { baseUrl });\n\n // Merge static props with resolved data\n // Data takes precedence (allows overriding defaults)\n // Memoized to prevent unnecessary child re-renders\n // Note: Must be called before any early returns to satisfy Rules of Hooks\n const mergedProps = useMemo(\n () => ({\n ...widget.props,\n ...data,\n ...stableAdditionalProps,\n }),\n [widget.props, data, stableAdditionalProps],\n );\n\n // Show loading state\n if (isLoading && widget.dataSource?.loading?.showSkeleton !== false) {\n if (loadingComponent) {\n return <>{loadingComponent}</>;\n }\n // Default skeleton - can be customized\n return (\n <div\n className=\"bg-muted animate-pulse rounded-md\"\n style={{ minHeight: 100 }}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n\n // Show error state (if no fallback was applied)\n if (error && !data) {\n if (errorComponent) {\n return <>{errorComponent(error)}</>;\n }\n // Default error display\n return <ErrorState />;\n }\n\n return <Component {...mergedProps} />;\n}\n\n/**\n * Memoized wrapper component that resolves data sources before rendering the widget.\n * Prevents re-renders when parent re-renders but props haven't changed.\n */\nexport const DataAwareWidget: React.NamedExoticComponent<DataAwareWidgetProps> =\n memo(DataAwareWidgetImpl);\n"],"mappings":";;;;;AAqBA,MAAM,eAAwC,EAAE;;;;;AAMhD,SAAS,oBAAoB,EAC3B,QACA,WACA,iBACA,kBACA,gBACA,WACiD;CAEjD,MAAM,wBAAwB,mBAAmB;CACjD,MAAM,EAAE,MAAM,WAAW,UAAU,cAAc,QAAQ,EAAE,SAAS,CAAC;CAMrE,MAAM,cAAc,eACX;EACL,GAAG,OAAO;EACV,GAAG;EACH,GAAG;EACJ,GACD;EAAC,OAAO;EAAO;EAAM;EAAsB,CAC5C;AAGD,KAAI,aAAa,OAAO,YAAY,SAAS,iBAAiB,OAAO;AACnE,MAAI,iBACF,QAAO,oBAAA,UAAA,EAAA,UAAG,kBAAoB,CAAA;AAGhC,SACE,oBAAC,OAAD;GACE,WAAU;GACV,OAAO,EAAE,WAAW,KAAK;aAEzB,oBAAC,QAAD;IAAM,WAAU;cAAU;IAAiB,CAAA;GACvC,CAAA;;AAKV,KAAI,SAAS,CAAC,MAAM;AAClB,MAAI,eACF,QAAO,oBAAA,UAAA,EAAA,UAAG,eAAe,MAAM,EAAI,CAAA;AAGrC,SAAO,oBAAC,YAAD,EAAc,CAAA;;AAGvB,QAAO,oBAAC,WAAD,EAAW,GAAI,aAAe,CAAA;;;;;;AAOvC,MAAa,kBACX,KAAK,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorState.cjs","names":[],"sources":["../../src/data-sources/ErrorState.tsx"],"sourcesContent":["export function ErrorState() {\n return (\n <div className=\"flex min-h-[120px] flex-col items-center justify-center p-6 text-center\">\n <p className=\"text-lg font-semibold\">Something Went Wrong</p>\n <p className=\"text-muted-foreground text-sm\">\n Please contact a company admin for help\n </p>\n </div>\n );\n}\n"],"mappings":";;;;AAAA,SAAgB,aAAa;AAC3B,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,WAAU;YAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,KAAD;GAAG,WAAU;aAAwB;GAAwB,CAAA,EAC7D,iBAAA,GAAA,kBAAA,KAAC,KAAD;GAAG,WAAU;aAAgC;GAEzC,CAAA,CACA"}
1
+ {"version":3,"file":"ErrorState.cjs","names":[],"sources":["../../src/data-sources/ErrorState.tsx"],"sourcesContent":["import type React from \"react\";\n\nexport function ErrorState(): React.JSX.Element {\n return (\n <div className=\"flex min-h-[120px] flex-col items-center justify-center p-6 text-center\">\n <p className=\"text-lg font-semibold\">Something Went Wrong</p>\n <p className=\"text-muted-foreground text-sm\">\n Please contact a company admin for help\n </p>\n </div>\n );\n}\n"],"mappings":";;;;AAEA,SAAgB,aAAgC;AAC9C,QACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,WAAU;YAAf,CACE,iBAAA,GAAA,kBAAA,KAAC,KAAD;GAAG,WAAU;aAAwB;GAAwB,CAAA,EAC7D,iBAAA,GAAA,kBAAA,KAAC,KAAD;GAAG,WAAU;aAAgC;GAEzC,CAAA,CACA"}
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import React from "react";
2
2
 
3
3
  //#region src/data-sources/ErrorState.d.ts
4
- declare function ErrorState(): react_jsx_runtime0.JSX.Element;
4
+ declare function ErrorState(): React.JSX.Element;
5
5
  //#endregion
6
6
  export { ErrorState };
7
7
  //# sourceMappingURL=ErrorState.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorState.d.cts","names":[],"sources":["../../src/data-sources/ErrorState.tsx"],"mappings":";;;iBAAgB,UAAA,CAAA,GAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ErrorState.d.cts","names":[],"sources":["../../src/data-sources/ErrorState.tsx"],"mappings":";;;iBAEgB,UAAA,CAAA,GAAc,KAAA,CAAM,GAAA,CAAI,OAAA"}
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import React from "react";
2
2
 
3
3
  //#region src/data-sources/ErrorState.d.ts
4
- declare function ErrorState(): react_jsx_runtime0.JSX.Element;
4
+ declare function ErrorState(): React.JSX.Element;
5
5
  //#endregion
6
6
  export { ErrorState };
7
7
  //# sourceMappingURL=ErrorState.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorState.d.mts","names":[],"sources":["../../src/data-sources/ErrorState.tsx"],"mappings":";;;iBAAgB,UAAA,CAAA,GAAU,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"ErrorState.d.mts","names":[],"sources":["../../src/data-sources/ErrorState.tsx"],"mappings":";;;iBAEgB,UAAA,CAAA,GAAc,KAAA,CAAM,GAAA,CAAI,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorState.mjs","names":[],"sources":["../../src/data-sources/ErrorState.tsx"],"sourcesContent":["export function ErrorState() {\n return (\n <div className=\"flex min-h-[120px] flex-col items-center justify-center p-6 text-center\">\n <p className=\"text-lg font-semibold\">Something Went Wrong</p>\n <p className=\"text-muted-foreground text-sm\">\n Please contact a company admin for help\n </p>\n </div>\n );\n}\n"],"mappings":";;AAAA,SAAgB,aAAa;AAC3B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,KAAD;GAAG,WAAU;aAAwB;GAAwB,CAAA,EAC7D,oBAAC,KAAD;GAAG,WAAU;aAAgC;GAEzC,CAAA,CACA"}
1
+ {"version":3,"file":"ErrorState.mjs","names":[],"sources":["../../src/data-sources/ErrorState.tsx"],"sourcesContent":["import type React from \"react\";\n\nexport function ErrorState(): React.JSX.Element {\n return (\n <div className=\"flex min-h-[120px] flex-col items-center justify-center p-6 text-center\">\n <p className=\"text-lg font-semibold\">Something Went Wrong</p>\n <p className=\"text-muted-foreground text-sm\">\n Please contact a company admin for help\n </p>\n </div>\n );\n}\n"],"mappings":";;AAEA,SAAgB,aAAgC;AAC9C,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,KAAD;GAAG,WAAU;aAAwB;GAAwB,CAAA,EAC7D,oBAAC,KAAD;GAAG,WAAU;aAAgC;GAEzC,CAAA,CACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.cjs","names":[],"sources":["../../src/data-sources/context.tsx"],"sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from \"react\";\n\nexport interface DataSourceContextValue {\n baseUrl?: string | undefined;\n getApiHeaders?: (() => Record<string, string>) | undefined;\n}\n\nconst DataSourceContext = createContext<DataSourceContextValue>({});\n\nexport interface DataSourceProviderProps {\n baseUrl?: string | undefined;\n getApiHeaders?: (() => Record<string, string>) | undefined;\n children: ReactNode;\n}\n\nexport function DataSourceProvider({\n baseUrl,\n getApiHeaders,\n children,\n}: DataSourceProviderProps) {\n const value = useMemo(\n () => ({ baseUrl, getApiHeaders }),\n [baseUrl, getApiHeaders],\n );\n\n return (\n <DataSourceContext.Provider value={value}>\n {children}\n </DataSourceContext.Provider>\n );\n}\n\nexport function useDataSourceConfig(): DataSourceContextValue {\n return useContext(DataSourceContext);\n}\n"],"mappings":";;;;;AAOA,MAAM,qBAAA,GAAA,MAAA,eAA0D,EAAE,CAAC;AAQnE,SAAgB,mBAAmB,EACjC,SACA,eACA,YAC0B;CAC1B,MAAM,SAAA,GAAA,MAAA,gBACG;EAAE;EAAS;EAAe,GACjC,CAAC,SAAS,cAAc,CACzB;AAED,QACE,iBAAA,GAAA,kBAAA,KAAC,kBAAkB,UAAnB;EAAmC;EAChC;EAC0B,CAAA;;AAIjC,SAAgB,sBAA8C;AAC5D,SAAA,GAAA,MAAA,YAAkB,kBAAkB"}
1
+ {"version":3,"file":"context.cjs","names":[],"sources":["../../src/data-sources/context.tsx"],"sourcesContent":["import type React from \"react\";\nimport { createContext, useContext, useMemo, type ReactNode } from \"react\";\n\nexport interface DataSourceContextValue {\n baseUrl?: string | undefined;\n getApiHeaders?: (() => Record<string, string>) | undefined;\n}\n\nconst DataSourceContext = createContext<DataSourceContextValue>({});\n\nexport interface DataSourceProviderProps {\n baseUrl?: string | undefined;\n getApiHeaders?: (() => Record<string, string>) | undefined;\n children: ReactNode;\n}\n\nexport function DataSourceProvider({\n baseUrl,\n getApiHeaders,\n children,\n}: DataSourceProviderProps): React.JSX.Element {\n const value = useMemo(\n () => ({ baseUrl, getApiHeaders }),\n [baseUrl, getApiHeaders],\n );\n\n return (\n <DataSourceContext.Provider value={value}>\n {children}\n </DataSourceContext.Provider>\n );\n}\n\nexport function useDataSourceConfig(): DataSourceContextValue {\n return useContext(DataSourceContext);\n}\n"],"mappings":";;;;;AAQA,MAAM,qBAAA,GAAA,MAAA,eAA0D,EAAE,CAAC;AAQnE,SAAgB,mBAAmB,EACjC,SACA,eACA,YAC6C;CAC7C,MAAM,SAAA,GAAA,MAAA,gBACG;EAAE;EAAS;EAAe,GACjC,CAAC,SAAS,cAAc,CACzB;AAED,QACE,iBAAA,GAAA,kBAAA,KAAC,kBAAkB,UAAnB;EAAmC;EAChC;EAC0B,CAAA;;AAIjC,SAAgB,sBAA8C;AAC5D,SAAA,GAAA,MAAA,YAAkB,kBAAkB"}
@@ -1,5 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
- import { ReactNode } from "react";
1
+ import React, { ReactNode } from "react";
3
2
 
4
3
  //#region src/data-sources/context.d.ts
5
4
  interface DataSourceContextValue {
@@ -15,7 +14,7 @@ declare function DataSourceProvider({
15
14
  baseUrl,
16
15
  getApiHeaders,
17
16
  children
18
- }: DataSourceProviderProps): react_jsx_runtime0.JSX.Element;
17
+ }: DataSourceProviderProps): React.JSX.Element;
19
18
  declare function useDataSourceConfig(): DataSourceContextValue;
20
19
  //#endregion
21
20
  export { DataSourceContextValue, DataSourceProvider, DataSourceProviderProps, useDataSourceConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.cts","names":[],"sources":["../../src/data-sources/context.tsx"],"mappings":";;;;UAEiB,sBAAA;EACf,OAAA;EACA,aAAA,UAAuB,MAAA;AAAA;AAAA,UAKR,uBAAA;EACf,OAAA;EACA,aAAA,UAAuB,MAAA;EACvB,QAAA,EAAU,SAAA;AAAA;AAAA,iBAGI,kBAAA,CAAA;EACd,OAAA;EACA,aAAA;EACA;AAAA,GACC,uBAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAaV,mBAAA,CAAA,GAAuB,sBAAA"}
1
+ {"version":3,"file":"context.d.cts","names":[],"sources":["../../src/data-sources/context.tsx"],"mappings":";;;UAGiB,sBAAA;EACf,OAAA;EACA,aAAA,UAAuB,MAAA;AAAA;AAAA,UAKR,uBAAA;EACf,OAAA;EACA,aAAA,UAAuB,MAAA;EACvB,QAAA,EAAU,SAAA;AAAA;AAAA,iBAGI,kBAAA,CAAA;EACd,OAAA;EACA,aAAA;EACA;AAAA,GACC,uBAAA,GAA0B,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,iBAavB,mBAAA,CAAA,GAAuB,sBAAA"}
@@ -1,5 +1,4 @@
1
- import { ReactNode } from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import React, { ReactNode } from "react";
3
2
 
4
3
  //#region src/data-sources/context.d.ts
5
4
  interface DataSourceContextValue {
@@ -15,7 +14,7 @@ declare function DataSourceProvider({
15
14
  baseUrl,
16
15
  getApiHeaders,
17
16
  children
18
- }: DataSourceProviderProps): react_jsx_runtime0.JSX.Element;
17
+ }: DataSourceProviderProps): React.JSX.Element;
19
18
  declare function useDataSourceConfig(): DataSourceContextValue;
20
19
  //#endregion
21
20
  export { DataSourceContextValue, DataSourceProvider, DataSourceProviderProps, useDataSourceConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.mts","names":[],"sources":["../../src/data-sources/context.tsx"],"mappings":";;;;UAEiB,sBAAA;EACf,OAAA;EACA,aAAA,UAAuB,MAAA;AAAA;AAAA,UAKR,uBAAA;EACf,OAAA;EACA,aAAA,UAAuB,MAAA;EACvB,QAAA,EAAU,SAAA;AAAA;AAAA,iBAGI,kBAAA,CAAA;EACd,OAAA;EACA,aAAA;EACA;AAAA,GACC,uBAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAaV,mBAAA,CAAA,GAAuB,sBAAA"}
1
+ {"version":3,"file":"context.d.mts","names":[],"sources":["../../src/data-sources/context.tsx"],"mappings":";;;UAGiB,sBAAA;EACf,OAAA;EACA,aAAA,UAAuB,MAAA;AAAA;AAAA,UAKR,uBAAA;EACf,OAAA;EACA,aAAA,UAAuB,MAAA;EACvB,QAAA,EAAU,SAAA;AAAA;AAAA,iBAGI,kBAAA,CAAA;EACd,OAAA;EACA,aAAA;EACA;AAAA,GACC,uBAAA,GAA0B,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,iBAavB,mBAAA,CAAA,GAAuB,sBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.mjs","names":[],"sources":["../../src/data-sources/context.tsx"],"sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from \"react\";\n\nexport interface DataSourceContextValue {\n baseUrl?: string | undefined;\n getApiHeaders?: (() => Record<string, string>) | undefined;\n}\n\nconst DataSourceContext = createContext<DataSourceContextValue>({});\n\nexport interface DataSourceProviderProps {\n baseUrl?: string | undefined;\n getApiHeaders?: (() => Record<string, string>) | undefined;\n children: ReactNode;\n}\n\nexport function DataSourceProvider({\n baseUrl,\n getApiHeaders,\n children,\n}: DataSourceProviderProps) {\n const value = useMemo(\n () => ({ baseUrl, getApiHeaders }),\n [baseUrl, getApiHeaders],\n );\n\n return (\n <DataSourceContext.Provider value={value}>\n {children}\n </DataSourceContext.Provider>\n );\n}\n\nexport function useDataSourceConfig(): DataSourceContextValue {\n return useContext(DataSourceContext);\n}\n"],"mappings":";;;AAOA,MAAM,oBAAoB,cAAsC,EAAE,CAAC;AAQnE,SAAgB,mBAAmB,EACjC,SACA,eACA,YAC0B;CAC1B,MAAM,QAAQ,eACL;EAAE;EAAS;EAAe,GACjC,CAAC,SAAS,cAAc,CACzB;AAED,QACE,oBAAC,kBAAkB,UAAnB;EAAmC;EAChC;EAC0B,CAAA;;AAIjC,SAAgB,sBAA8C;AAC5D,QAAO,WAAW,kBAAkB"}
1
+ {"version":3,"file":"context.mjs","names":[],"sources":["../../src/data-sources/context.tsx"],"sourcesContent":["import type React from \"react\";\nimport { createContext, useContext, useMemo, type ReactNode } from \"react\";\n\nexport interface DataSourceContextValue {\n baseUrl?: string | undefined;\n getApiHeaders?: (() => Record<string, string>) | undefined;\n}\n\nconst DataSourceContext = createContext<DataSourceContextValue>({});\n\nexport interface DataSourceProviderProps {\n baseUrl?: string | undefined;\n getApiHeaders?: (() => Record<string, string>) | undefined;\n children: ReactNode;\n}\n\nexport function DataSourceProvider({\n baseUrl,\n getApiHeaders,\n children,\n}: DataSourceProviderProps): React.JSX.Element {\n const value = useMemo(\n () => ({ baseUrl, getApiHeaders }),\n [baseUrl, getApiHeaders],\n );\n\n return (\n <DataSourceContext.Provider value={value}>\n {children}\n </DataSourceContext.Provider>\n );\n}\n\nexport function useDataSourceConfig(): DataSourceContextValue {\n return useContext(DataSourceContext);\n}\n"],"mappings":";;;AAQA,MAAM,oBAAoB,cAAsC,EAAE,CAAC;AAQnE,SAAgB,mBAAmB,EACjC,SACA,eACA,YAC6C;CAC7C,MAAM,QAAQ,eACL;EAAE;EAAS;EAAe,GACjC,CAAC,SAAS,cAAc,CACzB;AAED,QACE,oBAAC,kBAAkB,UAAnB;EAAmC;EAChC;EAC0B,CAAA;;AAIjC,SAAgB,sBAA8C;AAC5D,QAAO,WAAW,kBAAkB"}
@@ -1,9 +1,9 @@
1
- import { o as DataSourceContext, t as ApiDataSource } from "../../types-BIXtQlHB.cjs";
1
+ import { o as DataSourceContext, t as ApiDataSource } from "../../types-DrzvahW8.cjs";
2
2
 
3
3
  //#region src/data-sources/fetchers/api.d.ts
4
4
  /**
5
- * Default API fetcher implementation
6
- */
5
+ * Default API fetcher implementation
6
+ */
7
7
  declare function apiFetcher(source: ApiDataSource, context: DataSourceContext): Promise<unknown>;
8
8
  //#endregion
9
9
  export { apiFetcher };
@@ -1,9 +1,9 @@
1
- import { o as DataSourceContext, t as ApiDataSource } from "../../types-C5OFJy-O.mjs";
1
+ import { o as DataSourceContext, t as ApiDataSource } from "../../types-C5Zs5V3E.mjs";
2
2
 
3
3
  //#region src/data-sources/fetchers/api.d.ts
4
4
  /**
5
- * Default API fetcher implementation
6
- */
5
+ * Default API fetcher implementation
6
+ */
7
7
  declare function apiFetcher(source: ApiDataSource, context: DataSourceContext): Promise<unknown>;
8
8
  //#endregion
9
9
  export { apiFetcher };
@@ -1,16 +1,16 @@
1
- import { n as CustomDataSource, o as DataSourceContext } from "../../types-BIXtQlHB.cjs";
1
+ import { n as CustomDataSource, o as DataSourceContext } from "../../types-DrzvahW8.cjs";
2
2
 
3
3
  //#region src/data-sources/fetchers/custom.d.ts
4
4
  /**
5
- * Custom fetcher that fetches selected items.
6
- *
7
- * Fetches items from individual resource endpoints using the configured
8
- * getApiHeaders for authentication.
9
- *
10
- * Fetches all items in parallel for performance.
11
- * Returns an array of successfully fetched items, preserving order.
12
- * Logs warnings for failed fetches but doesn't throw.
13
- */
5
+ * Custom fetcher that fetches selected items.
6
+ *
7
+ * Fetches items from individual resource endpoints using the configured
8
+ * getApiHeaders for authentication.
9
+ *
10
+ * Fetches all items in parallel for performance.
11
+ * Returns an array of successfully fetched items, preserving order.
12
+ * Logs warnings for failed fetches but doesn't throw.
13
+ */
14
14
  declare function customFetcher(source: CustomDataSource, context: DataSourceContext): Promise<unknown[]>;
15
15
  //#endregion
16
16
  export { customFetcher };
@@ -1,16 +1,16 @@
1
- import { n as CustomDataSource, o as DataSourceContext } from "../../types-C5OFJy-O.mjs";
1
+ import { n as CustomDataSource, o as DataSourceContext } from "../../types-C5Zs5V3E.mjs";
2
2
 
3
3
  //#region src/data-sources/fetchers/custom.d.ts
4
4
  /**
5
- * Custom fetcher that fetches selected items.
6
- *
7
- * Fetches items from individual resource endpoints using the configured
8
- * getApiHeaders for authentication.
9
- *
10
- * Fetches all items in parallel for performance.
11
- * Returns an array of successfully fetched items, preserving order.
12
- * Logs warnings for failed fetches but doesn't throw.
13
- */
5
+ * Custom fetcher that fetches selected items.
6
+ *
7
+ * Fetches items from individual resource endpoints using the configured
8
+ * getApiHeaders for authentication.
9
+ *
10
+ * Fetches all items in parallel for performance.
11
+ * Returns an array of successfully fetched items, preserving order.
12
+ * Logs warnings for failed fetches but doesn't throw.
13
+ */
14
14
  declare function customFetcher(source: CustomDataSource, context: DataSourceContext): Promise<unknown[]>;
15
15
  //#endregion
16
16
  export { customFetcher };
@@ -1,20 +1,20 @@
1
- import { f as StaticDataSource, m as StaticSourceType, o as DataSourceContext, p as StaticItem } from "../../types-BIXtQlHB.cjs";
1
+ import { f as StaticDataSource, m as StaticSourceType, o as DataSourceContext, p as StaticItem } from "../../types-DrzvahW8.cjs";
2
2
 
3
3
  //#region src/data-sources/fetchers/static.d.ts
4
4
  /**
5
- * Static data source fetcher.
6
- *
7
- * Fetches products filtered by collection or category ID.
8
- * Tags are not yet supported (requires backend API changes).
9
- *
10
- * @param source - The static data source configuration
11
- * @param context - The data source context with baseUrl and headers
12
- * @returns Array of products matching the filter criteria
13
- */
5
+ * Static data source fetcher.
6
+ *
7
+ * Fetches products filtered by collection or category ID.
8
+ * Tags are not yet supported (requires backend API changes).
9
+ *
10
+ * @param source - The static data source configuration
11
+ * @param context - The data source context with baseUrl and headers
12
+ * @returns Array of products matching the filter criteria
13
+ */
14
14
  declare function staticFetcher(source: StaticDataSource, context: DataSourceContext): Promise<unknown[]>;
15
15
  /**
16
- * Result type for useStaticSourceItems hook.
17
- */
16
+ * Result type for useStaticSourceItems hook.
17
+ */
18
18
  interface UseStaticSourceItemsResult {
19
19
  /** The fetched items */
20
20
  items: StaticItem[];
@@ -24,14 +24,14 @@ interface UseStaticSourceItemsResult {
24
24
  error: string | null;
25
25
  }
26
26
  /**
27
- * React hook for fetching static source items (collections, categories).
28
- * Handles loading state, error state, abort on cleanup, and search filtering.
29
- *
30
- * @param staticType - The type of static source to fetch, or null to reset
31
- * @param context - Context with baseUrl and getApiHeaders
32
- * @param params - Optional search parameters
33
- * @returns Object with items, isLoading, and error state
34
- */
27
+ * React hook for fetching static source items (collections, categories).
28
+ * Handles loading state, error state, abort on cleanup, and search filtering.
29
+ *
30
+ * @param staticType - The type of static source to fetch, or null to reset
31
+ * @param context - Context with baseUrl and getApiHeaders
32
+ * @param params - Optional search parameters
33
+ * @returns Object with items, isLoading, and error state
34
+ */
35
35
  declare function useStaticSourceItems(staticType: StaticSourceType | null, context: Pick<DataSourceContext, "baseUrl" | "getApiHeaders">, params?: {
36
36
  search?: string;
37
37
  }): UseStaticSourceItemsResult;
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.cts","names":[],"sources":["../../../src/data-sources/fetchers/static.ts"],"mappings":";;;;;AAwDA;;;;;;;;iBAAsB,aAAA,CACpB,MAAA,EAAQ,gBAAA,EACR,OAAA,EAAS,iBAAA,GACR,OAAA;;;;UA0Ec,0BAAA;EA1EP;EA4ER,KAAA,EAAO,UAAA;EAFQ;EAIf,SAAA;;EAEA,KAAA;AAAA;;;;;;AAYF;;;;iBAAgB,oBAAA,CACd,UAAA,EAAY,gBAAA,SACZ,OAAA,EAAS,IAAA,CAAK,iBAAA,gCACd,MAAA;EAAW,MAAA;AAAA,IACV,0BAAA"}
1
+ {"version":3,"file":"static.d.cts","names":[],"sources":["../../../src/data-sources/fetchers/static.ts"],"mappings":";;;;;AAwDA;;;;;;;;iBAAsB,aAAA,CACpB,MAAA,EAAQ,gBAAA,EACR,OAAA,EAAS,iBAAA,GACR,OAAA;;;;UA0Ec,0BAAA;;EAEf,KAAA,EAAO,UAAA;EAFT;EAIE,SAAA;;EAEA,KAAA;AAAA;;;;;;AAYF;;;;iBAAgB,oBAAA,CACd,UAAA,EAAY,gBAAA,SACZ,OAAA,EAAS,IAAA,CAAK,iBAAA,gCACd,MAAA;EAAW,MAAA;AAAA,IACV,0BAAA"}
@@ -1,20 +1,20 @@
1
- import { f as StaticDataSource, m as StaticSourceType, o as DataSourceContext, p as StaticItem } from "../../types-C5OFJy-O.mjs";
1
+ import { f as StaticDataSource, m as StaticSourceType, o as DataSourceContext, p as StaticItem } from "../../types-C5Zs5V3E.mjs";
2
2
 
3
3
  //#region src/data-sources/fetchers/static.d.ts
4
4
  /**
5
- * Static data source fetcher.
6
- *
7
- * Fetches products filtered by collection or category ID.
8
- * Tags are not yet supported (requires backend API changes).
9
- *
10
- * @param source - The static data source configuration
11
- * @param context - The data source context with baseUrl and headers
12
- * @returns Array of products matching the filter criteria
13
- */
5
+ * Static data source fetcher.
6
+ *
7
+ * Fetches products filtered by collection or category ID.
8
+ * Tags are not yet supported (requires backend API changes).
9
+ *
10
+ * @param source - The static data source configuration
11
+ * @param context - The data source context with baseUrl and headers
12
+ * @returns Array of products matching the filter criteria
13
+ */
14
14
  declare function staticFetcher(source: StaticDataSource, context: DataSourceContext): Promise<unknown[]>;
15
15
  /**
16
- * Result type for useStaticSourceItems hook.
17
- */
16
+ * Result type for useStaticSourceItems hook.
17
+ */
18
18
  interface UseStaticSourceItemsResult {
19
19
  /** The fetched items */
20
20
  items: StaticItem[];
@@ -24,14 +24,14 @@ interface UseStaticSourceItemsResult {
24
24
  error: string | null;
25
25
  }
26
26
  /**
27
- * React hook for fetching static source items (collections, categories).
28
- * Handles loading state, error state, abort on cleanup, and search filtering.
29
- *
30
- * @param staticType - The type of static source to fetch, or null to reset
31
- * @param context - Context with baseUrl and getApiHeaders
32
- * @param params - Optional search parameters
33
- * @returns Object with items, isLoading, and error state
34
- */
27
+ * React hook for fetching static source items (collections, categories).
28
+ * Handles loading state, error state, abort on cleanup, and search filtering.
29
+ *
30
+ * @param staticType - The type of static source to fetch, or null to reset
31
+ * @param context - Context with baseUrl and getApiHeaders
32
+ * @param params - Optional search parameters
33
+ * @returns Object with items, isLoading, and error state
34
+ */
35
35
  declare function useStaticSourceItems(staticType: StaticSourceType | null, context: Pick<DataSourceContext, "baseUrl" | "getApiHeaders">, params?: {
36
36
  search?: string;
37
37
  }): UseStaticSourceItemsResult;
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.mts","names":[],"sources":["../../../src/data-sources/fetchers/static.ts"],"mappings":";;;;;AAwDA;;;;;;;;iBAAsB,aAAA,CACpB,MAAA,EAAQ,gBAAA,EACR,OAAA,EAAS,iBAAA,GACR,OAAA;;;;UA0Ec,0BAAA;EA1EP;EA4ER,KAAA,EAAO,UAAA;EAFQ;EAIf,SAAA;;EAEA,KAAA;AAAA;;;;;;AAYF;;;;iBAAgB,oBAAA,CACd,UAAA,EAAY,gBAAA,SACZ,OAAA,EAAS,IAAA,CAAK,iBAAA,gCACd,MAAA;EAAW,MAAA;AAAA,IACV,0BAAA"}
1
+ {"version":3,"file":"static.d.mts","names":[],"sources":["../../../src/data-sources/fetchers/static.ts"],"mappings":";;;;;AAwDA;;;;;;;;iBAAsB,aAAA,CACpB,MAAA,EAAQ,gBAAA,EACR,OAAA,EAAS,iBAAA,GACR,OAAA;;;;UA0Ec,0BAAA;;EAEf,KAAA,EAAO,UAAA;EAFT;EAIE,SAAA;;EAEA,KAAA;AAAA;;;;;;AAYF;;;;iBAAgB,oBAAA,CACd,UAAA,EAAY,gBAAA,SACZ,OAAA,EAAS,IAAA,CAAK,iBAAA,gCACd,MAAA;EAAW,MAAA;AAAA,IACV,0BAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"preview-context.cjs","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\ntype WidgetPreviewContextValue = {\n isPreview: boolean;\n};\n\nconst WidgetPreviewContext = createContext<WidgetPreviewContextValue>({\n isPreview: false,\n});\n\nexport function WidgetPreviewProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n return (\n <WidgetPreviewContext value={{ isPreview: true }}>\n {children}\n </WidgetPreviewContext>\n );\n}\n\nexport function useWidgetPreviewContext() {\n return useContext(WidgetPreviewContext);\n}\n"],"mappings":";;;;;;AAQA,MAAM,wBAAA,GAAA,MAAA,eAAgE,EACpE,WAAW,OACZ,CAAC;AAEF,SAAgB,sBAAsB,EACpC,YAGC;AACD,QACE,iBAAA,GAAA,kBAAA,KAAC,sBAAD;EAAsB,OAAO,EAAE,WAAW,MAAM;EAC7C;EACoB,CAAA;;AAI3B,SAAgB,0BAA0B;AACxC,SAAA,GAAA,MAAA,YAAkB,qBAAqB"}
1
+ {"version":3,"file":"preview-context.cjs","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\ntype WidgetPreviewContextValue = {\n isPreview: boolean;\n};\n\nconst WidgetPreviewContext = createContext<WidgetPreviewContextValue>({\n isPreview: false,\n});\n\nexport function WidgetPreviewProvider({\n children,\n}: {\n children: React.ReactNode;\n}): React.JSX.Element {\n return (\n <WidgetPreviewContext value={{ isPreview: true }}>\n {children}\n </WidgetPreviewContext>\n );\n}\n\nexport function useWidgetPreviewContext(): WidgetPreviewContextValue {\n return useContext(WidgetPreviewContext);\n}\n"],"mappings":";;;;;;AAQA,MAAM,wBAAA,GAAA,MAAA,eAAgE,EACpE,WAAW,OACZ,CAAC;AAEF,SAAgB,sBAAsB,EACpC,YAGoB;AACpB,QACE,iBAAA,GAAA,kBAAA,KAAC,sBAAD;EAAsB,OAAO,EAAE,WAAW,MAAM;EAC7C;EACoB,CAAA;;AAI3B,SAAgB,0BAAqD;AACnE,SAAA,GAAA,MAAA,YAAkB,qBAAqB"}
@@ -1,5 +1,3 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
-
3
1
  //#region src/data-sources/preview-context.d.ts
4
2
  type WidgetPreviewContextValue = {
5
3
  isPreview: boolean;
@@ -8,7 +6,7 @@ declare function WidgetPreviewProvider({
8
6
  children
9
7
  }: {
10
8
  children: React.ReactNode;
11
- }): react_jsx_runtime0.JSX.Element;
9
+ }): React.JSX.Element;
12
10
  declare function useWidgetPreviewContext(): WidgetPreviewContextValue;
13
11
  //#endregion
14
12
  export { WidgetPreviewProvider, useWidgetPreviewContext };
@@ -1 +1 @@
1
- {"version":3,"file":"preview-context.d.cts","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"mappings":";;;KAIK,yBAAA;EACH,SAAA;AAAA;AAAA,iBAOc,qBAAA,CAAA;EACd;AAAA;EAEA,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,IACjB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAQe,uBAAA,CAAA,GAAuB,yBAAA"}
1
+ {"version":3,"file":"preview-context.d.cts","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"mappings":";KAIK,yBAAA;EACH,SAAA;AAAA;AAAA,iBAOc,qBAAA,CAAA;EACd;AAAA;EAEA,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,IACd,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,iBAQE,uBAAA,CAAA,GAA2B,yBAAA"}
@@ -1,5 +1,3 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
-
3
1
  //#region src/data-sources/preview-context.d.ts
4
2
  type WidgetPreviewContextValue = {
5
3
  isPreview: boolean;
@@ -8,7 +6,7 @@ declare function WidgetPreviewProvider({
8
6
  children
9
7
  }: {
10
8
  children: React.ReactNode;
11
- }): react_jsx_runtime0.JSX.Element;
9
+ }): React.JSX.Element;
12
10
  declare function useWidgetPreviewContext(): WidgetPreviewContextValue;
13
11
  //#endregion
14
12
  export { WidgetPreviewProvider, useWidgetPreviewContext };
@@ -1 +1 @@
1
- {"version":3,"file":"preview-context.d.mts","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"mappings":";;;KAIK,yBAAA;EACH,SAAA;AAAA;AAAA,iBAOc,qBAAA,CAAA;EACd;AAAA;EAEA,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,IACjB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAQe,uBAAA,CAAA,GAAuB,yBAAA"}
1
+ {"version":3,"file":"preview-context.d.mts","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"mappings":";KAIK,yBAAA;EACH,SAAA;AAAA;AAAA,iBAOc,qBAAA,CAAA;EACd;AAAA;EAEA,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA,IACd,KAAA,CAAM,GAAA,CAAI,OAAA;AAAA,iBAQE,uBAAA,CAAA,GAA2B,yBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"preview-context.mjs","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\ntype WidgetPreviewContextValue = {\n isPreview: boolean;\n};\n\nconst WidgetPreviewContext = createContext<WidgetPreviewContextValue>({\n isPreview: false,\n});\n\nexport function WidgetPreviewProvider({\n children,\n}: {\n children: React.ReactNode;\n}) {\n return (\n <WidgetPreviewContext value={{ isPreview: true }}>\n {children}\n </WidgetPreviewContext>\n );\n}\n\nexport function useWidgetPreviewContext() {\n return useContext(WidgetPreviewContext);\n}\n"],"mappings":";;;;AAQA,MAAM,uBAAuB,cAAyC,EACpE,WAAW,OACZ,CAAC;AAEF,SAAgB,sBAAsB,EACpC,YAGC;AACD,QACE,oBAAC,sBAAD;EAAsB,OAAO,EAAE,WAAW,MAAM;EAC7C;EACoB,CAAA;;AAI3B,SAAgB,0BAA0B;AACxC,QAAO,WAAW,qBAAqB"}
1
+ {"version":3,"file":"preview-context.mjs","names":[],"sources":["../../src/data-sources/preview-context.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\n\ntype WidgetPreviewContextValue = {\n isPreview: boolean;\n};\n\nconst WidgetPreviewContext = createContext<WidgetPreviewContextValue>({\n isPreview: false,\n});\n\nexport function WidgetPreviewProvider({\n children,\n}: {\n children: React.ReactNode;\n}): React.JSX.Element {\n return (\n <WidgetPreviewContext value={{ isPreview: true }}>\n {children}\n </WidgetPreviewContext>\n );\n}\n\nexport function useWidgetPreviewContext(): WidgetPreviewContextValue {\n return useContext(WidgetPreviewContext);\n}\n"],"mappings":";;;;AAQA,MAAM,uBAAuB,cAAyC,EACpE,WAAW,OACZ,CAAC;AAEF,SAAgB,sBAAsB,EACpC,YAGoB;AACpB,QACE,oBAAC,sBAAD;EAAsB,OAAO,EAAE,WAAW,MAAM;EAC7C;EACoB,CAAA;;AAI3B,SAAgB,0BAAqD;AACnE,QAAO,WAAW,qBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry-context.cjs","names":["DEFAULT_DATA_SOURCE_REGISTRY","DataSourceProvider"],"sources":["../../src/data-sources/registry-context.tsx"],"sourcesContent":["import { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport type { DataSourceRegistry } from \"./types\";\nimport { DEFAULT_DATA_SOURCE_REGISTRY } from \"./registry\";\nimport { DataSourceProvider } from \"./context\";\n\ninterface DataSourceRegistryContextValue {\n registry: DataSourceRegistry;\n baseUrl?: string | undefined;\n /** Get API headers function */\n getApiHeaders?: (() => Record<string, string>) | undefined;\n /** Dynamic variables for endpoint path substitution (e.g., { rep_id: \"123\" }) */\n variables?: Record<string, string> | undefined;\n}\n\nconst DataSourceRegistryContext = createContext<DataSourceRegistryContextValue>(\n {\n registry: DEFAULT_DATA_SOURCE_REGISTRY,\n },\n);\n\nexport interface DataSourceRegistryProviderProps {\n registry?: DataSourceRegistry | undefined;\n /** Base URL for API calls (e.g., \"https://api.fluid.app/api\") */\n baseUrl?: string | undefined;\n /**\n * Get API headers function\n */\n getApiHeaders?: (() => Record<string, string>) | undefined;\n /** Dynamic variables for endpoint path substitution (e.g., { rep_id: \"123\" }) */\n variables?: Record<string, string> | undefined;\n children: ReactNode;\n}\n\n/**\n * Provides data source registry and configuration to all descendants.\n * If no registry is provided, uses the default.\n * Also provides the shared DataSourceProvider from rep-core so that\n * rep-widgets hooks can access baseUrl and getApiHeaders.\n */\nexport function DataSourceRegistryProvider({\n registry,\n baseUrl,\n getApiHeaders,\n variables,\n children,\n}: DataSourceRegistryProviderProps) {\n const value = useMemo(\n () => ({\n registry: registry ?? DEFAULT_DATA_SOURCE_REGISTRY,\n baseUrl,\n getApiHeaders,\n variables,\n }),\n [registry, baseUrl, getApiHeaders, variables],\n );\n\n return (\n <DataSourceRegistryContext.Provider value={value}>\n <DataSourceProvider baseUrl={baseUrl} getApiHeaders={getApiHeaders}>\n {children}\n </DataSourceProvider>\n </DataSourceRegistryContext.Provider>\n );\n}\n\n/**\n * Hook to access the data source registry.\n */\nexport function useDataSourceRegistry(): DataSourceRegistry {\n return useContext(DataSourceRegistryContext).registry;\n}\n\n/**\n * Hook to access the full data source registry context (registry + config).\n */\nexport function useDataSourceRegistryConfig(): DataSourceRegistryContextValue {\n return useContext(DataSourceRegistryContext);\n}\n"],"mappings":";;;;;;;AAcA,MAAM,6BAAA,GAAA,MAAA,eACJ,EACE,UAAUA,8BAAAA,8BACX,CACF;;;;;;;AAqBD,SAAgB,2BAA2B,EACzC,UACA,SACA,eACA,WACA,YACkC;CAClC,MAAM,SAAA,GAAA,MAAA,gBACG;EACL,UAAU,YAAYA,8BAAAA;EACtB;EACA;EACA;EACD,GACD;EAAC;EAAU;EAAS;EAAe;EAAU,CAC9C;AAED,QACE,iBAAA,GAAA,kBAAA,KAAC,0BAA0B,UAA3B;EAA2C;YACzC,iBAAA,GAAA,kBAAA,KAACC,6BAAAA,oBAAD;GAA6B;GAAwB;GAClD;GACkB,CAAA;EACc,CAAA;;;;;AAOzC,SAAgB,wBAA4C;AAC1D,SAAA,GAAA,MAAA,YAAkB,0BAA0B,CAAC;;;;;AAM/C,SAAgB,8BAA8D;AAC5E,SAAA,GAAA,MAAA,YAAkB,0BAA0B"}
1
+ {"version":3,"file":"registry-context.cjs","names":["DEFAULT_DATA_SOURCE_REGISTRY","DataSourceProvider"],"sources":["../../src/data-sources/registry-context.tsx"],"sourcesContent":["import type React from \"react\";\nimport { createContext, useContext, useMemo, type ReactNode } from \"react\";\nimport type { DataSourceRegistry } from \"./types\";\nimport { DEFAULT_DATA_SOURCE_REGISTRY } from \"./registry\";\nimport { DataSourceProvider } from \"./context\";\n\ninterface DataSourceRegistryContextValue {\n registry: DataSourceRegistry;\n baseUrl?: string | undefined;\n /** Get API headers function */\n getApiHeaders?: (() => Record<string, string>) | undefined;\n /** Dynamic variables for endpoint path substitution (e.g., { rep_id: \"123\" }) */\n variables?: Record<string, string> | undefined;\n}\n\nconst DataSourceRegistryContext = createContext<DataSourceRegistryContextValue>(\n {\n registry: DEFAULT_DATA_SOURCE_REGISTRY,\n },\n);\n\nexport interface DataSourceRegistryProviderProps {\n registry?: DataSourceRegistry | undefined;\n /** Base URL for API calls (e.g., \"https://api.fluid.app/api\") */\n baseUrl?: string | undefined;\n /**\n * Get API headers function\n */\n getApiHeaders?: (() => Record<string, string>) | undefined;\n /** Dynamic variables for endpoint path substitution (e.g., { rep_id: \"123\" }) */\n variables?: Record<string, string> | undefined;\n children: ReactNode;\n}\n\n/**\n * Provides data source registry and configuration to all descendants.\n * If no registry is provided, uses the default.\n * Also provides the shared DataSourceProvider from rep-core so that\n * rep-widgets hooks can access baseUrl and getApiHeaders.\n */\nexport function DataSourceRegistryProvider({\n registry,\n baseUrl,\n getApiHeaders,\n variables,\n children,\n}: DataSourceRegistryProviderProps): React.JSX.Element {\n const value = useMemo(\n () => ({\n registry: registry ?? DEFAULT_DATA_SOURCE_REGISTRY,\n baseUrl,\n getApiHeaders,\n variables,\n }),\n [registry, baseUrl, getApiHeaders, variables],\n );\n\n return (\n <DataSourceRegistryContext.Provider value={value}>\n <DataSourceProvider baseUrl={baseUrl} getApiHeaders={getApiHeaders}>\n {children}\n </DataSourceProvider>\n </DataSourceRegistryContext.Provider>\n );\n}\n\n/**\n * Hook to access the data source registry.\n */\nexport function useDataSourceRegistry(): DataSourceRegistry {\n return useContext(DataSourceRegistryContext).registry;\n}\n\n/**\n * Hook to access the full data source registry context (registry + config).\n */\nexport function useDataSourceRegistryConfig(): DataSourceRegistryContextValue {\n return useContext(DataSourceRegistryContext);\n}\n"],"mappings":";;;;;;;AAeA,MAAM,6BAAA,GAAA,MAAA,eACJ,EACE,UAAUA,8BAAAA,8BACX,CACF;;;;;;;AAqBD,SAAgB,2BAA2B,EACzC,UACA,SACA,eACA,WACA,YACqD;CACrD,MAAM,SAAA,GAAA,MAAA,gBACG;EACL,UAAU,YAAYA,8BAAAA;EACtB;EACA;EACA;EACD,GACD;EAAC;EAAU;EAAS;EAAe;EAAU,CAC9C;AAED,QACE,iBAAA,GAAA,kBAAA,KAAC,0BAA0B,UAA3B;EAA2C;YACzC,iBAAA,GAAA,kBAAA,KAACC,6BAAAA,oBAAD;GAA6B;GAAwB;GAClD;GACkB,CAAA;EACc,CAAA;;;;;AAOzC,SAAgB,wBAA4C;AAC1D,SAAA,GAAA,MAAA,YAAkB,0BAA0B,CAAC;;;;;AAM/C,SAAgB,8BAA8D;AAC5E,SAAA,GAAA,MAAA,YAAkB,0BAA0B"}
@@ -1,6 +1,5 @@
1
- import { s as DataSourceRegistry } from "../types-BIXtQlHB.cjs";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import { ReactNode } from "react";
1
+ import { s as DataSourceRegistry } from "../types-DrzvahW8.cjs";
2
+ import React, { ReactNode } from "react";
4
3
 
5
4
  //#region src/data-sources/registry-context.d.ts
6
5
  interface DataSourceRegistryContextValue {
@@ -16,33 +15,33 @@ interface DataSourceRegistryProviderProps {
16
15
  /** Base URL for API calls (e.g., "https://api.fluid.app/api") */
17
16
  baseUrl?: string | undefined;
18
17
  /**
19
- * Get API headers function
20
- */
18
+ * Get API headers function
19
+ */
21
20
  getApiHeaders?: (() => Record<string, string>) | undefined;
22
21
  /** Dynamic variables for endpoint path substitution (e.g., { rep_id: "123" }) */
23
22
  variables?: Record<string, string> | undefined;
24
23
  children: ReactNode;
25
24
  }
26
25
  /**
27
- * Provides data source registry and configuration to all descendants.
28
- * If no registry is provided, uses the default.
29
- * Also provides the shared DataSourceProvider from rep-core so that
30
- * rep-widgets hooks can access baseUrl and getApiHeaders.
31
- */
26
+ * Provides data source registry and configuration to all descendants.
27
+ * If no registry is provided, uses the default.
28
+ * Also provides the shared DataSourceProvider from rep-core so that
29
+ * rep-widgets hooks can access baseUrl and getApiHeaders.
30
+ */
32
31
  declare function DataSourceRegistryProvider({
33
32
  registry,
34
33
  baseUrl,
35
34
  getApiHeaders,
36
35
  variables,
37
36
  children
38
- }: DataSourceRegistryProviderProps): react_jsx_runtime0.JSX.Element;
37
+ }: DataSourceRegistryProviderProps): React.JSX.Element;
39
38
  /**
40
- * Hook to access the data source registry.
41
- */
39
+ * Hook to access the data source registry.
40
+ */
42
41
  declare function useDataSourceRegistry(): DataSourceRegistry;
43
42
  /**
44
- * Hook to access the full data source registry context (registry + config).
45
- */
43
+ * Hook to access the full data source registry context (registry + config).
44
+ */
46
45
  declare function useDataSourceRegistryConfig(): DataSourceRegistryContextValue;
47
46
  //#endregion
48
47
  export { DataSourceRegistryProvider, DataSourceRegistryProviderProps, useDataSourceRegistry, useDataSourceRegistryConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"registry-context.d.cts","names":[],"sources":["../../src/data-sources/registry-context.tsx"],"mappings":";;;;;UAKU,8BAAA;EACR,QAAA,EAAU,kBAAA;EACV,OAAA;EAFQ;EAIR,aAAA,UAAuB,MAAA;;EAEvB,SAAA,GAAY,MAAA;AAAA;AAAA,UASG,+BAAA;EACf,QAAA,GAAW,kBAAA;EAVO;EAYlB,OAAA;EAjBU;;;EAqBV,aAAA,UAAuB,MAAA;EAhBvB;EAkBA,SAAA,GAAY,MAAA;EACZ,QAAA,EAAU,SAAA;AAAA;AAVZ;;;;;;AAAA,iBAmBgB,0BAAA,CAAA;EACd,QAAA;EACA,OAAA;EACA,aAAA;EACA,SAAA;EACA;AAAA,GACC,+BAAA,GAA+B,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAuBlB,qBAAA,CAAA,GAAyB,kBAAA;;;;iBAOzB,2BAAA,CAAA,GAA+B,8BAAA"}
1
+ {"version":3,"file":"registry-context.d.cts","names":[],"sources":["../../src/data-sources/registry-context.tsx"],"mappings":";;;;UAMU,8BAAA;EACR,QAAA,EAAU,kBAAA;EACV,OAAA;;EAEA,aAAA,UAAuB,MAAA;;EAEvB,SAAA,GAAY,MAAA;AAAA;AAAA,UASG,+BAAA;EACf,QAAA,GAAW,kBAAA;;EAEX,OAAA;;;;EAIA,aAAA,UAAuB,MAAA;;EAEvB,SAAA,GAAY,MAAA;EACZ,QAAA,EAAU,SAAA;AAAA;;;;;;;iBASI,0BAAA,CAAA;EACd,QAAA;EACA,OAAA;EACA,aAAA;EACA,SAAA;EACA;AAAA,GACC,+BAAA,GAAkC,KAAA,CAAM,GAAA,CAAI,OAAA;;;;iBAuB/B,qBAAA,CAAA,GAAyB,kBAAA;;;;iBAOzB,2BAAA,CAAA,GAA+B,8BAAA"}