druxt-breadcrumb 0.11.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +2 -7
- package/dist/components/DruxtBreadcrumb.stories.mjs +15 -0
- package/dist/components/DruxtBreadcrumb.vue +10 -13
- package/dist/druxt-breadcrumb.esm.js +4 -13
- package/dist/druxt-breadcrumb.ssr.js +3 -12
- package/package.json +24 -12
- package/nuxt/plugin.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# druxt-breadcrumb
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [9161b38]
|
|
8
|
+
- druxt-router@0.24.0
|
|
9
|
+
- druxt-blocks@0.14.1
|
|
10
|
+
|
|
11
|
+
## 0.13.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- e7b1533: Refactored DruxtModule fetch hooks
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [77ab204]
|
|
20
|
+
- druxt-blocks@0.14.0
|
|
21
|
+
- druxt@0.13.0
|
|
22
|
+
- druxt-router@0.23.0
|
|
23
|
+
|
|
24
|
+
## 0.12.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [4504a2f]
|
|
29
|
+
- druxt@0.12.0
|
|
30
|
+
- druxt-router@0.22.0
|
|
31
|
+
- druxt-blocks@0.13.1
|
|
32
|
+
|
|
33
|
+
## 0.12.0
|
|
34
|
+
|
|
35
|
+
### Minor Changes
|
|
36
|
+
|
|
37
|
+
- 8d28c18: Updated storybook integration
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- 9a1d720: Fixed error when no crumbs are present
|
|
42
|
+
- dae345e: Removed unused `$druxtBreadcrumb` plugin
|
|
43
|
+
- Updated dependencies [9d905e8]
|
|
44
|
+
- druxt-router@0.21.0
|
|
45
|
+
- druxt-blocks@0.13.0
|
|
46
|
+
- druxt@0.11.0
|
|
47
|
+
|
|
3
48
|
## 0.11.0
|
|
4
49
|
|
|
5
50
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -7,19 +7,16 @@
|
|
|
7
7
|
|
|
8
8
|
> Decoupled Router based Breadcrumb Druxt component.
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
## Links
|
|
12
11
|
|
|
13
12
|
- DruxtJS: https://druxtjs.org
|
|
14
|
-
- Documentation: https://
|
|
13
|
+
- Documentation: https://druxtjs.org/modules/breadcrumb
|
|
15
14
|
- Community Discord server: https://discord.druxtjs.org
|
|
16
15
|
|
|
17
|
-
|
|
18
16
|
## Install
|
|
19
17
|
|
|
20
18
|
`$ npm install druxt-breadcrumb`
|
|
21
19
|
|
|
22
|
-
|
|
23
20
|
### Nuxt.js
|
|
24
21
|
|
|
25
22
|
Add module to `nuxt.config.js`
|
|
@@ -33,7 +30,6 @@ module.exports = {
|
|
|
33
30
|
}
|
|
34
31
|
```
|
|
35
32
|
|
|
36
|
-
|
|
37
33
|
## Usage
|
|
38
34
|
|
|
39
35
|
### DruxtBreadcrumb component
|
|
@@ -63,8 +59,7 @@ The DruxtBreadcrumb also provide a DruxtWrapper component for theming:
|
|
|
63
59
|
</template>
|
|
64
60
|
```
|
|
65
61
|
|
|
66
|
-
See the [DruxtBreadcrumb API documentation](https://
|
|
67
|
-
|
|
62
|
+
See the [DruxtBreadcrumb API documentation](https://druxtjs.org/api/packages/breadcrumb/components/DruxtBreadcrumb) for more information.
|
|
68
63
|
|
|
69
64
|
## Options
|
|
70
65
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import DruxtBreadcrumb from './DruxtBreadcrumb.vue'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Druxt/Breadcrumb/DruxtBreadcrumb',
|
|
5
|
+
component: DruxtBreadcrumb
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const Template = (args, { argTypes }) => ({
|
|
9
|
+
components: { DruxtBreadcrumb },
|
|
10
|
+
props: Object.keys(argTypes),
|
|
11
|
+
template: `<DruxtBreadcrumb v-bind="$props" />`
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export const Default = Template.bind({})
|
|
15
|
+
Default.storyName = 'DruxtBreadcrumb'
|
|
@@ -30,18 +30,6 @@ export default {
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* The Nuxt Fetch hook.
|
|
35
|
-
*
|
|
36
|
-
* Fetches the breadcrumbs.
|
|
37
|
-
*/
|
|
38
|
-
async fetch() {
|
|
39
|
-
if (!this.value) {
|
|
40
|
-
await this.fetchCrumbs()
|
|
41
|
-
}
|
|
42
|
-
await DruxtModule.fetch.call(this)
|
|
43
|
-
},
|
|
44
|
-
|
|
45
33
|
/** */
|
|
46
34
|
computed: {
|
|
47
35
|
/**
|
|
@@ -137,6 +125,15 @@ export default {
|
|
|
137
125
|
*/
|
|
138
126
|
componentOptions: () => [['default']],
|
|
139
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Fetches the breadcrumbs.
|
|
130
|
+
*/
|
|
131
|
+
async fetchConfig() {
|
|
132
|
+
if (!this.value) {
|
|
133
|
+
await this.fetchCrumbs()
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
|
|
140
137
|
/**
|
|
141
138
|
* Provides propsData for the DruxtWrapper.
|
|
142
139
|
*
|
|
@@ -157,7 +154,7 @@ export default {
|
|
|
157
154
|
const scopedSlots = {}
|
|
158
155
|
|
|
159
156
|
// Build default slot.
|
|
160
|
-
scopedSlots.default = () => this.$createElement('ul', this.crumbs.map((crumb) =>
|
|
157
|
+
scopedSlots.default = () => this.$createElement('ul', (this.crumbs || []).map((crumb) =>
|
|
161
158
|
this.$createElement('li', [
|
|
162
159
|
crumb.to
|
|
163
160
|
? this.$createElement('NuxtLink', { props: { to: crumb.to }}, [crumb.text])
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { join
|
|
1
|
+
import { join } from 'path';
|
|
2
2
|
|
|
3
3
|
const DruxtBreadcrumbModule = function() {
|
|
4
|
-
if (typeof this.options === "undefined" || !this.options.druxt) {
|
|
5
|
-
throw new TypeError("Druxt settings missing.");
|
|
6
|
-
}
|
|
7
|
-
const options = this.options.druxt;
|
|
8
|
-
options.breadcrumb = {
|
|
9
|
-
home: true,
|
|
10
|
-
...options.breadcrumb
|
|
11
|
-
};
|
|
12
4
|
this.nuxt.hook("components:dirs", (dirs) => {
|
|
13
5
|
dirs.push({ path: join(__dirname, "components") });
|
|
14
6
|
dirs.push({ path: join(__dirname, "components/blocks") });
|
|
15
7
|
});
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
fileName: "druxt-breadcrumb.js",
|
|
19
|
-
options
|
|
8
|
+
this.nuxt.hook("storybook:config", ({ stories }) => {
|
|
9
|
+
stories.push("druxt-breadcrumb/dist/components/*.stories.mjs");
|
|
20
10
|
});
|
|
21
11
|
};
|
|
12
|
+
DruxtBreadcrumbModule.meta = require("../package.json");
|
|
22
13
|
|
|
23
14
|
const DruxtBreadcrumbMixin = {
|
|
24
15
|
props: {
|
|
@@ -5,24 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
|
|
7
7
|
const DruxtBreadcrumbModule = function() {
|
|
8
|
-
if (typeof this.options === "undefined" || !this.options.druxt) {
|
|
9
|
-
throw new TypeError("Druxt settings missing.");
|
|
10
|
-
}
|
|
11
|
-
const options = this.options.druxt;
|
|
12
|
-
options.breadcrumb = {
|
|
13
|
-
home: true,
|
|
14
|
-
...options.breadcrumb
|
|
15
|
-
};
|
|
16
8
|
this.nuxt.hook("components:dirs", (dirs) => {
|
|
17
9
|
dirs.push({ path: path.join(__dirname, "components") });
|
|
18
10
|
dirs.push({ path: path.join(__dirname, "components/blocks") });
|
|
19
11
|
});
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
fileName: "druxt-breadcrumb.js",
|
|
23
|
-
options
|
|
12
|
+
this.nuxt.hook("storybook:config", ({ stories }) => {
|
|
13
|
+
stories.push("druxt-breadcrumb/dist/components/*.stories.mjs");
|
|
24
14
|
});
|
|
25
15
|
};
|
|
16
|
+
DruxtBreadcrumbModule.meta = require("../package.json");
|
|
26
17
|
|
|
27
18
|
const DruxtBreadcrumbMixin = {
|
|
28
19
|
props: {
|
package/package.json
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "druxt-breadcrumb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "Decoupled Router based Breadcrumb Druxt component.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"breadcrumb",
|
|
7
7
|
"breadcrumbs",
|
|
8
|
+
"cms",
|
|
9
|
+
"decoupled",
|
|
8
10
|
"drupal",
|
|
9
11
|
"druxt",
|
|
10
|
-
"
|
|
12
|
+
"druxtjs",
|
|
13
|
+
"headless",
|
|
14
|
+
"jsonapi",
|
|
15
|
+
"json:api",
|
|
16
|
+
"nuxt",
|
|
17
|
+
"nuxtjs",
|
|
18
|
+
"module",
|
|
19
|
+
"storybook",
|
|
20
|
+
"vue"
|
|
11
21
|
],
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
"homepage": "https://druxtjs.org",
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/druxt/druxt.js/issues"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/druxt/druxt.js"
|
|
17
29
|
},
|
|
30
|
+
"license": "MIT",
|
|
18
31
|
"exports": {
|
|
19
32
|
".": {
|
|
20
33
|
"require": "./dist/druxt-breadcrumb.ssr.js",
|
|
@@ -25,13 +38,12 @@
|
|
|
25
38
|
"main": "dist/druxt-breadcrumb.ssr.js",
|
|
26
39
|
"module": "dist/druxt-breadcrumb.esm.js",
|
|
27
40
|
"files": [
|
|
28
|
-
"dist"
|
|
29
|
-
"nuxt"
|
|
41
|
+
"dist"
|
|
30
42
|
],
|
|
31
43
|
"dependencies": {
|
|
32
|
-
"druxt": "^0.
|
|
33
|
-
"druxt-blocks": "^0.
|
|
34
|
-
"druxt-router": "^0.
|
|
44
|
+
"druxt": "^0.13.0",
|
|
45
|
+
"druxt-blocks": "^0.14.1",
|
|
46
|
+
"druxt-router": "^0.24.0"
|
|
35
47
|
},
|
|
36
48
|
"optionalDependencies": {
|
|
37
49
|
"vue": "^2.6.14",
|