Skip to content

Commit

Permalink
Build assets after updating npm dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Coulbourne committed Aug 28, 2018
1 parent 459c998 commit 32a601c
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 6,555 deletions.
159 changes: 89 additions & 70 deletions dist/js/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,34 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
Expand All @@ -69,6 +89,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
Expand All @@ -78,42 +99,91 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (immutable) */ __webpack_exports__["default"] = route;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__UrlBuilder__ = __webpack_require__(1);
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./src/js/UrlBuilder.js
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var UrlBuilder = function () {
function UrlBuilder(name, absolute, ziggyObject) {
_classCallCheck(this, UrlBuilder);

this.name = name;
this.ziggy = ziggyObject;
this.route = this.ziggy.namedRoutes[this.name];

if (typeof this.name === 'undefined') {
throw new Error('Ziggy Error: You must provide a route name');
} else if (typeof this.route === 'undefined') {
throw new Error('Ziggy Error: route \'' + this.name + '\' is not found in the route list');
}

this.absolute = typeof absolute === 'undefined' ? true : absolute;
this.domain = this.setDomain();
this.path = this.route.uri.replace(/^\//, '');
}

_createClass(UrlBuilder, [{
key: 'setDomain',
value: function setDomain() {
if (!this.absolute) return '/';

if (!this.route.domain) return this.ziggy.baseUrl.replace(/\/?$/, '/');

var host = (this.route.domain || this.ziggy.baseDomain).replace(/\/+$/, '');

if (this.ziggy.basePort && host.replace(/\/+$/, '') === this.ziggy.baseDomain.replace(/\/+$/, '')) host = this.ziggy.baseDomain + ':' + this.ziggy.basePort;

return this.ziggy.baseProtocol + '://' + host + '/';
}
}, {
key: 'construct',
value: function construct() {
return this.domain + this.path;
}
}]);

return UrlBuilder;
}();

/* harmony default export */ var js_UrlBuilder = (UrlBuilder);
// CONCATENATED MODULE: ./src/js/route.js
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return route; });
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var route_createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function route_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }



var Router = function (_String) {
var route_Router = function (_String) {
_inherits(Router, _String);

function Router(name, params, absolute) {
var customZiggy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;

_classCallCheck(this, Router);
route_classCallCheck(this, Router);

var _this = _possibleConstructorReturn(this, (Router.__proto__ || Object.getPrototypeOf(Router)).call(this));

_this.name = name;
_this.absolute = absolute;
_this.ziggy = customZiggy ? customZiggy : Ziggy;
_this.template = _this.name ? new __WEBPACK_IMPORTED_MODULE_0__UrlBuilder__["a" /* default */](name, absolute, _this.ziggy).construct() : '', _this.urlParams = _this.normalizeParams(params);
_this.template = _this.name ? new js_UrlBuilder(name, absolute, _this.ziggy).construct() : '', _this.urlParams = _this.normalizeParams(params);
_this.queryParams = _this.normalizeParams(params);
return _this;
}

_createClass(Router, [{
route_createClass(Router, [{
key: 'normalizeParams',
value: function normalizeParams(params) {
if (typeof params === 'undefined') return {};
Expand Down Expand Up @@ -206,7 +276,7 @@ var Router = function (_String) {
var queryString = '?';

Object.keys(this.queryParams).forEach(function (key, i) {
if (this.queryParams[key]) {
if (this.queryParams[key] !== undefined && this.queryParams[key] !== null) {
queryString = i === 0 ? queryString : queryString + '&';
queryString += key + '=' + encodeURIComponent(this.queryParams[key]);
}
Expand All @@ -217,12 +287,14 @@ var Router = function (_String) {
}, {
key: 'current',
value: function current() {
var _this3 = this;

var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

var routeNames = Object.keys(this.ziggy.namedRoutes);

var currentRoute = routeNames.filter(function (name) {
return new Router(name).matchUrl();
return new Router(name, undefined, undefined, _this3.ziggy).matchUrl();
})[0];

return name ? name == currentRoute : currentRoute;
Expand Down Expand Up @@ -254,62 +326,9 @@ var Router = function (_String) {
}(String);

function route(name, params, absolute, customZiggy) {
return new Router(name, params, absolute, customZiggy);
return new route_Router(name, params, absolute, customZiggy);
};

/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var UrlBuilder = function () {
function UrlBuilder(name, absolute, ziggyObject) {
_classCallCheck(this, UrlBuilder);

this.name = name;
this.ziggy = ziggyObject;
this.route = this.ziggy.namedRoutes[this.name];

if (typeof this.name === 'undefined') {
throw new Error('Ziggy Error: You must provide a route name');
} else if (typeof this.route === 'undefined') {
throw new Error('Ziggy Error: route \'' + this.name + '\' is not found in the route list');
}

this.absolute = typeof absolute === 'undefined' ? true : absolute;
this.domain = this.setDomain();
this.path = this.route.uri.replace(/^\//, '');
}

_createClass(UrlBuilder, [{
key: 'setDomain',
value: function setDomain() {
if (!this.absolute) return '/';

if (!this.route.domain) return this.ziggy.baseUrl.replace(/\/?$/, '/');

var host = (this.route.domain || this.ziggy.baseDomain).replace(/\/+$/, '');

if (this.ziggy.basePort && host.replace(/\/+$/, '') === this.ziggy.baseDomain.replace(/\/+$/, '')) host = this.ziggy.baseDomain + ':' + this.ziggy.basePort;

return this.ziggy.baseProtocol + '://' + host + '/';
}
}, {
key: 'construct',
value: function construct() {
return this.domain + this.path;
}
}]);

return UrlBuilder;
}();

/* harmony default export */ __webpack_exports__["a"] = (UrlBuilder);

/***/ })
/******/ ])["default"];
});
Loading

0 comments on commit 32a601c

Please sign in to comment.