Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
26 lines
1.5 KiB
TypeScript
26 lines
1.5 KiB
TypeScript
import { CLSReportCallback, MetricRatingThresholds, ReportOpts } from './types.js';
|
|
/** Thresholds for CLS. See https://web.dev/articles/cls#what_is_a_good_cls_score */
|
|
export declare const CLSThresholds: MetricRatingThresholds;
|
|
/**
|
|
* Calculates the [CLS](https://web.dev/articles/cls) value for the current page and
|
|
* calls the `callback` function once the value is ready to be reported, along
|
|
* with all `layout-shift` performance entries that were used in the metric
|
|
* value calculation. The reported value is a `double` (corresponding to a
|
|
* [layout shift score](https://web.dev/articles/cls#layout_shift_score)).
|
|
*
|
|
* If the `reportAllChanges` configuration option is set to `true`, the
|
|
* `callback` function will be called as soon as the value is initially
|
|
* determined as well as any time the value changes throughout the page
|
|
* lifespan.
|
|
*
|
|
* _**Important:** CLS should be continually monitored for changes throughout
|
|
* the entire lifespan of a page—including if the user returns to the page after
|
|
* it's been hidden/backgrounded. However, since browsers often [will not fire
|
|
* additional callbacks once the user has backgrounded a
|
|
* page](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden),
|
|
* `callback` is always called when the page's visibility state changes to
|
|
* hidden. As a result, the `callback` function might be called multiple times
|
|
* during the same page load._
|
|
*/
|
|
export declare const onCLS: (onReport: CLSReportCallback, opts?: ReportOpts) => void;
|