piral-breadcrumbs 0.15.0-alpha.4041 → 0.15.0-alpha.4098

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.
package/esm/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ComponentType, ReactChild } from 'react';
1
+ import type { ComponentType, ReactChild, ReactNode } from 'react';
2
2
  import type { Dict, BaseRegistration, RegistrationDisposer } from 'piral-core';
3
3
  declare module 'piral-core/lib/types/custom' {
4
4
  interface PiletCustomApi extends PiletBreadcrumbsApi {
@@ -36,12 +36,20 @@ declare module 'piral-core/lib/types/custom' {
36
36
  }
37
37
  }
38
38
  export interface BreadcrumbsContainerProps {
39
+ /**
40
+ * The breadcrumbs to display.
41
+ */
42
+ children?: ReactNode;
39
43
  }
40
44
  export interface BreadcrumbItemProps extends Omit<BreadcrumbSettings, 'title'> {
41
45
  /**
42
46
  * Determins if the breadcrumb is the current page.
43
47
  */
44
48
  current: boolean;
49
+ /**
50
+ * The title of the breadcrumb to display.
51
+ */
52
+ children?: ReactNode;
45
53
  }
46
54
  export interface PiralCustomBreadcrumbSettings {
47
55
  }
@@ -14,7 +14,7 @@ const Breadcrumbs = () => {
14
14
  const current = breadcrumbs[currentIndex];
15
15
  const { params } = (0, react_router_1.useRouteMatch)((_a = current === null || current === void 0 ? void 0 : current.settings.path) !== null && _a !== void 0 ? _a : '/');
16
16
  const children = breadcrumbs.map(({ settings }, i) => {
17
- const { title, path } = settings, props = (0, tslib_1.__rest)(settings, ["title", "path"]);
17
+ const { title, path } = settings, props = tslib_1.__rest(settings, ["title", "path"]);
18
18
  const key = `bc_${i}_${settings.path}`;
19
19
  const current = i === currentIndex;
20
20
  const computedPath = path.replace(/:([A-Za-z0-9_]+)/g, (s, id) => { var _a; return (_a = params[id]) !== null && _a !== void 0 ? _a : s; });
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../src/Breadcrumbs.tsx"],"names":[],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,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,IAAM,KAAK,GAC3E,KAAK,CACc,CACvB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,oBAAC,sCAAyB,IAAC,QAAQ,EAAE,QAAQ,GAAI,CAAC;AAC3D,CAAC,CAAC;AArBW,QAAA,WAAW,eAqBtB;AACF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC"}
package/lib/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- (0, tslib_1.__exportStar)(require("./Breadcrumbs"), exports);
5
- (0, tslib_1.__exportStar)(require("./create"), exports);
6
- (0, tslib_1.__exportStar)(require("./components"), exports);
7
- (0, tslib_1.__exportStar)(require("./types"), exports);
8
- (0, tslib_1.__exportStar)(require("./useBreadcrumbs"), exports);
4
+ tslib_1.__exportStar(require("./Breadcrumbs"), exports);
5
+ tslib_1.__exportStar(require("./create"), exports);
6
+ tslib_1.__exportStar(require("./components"), exports);
7
+ tslib_1.__exportStar(require("./types"), exports);
8
+ tslib_1.__exportStar(require("./useBreadcrumbs"), exports);
9
9
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAA8B;AAC9B,wDAAyB;AACzB,4DAA6B;AAC7B,uDAAwB;AACxB,gEAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,wDAA8B;AAC9B,mDAAyB;AACzB,uDAA6B;AAC7B,kDAAwB;AACxB,2DAAiC"}
package/lib/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ComponentType, ReactChild } from 'react';
1
+ import type { ComponentType, ReactChild, ReactNode } from 'react';
2
2
  import type { Dict, BaseRegistration, RegistrationDisposer } from 'piral-core';
3
3
  declare module 'piral-core/lib/types/custom' {
4
4
  interface PiletCustomApi extends PiletBreadcrumbsApi {
@@ -36,12 +36,20 @@ declare module 'piral-core/lib/types/custom' {
36
36
  }
37
37
  }
38
38
  export interface BreadcrumbsContainerProps {
39
+ /**
40
+ * The breadcrumbs to display.
41
+ */
42
+ children?: ReactNode;
39
43
  }
40
44
  export interface BreadcrumbItemProps extends Omit<BreadcrumbSettings, 'title'> {
41
45
  /**
42
46
  * Determins if the breadcrumb is the current page.
43
47
  */
44
48
  current: boolean;
49
+ /**
50
+ * The title of the breadcrumb to display.
51
+ */
52
+ children?: ReactNode;
45
53
  }
46
54
  export interface PiralCustomBreadcrumbSettings {
47
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "piral-breadcrumbs",
3
- "version": "0.15.0-alpha.4041",
3
+ "version": "0.15.0-alpha.4098",
4
4
  "description": "Plugin for creating a breadcrumb manager in Piral.",
5
5
  "keywords": [
6
6
  "piral",
@@ -43,20 +43,20 @@
43
43
  "typedoc": "typedoc --json ../../../docs/types/piral-breadcrumbs.json src --exclude \"src/**/*.test.*\"",
44
44
  "test": "echo \"Error: run tests from root\" && exit 1"
45
45
  },
46
+ "dependencies": {
47
+ "path-to-regexp": "^1.8.0"
48
+ },
46
49
  "devDependencies": {
47
- "@types/react": "^17.0.0",
50
+ "@types/react": "^18.0.0",
48
51
  "@types/react-router": "^5.1.8",
49
- "piral-core": "0.15.0-alpha.4041",
50
- "react": "^17.0.1",
52
+ "piral-core": "0.15.0-alpha.4098",
53
+ "react": "^18.0.0",
51
54
  "react-router": "^5.2.0"
52
55
  },
53
- "dependencies": {
54
- "path-to-regexp": "^1.8.0"
55
- },
56
56
  "peerDependencies": {
57
- "piral-core": "0.14.x",
57
+ "piral-core": "0.14.x || 0.15.x",
58
58
  "react": ">=16.8.0",
59
59
  "react-router": "5.x"
60
60
  },
61
- "gitHead": "3d305d88c72e3e05a44acbf240a38f6ad7b03959"
61
+ "gitHead": "02ef35574b29cc5dd93c515bfdf27dd523893b28"
62
62
  }
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ComponentType, ReactChild } from 'react';
1
+ import type { ComponentType, ReactChild, ReactNode } from 'react';
2
2
  import type { Dict, BaseRegistration, RegistrationDisposer } from 'piral-core';
3
3
 
4
4
  declare module 'piral-core/lib/types/custom' {
@@ -39,13 +39,22 @@ declare module 'piral-core/lib/types/custom' {
39
39
  }
40
40
  }
41
41
 
42
- export interface BreadcrumbsContainerProps {}
42
+ export interface BreadcrumbsContainerProps {
43
+ /**
44
+ * The breadcrumbs to display.
45
+ */
46
+ children?: ReactNode;
47
+ }
43
48
 
44
49
  export interface BreadcrumbItemProps extends Omit<BreadcrumbSettings, 'title'> {
45
50
  /**
46
51
  * Determins if the breadcrumb is the current page.
47
52
  */
48
53
  current: boolean;
54
+ /**
55
+ * The title of the breadcrumb to display.
56
+ */
57
+ children?: ReactNode;
49
58
  }
50
59
 
51
60
  export interface PiralCustomBreadcrumbSettings {}