@bdlite/domains 1.1.26 → 1.1.28

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.
@@ -1,9 +1,11 @@
1
1
  import { createSubChannelKit } from '@bdlite/observable/es/create-observable-kit'
2
- import { CHANNEL_NAME, MENU_CHANNEL_NAME } from './constants'
2
+ import { CHANNEL_NAME, MENU_CHANNEL_NAME, MENU_ITEM_CHANNEL_NAME } from './constants'
3
3
 
4
4
  const obOptions = { relay: 1 }
5
5
  const layoutChannel = createSubChannelKit({ channelName: CHANNEL_NAME }, obOptions)
6
6
  const menuChannel = createSubChannelKit({ channelName: MENU_CHANNEL_NAME }, obOptions)
7
+ const menuItemChannel = createSubChannelKit({ channelName: MENU_ITEM_CHANNEL_NAME }, obOptions)
7
8
 
8
9
  export const subscribeLayout = layoutChannel.subscribe
9
- export const subscribeMenu = menuChannel.subscribe
10
+ export const subscribeMenu = menuChannel.subscribe
11
+ export const subscribeMenuItem = menuItemChannel.subscribe
@@ -1,5 +1,6 @@
1
- export const CHANNEL_NAME = 'layout'
2
- export const MENU_CHANNEL_NAME = 'layout-menu'
1
+ export const CHANNEL_NAME = 'domainsLayout'
2
+ export const MENU_CHANNEL_NAME = 'domainsMenu'
3
+ export const MENU_ITEM_CHANNEL_NAME = 'domainsMenuItem'
3
4
 
4
5
  // 初始值
5
6
  export const LAYOUT_MODE = {
@@ -0,0 +1,15 @@
1
+ import { isObject } from '@bdlite/strategy'
2
+ import { createObservableKit } from '@bdlite/observable/es/create-observable-kit'
3
+ import { MENU_ITEM_CHANNEL_NAME } from './constants'
4
+
5
+ const { getData, subscribe, publish } = createObservableKit({ selectedItem: {}, iframeUrl: '' }, null, { channelName: MENU_ITEM_CHANNEL_NAME })
6
+
7
+ export const subscribeMenuItem = subscribe
8
+
9
+ export const getMenuData = getData
10
+
11
+ export function publishMenuItem(data = {}) {
12
+ if (isObject(data)) {
13
+ publish({ ...getData(), ...data })
14
+ }
15
+ }
package/es/layout/menu.js CHANGED
@@ -2,8 +2,8 @@ import { isObject } from '@bdlite/strategy'
2
2
  import { createObservableKit } from '@bdlite/observable/es/create-observable-kit'
3
3
  import { MENU_CHANNEL_NAME } from './constants'
4
4
 
5
- const defaultData = { menu: [], selectedItem: {}, iframeKey: '', iframeUrl: '' }
6
- const { getData, subscribe, publish } = createObservableKit(defaultData, null, { channelName: MENU_CHANNEL_NAME })
5
+ const initialData = { menu: [], globalOpenTarget: '', isPreviewMode: false }
6
+ const { getData, subscribe, publish } = createObservableKit(initialData, null, { channelName: MENU_CHANNEL_NAME })
7
7
 
8
8
  export const subscribeMenu = subscribe
9
9
 
@@ -11,4 +11,5 @@ export function publishMenu(data = {}) {
11
11
  if (isObject(data)) {
12
12
  publish({ ...getData(), ...data })
13
13
  }
14
- }
14
+ }
15
+ export const getMenuData = getData
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bdlite/domains",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "description": "A domains entity collection library driven by @bdlite/observable",
5
5
  "keywords": [
6
6
  "DDD",
@@ -20,14 +20,14 @@
20
20
  ],
21
21
  "license": "MIT",
22
22
  "peerDependencies": {
23
- "@bdlite/helpers": "^1.1.0",
23
+ "@bdlite/helpers": "^1.1.24",
24
24
  "@bdlite/observable": "^1.1.20",
25
- "@bdlite/strategy": "^1.1.0"
25
+ "@bdlite/strategy": "^1.1.25"
26
26
  },
27
27
  "dependencies": {
28
- "@bdlite/helpers": "^1.1.24",
29
- "@bdlite/observable": "^1.1.20",
30
- "@bdlite/strategy": "^1.1.22"
28
+ "@bdlite/helpers": "^1.1.25",
29
+ "@bdlite/observable": "^1.1.25",
30
+ "@bdlite/strategy": "^1.1.25"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@rollup/plugin-babel": "6.0.4",