pptx-angular-viewer 1.1.38 → 1.1.40

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.
@@ -14768,7 +14768,7 @@ function deleteTableColumn(tableData, colIdx) {
14768
14768
  * const updated = setCellText(el, 0, 1, "Revenue");
14769
14769
  * ```
14770
14770
  */
14771
- function setCellText$1(element, rowIndex, colIndex, text) {
14771
+ function setCellText(element, rowIndex, colIndex, text) {
14772
14772
  const tableData = element.tableData;
14773
14773
  if (!tableData) {
14774
14774
  return element;
@@ -25518,6 +25518,13 @@ function createTouchGestureRecognizer(config) {
25518
25518
  // Swipe state.
25519
25519
  let swipeStartX = 0;
25520
25520
  let swipeStartY = 0;
25521
+ // Most recent single-finger position. Lets a swipe still be measured when
25522
+ // `touchend` arrives with an empty `changedTouches` list (some synthetic
25523
+ // dispatchers, e.g. CDP `Input.dispatchTouchEvent`, omit it). Real
25524
+ // browsers always populate `changedTouches`, so their behaviour is
25525
+ // unchanged.
25526
+ let swipeLastX = 0;
25527
+ let swipeLastY = 0;
25521
25528
  // Long-press state.
25522
25529
  let longPressTimer = null;
25523
25530
  let longPressStartX = 0;
@@ -25541,6 +25548,8 @@ function createTouchGestureRecognizer(config) {
25541
25548
  // Potential swipe or long-press.
25542
25549
  swipeStartX = e.touches[0].clientX;
25543
25550
  swipeStartY = e.touches[0].clientY;
25551
+ swipeLastX = swipeStartX;
25552
+ swipeLastY = swipeStartY;
25544
25553
  longPressStartX = e.touches[0].clientX;
25545
25554
  longPressStartY = e.touches[0].clientY;
25546
25555
  cancelLongPress();
@@ -25561,6 +25570,8 @@ function createTouchGestureRecognizer(config) {
25561
25570
  }
25562
25571
  }
25563
25572
  else if (e.touches.length === 1) {
25573
+ swipeLastX = e.touches[0].clientX;
25574
+ swipeLastY = e.touches[0].clientY;
25564
25575
  // Cancel the long-press if the finger moved too far.
25565
25576
  const dx = e.touches[0].clientX - longPressStartX;
25566
25577
  const dy = e.touches[0].clientY - longPressStartY;
@@ -25577,10 +25588,13 @@ function createTouchGestureRecognizer(config) {
25577
25588
  return;
25578
25589
  }
25579
25590
  cancelLongPress();
25580
- // Detect a swipe from the touch that just ended.
25581
- if (e.changedTouches.length === 1 && e.touches.length === 0) {
25582
- const endX = e.changedTouches[0].clientX;
25583
- const endY = e.changedTouches[0].clientY;
25591
+ // Detect a swipe from the touch that just ended, but only once every
25592
+ // finger is up. Prefer the lifted touch's coordinates; fall back to the
25593
+ // last tracked move position when `changedTouches` is empty (synthetic
25594
+ // dispatchers), so a swipe is not silently dropped.
25595
+ if (e.touches.length === 0) {
25596
+ const endX = e.changedTouches.length >= 1 ? e.changedTouches[0].clientX : swipeLastX;
25597
+ const endY = e.changedTouches.length >= 1 ? e.changedTouches[0].clientY : swipeLastY;
25584
25598
  const deltaX = endX - swipeStartX;
25585
25599
  const deltaY = endY - swipeStartY;
25586
25600
  if (Math.abs(deltaX) >= SWIPE_THRESHOLD_PX && Math.abs(deltaY) < SWIPE_MAX_VERTICAL_PX) {
@@ -35983,6 +35997,11 @@ function inputValue(event) {
35983
35997
  *
35984
35998
  * @module angular-viewer/table-data-helpers
35985
35999
  */
36000
+ // `setCellText` is the framework-agnostic single-cell text edit. It lives in
36001
+ // `pptx-viewer-shared` (`render/table-cell-edit`) so the three bindings share
36002
+ // one copy; Angular consumes the vendored, inlined copy under
36003
+ // `../internal/shared-src`. Re-exported here so existing consumers and the
36004
+ // colocated test keep importing it from this module unchanged.
35986
36005
  // ---------------------------------------------------------------------------
35987
36006
  // Internal utilities
35988
36007
  // ---------------------------------------------------------------------------
@@ -36019,39 +36038,6 @@ function clearAllMerges(rows) {
36019
36038
  }));
36020
36039
  }
36021
36040
  // ---------------------------------------------------------------------------
36022
- // setCellText
36023
- // ---------------------------------------------------------------------------
36024
- /**
36025
- * Return a new `TablePptxElement` with the text of a single cell updated.
36026
- *
36027
- * @param element - The source table element (not mutated).
36028
- * @param rowIndex - Zero-based row index.
36029
- * @param colIndex - Zero-based column index.
36030
- * @param text - New text content for the cell.
36031
- * @returns A new `TablePptxElement`.
36032
- *
36033
- * @example
36034
- * ```ts
36035
- * const updated = setCellText(el, 0, 1, "Revenue");
36036
- * ```
36037
- */
36038
- function setCellText(element, rowIndex, colIndex, text) {
36039
- const tableData = element.tableData;
36040
- if (!tableData) {
36041
- return element;
36042
- }
36043
- const rows = tableData.rows.map((row, ri) => {
36044
- if (ri !== rowIndex) {
36045
- return row;
36046
- }
36047
- return {
36048
- ...row,
36049
- cells: row.cells.map((cell, ci) => (ci === colIndex ? { ...cell, text } : cell)),
36050
- };
36051
- });
36052
- return { ...element, tableData: { ...tableData, rows } };
36053
- }
36054
- // ---------------------------------------------------------------------------
36055
36041
  // addTableRow
36056
36042
  // ---------------------------------------------------------------------------
36057
36043
  /**