@alepha/react 0.13.3 → 0.13.5

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.
@@ -8,7 +8,7 @@ import React, { StrictMode, createContext, createElement, memo, use, useCallback
8
8
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
9
  import { createRoot, hydrateRoot } from "react-dom/client";
10
10
 
11
- //#region src/core/services/ReactPageService.ts
11
+ //#region ../../src/core/services/ReactPageService.ts
12
12
  var ReactPageService = class {
13
13
  fetch(pathname, options = {}) {
14
14
  throw new AlephaError("Fetch is not available for this environment.");
@@ -19,7 +19,7 @@ var ReactPageService = class {
19
19
  };
20
20
 
21
21
  //#endregion
22
- //#region src/core/primitives/$page.ts
22
+ //#region ../../src/core/primitives/$page.ts
23
23
  /**
24
24
  * Main primitive for defining a React route in the application.
25
25
  *
@@ -144,7 +144,7 @@ var PagePrimitive = class extends Primitive {
144
144
  $page[KIND] = PagePrimitive;
145
145
 
146
146
  //#endregion
147
- //#region src/core/components/NotFound.tsx
147
+ //#region ../../src/core/components/NotFound.tsx
148
148
  function NotFoundPage(props) {
149
149
  return /* @__PURE__ */ jsxs("div", {
150
150
  style: {
@@ -179,7 +179,7 @@ function NotFoundPage(props) {
179
179
  }
180
180
 
181
181
  //#endregion
182
- //#region src/core/components/ClientOnly.tsx
182
+ //#region ../../src/core/components/ClientOnly.tsx
183
183
  /**
184
184
  * A small utility component that renders its children only on the client side.
185
185
  *
@@ -199,7 +199,7 @@ const ClientOnly = (props) => {
199
199
  var ClientOnly_default = ClientOnly;
200
200
 
201
201
  //#endregion
202
- //#region src/core/components/ErrorViewer.tsx
202
+ //#region ../../src/core/components/ErrorViewer.tsx
203
203
  const ErrorViewer = ({ error, alepha }) => {
204
204
  const [expanded, setExpanded] = useState(false);
205
205
  if (alepha.isProduction()) return /* @__PURE__ */ jsx(ErrorViewerProduction, {});
@@ -347,11 +347,11 @@ const ErrorViewerProduction = () => {
347
347
  };
348
348
 
349
349
  //#endregion
350
- //#region src/core/contexts/RouterLayerContext.ts
350
+ //#region ../../src/core/contexts/RouterLayerContext.ts
351
351
  const RouterLayerContext = createContext(void 0);
352
352
 
353
353
  //#endregion
354
- //#region src/core/errors/Redirection.ts
354
+ //#region ../../src/core/errors/Redirection.ts
355
355
  /**
356
356
  * Used for Redirection during the page loading.
357
357
  *
@@ -366,11 +366,11 @@ var Redirection = class extends Error {
366
366
  };
367
367
 
368
368
  //#endregion
369
- //#region src/core/contexts/AlephaContext.ts
369
+ //#region ../../src/core/contexts/AlephaContext.ts
370
370
  const AlephaContext = createContext(void 0);
371
371
 
372
372
  //#endregion
373
- //#region src/core/hooks/useAlepha.ts
373
+ //#region ../../src/core/hooks/useAlepha.ts
374
374
  /**
375
375
  * Main Alepha hook.
376
376
  *
@@ -390,7 +390,7 @@ const useAlepha = () => {
390
390
  };
391
391
 
392
392
  //#endregion
393
- //#region src/core/hooks/useEvents.ts
393
+ //#region ../../src/core/hooks/useEvents.ts
394
394
  /**
395
395
  * Allow subscribing to multiple Alepha events. See {@link Hooks} for available events.
396
396
  *
@@ -427,7 +427,7 @@ const useEvents = (opts, deps) => {
427
427
  };
428
428
 
429
429
  //#endregion
430
- //#region src/core/hooks/useStore.ts
430
+ //#region ../../src/core/hooks/useStore.ts
431
431
  function useStore(target, defaultValue) {
432
432
  const alepha = useAlepha();
433
433
  useMemo(() => {
@@ -447,7 +447,7 @@ function useStore(target, defaultValue) {
447
447
  }
448
448
 
449
449
  //#endregion
450
- //#region src/core/hooks/useRouterState.ts
450
+ //#region ../../src/core/hooks/useRouterState.ts
451
451
  const useRouterState = () => {
452
452
  const [state] = useStore("alepha.react.router.state");
453
453
  if (!state) throw new AlephaError("Missing react router state");
@@ -455,7 +455,7 @@ const useRouterState = () => {
455
455
  };
456
456
 
457
457
  //#endregion
458
- //#region src/core/components/ErrorBoundary.tsx
458
+ //#region ../../src/core/components/ErrorBoundary.tsx
459
459
  /**
460
460
  * A reusable error boundary for catching rendering errors
461
461
  * in any part of the React component tree.
@@ -486,7 +486,7 @@ var ErrorBoundary = class extends React.Component {
486
486
  var ErrorBoundary_default = ErrorBoundary;
487
487
 
488
488
  //#endregion
489
- //#region src/core/components/NestedView.tsx
489
+ //#region ../../src/core/components/NestedView.tsx
490
490
  /**
491
491
  * A component that renders the current view of the nested router layer.
492
492
  *
@@ -609,7 +609,7 @@ function parseAnimation(animationLike, state, type = "enter") {
609
609
  }
610
610
 
611
611
  //#endregion
612
- //#region src/core/providers/ReactPageProvider.ts
612
+ //#region ../../src/core/providers/ReactPageProvider.ts
613
613
  const envSchema$1 = t.object({ REACT_STRICT_MODE: t.boolean({ default: true }) });
614
614
  var ReactPageProvider = class {
615
615
  log = $logger();
@@ -933,7 +933,7 @@ const isPageRoute = (it) => {
933
933
  };
934
934
 
935
935
  //#endregion
936
- //#region src/core/providers/ReactBrowserRouterProvider.ts
936
+ //#region ../../src/core/providers/ReactBrowserRouterProvider.ts
937
937
  var ReactBrowserRouterProvider = class extends RouterProvider {
938
938
  log = $logger();
939
939
  alepha = $inject(Alepha);
@@ -1015,7 +1015,7 @@ var ReactBrowserRouterProvider = class extends RouterProvider {
1015
1015
  };
1016
1016
 
1017
1017
  //#endregion
1018
- //#region src/core/providers/ReactBrowserProvider.ts
1018
+ //#region ../../src/core/providers/ReactBrowserProvider.ts
1019
1019
  const envSchema = t.object({ REACT_ROOT_ID: t.text({ default: "root" }) });
1020
1020
  /**
1021
1021
  * React browser renderer configuration atom
@@ -1180,7 +1180,7 @@ var ReactBrowserProvider = class {
1180
1180
  };
1181
1181
 
1182
1182
  //#endregion
1183
- //#region src/core/providers/ReactBrowserRendererProvider.ts
1183
+ //#region ../../src/core/providers/ReactBrowserRendererProvider.ts
1184
1184
  var ReactBrowserRendererProvider = class {
1185
1185
  log = $logger();
1186
1186
  root;
@@ -1200,7 +1200,7 @@ var ReactBrowserRendererProvider = class {
1200
1200
  };
1201
1201
 
1202
1202
  //#endregion
1203
- //#region src/core/services/ReactRouter.ts
1203
+ //#region ../../src/core/services/ReactRouter.ts
1204
1204
  var ReactRouter = class {
1205
1205
  alepha = $inject(Alepha);
1206
1206
  pageApi = $inject(ReactPageProvider);
@@ -1322,7 +1322,7 @@ var ReactRouter = class {
1322
1322
  };
1323
1323
 
1324
1324
  //#endregion
1325
- //#region src/core/hooks/useInject.ts
1325
+ //#region ../../src/core/hooks/useInject.ts
1326
1326
  /**
1327
1327
  * Hook to inject a service instance.
1328
1328
  * It's a wrapper of `useAlepha().inject(service)` with a memoization.
@@ -1333,7 +1333,7 @@ const useInject = (service) => {
1333
1333
  };
1334
1334
 
1335
1335
  //#endregion
1336
- //#region src/core/hooks/useAction.ts
1336
+ //#region ../../src/core/hooks/useAction.ts
1337
1337
  /**
1338
1338
  * Hook for handling async actions with automatic error handling and event emission.
1339
1339
  *
@@ -1560,7 +1560,7 @@ function useAction(options, deps) {
1560
1560
  }
1561
1561
 
1562
1562
  //#endregion
1563
- //#region src/core/hooks/useClient.ts
1563
+ //#region ../../src/core/hooks/useClient.ts
1564
1564
  /**
1565
1565
  * Hook to get a virtual client for the specified scope.
1566
1566
  *
@@ -1571,7 +1571,7 @@ const useClient = (scope) => {
1571
1571
  };
1572
1572
 
1573
1573
  //#endregion
1574
- //#region src/core/hooks/useSchema.ts
1574
+ //#region ../../src/core/hooks/useSchema.ts
1575
1575
  const useSchema = (action) => {
1576
1576
  const name = action.name;
1577
1577
  const alepha = useAlepha();
@@ -1605,7 +1605,7 @@ const ssrSchemaLoading = (alepha, name) => {
1605
1605
  };
1606
1606
 
1607
1607
  //#endregion
1608
- //#region src/core/hooks/useRouter.ts
1608
+ //#region ../../src/core/hooks/useRouter.ts
1609
1609
  /**
1610
1610
  * Use this hook to access the React Router instance.
1611
1611
  *
@@ -1625,7 +1625,7 @@ const useRouter = () => {
1625
1625
  };
1626
1626
 
1627
1627
  //#endregion
1628
- //#region src/core/components/Link.tsx
1628
+ //#region ../../src/core/components/Link.tsx
1629
1629
  const Link = (props) => {
1630
1630
  const router = useRouter();
1631
1631
  return /* @__PURE__ */ jsx("a", {
@@ -1637,7 +1637,7 @@ const Link = (props) => {
1637
1637
  var Link_default = Link;
1638
1638
 
1639
1639
  //#endregion
1640
- //#region src/core/hooks/useActive.ts
1640
+ //#region ../../src/core/hooks/useActive.ts
1641
1641
  const useActive = (args) => {
1642
1642
  const router = useRouter();
1643
1643
  const [isPending, setPending] = useState(false);
@@ -1670,7 +1670,7 @@ const useActive = (args) => {
1670
1670
  };
1671
1671
 
1672
1672
  //#endregion
1673
- //#region src/core/hooks/useQueryParams.ts
1673
+ //#region ../../src/core/hooks/useQueryParams.ts
1674
1674
  /**
1675
1675
  * Not well tested. Use with caution.
1676
1676
  */
@@ -1705,7 +1705,7 @@ const decode = (alepha, schema, data) => {
1705
1705
  };
1706
1706
 
1707
1707
  //#endregion
1708
- //#region src/core/index.browser.ts
1708
+ //#region ../../src/core/index.browser.ts
1709
1709
  const AlephaReact = $module({
1710
1710
  name: "alepha.react",
1711
1711
  primitives: [$page],