# speechkit/7.0.0/src/editor/components/inspect-panel/helpers.js

BeyondWords – AI audio for publishers, version 7.0.0. 56 lines.

- Page: https://pluginprobe.com/plugins/speechkit/7.0.0/code/src/editor/components/inspect-panel/helpers.js
- Raw: https://pluginprobe.com/plugins/speechkit/7.0.0/raw/src/editor/components/inspect-panel/helpers.js
- Modified: 2026-08-12T09:46:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/speechkit/7.0.0/code/src/editor/components/inspect-panel/helpers.js#L10-L20`.

```javascript
/**
 * WordPress dependencies
 */
import { __ } from '@wordpress/i18n';

// Always-present diagnostics appended to the copied payload only — never counted
// as removable post data. The data-key lists stay in PHP (single source of truth).
export const SYSTEM_META_KEYS = [
	'plugin_version',
	'wp_version',
	'wp_post_id',
];

/**
 * Does the post hold any BeyondWords data worth removing?
 *
 * Checks the data fields only (never the always-present system fields), so the
 * Remove button tracks the post's current state, not a mount-time snapshot.
 *
 * @param {Object}   meta     Live custom-field values keyed by field name.
 * @param {string[]} dataKeys Current + deprecated meta keys (sourced from PHP).
 * @return {boolean} Whether any data field has a non-empty value.
 */
export const hasBeyondwordsData = ( meta, dataKeys = [] ) =>
	dataKeys.some( ( key ) => !! meta[ key ]?.length );

/**
 * Build the plain-text diagnostics payload for the Copy button.
 *
 * Reads the same live `meta` as {@link hasBeyondwordsData} so Copy and Remove
 * can never disagree; the key lists render in the order supplied.
 *
 * @param {Object}   meta           Live values keyed by field name (incl. system).
 * @param {string[]} currentKeys    Current meta keys, in display order.
 * @param {string[]} deprecatedKeys Deprecated meta keys, in display order.
 * @return {string} The clipboard payload.
 */
export const getTextToCopy = (
	meta,
	currentKeys = [],
	deprecatedKeys = []
) => {
	const line = ( key ) => `${ key }\r\n${ meta[ key ] }`;

	return (
		[
			...currentKeys.map( line ),
			`=== ${ __( 'Deprecated', 'speechkit' ) } ===`,
			...deprecatedKeys.map( line ),
			`=== ${ __( 'System', 'speechkit' ) } ===`,
			...SYSTEM_META_KEYS.map( line ),
			`=== ${ __( 'Copied using the Block Editor', 'speechkit' ) } ===`,
		].join( '\r\n\r\n' ) + '\r\n\r\n'
	);
};

```
