@lvce-editor/title-bar-worker 4.10.0 → 4.12.0

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.
@@ -4334,6 +4334,12 @@ const activeEntryLabelNode = {
4334
4334
  className: TitleBarTopLevelEntryLabel,
4335
4335
  type: Div
4336
4336
  };
4337
+ const getActiveEntryLabelDom = isFocused => {
4338
+ if (!isFocused) {
4339
+ return [];
4340
+ }
4341
+ return [activeEntryLabelNode];
4342
+ };
4337
4343
  const getItemVirtualDom = item => {
4338
4344
  // @ts-ignore
4339
4345
  const {
@@ -4357,7 +4363,7 @@ const getItemVirtualDom = item => {
4357
4363
  // TODO have separate name attribute
4358
4364
  role: MenuItem$1,
4359
4365
  type: Button$1
4360
- }, ...(isFocused ? [activeEntryLabelNode] : []), text(label)];
4366
+ }, ...getActiveEntryLabelDom(isFocused), text(label)];
4361
4367
  };
4362
4368
  const getTitleBarMenuBarItemsVirtualDom = visibleItems => {
4363
4369
  const dom = visibleItems.flatMap(getItemVirtualDom);
@@ -4593,6 +4599,13 @@ const showMenuBar = async state => {
4593
4599
  };
4594
4600
  };
4595
4601
 
4602
+ const sleep = uid => {
4603
+ const {
4604
+ newState
4605
+ } = get(uid);
4606
+ return newState;
4607
+ };
4608
+
4596
4609
  const create = (id, uri, x, y, width, height) => {
4597
4610
  const state = {
4598
4611
  ...createDefaultState(),
@@ -5182,6 +5195,10 @@ const toggleMenu = async state => {
5182
5195
  return openMenu(state, /* focus */false);
5183
5196
  };
5184
5197
 
5198
+ const wakeUp = sleepState => {
5199
+ set(sleepState.uid, sleepState, sleepState);
5200
+ };
5201
+
5185
5202
  const commandMap = {
5186
5203
  'TitleBar.closeMenu': wrapCommand(closeMenu),
5187
5204
  'TitleBar.create': create,
@@ -5239,9 +5256,11 @@ const commandMap = {
5239
5256
  'TitleBar.setWidth': wrapCommand(setWidth),
5240
5257
  'TitleBar.showCommandCenter': wrapCommand(showCommandCenter),
5241
5258
  'TitleBar.showMenuBar': wrapCommand(showMenuBar),
5259
+ 'TitleBar.sleep': sleep,
5242
5260
  'TitleBar.terminate': terminate,
5243
5261
  'TitleBar.toggleIndex': wrapCommand(toggleIndex),
5244
- 'TitleBar.toggleMenu': wrapCommand(toggleMenu)
5262
+ 'TitleBar.toggleMenu': wrapCommand(toggleMenu),
5263
+ 'TitleBar.wakeUp': wakeUp
5245
5264
  };
5246
5265
 
5247
5266
  const listen = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "4.10.0",
3
+ "version": "4.12.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",