Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gridion

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gridion - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

.eslintrc.json

54

package.json
{
"name": "gridion",
"version": "0.0.2",
"description": "",
"main": "index.js",
"version": "0.0.3",
"description": "A small self-adjusting js grid.",
"main": "dist/gridion.js",
"module": "source/lib/gridion.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build:dev": "webpack --progress --env=dev",
"build:lib": "webpack --progress --env=lib",
"build:demo": "webpack --progress --env=demo",
"build:prod": "webpack --progress --env=prod",
"watch:dev": "webpack-dev-server --env=dev --progress",
"watch:demo": "webpack-dev-server --env=demo --progress"
},

@@ -20,22 +26,26 @@ "repository": {

"license": "ISC",
"dependencies": {},
"devDependencies": {
"autoprefixer": "^6.6.0",
"autoprefixer-loader": "^3.2.0",
"babel-core": "^6.21.0",
"babel-loader": "^6.2.10",
"babel-preset-es2015": "^6.18.0",
"browser-sync": "^2.18.5",
"browser-sync-webpack-plugin": "^1.1.3",
"css-loader": "^0.26.1",
"extract-text-webpack-plugin": "^1.0.1",
"html-loader": "^0.4.4",
"html-webpack-plugin": "^2.28.0",
"lodash": "^4.17.4",
"style-loader": "^0.13.1",
"babel-core": "^6.25.0",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.1.1",
"babel-preset-env": "^1.6.0",
"clean-webpack-plugin": "^0.1.16",
"css-loader": "^0.28.4",
"eslint": "^4.4.1",
"eslint-loader": "^1.9.0",
"extract-text-webpack-plugin": "^3.0.0",
"html-webpack-harddisk-plugin": "^0.1.0",
"html-webpack-plugin": "^2.30.1",
"postcss-loader": "^2.0.6",
"style-loader": "^0.18.2",
"stylus": "^0.54.5",
"stylus-loader": "^2.4.0",
"url-loader": "^0.5.7",
"webpack": "^1.14.0"
}
"stylus-loader": "^3.0.1",
"webpack": "^3.4.1",
"webpack-dev-server": "^2.6.1",
"webpack-merge": "^4.1.0"
},
"browserslist": [
"> 3%"
],
"dependencies": {}
}

@@ -1,1 +0,79 @@

#Gridion v0.0.1
Gridion v0.0.3
===================
A small self-adjusting js grid.
Install via npm:
-------------------
```sh
npm i gridion --save
```
js
```javascript
import Gridion from 'gridion';
import 'gridion/dist/gridion.css';
let grid = new Gridion('.container',6);
```
Or use cdn:
-------------------
```html
<link rel="stylesheet" href="url">
<script src="url"></script>
```
```javascript
let grid = new Gridion('.container',6);
```
Demo:
-------------------
Simple demo
url
Demo1
url
Demo2 (Infinity gallery)
url
Usage:
-------------------
```javascript
let grid = new Gridion(parentSelector,cols);
```
```parentSelector``` - tag selector that contains grid;
```cols``` - columns amount;
```javascript
let cellConfig = {
size:{
w:1,//width
h:2//height
},
data:'content'//content,
buildCallback:function(){
//running callback when cell is added to model
}
}
//just an array of cell configurations
let configList = [
cellConfig1,
cellConfig2,
];
```
```grid.addItems(configList,index,cbk)``` - Adds cells to grid
```grid.removeItem(id,cbk)``` - Remove cell from grid
```grid.scaleItem(id,x,y,cbk)``` - Change cell size
```grid.fastAddItem(config,index)``` - Adds cell to grid, without animation
```grid.fastAddItems(configList,index)``` - Adds cells to grid, without animation
```grid.fastRemoveItem(id)``` - Remove cell from grid, without animation

@@ -1,119 +0,66 @@

