@koeroesi86/canvas-grid 1.0.15 → 26.11.2
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/README.md +27 -0
- package/build/types/cell-background/index.d.ts +25 -0
- package/build/types/cell-value/index.d.ts +21 -0
- package/build/types/character/index.d.ts +21 -0
- package/build/types/header/index.d.ts +25 -0
- package/build/types/rectangle/index.d.ts +12 -0
- package/build/types/text/index.d.ts +31 -0
- package/build/types/types.d.ts +87 -0
- package/build/types/utils/canvas.d.ts +1 -0
- package/build/types/utils/collection.d.ts +18 -0
- package/build/types/utils/column-store.d.ts +16 -0
- package/build/types/utils/data-store.d.ts +49 -0
- package/build/types/utils/jsx.d.ts +40 -0
- package/build/types/utils/layer.d.ts +26 -0
- package/build/types/utils/loading.d.ts +17 -0
- package/build/types/utils/lru-cache.d.ts +11 -0
- package/build/types/utils/renderer-registry.d.ts +13 -0
- package/build/types/utils/renderer.d.ts +26 -0
- package/build/types/utils/row-store.d.ts +37 -0
- package/build/types/utils/selectors.d.ts +3 -0
- package/build/types/web-component.d.ts +189 -0
- package/build/web-component.js +1 -732
- package/build/web-component.js.map +1 -1
- package/build/web-component.mjs +1226 -0
- package/build/web-component.mjs.map +1 -0
- package/package.json +32 -32
- package/.babelrc +0 -14
- package/.eslintrc +0 -7
- package/.github/CODEOWNERS +0 -1
- package/.github/SECURITY.md +0 -9
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/ci.yml +0 -32
- package/.github/workflows/codeql.yml +0 -26
- package/.github/workflows/publish.yml +0 -51
- package/components/cellBackground/index.jsx +0 -86
- package/components/cellValue/index.jsx +0 -80
- package/components/character/index.jsx +0 -82
- package/components/component.scss +0 -45
- package/components/example.js +0 -56
- package/components/header/index.jsx +0 -100
- package/components/rectangle/index.jsx +0 -65
- package/components/text/index.jsx +0 -131
- package/components/utils/collection.js +0 -58
- package/components/utils/drawingLayer.js +0 -66
- package/components/utils/jsx.js +0 -57
- package/components/utils/loading.js +0 -58
- package/components/utils/renderer.js +0 -45
- package/components/utils/selectors.js +0 -13
- package/components/web-component.js +0 -582
- package/config/htmlGenerator.js +0 -36
- package/nodemon.json +0 -5
- package/public/index.html +0 -29
- package/scripts/build.js +0 -30
- package/scripts/dev.js +0 -64
- package/server/example.js +0 -59
- package/server/exampleServe.js +0 -3
- package/webpack.config.js +0 -151
package/scripts/dev.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
const { resolve } = require('path');
|
|
2
|
-
const { existsSync } = require('fs');
|
|
3
|
-
const { removeSync } = require('fs-extra');
|
|
4
|
-
const webpack = require('webpack');
|
|
5
|
-
const WebpackDevServer = require('webpack-dev-server');
|
|
6
|
-
|
|
7
|
-
process.env.BABEL_ENV = 'development';
|
|
8
|
-
process.env.NODE_ENV = 'development';
|
|
9
|
-
|
|
10
|
-
if (!process.env.DEV_PORT) {
|
|
11
|
-
process.env.DEV_PORT = '3000';
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const config = require('../webpack.config');
|
|
15
|
-
const exampleServer = require('../server/example');
|
|
16
|
-
|
|
17
|
-
if (existsSync(resolve(__dirname, '../build'))) {
|
|
18
|
-
removeSync(resolve(__dirname, '../build'))
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
process.on('unhandledRejection', err => {
|
|
22
|
-
throw err
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
const port = process.env.DEV_PORT;
|
|
26
|
-
const compiler = webpack(config);
|
|
27
|
-
const devServerOptions = Object.assign({}, config.devServer, {
|
|
28
|
-
open: false,
|
|
29
|
-
inline: false,
|
|
30
|
-
hot: true,
|
|
31
|
-
compress: true,
|
|
32
|
-
historyApiFallback: true,
|
|
33
|
-
// noInfo: true,
|
|
34
|
-
overlay: {
|
|
35
|
-
warnings: false,
|
|
36
|
-
errors: true
|
|
37
|
-
},
|
|
38
|
-
watchOptions: {
|
|
39
|
-
aggregateTimeout: 300,
|
|
40
|
-
poll: 1000
|
|
41
|
-
},
|
|
42
|
-
stats: {
|
|
43
|
-
builtAt: true,
|
|
44
|
-
hash: false,
|
|
45
|
-
version: false,
|
|
46
|
-
chunks: false,
|
|
47
|
-
colors: true,
|
|
48
|
-
assets: false,
|
|
49
|
-
children: false,
|
|
50
|
-
entrypoints: false,
|
|
51
|
-
modules: false,
|
|
52
|
-
errors: true,
|
|
53
|
-
errorDetails: true,
|
|
54
|
-
performance: true,
|
|
55
|
-
warnings: true,
|
|
56
|
-
},
|
|
57
|
-
// before: app => {
|
|
58
|
-
// }
|
|
59
|
-
});
|
|
60
|
-
const devServer = new WebpackDevServer(compiler, devServerOptions);
|
|
61
|
-
const httpServer = devServer.listen(port, '0.0.0.0', () => {
|
|
62
|
-
console.log(`Starting server on http://localhost:${port}`);
|
|
63
|
-
});
|
|
64
|
-
exampleServer(httpServer);
|
package/server/example.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const WebSocket = require('ws');
|
|
2
|
-
|
|
3
|
-
require('dotenv').config();
|
|
4
|
-
|
|
5
|
-
const rowCount = 500;
|
|
6
|
-
const columnCount = 30;
|
|
7
|
-
|
|
8
|
-
module.exports = (server) => {
|
|
9
|
-
console.log('Initialising server');
|
|
10
|
-
|
|
11
|
-
const wsServer = new WebSocket.Server(server ? { server } : { port: process.env.DEV_PORT || '3000' });
|
|
12
|
-
|
|
13
|
-
const data = new Map();
|
|
14
|
-
const getRandomValue = () => (Math.random() * 100).toFixed(10).toString();
|
|
15
|
-
|
|
16
|
-
const randomText = () => {
|
|
17
|
-
data.forEach((row, id) => {
|
|
18
|
-
Object.keys(row).forEach(key => {
|
|
19
|
-
if (key !== 'id' && Math.random() > 0.99) {
|
|
20
|
-
const value = getRandomValue();
|
|
21
|
-
if (value !== row[key]) {
|
|
22
|
-
data.set(id, { ...row, [key]: value });
|
|
23
|
-
wsServer.clients.forEach(client => {
|
|
24
|
-
client.send(JSON.stringify({ row: { id, [key]: value } }));
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const init = () => {
|
|
33
|
-
// fill up initial data
|
|
34
|
-
for (let r = 0; r <= rowCount; r++) {
|
|
35
|
-
const row = { id: r };
|
|
36
|
-
for (let column = 0; column <= columnCount; column++) {
|
|
37
|
-
row[column] = getRandomValue();
|
|
38
|
-
}
|
|
39
|
-
data.set(r, row);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
setInterval(randomText, 50);
|
|
43
|
-
console.log('Server started');
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
wsServer.on('connection', ws => {
|
|
47
|
-
ws.on('message', message => {
|
|
48
|
-
console.log(`Received message => ${message}`)
|
|
49
|
-
});
|
|
50
|
-
const initialData = [];
|
|
51
|
-
data.forEach(row => {
|
|
52
|
-
initialData.push(row);
|
|
53
|
-
});
|
|
54
|
-
ws.send(JSON.stringify({ columns: Object.keys(initialData[0]) }));
|
|
55
|
-
ws.send(JSON.stringify({ all: initialData }));
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
init();
|
|
59
|
-
};
|
package/server/exampleServe.js
DELETED
package/webpack.config.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const StaticSiteGeneratorPlugin = require('static-site-generator-webpack-plugin');
|
|
3
|
-
const webpack = require('webpack');
|
|
4
|
-
const WebpackBar = require('webpackbar');
|
|
5
|
-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
|
|
6
|
-
|
|
7
|
-
const isDev = process.env.NODE_ENV === 'development';
|
|
8
|
-
|
|
9
|
-
const config = {
|
|
10
|
-
mode: isDev ? 'development' : 'production',
|
|
11
|
-
entry: {
|
|
12
|
-
'web-component': path.resolve(__dirname, './components/web-component.js'),
|
|
13
|
-
...(isDev && {
|
|
14
|
-
htmlGenerator: path.resolve(__dirname, './config/htmlGenerator.js'),
|
|
15
|
-
example: [
|
|
16
|
-
`webpack-dev-server/client?http://localhost:${process.env.DEV_PORT}`,
|
|
17
|
-
// 'webpack/hot/only-dev-server',
|
|
18
|
-
'webpack/hot/dev-server',
|
|
19
|
-
path.resolve(__dirname, './components/example.js'),
|
|
20
|
-
],
|
|
21
|
-
}),
|
|
22
|
-
},
|
|
23
|
-
output: {
|
|
24
|
-
pathinfo: true,
|
|
25
|
-
libraryTarget: 'umd',
|
|
26
|
-
path: path.resolve(__dirname, './build'),
|
|
27
|
-
publicPath: '/',
|
|
28
|
-
globalObject: `typeof self !== 'undefined' ? self : this`,
|
|
29
|
-
filename: '[name].js'
|
|
30
|
-
},
|
|
31
|
-
plugins: [
|
|
32
|
-
// new MiniCssExtractPlugin({
|
|
33
|
-
// filename: isDev ? '[name].css' : '[name].[hash].css',
|
|
34
|
-
// chunkFilename: isDev ? '[id].css' : '[id].[hash].css',
|
|
35
|
-
// }),
|
|
36
|
-
isDev && new StaticSiteGeneratorPlugin({
|
|
37
|
-
entry: 'htmlGenerator',
|
|
38
|
-
paths: [
|
|
39
|
-
'/',
|
|
40
|
-
'/index.html'
|
|
41
|
-
],
|
|
42
|
-
locals: {
|
|
43
|
-
}
|
|
44
|
-
}),
|
|
45
|
-
// new WebpackBar({
|
|
46
|
-
// name: "Assets",
|
|
47
|
-
// color: 'green'
|
|
48
|
-
// }),
|
|
49
|
-
new webpack.SourceMapDevToolPlugin({
|
|
50
|
-
test: /\.(js)/,
|
|
51
|
-
module: true,
|
|
52
|
-
filename: '[file].map',
|
|
53
|
-
}),
|
|
54
|
-
new webpack.EnvironmentPlugin({
|
|
55
|
-
DEV_PORT: '3000'
|
|
56
|
-
}),
|
|
57
|
-
isDev && new webpack.HotModuleReplacementPlugin({
|
|
58
|
-
multiStep: false,
|
|
59
|
-
}),
|
|
60
|
-
isDev && new webpack.NamedModulesPlugin(),
|
|
61
|
-
].filter(Boolean),
|
|
62
|
-
optimization: {
|
|
63
|
-
minimize: true,
|
|
64
|
-
minimizer: [new UglifyJsPlugin({
|
|
65
|
-
sourceMap: true,
|
|
66
|
-
parallel: true,
|
|
67
|
-
// uglifyOptions: {
|
|
68
|
-
// compress: false,
|
|
69
|
-
// output: {
|
|
70
|
-
// comments: false
|
|
71
|
-
// }
|
|
72
|
-
// }
|
|
73
|
-
})]
|
|
74
|
-
},
|
|
75
|
-
module: {
|
|
76
|
-
rules: [
|
|
77
|
-
{
|
|
78
|
-
test: /\.(js|jsx)$/,
|
|
79
|
-
exclude: /node_modules/,
|
|
80
|
-
loader: 'babel-loader',
|
|
81
|
-
query: {
|
|
82
|
-
cacheDirectory: isDev
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
// {
|
|
86
|
-
// test: /\.(svg|png|jpg|webm|mp4|woff|woff2|ttf|eot)$/,
|
|
87
|
-
// loader: 'url-loader'
|
|
88
|
-
// },
|
|
89
|
-
// fonts/fonts/components/player-home/fonts/fonts/open-sans-regular.woff2
|
|
90
|
-
// http://localhost:3000/assets/components/player-home/fonts/fonts/open-sans-regular.woff2
|
|
91
|
-
{
|
|
92
|
-
test: /\.(woff(2)?|ttf|eot)$/,
|
|
93
|
-
use: [{
|
|
94
|
-
loader: 'file-loader',
|
|
95
|
-
options: {
|
|
96
|
-
name: '[name]-[hash].[ext]',
|
|
97
|
-
useRelativePath: true,
|
|
98
|
-
outputPath: 'fonts/',
|
|
99
|
-
publicPath: 'fonts/'
|
|
100
|
-
}
|
|
101
|
-
}]
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
test: /\.(svg|png|ico|jpg|webm|mp4)$/,
|
|
105
|
-
loader: 'file-loader',
|
|
106
|
-
options: {
|
|
107
|
-
name: '[name]-[hash].[ext]',
|
|
108
|
-
useRelativePath: true,
|
|
109
|
-
outputPath: 'assets/',
|
|
110
|
-
publicPath: 'assets/'
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
test: /\.(sa|sc|c)ss$/,
|
|
115
|
-
use: [
|
|
116
|
-
{
|
|
117
|
-
loader: 'style-loader',
|
|
118
|
-
options: {
|
|
119
|
-
sourceMap: process.env.NODE_ENV !== 'production',
|
|
120
|
-
singleton: true,
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
// {
|
|
124
|
-
// loader: MiniCssExtractPlugin.loader,
|
|
125
|
-
// options: {
|
|
126
|
-
// hmr: false,
|
|
127
|
-
// reloadAll: true,
|
|
128
|
-
// }
|
|
129
|
-
// },
|
|
130
|
-
{
|
|
131
|
-
loader: 'css-loader',
|
|
132
|
-
options: {
|
|
133
|
-
modules: true,
|
|
134
|
-
importLoaders: 1,
|
|
135
|
-
localIdentName: (process.env.NODE_ENV === 'production' ? '[sha1:hash:hex:4]' : '[name]__[local]')
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
loader: 'sass-loader'
|
|
140
|
-
}
|
|
141
|
-
]
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
},
|
|
145
|
-
resolve: {
|
|
146
|
-
extensions: ['.js', '.jsx', '.json']
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
module.exports = config;
|