jj 3.0.0-rc.7 → 3.0.0-rc.9

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/lib/bundle.cjs CHANGED
@@ -268,9 +268,9 @@ var _JJET = class _JJET {
268
268
  * @example
269
269
  * ```ts
270
270
  * node
271
- * .run(function (context) {
271
+ * .run(function (jjContext) {
272
272
  * console.log(this.ref)
273
- * console.log(context.ref)
273
+ * console.log(jjContext.ref)
274
274
  * })
275
275
  * .trigger(new Event('ready'))
276
276
  * ```
@@ -1732,6 +1732,50 @@ var JJE = class _JJE extends JJNx {
1732
1732
  enable() {
1733
1733
  return this.rmAttr("disabled", "aria-disabled");
1734
1734
  }
1735
+ /**
1736
+ * Gets the text content of the Element.
1737
+ *
1738
+ * @remarks
1739
+ * This method operates on `textContent`. The method name is kept short for convenience.
1740
+ *
1741
+ * For HTML-only rendering-aware text behavior (layout-aware whitespace and line breaks),
1742
+ * use `jjEl.ref.innerText` on `JJHE` wrappers.
1743
+ *
1744
+ * This method exists on element wrappers (`JJE`, `JJHE`, `JJSE`, `JJME`) and does not
1745
+ * apply to `JJD` (Document wrapper). Per MDN, `Document.textContent` and
1746
+ * `DocumentType.textContent` are `null`; for full document text, use one of the following:
1747
+ * - `document.documentElement.textContent`
1748
+ * - `jjDoc.ref.documentElement.textContent`
1749
+ * - `JJE.from(document.documentElement).getText()`.
1750
+ *
1751
+ * @returns The text content, or an empty string when `textContent` is null.
1752
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent | Node.textContent}
1753
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText | HTMLElement.innerText}
1754
+ */
1755
+ getText() {
1756
+ return this.ref.textContent ?? "";
1757
+ }
1758
+ /**
1759
+ * Sets the text content of the Element.
1760
+ *
1761
+ * @remarks
1762
+ * This method operates on `textContent`. The method name is kept short for convenience.
1763
+ * Pass an empty string, `null`, or `undefined` to clear the content.
1764
+ * Numbers and booleans are automatically converted to strings by the DOM.
1765
+ *
1766
+ * For HTML-only rendering-aware text behavior (for example preserving line breaks via
1767
+ * `innerText`), use `jjEl.ref.innerText = 'Hello\nworld!'` on a `JJHE` wrapper.
1768
+ *
1769
+ * @param text - The text to set, or null/undefined to clear.
1770
+ * @returns This instance for chaining.
1771
+ * @see {@link getText} for reading text content.
1772
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent | Node.textContent}
1773
+ * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText | HTMLElement.innerText}
1774
+ */
1775
+ setText(text) {
1776
+ this.ref.textContent = text;
1777
+ return this;
1778
+ }
1735
1779
  /**
1736
1780
  * Gets the inner HTML of the Element.
1737
1781
  *
@@ -2269,34 +2313,6 @@ var JJHE = class _JJHE extends JJEx {
2269
2313
  this.ref.click();
2270
2314
  return this;
2271
2315
  }
2272
- /**
2273
- * Gets the inner text of the HTMLElement.
2274
- *
2275
- * @remarks
2276
- * This method operates on `innerText`. The method name is kept short for convenience.
2277
- *
2278
- * @returns The inner text.
2279
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText | HTMLElement.innerText}
2280
- */
2281
- getText() {
2282
- return this.ref.innerText;
2283
- }
2284
- /**
2285
- * Sets the inner text of the HTMLElement.
2286
- *
2287
- * @remarks
2288
- * This method operates on `innerText`. The method name is kept short for convenience.
2289
- * Pass an empty string, `null`, or `undefined` to clear the content.
2290
- * Numbers and booleans are automatically converted to strings.
2291
- *
2292
- * @param text - The text to set, or null/undefined to clear.
2293
- * @returns This instance for chaining.
2294
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/innerText | HTMLElement.innerText}
2295
- */
2296
- setText(text) {
2297
- this.ref.innerText = text;
2298
- return this;
2299
- }
2300
2316
  };
2301
2317
 
2302
2318
  // src/wrappers/JJT.ts
@@ -2546,46 +2562,6 @@ var JJME = class _JJME extends JJEx {
2546
2562
  }
2547
2563
  super(ref);
2548
2564
  }
2549
- /**
2550
- * Gets the text content of the MathMLElement.
2551
- *
2552
- * @remarks
2553
- * This method operates on `textContent`. The method name is kept short for convenience.
2554
- *
2555
- * @example
2556
- * ```ts
2557
- * const text = math.getText()
2558
- * ```
2559
- *
2560
- * @returns The text content.
2561
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent | Node.textContent}
2562
- */
2563
- getText() {
2564
- return this.ref.textContent ?? "";
2565
- }
2566
- /**
2567
- * Sets the text content of the MathMLElement.
2568
- *
2569
- * @remarks
2570
- * This method operates on `textContent`. The method name is kept short for convenience.
2571
- * Pass an empty string, `null`, or `undefined` to clear the content.
2572
- * Numbers and booleans are automatically converted to strings.
2573
- *
2574
- * @example
2575
- * ```ts
2576
- * mi.setText('x')
2577
- * mi.setText(null) // Clear content
2578
- * mi.setText(42) // Numbers are converted
2579
- * ```
2580
- *
2581
- * @param text - The text to set, or null/undefined to clear.
2582
- * @returns This instance for chaining.
2583
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent | Node.textContent}
2584
- */
2585
- setText(text) {
2586
- this.ref.textContent = text;
2587
- return this;
2588
- }
2589
2565
  };
2590
2566
 
2591
2567
  // src/wrappers/JJSE.ts
@@ -2674,46 +2650,6 @@ var JJSE = class _JJSE extends JJEx {
2674
2650
  }
2675
2651
  super(ref);
2676
2652
  }
2677
- /**
2678
- * Gets the text content of the SVGElement.
2679
- *
2680
- * @remarks
2681
- * This method operates on `textContent`. The method name is kept short for convenience.
2682
- *
2683
- * @example
2684
- * ```ts
2685
- * const text = svg.getText()
2686
- * ```
2687
- *
2688
- * @returns The text content.
2689
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent | Node.textContent}
2690
- */
2691
- getText() {
2692
- return this.ref.textContent ?? "";
2693
- }
2694
- /**
2695
- * Sets the text content of the SVGElement.
2696
- *
2697
- * @remarks
2698
- * This method operates on `textContent`. The method name is kept short for convenience.
2699
- * Pass an empty string, `null`, or `undefined` to clear the content.
2700
- * Numbers and booleans are automatically converted to strings.
2701
- *
2702
- * @example
2703
- * ```ts
2704
- * svg.setText('Hello SVG')
2705
- * svg.setText(null) // Clear content
2706
- * svg.setText(42) // Numbers are converted
2707
- * ```
2708
- *
2709
- * @param text - The text to set, or null/undefined to clear.
2710
- * @returns This instance for chaining.
2711
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent | Node.textContent}
2712
- */
2713
- setText(text) {
2714
- this.ref.textContent = text;
2715
- return this;
2716
- }
2717
2653
  /**
2718
2654
  * Sets the fill attribute.
2719
2655
  *