@vnejs/plugins.feature.gallery 0.0.1 → 0.1.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/const/params.js +1 -0
- package/index.d.ts +17 -0
- package/index.js +3 -1
- package/modules/gallery.js +2 -7
- package/package.json +5 -6
package/const/params.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const TABS = {};
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as constants from "./const/const";
|
|
2
|
+
import { SUBSCRIBE_EVENTS } from "./const/events";
|
|
3
|
+
import * as params from "./const/params";
|
|
4
|
+
import { SETTINGS_KEYS } from "./const/settings";
|
|
5
|
+
|
|
6
|
+
type ConstantsType = typeof constants;
|
|
7
|
+
type SubscribeEventsType = typeof SUBSCRIBE_EVENTS;
|
|
8
|
+
type ParamsType = typeof params;
|
|
9
|
+
type SettingsKeysType = typeof SETTINGS_KEYS;
|
|
10
|
+
|
|
11
|
+
const PLUGIN_NAME = "GALLERY";
|
|
12
|
+
|
|
13
|
+
declare global {
|
|
14
|
+
interface PARAMS {
|
|
15
|
+
[PLUGIN_NAME]: ParamsType;
|
|
16
|
+
}
|
|
17
|
+
}
|
package/index.js
CHANGED
package/modules/gallery.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { Module } from "@vnejs/module";
|
|
2
2
|
|
|
3
|
-
window.VNEGalleryInfo = {};
|
|
4
|
-
|
|
5
3
|
export class Gallery extends Module {
|
|
6
4
|
name = "gallery";
|
|
7
5
|
|
|
8
6
|
subscribe = () => {
|
|
9
|
-
this.on(this.EVENTS.
|
|
10
|
-
};
|
|
11
|
-
init = async () => {
|
|
12
|
-
this.shared.galleryInfo = window.VNEGalleryInfo;
|
|
7
|
+
this.on(this.EVENTS.LAYER.CHILD_ADD, this.onChildAdd);
|
|
13
8
|
};
|
|
14
9
|
|
|
15
|
-
|
|
10
|
+
onChildAdd = ({ layer = "", child: { name = "" } = {} } = {}) =>
|
|
16
11
|
name && layer && this.emit(this.EVENTS.STORAGE.SET, { prefix: this.name, key: `${layer}/${name}`, value: 1 });
|
|
17
12
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/plugins.feature.gallery",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"publish:major:plugin": "npm run publish:major",
|
|
8
|
+
"publish:minor:plugin": "npm run publish:minor",
|
|
9
|
+
"publish:patch:plugin": "npm run publish:patch",
|
|
7
10
|
"publish:major": "npm version major && npm publish --access public",
|
|
8
11
|
"publish:minor": "npm version minor && npm publish --access public",
|
|
9
12
|
"publish:patch": "npm version patch && npm publish --access public"
|
|
10
13
|
},
|
|
11
14
|
"author": "",
|
|
12
15
|
"license": "ISC",
|
|
13
|
-
"description": ""
|
|
14
|
-
"peerDependencies": {
|
|
15
|
-
"@vnejs/shared": "*",
|
|
16
|
-
"@vnejs/module": "*"
|
|
17
|
-
}
|
|
16
|
+
"description": ""
|
|
18
17
|
}
|