Skip to content

Commit 598ce37

Browse files
committed
Merge remote-tracking branch 'origin/develop' into enhancement/12765-hide-widget.
2 parents 91fa60f + 909ce16 commit 598ce37

1,051 files changed

Lines changed: 3392 additions & 1753 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@
3535
"css",
3636
"scss"
3737
],
38-
"javascript.preferences.importModuleSpecifier": "non-relative"
38+
"javascript.preferences.importModuleSpecifier": "non-relative",
39+
"typescript.preferences.importModuleSpecifier": "non-relative"
3940
}

__mocks__/@react-pdf/renderer.js

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/**
2+
* `@react-pdf/renderer` jest mock.
3+
*
4+
* Site Kit by Google, Copyright 2026 Google LLC
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* https://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// Manual Jest mock for `@react-pdf/renderer`. The real package ships ESM
20+
// with native deps that fail in jsdom. CommonJS to match `__mocks__/tabbable.js`.
21+
22+
/**
23+
* External dependencies
24+
*/
25+
const React = require( 'react' );
26+
27+
function passthrough( name ) {
28+
function Component( props ) {
29+
return React.createElement(
30+
name.toLowerCase(),
31+
{ 'data-react-pdf': name, ...props },
32+
props && props.children
33+
);
34+
}
35+
Component.displayName = name;
36+
return Component;
37+
}
38+
39+
const Document = passthrough( 'Document' );
40+
const Page = passthrough( 'Page' );
41+
const View = passthrough( 'View' );
42+
const Text = passthrough( 'Text' );
43+
const Image = passthrough( 'Image' );
44+
const Link = passthrough( 'Link' );
45+
const Note = passthrough( 'Note' );
46+
const Canvas = passthrough( 'Canvas' );
47+
48+
const StyleSheet = {
49+
create: ( styles ) => styles,
50+
flatten: ( style ) => Object.assign( {}, ...[].concat( style || {} ) ),
51+
};
52+
53+
const Font = {
54+
register: jest.fn(),
55+
getRegisteredFonts: jest.fn( () => [] ),
56+
clear: jest.fn(),
57+
};
58+
59+
const pdf = jest.fn( () => ( {
60+
toBlob: jest.fn( () =>
61+
Promise.resolve(
62+
new Blob( [ 'mock-pdf' ], { type: 'application/pdf' } )
63+
)
64+
),
65+
toBuffer: jest.fn( () => Promise.resolve( Buffer.from( 'mock-pdf' ) ) ),
66+
toString: jest.fn( () => Promise.resolve( 'mock-pdf' ) ),
67+
updateContainer: jest.fn(),
68+
on: jest.fn(),
69+
} ) );
70+
71+
const PDFViewer = passthrough( 'PDFViewer' );
72+
const PDFDownloadLink = passthrough( 'PDFDownloadLink' );
73+
function BlobProvider( { children } ) {
74+
return typeof children === 'function'
75+
? children( { blob: null, url: null, loading: false, error: null } )
76+
: null;
77+
}
78+
79+
module.exports = {
80+
Document,
81+
Page,
82+
View,
83+
Text,
84+
Image,
85+
Link,
86+
Note,
87+
Canvas,
88+
StyleSheet,
89+
Font,
90+
pdf,
91+
PDFViewer,
92+
PDFDownloadLink,
93+
BlobProvider,
94+
__esModule: true,
95+
default: {
96+
Document,
97+
Page,
98+
View,
99+
Text,
100+
Image,
101+
Link,
102+
Note,
103+
Canvas,
104+
StyleSheet,
105+
Font,
106+
pdf,
107+
PDFViewer,
108+
PDFDownloadLink,
109+
BlobProvider,
110+
},
111+
};

assets/blocks/reader-revenue-manager/block-editor-plugin/plugin-registration.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import { registerStore as registerCoreModulesStore } from '@/js/googlesitekit/mo
5454
import { MODULE_SLUG_READER_REVENUE_MANAGER } from '@/js/modules/reader-revenue-manager/constants';
5555
import { registerStore as registerReaderRevenueManagerStore } from '@/js/modules/reader-revenue-manager/datastore';
5656
import { MODULES_READER_REVENUE_MANAGER } from '@/js/modules/reader-revenue-manager/datastore/constants';
57-
import { provideModules, provideUserInfo } from '../../../../tests/js/utils';
57+
import { provideModules, provideUserInfo } from '@tests/js/utils';
5858
import { registerReaderRevenueManagerPlugin } from './plugin-registration';
5959
import SettingPanel from './SettingPanel';
6060

assets/blocks/reader-revenue-manager/contribute-with-google/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 2,
44
"name": "google-site-kit/rrm-contribute-with-google",
5-
"version": "1.179.0",
5+
"version": "1.180.0",
66
"title": "Contribute with Google",
77
"category": "widgets",
88
"icon": "google",

assets/blocks/reader-revenue-manager/contribute-with-google/v3/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 3,
44
"name": "google-site-kit/rrm-contribute-with-google",
5-
"version": "1.179.0",
5+
"version": "1.180.0",
66
"title": "Contribute with Google",
77
"category": "widgets",
88
"icon": "google",

assets/blocks/reader-revenue-manager/subscribe-with-google/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 2,
44
"name": "google-site-kit/rrm-subscribe-with-google",
5-
"version": "1.179.0",
5+
"version": "1.180.0",
66
"title": "Subscribe with Google",
77
"category": "widgets",
88
"icon": "google",

assets/blocks/reader-revenue-manager/subscribe-with-google/v3/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 3,
44
"name": "google-site-kit/rrm-subscribe-with-google",
5-
"version": "1.179.0",
5+
"version": "1.180.0",
66
"title": "Subscribe with Google",
77
"category": "widgets",
88
"icon": "google",

assets/blocks/sign-in-with-google/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 2,
44
"name": "google-site-kit/sign-in-with-google",
5-
"version": "1.179.0",
5+
"version": "1.180.0",
66
"title": "Sign in with Google",
77
"category": "widgets",
88
"icon": "google",

assets/blocks/sign-in-with-google/v3/block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://schemas.wp.org/trunk/block.json",
33
"apiVersion": 3,
44
"name": "google-site-kit/sign-in-with-google",
5-
"version": "1.179.0",
5+
"version": "1.180.0",
66
"title": "Sign in with Google",
77
"category": "widgets",
88
"icon": "google",

assets/js/all-datastores.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { omit } from 'lodash';
2424
/**
2525
* Internal dependencies
2626
*/
27-
import { createTestRegistry } from '../../tests/js/utils';
27+
import { createTestRegistry } from '@tests/js/utils';
2828

2929
const registry = createTestRegistry();
3030
const firstPartyStores = omit( registry.stores, 'core/data' );

0 commit comments

Comments
 (0)