'use strict';
var webpack = require('webpack'),
ExtractTextPlugin = require('extract-text-webpack-plugin'),
HtmlPlugin = require('html-webpack-plugin'),
path = require('path'),
_ = require('lodash'),
BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const merge = require('webpack-merge');
var packageJson = require(__dirname + '/package.json')
const configCommon = require('./webpack/webpack.common');
var app = {
name:packageJson.name[0].toUpperCase() + packageJson.name.slice(1),
path:path.join(__dirname,'app'),
globalStylePath:path.join(__dirname,'style'),
projectPath:__dirname
let sameRule = function(a,b){
if(String(a.test)!==String(b.test)){//check test
return false;
}
let use1, use2;
Array.isArray(a.use) ? use1 = a.use : use1 = [a.use];
Array.isArray(b.use) ? use2 = b.use : use2 = [b.use];
if(use1.length!==use2.length){//check loaders count
return false;
}
for(let i = 0;i<use1.length;i++){//check by loaders
if(use1[i].loader !== use2[i].loader){
return false;
}
}
return true;
};
module.exports = {
entry:{
['js/'+packageJson.name]:'./app/app.js',
['../demo/index']:'./demo/_index.js',
'css/style.bundle':'./style/style.styl'
},
output:{
path:'./bundle/',
filename:'[name].js',
publicPath: '../bundle/'
},
resolve:{
alias:{
_project:app.projectPath,
_app:app.path,
_interfaces:path.join(__dirname,'app','interfaces'),
_models:path.join(__dirname,'app','models'),
_components:path.join(__dirname,'app','components')
}
},
module: {
loaders: [
{
test: /\.js$/,
include:[
app.path,
path.join(__dirname,'demo','_index.js')
],
loader:'babel',
query: {
presets: ['es2015'],
//cacheDirectory: true
let configComplete = function (env) {
const config = require(`./webpack/webpack.${env}.js`);
let complete = merge(
{
customizeArray(a, b, key) {
if(key === 'module.rules'){
let rules = b;
a.forEach(elA=>{
if(rules.every(r=>!sameRule(r,elA))){//uniq
rules.push(elA);
}
});
return rules;
}
if(key === 'plugins'){
if(
a.find(elA=>elA.constructor.name==='ExtractTextPlugin') &&
b.find(elB=>elB.constructor.name==='ExtractTextPlugin')
){
let etp = a.find(elA=>elA.constructor.name==='ExtractTextPlugin');
let idx = a.indexOf(etp);
a.splice(idx,1);
}
}
// Fall back to default merging
return undefined;
},
{
loader: ExtractTextPlugin.extract('style-loader', 'css-loader!autoprefixer-loader?browsers=last 10 version!stylus-loader'),
test: /\.styl$/,
include:[
app.path,
app.globalStylePath
]
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader')
},
{//сжимает файлы в base64 и пихает строкой, при достижении лимита перетаскивает файлы в bundle
test : /\.(ttf|eot|svg|woff|otf|png|jpg|gif)(\?[a-z0-9]+)?$/,
loader : 'url-loader?limit=2000&name=style/assets/[path][name].[ext]'
},
{
test: /\.html$/,
loader: "html-loader",
include:[
app.path
]
customizeObject(a, b, key) {
if (key === 'entry') {
return b;
}
// Fall back to default merging
return undefined;
}
]
},
plugins: [
// new webpack.optimize.UglifyJsPlugin({
// minimize: true,
// warnings: false
// }),
}
)(configCommon,config);
//console.log(complete);
return complete;
};
new HtmlPlugin({
title: app.name,
inject: false,
filename: path.join(__dirname, 'demo','index.html'),
template: path.join(__dirname,'templates', 'index.html.ejs')
}),
new HtmlPlugin({
info:{
name: packageJson.name,
version: packageJson.version,
description: packageJson.description,
repository:packageJson.repository.url
},
title: app.name,
inject: false,
filename: path.join(__dirname, 'README.md'),
template: path.join(__dirname,'templates', 'README.md.ejs')
}),
// new HtmlPlugin({
// info:{
// name: packageJson.name
// },
// title: app.name,
// inject: false,
// filename: path.join(__dirname, 'index.js'),
// template: path.join(__dirname, 'templates', 'index.js.ejs')
// }),
new ExtractTextPlugin('[name].css'),
new BrowserSyncPlugin({
// browse to http://localhost:3000/ during development,
// ./public directory is being served
host: 'localhost',
port: 3000,
server: { baseDir: [__dirname] }
})
]
};
module.exports = configComplete;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc