@lvce-editor/title-bar-worker 1.6.0 → 1.7.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.
@@ -864,6 +864,55 @@ const WebWorkerRpcClient = {
864
864
  create: create$2
865
865
  };
866
866
 
867
+ const RenderEntries = 1;
868
+ const RenderFocusedIndex = 2;
869
+ const RenderMenus = 3;
870
+
871
+ const diffType$2 = RenderEntries;
872
+ const isEqual$2 = (oldState, newState) => {
873
+ return oldState.titleBarEntries === newState.titleBarEntries && oldState.width === newState.width && oldState.focusedIndex === newState.focusedIndex && oldState.isMenuOpen === newState.isMenuOpen;
874
+ };
875
+
876
+ const DiffEntries = {
877
+ __proto__: null,
878
+ diffType: diffType$2,
879
+ isEqual: isEqual$2
880
+ };
881
+
882
+ const diffType$1 = RenderFocusedIndex;
883
+ const isEqual$1 = (oldState, newState) => {
884
+ return oldState.focusedIndex === newState.focusedIndex && oldState.isMenuOpen === newState.isMenuOpen;
885
+ };
886
+
887
+ const DiffFocusedIndex = {
888
+ __proto__: null,
889
+ diffType: diffType$1,
890
+ isEqual: isEqual$1
891
+ };
892
+
893
+ const diffType = RenderMenus;
894
+ const isEqual = (oldState, newState) => {
895
+ return oldState.menus === newState.menus;
896
+ };
897
+
898
+ const DiffMenus = {
899
+ __proto__: null,
900
+ diffType,
901
+ isEqual
902
+ };
903
+
904
+ const modules = [DiffFocusedIndex, DiffEntries, DiffMenus];
905
+
906
+ const diff = (oldState, newState) => {
907
+ const diffResult = [];
908
+ for (const module of modules) {
909
+ if (!module.isEqual(oldState, newState)) {
910
+ diffResult.push(module.diffType);
911
+ }
912
+ }
913
+ return diffResult;
914
+ };
915
+
867
916
  const Menu$1 = 'menu';
868
917
  const MenuBar = 'menubar';
869
918
  const MenuItem$1 = 'menuitem';
@@ -1187,10 +1236,10 @@ const parseKey = rawKey => {
1187
1236
 
1188
1237
  const Button = 1;
1189
1238
  const Div = 4;
1190
- const Span = 8;
1191
1239
  const Text = 12;
1192
1240
  const I = 16;
1193
1241
  const Img = 17;
1242
+ const Span = 8;
1194
1243
 
1195
1244
  const text = data => {
1196
1245
  return {
@@ -3185,6 +3234,7 @@ const commandMap = {
3185
3234
  'TitleBarMenuBar.getCommands': getCommandIds,
3186
3235
  'TitleBarMenuBar.getKeyBindings': getKeyBindings,
3187
3236
  'TitleBarMenuBar.getMenus': getMenus,
3237
+ 'TitleBarMenuBar.diff': diff,
3188
3238
  'TitleBarMenuBar.getVirtualDom': getTitleBarMenuBarVirtualDom,
3189
3239
  'TitleBarMenuBar.handleClick': wrapCommand(handleClick),
3190
3240
  'TitleBarMenuBar.handleFocus': wrapCommand(handleFocus),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",