@lvce-editor/renderer-process 30.59.0 → 30.60.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.
@@ -2592,7 +2592,7 @@ const Span = 8;
2592
2592
  const Table = 9;
2593
2593
  const TBody = 10;
2594
2594
  const Td = 11;
2595
- const Text$1 = 12;
2595
+ const Text$2 = 12;
2596
2596
  const Th = 13;
2597
2597
  const THead = 14;
2598
2598
  const Tr = 15;
@@ -2733,7 +2733,7 @@ const VirtualDomElements = {
2733
2733
  THead,
2734
2734
  Table,
2735
2735
  Td,
2736
- Text: Text$1,
2736
+ Text: Text$2,
2737
2737
  TextArea,
2738
2738
  Tfoot,
2739
2739
  Th,
@@ -3432,7 +3432,7 @@ const {
3432
3432
  Polyline,
3433
3433
  Rect,
3434
3434
  Svg,
3435
- Text,
3435
+ Text: Text$1,
3436
3436
  Use,
3437
3437
  Reference} = VirtualDomElements;
3438
3438
 
@@ -3461,7 +3461,7 @@ const render$1 = (element, eventMap, newEventMap) => {
3461
3461
  switch (element.type) {
3462
3462
  case Reference:
3463
3463
  return renderReferenceNode(element, eventMap, newEventMap);
3464
- case Text:
3464
+ case Text$1:
3465
3465
  return renderDomTextNode(element);
3466
3466
  default:
3467
3467
  return renderDomElement(element, eventMap, newEventMap);
@@ -5355,6 +5355,32 @@ const start = async (id, options) => {
5355
5355
  }
5356
5356
  };
5357
5357
 
5358
+ // Wire protocol IDs shared with test-worker. Keep existing string callers compatible.
5359
+ const conditionNames = {
5360
+ 1: 'toBeFocused',
5361
+ 10: 'toHaveJSProperty',
5362
+ 11: 'toHaveText',
5363
+ 12: 'toHaveValue',
5364
+ 2: 'toBeHidden',
5365
+ 3: 'toBeVisible',
5366
+ 4: 'toContainText',
5367
+ 5: 'toHaveAttribute',
5368
+ 6: 'toHaveClass',
5369
+ 7: 'toHaveCount',
5370
+ 8: 'toHaveCss',
5371
+ 9: 'toHaveId'
5372
+ };
5373
+ const getConditionName = condition => {
5374
+ if (typeof condition === 'string') {
5375
+ return condition;
5376
+ }
5377
+ const name = conditionNames[condition];
5378
+ if (!name) {
5379
+ throw new Error(`unexpected condition type ${condition}`);
5380
+ }
5381
+ return name;
5382
+ };
5383
+
5358
5384
  const getEventClass = eventType => {
5359
5385
  switch (eventType) {
5360
5386
  case ContextMenu:
@@ -5447,6 +5473,11 @@ const ElementActions = {
5447
5473
  type
5448
5474
  };
5449
5475
 
5476
+ const Css = 1;
5477
+ const Text = 2;
5478
+ const HasText = 3;
5479
+ const Nth = 4;
5480
+
5450
5481
  const querySelectorByText = (root, text) => {
5451
5482
  let node;
5452
5483
  const elements = [];
@@ -5473,7 +5504,7 @@ const querySelectorByCssFromRoot = (root, selector) => {
5473
5504
  const selectorToString = parsedSelector => {
5474
5505
  let result = '';
5475
5506
  for (const part of parsedSelector) {
5476
- if (part.type === 'css') {
5507
+ if (part.type === Css || part.type === 'css') {
5477
5508
  if (!result) {
5478
5509
  result = part.selector;
5479
5510
  continue;
@@ -5481,7 +5512,7 @@ const selectorToString = parsedSelector => {
5481
5512
  result += ` >> ${part.selector}`;
5482
5513
  continue;
5483
5514
  }
5484
- if (part.type === 'text') {
5515
+ if (part.type === Text || part.type === 'text') {
5485
5516
  if (!result) {
5486
5517
  result = `text=${part.text}`;
5487
5518
  continue;
@@ -5489,11 +5520,13 @@ const selectorToString = parsedSelector => {
5489
5520
  result += ` text=${part.text}`;
5490
5521
  continue;
5491
5522
  }
5492
- if (part.type === 'has-text') {
5523
+ if (part.type === HasText || part.type === 'has-text') {
5493
5524
  result += ` "${part.text}"`;
5494
5525
  continue;
5495
5526
  }
5496
- result += `:nth(${part.index})`;
5527
+ if (part.type === Nth || part.type === 'nth') {
5528
+ result += `:nth(${part.index})`;
5529
+ }
5497
5530
  }
5498
5531
  return result;
5499
5532
  };
@@ -5503,23 +5536,23 @@ const querySelector = parsedSelector => {
5503
5536
  }
5504
5537
  let elements = [document.body];
5505
5538
  for (const part of parsedSelector) {
5506
- if (part.type === 'text') {
5539
+ if (part.type === Text || part.type === 'text') {
5507
5540
  elements = elements.flatMap(element => {
5508
5541
  return querySelectorByText(element, part.text);
5509
5542
  });
5510
5543
  continue;
5511
5544
  }
5512
- if (part.type === 'css') {
5545
+ if (part.type === Css || part.type === 'css') {
5513
5546
  elements = elements.flatMap(element => {
5514
5547
  return querySelectorByCssFromRoot(element, part.selector);
5515
5548
  });
5516
5549
  continue;
5517
5550
  }
5518
- if (part.type === 'has-text') {
5551
+ if (part.type === HasText || part.type === 'has-text') {
5519
5552
  elements = elements.filter(element => element.textContent === part.text);
5520
5553
  continue;
5521
5554
  }
5522
- if (part.type === 'nth') {
5555
+ if (part.type === Nth || part.type === 'nth') {
5523
5556
  const element = elements[part.index];
5524
5557
  elements = element ? [element] : [];
5525
5558
  continue;
@@ -6019,7 +6052,7 @@ const performKeyboardAction = (fnName, options) => {
6019
6052
  fn(options);
6020
6053
  };
6021
6054
  const checkSingleElementCondition = async (locator, fnName, options) => {
6022
- const fn = SingleElementConditions[fnName];
6055
+ const fn = SingleElementConditions[getConditionName(fnName)];
6023
6056
  const parsedSelector = getParsedSelector(locator);
6024
6057
  return waitForCondition(() => {
6025
6058
  const element = querySelectorOne(parsedSelector);
@@ -6027,7 +6060,7 @@ const checkSingleElementCondition = async (locator, fnName, options) => {
6027
6060
  });
6028
6061
  };
6029
6062
  const checkMultiElementCondition = async (locator, fnName, options) => {
6030
- const fn = MultiElementConditions[fnName];
6063
+ const fn = MultiElementConditions[getConditionName(fnName)];
6031
6064
  const parsedSelector = getParsedSelector(locator);
6032
6065
  return waitForCondition(() => {
6033
6066
  const elements = querySelector(parsedSelector);
@@ -6035,7 +6068,7 @@ const checkMultiElementCondition = async (locator, fnName, options) => {
6035
6068
  });
6036
6069
  };
6037
6070
  const checkConditionError = (fnName, ...params) => {
6038
- const fn = ConditionValues[fnName];
6071
+ const fn = ConditionValues[getConditionName(fnName)];
6039
6072
  return fn(...params);
6040
6073
  };
6041
6074
 
@@ -11754,6 +11787,7 @@ const createTerminal = async uid => {
11754
11787
  }] = await Promise.all([import('./xterm.js'), import('./xterm.js'), import('./xterm.js')]);
11755
11788
  const terminal = new Terminal({
11756
11789
  allowTransparency: true,
11790
+ altClickMovesCursor: false,
11757
11791
  cols: defaultColumns,
11758
11792
  convertEol: true,
11759
11793
  cursorBlink: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/renderer-process",
3
- "version": "30.59.0",
3
+ "version": "30.60.0",
4
4
  "keywords": [
5
5
  "lvce-editor",
6
6
  "renderer-process"