@lvce-editor/title-bar-worker 2.17.0 → 2.18.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.
- package/dist/titleBarWorkerMain.js +17 -19
- package/package.json +1 -1
|
@@ -1149,10 +1149,11 @@ const {
|
|
|
1149
1149
|
set: set$3,
|
|
1150
1150
|
getCommandIds,
|
|
1151
1151
|
registerCommands,
|
|
1152
|
-
wrapCommand
|
|
1152
|
+
wrapCommand,
|
|
1153
|
+
wrapGetter
|
|
1153
1154
|
} = create$2();
|
|
1154
1155
|
|
|
1155
|
-
const create3 = (id, uri, x, y, width, height, platform, controlsOverlayEnabled, titleBarStyleCustom) => {
|
|
1156
|
+
const create3 = (id, uri, x, y, width, height, platform, controlsOverlayEnabled, titleBarStyleCustom, assetDir) => {
|
|
1156
1157
|
const titleBarButtons = getTitleBarButtons(platform, controlsOverlayEnabled, titleBarStyleCustom);
|
|
1157
1158
|
const state = {
|
|
1158
1159
|
...createDefaultState(),
|
|
@@ -1175,10 +1176,10 @@ const create3 = (id, uri, x, y, width, height, platform, controlsOverlayEnabled,
|
|
|
1175
1176
|
platform,
|
|
1176
1177
|
controlsOverlayEnabled,
|
|
1177
1178
|
titleBarStyleCustom,
|
|
1178
|
-
titleBarButtons
|
|
1179
|
+
titleBarButtons,
|
|
1180
|
+
assetDir
|
|
1179
1181
|
};
|
|
1180
1182
|
set$3(id, state, state);
|
|
1181
|
-
return state;
|
|
1182
1183
|
};
|
|
1183
1184
|
|
|
1184
1185
|
const RenderEntries = 1;
|
|
@@ -1189,12 +1190,10 @@ const isEqual$3 = (oldState, newState) => {
|
|
|
1189
1190
|
return oldState.titleBarEntries === newState.titleBarEntries && oldState.width === newState.width && oldState.focusedIndex === newState.focusedIndex && oldState.isMenuOpen === newState.isMenuOpen;
|
|
1190
1191
|
};
|
|
1191
1192
|
|
|
1192
|
-
const diffType$2 = RenderFocusedIndex;
|
|
1193
1193
|
const isEqual$2 = (oldState, newState) => {
|
|
1194
1194
|
return oldState.focusedIndex === newState.focusedIndex && oldState.isMenuOpen === newState.isMenuOpen;
|
|
1195
1195
|
};
|
|
1196
1196
|
|
|
1197
|
-
const diffType$1 = RenderMenus;
|
|
1198
1197
|
const isEqual$1 = (oldState, newState) => {
|
|
1199
1198
|
return oldState.menus === newState.menus;
|
|
1200
1199
|
};
|
|
@@ -1221,13 +1220,12 @@ const diff2 = uid => {
|
|
|
1221
1220
|
return diff(oldState, newState);
|
|
1222
1221
|
};
|
|
1223
1222
|
|
|
1224
|
-
const diffType = RenderEntries;
|
|
1225
1223
|
const isEqual = (oldState, newState) => {
|
|
1226
1224
|
return oldState.titleBarEntries === newState.titleBarEntries && oldState.width === newState.width && oldState.focusedIndex === newState.focusedIndex && oldState.isMenuOpen === newState.isMenuOpen && oldState.assetDir === newState.assetDir && oldState.titleBarIconEnabled === newState.titleBarIconEnabled && oldState.title === newState.title && oldState.titleBarTitleEnabled === newState.titleBarTitleEnabled && oldState.platform === newState.platform && oldState.controlsOverlayEnabled === newState.controlsOverlayEnabled && oldState.titleBarStyleCustom === newState.titleBarStyleCustom && oldState.titleBarButtonsEnabled === newState.titleBarButtonsEnabled && oldState.titleBarButtons === newState.titleBarButtons;
|
|
1227
1225
|
};
|
|
1228
1226
|
|
|
1229
1227
|
const modules = [isEqual, isEqual$2, isEqual$1];
|
|
1230
|
-
const numbers = [
|
|
1228
|
+
const numbers = [RenderEntries, RenderFocusedIndex, RenderMenus];
|
|
1231
1229
|
|
|
1232
1230
|
const diff3 = uid => {
|
|
1233
1231
|
const {
|
|
@@ -1548,6 +1546,8 @@ const parseKey = rawKey => {
|
|
|
1548
1546
|
const DebugWorker = 55;
|
|
1549
1547
|
const RendererWorker$1 = 1;
|
|
1550
1548
|
|
|
1549
|
+
const FocusTitleBarMenuBar = 26;
|
|
1550
|
+
|
|
1551
1551
|
const mergeClassNames = (...classNames) => {
|
|
1552
1552
|
return classNames.filter(Boolean).join(' ');
|
|
1553
1553
|
};
|
|
@@ -1564,8 +1564,6 @@ const text = data => {
|
|
|
1564
1564
|
};
|
|
1565
1565
|
};
|
|
1566
1566
|
|
|
1567
|
-
const FocusTitleBarMenuBar = 26;
|
|
1568
|
-
|
|
1569
1567
|
const getKeyBindings$1 = () => {
|
|
1570
1568
|
return [{
|
|
1571
1569
|
key: DownArrow$1,
|
|
@@ -2543,7 +2541,7 @@ const TitleBarButtons = 'TitleBarButtons';
|
|
|
2543
2541
|
const TitleBarEntryActive = 'TitleBarEntryActive';
|
|
2544
2542
|
const TitleBarIcon = 'TitleBarIcon';
|
|
2545
2543
|
const TitleBarIconIcon = 'TitleBarIconIcon';
|
|
2546
|
-
const TitleBarMenuBar
|
|
2544
|
+
const TitleBarMenuBar = 'TitleBarMenuBar';
|
|
2547
2545
|
const TitleBarTopLevelEntry = 'TitleBarTopLevelEntry';
|
|
2548
2546
|
const TitleBarTopLevelEntryLabel = 'TitleBarTopLevelEntryLabel';
|
|
2549
2547
|
const Viewlet = 'Viewlet';
|
|
@@ -2653,7 +2651,7 @@ const activeId = 'TitleBarEntryActive';
|
|
|
2653
2651
|
const getTitleBarMenuBarVirtualDom = (visibleItems, focusedIndex) => {
|
|
2654
2652
|
return [{
|
|
2655
2653
|
type: Div,
|
|
2656
|
-
className: mergeClassNames(Viewlet, TitleBarMenuBar
|
|
2654
|
+
className: mergeClassNames(Viewlet, TitleBarMenuBar),
|
|
2657
2655
|
role: MenuBar,
|
|
2658
2656
|
tabIndex: 0,
|
|
2659
2657
|
childCount: visibleItems.length,
|
|
@@ -3540,9 +3538,12 @@ const resize = async (state, dimensions) => {
|
|
|
3540
3538
|
};
|
|
3541
3539
|
};
|
|
3542
3540
|
|
|
3543
|
-
const saveState =
|
|
3541
|
+
const saveState = state => {
|
|
3542
|
+
const {
|
|
3543
|
+
focusedIndex
|
|
3544
|
+
} = state;
|
|
3544
3545
|
return {
|
|
3545
|
-
|
|
3546
|
+
focusedIndex
|
|
3546
3547
|
};
|
|
3547
3548
|
};
|
|
3548
3549
|
|
|
@@ -3675,11 +3676,8 @@ const setFocus = async focusKey => {
|
|
|
3675
3676
|
await invoke('Focus.setFocus', focusKey);
|
|
3676
3677
|
};
|
|
3677
3678
|
|
|
3678
|
-
// TODO remove this file and merge with whenExpressions
|
|
3679
|
-
const TitleBarMenuBar = FocusTitleBarMenuBar;
|
|
3680
|
-
|
|
3681
3679
|
const handleFocus = async state => {
|
|
3682
|
-
await setFocus(
|
|
3680
|
+
await setFocus(FocusTitleBarMenuBar);
|
|
3683
3681
|
return state;
|
|
3684
3682
|
};
|
|
3685
3683
|
|
|
@@ -4109,7 +4107,7 @@ const commandMap = {
|
|
|
4109
4107
|
'TitleBar.render3': render3,
|
|
4110
4108
|
'TitleBar.renderEventListeners': renderEventListeners,
|
|
4111
4109
|
'TitleBar.resize': wrapCommand(resize),
|
|
4112
|
-
'TitleBar.saveState': saveState,
|
|
4110
|
+
'TitleBar.saveState': wrapGetter(saveState),
|
|
4113
4111
|
'TitleBar.terminate': terminate,
|
|
4114
4112
|
'TitleBar.toggleIndex': wrapCommand(toggleIndex),
|
|
4115
4113
|
'TitleBar.toggleMenu': wrapCommand(toggleMenu)
|