Comparing version 0.3.0 to 0.3.1
@@ -481,2 +481,4 @@ import { resolve } from 'path'; | ||
var DruxtComponentMixin = { | ||
components: { DruxtWrapper: __vue_component__$1 }, | ||
/** | ||
@@ -525,3 +527,3 @@ * @property {Component} component - The wrapper component and propsData to be rendered. | ||
var options = druxt.getComponents(this, moduleData.componentOptions, true); | ||
this.component.options = options.map(function (item) { return item.pascal; }); | ||
this.component.options = [].concat( new Set(options.map(function (item) { return item.pascal; })) ); | ||
var available = options.filter(function (item) { return item.global; }); | ||
@@ -528,0 +530,0 @@ if (!available.length) { |
@@ -1,1 +0,1 @@ | ||
var Druxt=function(t,n){"use strict";function e(t,n,e,o,r,a,i,p,s,c){"boolean"!=typeof i&&(s=p,p=i,i=!1);var u,f="function"==typeof e?e.options:e;if(t&&t.render&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0,r&&(f.functional=!0)),o&&(f._scopeId=o),a?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,s(t)),t&&t._registeredComponents&&t._registeredComponents.add(a)},f._ssrRegister=u):n&&(u=i?function(t){n.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){n.call(this,p(t))}),u)if(f.functional){var d=f.render;f.render=function(t,n){return u.call(n),d(t,n)}}else{var l=f.beforeCreate;f.beforeCreate=l?[].concat(l,u):[u]}return e}var o=e({render:function(){var t=this,n=t.$createElement,e=t._self._c||n;return t.wrapper&&t.wrapper.component?e((t.wrapper||{}).component,t._b({tag:"component"},"component",(t.wrapper||{}).propsData,!1),[e(t.component.is,t._b({tag:"component"},"component",Object.assign({},t.component.propsData,t.$attrs),!1))],1):e(t.component.is,t._b({tag:"component"},"component",Object.assign({},t.component.propsData,t.$attrs),!1))},staticRenderFns:[]},undefined,{name:"Druxt",props:{module:{type:String,required:!0},propsData:{type:Object,default:function(){return{}}},wrapper:{type:[Object,Boolean],default:function(){return{component:"div",propsData:{}}}}},data:function(){return{component:{is:void 0,propsData:{}}}},created:function(){this.setModuleComponent()},methods:{setModuleComponent:function(){var t="Druxt"+this.module.split("-").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join("");this.$options.components[t]&&(this.component.is=t,this.component.propsData=this.propsData)}}},undefined,false,undefined,!1,void 0,void 0,void 0),r=e({render:function(){var t=this,n=t.$createElement;return(t._self._c||n)("div",[t._t("default")],2)},staticRenderFns:[]},undefined,{name:"DruxtWrapper"},undefined,false,undefined,!1,void 0,void 0,void 0),a=function(){};a.prototype.getComponents=function(t,n,e,o){void 0===e&&(e=!1);var r=[];return n.filter((function(t){return Array.isArray(t)})).map((function(n){var e=[];n.map((function(n){var r=e.length?e[e.length-1]:{},a=r.parts?r.parts.slice(0):[];a.push(n);var i=a.slice(0);"string"==typeof o||!1===o&&void 0!==o||!((t||{}).$options||{}).name||(o=t.$options.name.match(/[A-Z][a-z]+/g).map((function(t){return t.toLowerCase()})).join("-")),o&&i.unshift(o);var p=i.map((function(t){return t.toLowerCase().replace(/--|_/g,"-")})).join("-"),s=p.replace(/((\b|[^a-zA-Z0-9]+)[a-zA-Z0-9])/gi,(function(t,n,e){return t.toUpperCase().replace(e,"")})),c=!1;for(var u of[p,s])if(void 0!==(((t||{}).$options||{}).components||{})[u]){c=!0;break}e.unshift({global:c,kebab:p,parts:a,pascal:s,prefix:o})})),e.map((function(t){return r.push(t)}))})),r.filter((function(t){return t.global||!!e}))},a.prototype.getModuleData=async function(t){if("function"!=typeof((t||{}).$options||{}).druxt)return!1;var n=await t.$options.druxt({vm:t});return(t.$options||{}).name&&(n.name=t.$options.name.match(/[A-Z][a-z]+/g).map((function(t){return t.toLowerCase()})).join("-")),n};var i={data:function(){return{component:{is:"DruxtWrapper",options:[],propsData:{}}}},fetch:async function(){var t=new a,n=await t.getModuleData(this);if(n.componentOptions){var e=t.getComponents(this,n.componentOptions,!0);this.component.options=e.map((function(t){return t.pascal}));var o=e.filter((function(t){return t.global}));o.length&&(this.component.is=o[0].pascal,this.component.propsData=n.propsData||{})}}};return t.Druxt=o,t.DruxtClass=a,t.DruxtComponentMixin=i,t.DruxtWrapper=r,t.default=function(t){void 0===t&&(t={});var e=Object.assign({},t,(this.options||{}).druxt);this.addPlugin({src:n.resolve(__dirname,"../nuxt/plugin.js"),fileName:"druxt.js",options:e})},t}({},path); | ||
var Druxt=function(t,n){"use strict";function e(t,n,e,o,r,a,i,p,s,c){"boolean"!=typeof i&&(s=p,p=i,i=!1);var u,f="function"==typeof e?e.options:e;if(t&&t.render&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0,r&&(f.functional=!0)),o&&(f._scopeId=o),a?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,s(t)),t&&t._registeredComponents&&t._registeredComponents.add(a)},f._ssrRegister=u):n&&(u=i?function(t){n.call(this,c(t,this.$root.$options.shadowRoot))}:function(t){n.call(this,p(t))}),u)if(f.functional){var d=f.render;f.render=function(t,n){return u.call(n),d(t,n)}}else{var m=f.beforeCreate;f.beforeCreate=m?[].concat(m,u):[u]}return e}var o=e({render:function(){var t=this,n=t.$createElement,e=t._self._c||n;return t.wrapper&&t.wrapper.component?e((t.wrapper||{}).component,t._b({tag:"component"},"component",(t.wrapper||{}).propsData,!1),[e(t.component.is,t._b({tag:"component"},"component",Object.assign({},t.component.propsData,t.$attrs),!1))],1):e(t.component.is,t._b({tag:"component"},"component",Object.assign({},t.component.propsData,t.$attrs),!1))},staticRenderFns:[]},undefined,{name:"Druxt",props:{module:{type:String,required:!0},propsData:{type:Object,default:function(){return{}}},wrapper:{type:[Object,Boolean],default:function(){return{component:"div",propsData:{}}}}},data:function(){return{component:{is:void 0,propsData:{}}}},created:function(){this.setModuleComponent()},methods:{setModuleComponent:function(){var t="Druxt"+this.module.split("-").map((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})).join("");this.$options.components[t]&&(this.component.is=t,this.component.propsData=this.propsData)}}},undefined,false,undefined,!1,void 0,void 0,void 0),r=e({render:function(){var t=this,n=t.$createElement;return(t._self._c||n)("div",[t._t("default")],2)},staticRenderFns:[]},undefined,{name:"DruxtWrapper"},undefined,false,undefined,!1,void 0,void 0,void 0),a=function(){};a.prototype.getComponents=function(t,n,e,o){void 0===e&&(e=!1);var r=[];return n.filter((function(t){return Array.isArray(t)})).map((function(n){var e=[];n.map((function(n){var r=e.length?e[e.length-1]:{},a=r.parts?r.parts.slice(0):[];a.push(n);var i=a.slice(0);"string"==typeof o||!1===o&&void 0!==o||!((t||{}).$options||{}).name||(o=t.$options.name.match(/[A-Z][a-z]+/g).map((function(t){return t.toLowerCase()})).join("-")),o&&i.unshift(o);var p=i.map((function(t){return t.toLowerCase().replace(/--|_/g,"-")})).join("-"),s=p.replace(/((\b|[^a-zA-Z0-9]+)[a-zA-Z0-9])/gi,(function(t,n,e){return t.toUpperCase().replace(e,"")})),c=!1;for(var u of[p,s])if(void 0!==(((t||{}).$options||{}).components||{})[u]){c=!0;break}e.unshift({global:c,kebab:p,parts:a,pascal:s,prefix:o})})),e.map((function(t){return r.push(t)}))})),r.filter((function(t){return t.global||!!e}))},a.prototype.getModuleData=async function(t){if("function"!=typeof((t||{}).$options||{}).druxt)return!1;var n=await t.$options.druxt({vm:t});return(t.$options||{}).name&&(n.name=t.$options.name.match(/[A-Z][a-z]+/g).map((function(t){return t.toLowerCase()})).join("-")),n};var i={components:{DruxtWrapper:r},data:function(){return{component:{is:"DruxtWrapper",options:[],propsData:{}}}},fetch:async function(){var t=new a,n=await t.getModuleData(this);if(n.componentOptions){var e=t.getComponents(this,n.componentOptions,!0);this.component.options=[].concat(new Set(e.map((function(t){return t.pascal}))));var o=e.filter((function(t){return t.global}));o.length&&(this.component.is=o[0].pascal,this.component.propsData=n.propsData||{})}}};return t.Druxt=o,t.DruxtClass=a,t.DruxtComponentMixin=i,t.DruxtWrapper=r,t.default=function(t){void 0===t&&(t={});var e=Object.assign({},t,(this.options||{}).druxt);this.addPlugin({src:n.resolve(__dirname,"../nuxt/plugin.js"),fileName:"druxt.js",options:e})},t}({},path); |
@@ -465,2 +465,4 @@ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var path=require('path');// | ||
var DruxtComponentMixin = { | ||
components: { DruxtWrapper: __vue_component__$1 }, | ||
/** | ||
@@ -509,3 +511,3 @@ * @property {Component} component - The wrapper component and propsData to be rendered. | ||
var options = druxt.getComponents(this, moduleData.componentOptions, true); | ||
this.component.options = options.map(function (item) { return item.pascal; }); | ||
this.component.options = [].concat( new Set(options.map(function (item) { return item.pascal; })) ); | ||
var available = options.filter(function (item) { return item.global; }); | ||
@@ -512,0 +514,0 @@ if (!available.length) { |
{ | ||
"name": "druxt", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A Bridge between frameworks, NuxtJS in the front, Drupal in the back.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -1,2 +0,2 @@ | ||
# DruxtJS; A bridge between framekworks. | ||
# DruxtJS; A bridge between frameworks. | ||
@@ -8,6 +8,11 @@ [![CircleCI](https://circleci.com/gh/druxt/druxt.js.svg?style=svg)](https://circleci.com/gh/druxt/druxt.js) | ||
> DruxtJS connects your Drupal backend to your NuxtJS frontend through the power of Drupal's JSON:API. | ||
> DruxtJS provides an easy connection between a Drupal JSON:API backend and NuxtJS frontend application. | ||
## Links | ||
- Documentation: https://druxtjs.org | ||
- Community Discord server: https://discord.druxtjs.org | ||
## Install | ||
@@ -17,2 +22,3 @@ | ||
## Usage | ||
@@ -33,16 +39,26 @@ | ||
## Decoupled Site | ||
For an out of the box, decoupled Drupal site, see the [DruxtJS Site module](http://site.druxtjs.org/). | ||
### The Druxt component | ||
## Options | ||
Druxt provides a Vue.js component to easily access Drupal's JSON:API data, with a simple Slot based theming system. | ||
### Base Druxt options | ||
```vue | ||
<Druxt :module="module" :props-data="propsData" :wrapper="wrapper" /> | ||
``` | ||
These options are available to all Druxt modules. | ||
Get started with the [Guide](https://druxtjs.org/guide/) and [API Documentation](https://druxtjs.org/api/components/Druxt.html). | ||
| Option | Type | Required | Default | Description | | ||
| --- | --- | --- | --- | --- | | ||
| `axios` | `object` | No | `{}` | [Axios instance settings](https://github.com/axios/axios#axioscreateconfig). | | ||
| `baseUrl` | `string` | Yes | `null` | Base URL for the Drupal installation. | | ||
| `endpoint` | `string` | No | `/jsonapi` | JSON:API Endpoint of the Drupal installation. | | ||
## Join the community | ||
DruxtJS is an open source project, built by the comunity for the community. | ||
Find support or get involved in building Druxt via our community channels: | ||
- [DruxtJS Discord server](https://discord.druxtjs.org) | ||
- #druxt Slack channel on [Drupal.org slack](https://drupal.org/slack) | ||
## Decoupled sites | ||
The [DruxtJS Site module](http://site.druxtjs.org/) provides minimal configuration, decoupled Drupal site functionality. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
38758
991
62
0