@lvce-editor/renderer-process 18.0.0 → 18.1.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.
@@ -8120,72 +8120,6 @@ const handleContextMenu$1 = event => {
8120
8120
  return ['handleContextMenu', button, clientX, clientY];
8121
8121
  };
8122
8122
 
8123
- const create$5 = () => {
8124
- // TODO set aria label for title bar menu
8125
- // TODO add tests for aria properties
8126
- const $Viewlet = document.createElement('div');
8127
- $Viewlet.id = 'TitleBar';
8128
- $Viewlet.className = 'Viewlet TitleBar';
8129
- $Viewlet.ariaLabel = 'Title Bar';
8130
- $Viewlet.role = ContentInfo;
8131
- return {
8132
- $TitleBar: $Viewlet,
8133
- $Viewlet
8134
- };
8135
- };
8136
- const attachEvents = state => {
8137
- const {
8138
- $Viewlet
8139
- } = state;
8140
- attachEvents$9($Viewlet, {
8141
- [ContextMenu]: handleContextMenu$1
8142
- });
8143
- };
8144
- const activeClassName = 'TitleBarActive';
8145
- const setFocused = (state, isFocused) => {
8146
- const {
8147
- $Viewlet
8148
- } = state;
8149
- $Viewlet.classList.toggle(activeClassName, isFocused);
8150
- };
8151
-
8152
- const ViewletTitleBar = {
8153
- __proto__: null,
8154
- attachEvents,
8155
- create: create$5,
8156
- setFocused
8157
- };
8158
-
8159
- /**
8160
- *
8161
- * @param {MouseEvent} event
8162
- */
8163
- const handleTitleBarButtonsClick = event => {
8164
- const {
8165
- target
8166
- } = event;
8167
- return ['handleClick', target.className];
8168
- };
8169
- const returnValue$1 = true;
8170
-
8171
- const ViewletTitleBarButtonsEvents = {
8172
- __proto__: null,
8173
- handleTitleBarButtonsClick,
8174
- returnValue: returnValue$1
8175
- };
8176
-
8177
- const ViewletTitleBarButtons = {
8178
- __proto__: null,
8179
- Events: ViewletTitleBarButtonsEvents
8180
- };
8181
-
8182
- const Events = {};
8183
-
8184
- const ViewletTitleBarIcon = {
8185
- __proto__: null,
8186
- Events
8187
- };
8188
-
8189
8123
  const isInsideTitleBarMenu = $Element => {
8190
8124
  return $Element.classList.contains('MenuItem') || $Element.classList.contains('Menu') || $Element.classList.contains('TitleBarTopLevelEntry') || $Element.classList.contains('TitleBarMenuBar');
8191
8125
  };
@@ -8527,6 +8461,79 @@ const ViewletTitleBarMenuBar = {
8527
8461
  setMenus
8528
8462
  };
8529
8463
 
8464
+ const create$5 = () => {
8465
+ // TODO set aria label for title bar menu
8466
+ // TODO add tests for aria properties
8467
+ const $Viewlet = document.createElement('div');
8468
+ $Viewlet.id = 'TitleBar';
8469
+ $Viewlet.className = 'Viewlet TitleBar';
8470
+ $Viewlet.ariaLabel = 'Title Bar';
8471
+ $Viewlet.role = ContentInfo;
8472
+ return {
8473
+ $TitleBar: $Viewlet,
8474
+ $Viewlet
8475
+ };
8476
+ };
8477
+ const attachEvents = state => {
8478
+ const {
8479
+ $Viewlet
8480
+ } = state;
8481
+ attachEvents$9($Viewlet, {
8482
+ [ContextMenu]: handleContextMenu$1
8483
+ });
8484
+ };
8485
+ const activeClassName = 'TitleBarActive';
8486
+ const setFocused = (state, isFocused) => {
8487
+ const {
8488
+ $Viewlet
8489
+ } = state;
8490
+ $Viewlet.classList.toggle(activeClassName, isFocused);
8491
+ };
8492
+
8493
+ const ViewletTitleBar = {
8494
+ __proto__: null,
8495
+ Events: ViewletTitleBarMenuBarEvents,
8496
+ attachEvents,
8497
+ closeMenu,
8498
+ create: create$5,
8499
+ dispose: dispose$4,
8500
+ focus: focus$2,
8501
+ openMenu,
8502
+ setFocused,
8503
+ setFocusedIndex,
8504
+ setMenus
8505
+ };
8506
+
8507
+ /**
8508
+ *
8509
+ * @param {MouseEvent} event
8510
+ */
8511
+ const handleTitleBarButtonsClick = event => {
8512
+ const {
8513
+ target
8514
+ } = event;
8515
+ return ['handleClick', target.className];
8516
+ };
8517
+ const returnValue$1 = true;
8518
+
8519
+ const ViewletTitleBarButtonsEvents = {
8520
+ __proto__: null,
8521
+ handleTitleBarButtonsClick,
8522
+ returnValue: returnValue$1
8523
+ };
8524
+
8525
+ const ViewletTitleBarButtons = {
8526
+ __proto__: null,
8527
+ Events: ViewletTitleBarButtonsEvents
8528
+ };
8529
+
8530
+ const Events = {};
8531
+
8532
+ const ViewletTitleBarIcon = {
8533
+ __proto__: null,
8534
+ Events
8535
+ };
8536
+
8530
8537
  const create$4 = () => {
8531
8538
  const $Viewlet = document.createElement('div');
8532
8539
  $Viewlet.className = 'Viewlet TitleBarTitle';
@@ -8823,7 +8830,7 @@ const create$3 = (id, uid = id) => {
8823
8830
  const createFunctionalRoot = (id, uid = id, hasFunctionalEvents) => {
8824
8831
  let module = state$1.modules[id];
8825
8832
  if (hasFunctionalEvents) {
8826
- module = {};
8833
+ module ||= {};
8827
8834
  }
8828
8835
  if (!module) {
8829
8836
  throw new Error(`module not found: ${id}`);
@@ -10165,6 +10172,7 @@ const main = async () => {
10165
10172
  state$1.modules[EditorRename] = ViewletEditorRename;
10166
10173
  state$1.modules[EditorSourceActions] = ViewletEditorSourceActions;
10167
10174
  state$1.modules[FindWidget] = ViewletFindWidget;
10175
+ state$1.modules[TitleBar] = ViewletTitleBar;
10168
10176
  // TODO this is discovered very late
10169
10177
  await launchWorkers();
10170
10178
  setIpc(RendererWorker);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "18.0.0",
3
+ "version": "18.1.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"