@steedos-widgets/sortable 1.0.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/.env +1 -0
- package/.env.local +8 -0
- package/dist/assets-dev.json +25 -0
- package/dist/assets.json +25 -0
- package/dist/components/MultipleContainers.d.ts +7 -0
- package/dist/components/components/Container/Container.d.ts +17 -0
- package/dist/components/components/Container/index.d.ts +2 -0
- package/dist/components/components/Grid/Grid.d.ts +7 -0
- package/dist/components/components/Grid/index.d.ts +1 -0
- package/dist/components/components/GridContainer/GridContainer.d.ts +6 -0
- package/dist/components/components/GridContainer/index.d.ts +1 -0
- package/dist/components/components/Item/Item.d.ts +37 -0
- package/dist/components/components/Item/components/Action/Action.d.ts +9 -0
- package/dist/components/components/Item/components/Action/index.d.ts +2 -0
- package/dist/components/components/Item/components/Handle/Handle.d.ts +3 -0
- package/dist/components/components/Item/components/Handle/index.d.ts +1 -0
- package/dist/components/components/Item/components/Remove/Remove.d.ts +3 -0
- package/dist/components/components/Item/components/Remove/index.d.ts +1 -0
- package/dist/components/components/Item/components/index.d.ts +3 -0
- package/dist/components/components/Item/index.d.ts +2 -0
- package/dist/components/components/index.d.ts +5 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/multipleContainersKeyboardCoordinates.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/meta.d.ts +9 -0
- package/dist/meta.js +180 -0
- package/dist/metas/MultipleContainers.d.ts +2 -0
- package/dist/sortable.cjs.css +335 -0
- package/dist/sortable.cjs.js +56525 -0
- package/dist/sortable.cjs.js.map +1 -0
- package/dist/sortable.esm.css +335 -0
- package/dist/sortable.esm.js +56521 -0
- package/dist/sortable.esm.js.map +1 -0
- package/dist/sortable.umd.css +335 -0
- package/dist/sortable.umd.js +22829 -0
- package/dist/utilities/createRange.d.ts +1 -0
- package/dist/utilities/index.d.ts +1 -0
- package/package.json +51 -0
- package/rollup.config.ts +109 -0
- package/src/assets.json +25 -0
- package/src/components/MultipleContainers.tsx +802 -0
- package/src/components/components/Container/Container.module.css +103 -0
- package/src/components/components/Container/Container.tsx +83 -0
- package/src/components/components/Container/index.ts +2 -0
- package/src/components/components/Grid/Grid.module.css +30 -0
- package/src/components/components/Grid/Grid.tsx +22 -0
- package/src/components/components/Grid/index.ts +1 -0
- package/src/components/components/GridContainer/GridContainer.module.css +15 -0
- package/src/components/components/GridContainer/GridContainer.tsx +23 -0
- package/src/components/components/GridContainer/index.ts +1 -0
- package/src/components/components/Item/Item.module.css +145 -0
- package/src/components/components/Item/Item.tsx +157 -0
- package/src/components/components/Item/components/Action/Action.module.css +50 -0
- package/src/components/components/Item/components/Action/Action.tsx +33 -0
- package/src/components/components/Item/components/Action/index.ts +2 -0
- package/src/components/components/Item/components/Handle/Handle.tsx +20 -0
- package/src/components/components/Item/components/Handle/index.ts +1 -0
- package/src/components/components/Item/components/Remove/Remove.tsx +19 -0
- package/src/components/components/Item/components/Remove/index.ts +1 -0
- package/src/components/components/Item/components/index.ts +3 -0
- package/src/components/components/Item/index.ts +2 -0
- package/src/components/components/index.ts +6 -0
- package/src/components/index.ts +1 -0
- package/src/components/multipleContainersKeyboardCoordinates.ts +116 -0
- package/src/index.ts +1 -0
- package/src/meta.ts +20 -0
- package/src/metas/MultipleContainers.tsx +131 -0
- package/src/types/css.d.ts +4 -0
- package/src/types/global.d.ts +6 -0
- package/src/utilities/createRange.ts +15 -0
- package/src/utilities/index.ts +1 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createRange<T = number>(length: number, initializer?: (index: number) => any): T[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createRange } from './createRange';
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@steedos-widgets/sortable",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"main": "dist/sortable.cjs.js",
|
|
5
|
+
"module": "dist/sortable.esm.js",
|
|
6
|
+
"unpkg": "dist/sortable.umd.js",
|
|
7
|
+
"typings": "dist/index.d.ts",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"prebuild": "rimraf dist",
|
|
11
|
+
"build": "yarn build:rollup",
|
|
12
|
+
"build:rollup": "rollup -c rollup.config.ts",
|
|
13
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
17
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
18
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
19
|
+
"@rollup/plugin-typescript": "^8.4.0",
|
|
20
|
+
"@types/react": "^18.0.8",
|
|
21
|
+
"@types/react-dom": "^18.0.6",
|
|
22
|
+
"react": "18.2.0",
|
|
23
|
+
"react-dom": "18.2.0",
|
|
24
|
+
"rollup": "^2.70.1",
|
|
25
|
+
"rollup-plugin-alias": "^2.2.0",
|
|
26
|
+
"rollup-plugin-external-globals": "^0.6.1",
|
|
27
|
+
"rollup-plugin-json": "^4.0.0",
|
|
28
|
+
"rollup-plugin-node-builtins": "^2.1.2",
|
|
29
|
+
"rollup-plugin-node-globals": "^1.4.0",
|
|
30
|
+
"rollup-plugin-node-resolve": "^5.2.0",
|
|
31
|
+
"rollup-plugin-polyfill-node": "^0.8.0",
|
|
32
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
33
|
+
"rollup-plugin-postcss-webpack-alias-less-loader": "^1.0.0",
|
|
34
|
+
"rollup-plugin-re": "^1.0.7",
|
|
35
|
+
"rollup-plugin-replace": "^2.0.0",
|
|
36
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
37
|
+
"rollup-plugin-svg": "^2.0.0",
|
|
38
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
39
|
+
"rollup-plugin-tslib-resolve-id": "^0.0.0",
|
|
40
|
+
"rollup-plugin-visualizer": "^5.8.0"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@dnd-kit/core": "^6.0.5",
|
|
47
|
+
"@dnd-kit/sortable": "^7.0.1",
|
|
48
|
+
"@steedos-widgets/amis-lib": "1.0.1"
|
|
49
|
+
},
|
|
50
|
+
"gitHead": "7200c0614e935ad372fc58184fabbd305cf597e2"
|
|
51
|
+
}
|
package/rollup.config.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import resolve, { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
2
|
+
import postcss from 'rollup-plugin-postcss';
|
|
3
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
4
|
+
import typescript from '@rollup/plugin-typescript';
|
|
5
|
+
import json from 'rollup-plugin-json';
|
|
6
|
+
import { terser } from "rollup-plugin-terser";
|
|
7
|
+
|
|
8
|
+
require('dotenv-flow').config();
|
|
9
|
+
|
|
10
|
+
const pkg = require('./package.json');
|
|
11
|
+
|
|
12
|
+
const exportName = 'BuilderSortable';
|
|
13
|
+
|
|
14
|
+
const unpkgUrl = process.env.STEEDOS_UNPKG_URL ? process.env.STEEDOS_UNPKG_URL : 'https://unpkg.com'
|
|
15
|
+
|
|
16
|
+
const external = [
|
|
17
|
+
"react",
|
|
18
|
+
"react-dom"
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
const globals = {
|
|
22
|
+
react: 'React',
|
|
23
|
+
'react-dom': 'ReactDOM'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const options = {
|
|
27
|
+
input: `src/index.ts`,
|
|
28
|
+
// Indicate here external modules you don't wanna include in your bundle (i.e.: 'lodash')
|
|
29
|
+
external: [],
|
|
30
|
+
watch: {
|
|
31
|
+
include: 'src/**',
|
|
32
|
+
},
|
|
33
|
+
plugins: [
|
|
34
|
+
nodeResolve(),
|
|
35
|
+
json(),
|
|
36
|
+
typescript({
|
|
37
|
+
}),
|
|
38
|
+
commonjs({
|
|
39
|
+
}),
|
|
40
|
+
postcss({
|
|
41
|
+
extract: true,
|
|
42
|
+
plugins: [require('postcss-simple-vars'), require('postcss-nested')],
|
|
43
|
+
}),
|
|
44
|
+
// terser()
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default [
|
|
49
|
+
// React CJS
|
|
50
|
+
{
|
|
51
|
+
...options,
|
|
52
|
+
output: [{ file: pkg.main, format: 'cjs', sourcemap: true }],
|
|
53
|
+
plugins: options.plugins.concat([]),
|
|
54
|
+
},
|
|
55
|
+
// ES
|
|
56
|
+
{
|
|
57
|
+
...options,
|
|
58
|
+
output: [{ file: pkg.module, format: 'es', sourcemap: true }],
|
|
59
|
+
plugins: options.plugins.concat([]),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
...options,
|
|
63
|
+
external,
|
|
64
|
+
output: [
|
|
65
|
+
{
|
|
66
|
+
file: pkg.unpkg,
|
|
67
|
+
name: exportName,
|
|
68
|
+
format: 'umd',
|
|
69
|
+
sourcemap: false,
|
|
70
|
+
strict: false,
|
|
71
|
+
intro: 'const global = window;',
|
|
72
|
+
globals,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
// meta build
|
|
77
|
+
{
|
|
78
|
+
input: `src/meta.ts`,
|
|
79
|
+
plugins: [
|
|
80
|
+
typescript({
|
|
81
|
+
}),
|
|
82
|
+
{
|
|
83
|
+
name: 'assets',
|
|
84
|
+
generateBundle(outputOptions, bundle) {
|
|
85
|
+
// assets build
|
|
86
|
+
const assets = require('./src/assets.json')
|
|
87
|
+
const amis = JSON.stringify(assets, null, 4).replace(/\{\{version\}\}/g, `${pkg.version}`)
|
|
88
|
+
this.emitFile({
|
|
89
|
+
type: 'asset',
|
|
90
|
+
fileName: 'assets.json',
|
|
91
|
+
source: amis
|
|
92
|
+
});
|
|
93
|
+
const amisDev = JSON.stringify(assets, null, 4).replace(/\@\{\{version\}\}/g, ``).replace(/https\:\/\/unpkg.com/g, unpkgUrl)
|
|
94
|
+
this.emitFile({
|
|
95
|
+
type: 'asset',
|
|
96
|
+
fileName: 'assets-dev.json',
|
|
97
|
+
source: amisDev
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
output: {
|
|
103
|
+
file: "dist/meta.js",
|
|
104
|
+
format: "umd",
|
|
105
|
+
name: exportName + 'Meta',
|
|
106
|
+
sourcemap: false
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
];
|
package/src/assets.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"packages": [
|
|
3
|
+
{
|
|
4
|
+
"package": "@steedos-widgets/sortable",
|
|
5
|
+
"urls": [
|
|
6
|
+
"https://unpkg.com/@steedos-widgets/sortable@{{version}}/dist/sortable.umd.js",
|
|
7
|
+
"https://unpkg.com/@steedos-widgets/sortable@{{version}}/dist/sortable.umd.css"
|
|
8
|
+
],
|
|
9
|
+
"library": "BuilderSortable"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"components": [
|
|
13
|
+
{
|
|
14
|
+
"exportName": "BuilderSortableMeta",
|
|
15
|
+
"npm": {
|
|
16
|
+
"package": "@steedos-widgets/sortable"
|
|
17
|
+
},
|
|
18
|
+
"url": "https://unpkg.com/@steedos-widgets/sortable@{{version}}/dist/meta.js",
|
|
19
|
+
"urls": {
|
|
20
|
+
"default": "https://unpkg.com/@steedos-widgets/sortable@{{version}}/dist/meta.js",
|
|
21
|
+
"design": "https://unpkg.com/@steedos-widgets/sortable@{{version}}/dist/meta.js"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|