@lvce-editor/title-bar-worker 2.10.0 → 2.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.
@@ -1274,6 +1274,8 @@ const DownArrow$2 = 16;
1274
1274
  const CtrlCmd = 1 << 11 >>> 0;
1275
1275
  const Shift = 1 << 10 >>> 0;
1276
1276
 
1277
+ const TitleBar$1 = 15;
1278
+
1277
1279
  const DebugWorker = 55;
1278
1280
  const RendererWorker$1 = 1;
1279
1281
 
@@ -2311,13 +2313,13 @@ const getTitleBarButtonsVirtualDom = buttons => {
2311
2313
  }, ...buttons.flatMap(createTitleBarButton)];
2312
2314
  };
2313
2315
 
2314
- const parentNode = {
2316
+ const parentNode$1 = {
2315
2317
  type: Div,
2316
2318
  className: mergeClassNames(Viewlet, TitleBarIcon),
2317
2319
  childCount: 1
2318
2320
  };
2319
2321
  const getTitleBarIconVirtualDom = iconSrc => {
2320
- return [parentNode, {
2322
+ return [parentNode$1, {
2321
2323
  type: Img,
2322
2324
  className: TitleBarIconIcon,
2323
2325
  src: iconSrc,
@@ -2395,8 +2397,13 @@ const getTitleBarMenuBarVirtualDom = (visibleItems, focusedIndex) => {
2395
2397
  }, ...getTitleBarMenuBarItemsVirtualDom(visibleItems)];
2396
2398
  };
2397
2399
 
2400
+ const parentNode = {
2401
+ type: Div,
2402
+ className: 'TitleBarTitle',
2403
+ childCount: 1
2404
+ };
2398
2405
  const getTitleVirtualDom = title => {
2399
- return [text(title)];
2406
+ return [parentNode, text(title)];
2400
2407
  };
2401
2408
 
2402
2409
  const maximize = async () => {
@@ -2737,6 +2744,29 @@ const addWidths = (entries, labelPadding, fontWeight, fontSize, fontFamily, lett
2737
2744
  return withWidths;
2738
2745
  };
2739
2746
 
2747
+ const loadContent2 = async state => {
2748
+ const {
2749
+ platform,
2750
+ controlsOverlayEnabled,
2751
+ titleBarStyleCustom,
2752
+ labelFontFamily,
2753
+ labelFontSize,
2754
+ labelFontWeight,
2755
+ labelLetterSpacing,
2756
+ labelPadding
2757
+ } = state;
2758
+ const titleBarEntries = await getMenuEntries(TitleBar$1);
2759
+ const withWidths = addWidths(titleBarEntries, labelPadding, labelFontWeight, labelFontSize, labelFontFamily, labelLetterSpacing);
2760
+ const buttons = getTitleBarButtons(platform, controlsOverlayEnabled, titleBarStyleCustom);
2761
+ const title = 'test';
2762
+ return {
2763
+ ...state,
2764
+ titleBarEntries: withWidths,
2765
+ buttons,
2766
+ title
2767
+ };
2768
+ };
2769
+
2740
2770
  const loadContent = async (state, titleBarEntries) => {
2741
2771
  const {
2742
2772
  platform,
@@ -3372,6 +3402,14 @@ const getTitleBarVirtualDom = state => {
3372
3402
  titleBarButtons
3373
3403
  } = state;
3374
3404
  const dom = [];
3405
+ dom.push({
3406
+ type: Div,
3407
+ className: 'Viewlet TitleBar',
3408
+ id: 'TitleBar',
3409
+ role: 'contentinfo',
3410
+ ariaLabel: 'Title Bar',
3411
+ childCount: 4
3412
+ });
3375
3413
 
3376
3414
  // Add icon if enabled
3377
3415
  if (state.titleBarIconEnabled) {
@@ -3987,6 +4025,7 @@ const commandMap = {
3987
4025
  'TitleBar.getMenuEntries': getMenuEntries$1,
3988
4026
  'TitleBar.getMenuIds': getMenuIds,
3989
4027
  'TitleBar.getTitleVirtualDom': getTitleVirtualDom,
4028
+ 'TitleBar.loadContent2': wrapCommand(loadContent2),
3990
4029
  'TitleBar.handleButtonsClick': handleClick$1,
3991
4030
  'TitleBar.handleClickClose': wrapCommand(handleClickClose),
3992
4031
  'TitleBar.handleClickMinimize': wrapCommand(handleClickMinimize),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/title-bar-worker",
3
- "version": "2.10.0",
3
+ "version": "2.12.0",
4
4
  "description": "Title Bar Worker",
5
5
  "repository": {
6
6
  "type": "git",