@baseline-ui/test-utils 3.0.0 → 3.1.0
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/client/index.d.mts +1 -1
- package/client/index.d.ts +1 -1
- package/client/index.js +3 -3
- package/client/index.mjs +3 -3
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/package.json +2 -2
- package/sbom.json +6 -6
package/client/index.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { StylingProps, I18nProviderProps, ThemeProviderProps } from '@baseline-ui/core';
|
|
3
3
|
import { FrameComponentProps } from 'react-frame-component';
|
|
4
4
|
|
|
5
|
-
declare const IFrame: React.ForwardRefExoticComponent<
|
|
5
|
+
declare const IFrame: React.ForwardRefExoticComponent<IFrameProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
6
6
|
interface IFrameProps extends FrameComponentProps, Omit<React.IframeHTMLAttributes<HTMLIFrameElement>, keyof FrameComponentProps>, StylingProps {
|
|
7
7
|
}
|
|
8
8
|
declare const ShadowRoot: React.ForwardRefExoticComponent<ShadowRootProps & React.RefAttributes<HTMLDivElement>>;
|
package/client/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { StylingProps, I18nProviderProps, ThemeProviderProps } from '@baseline-ui/core';
|
|
3
3
|
import { FrameComponentProps } from 'react-frame-component';
|
|
4
4
|
|
|
5
|
-
declare const IFrame: React.ForwardRefExoticComponent<
|
|
5
|
+
declare const IFrame: React.ForwardRefExoticComponent<IFrameProps & React.RefAttributes<HTMLIFrameElement>>;
|
|
6
6
|
interface IFrameProps extends FrameComponentProps, Omit<React.IframeHTMLAttributes<HTMLIFrameElement>, keyof FrameComponentProps>, StylingProps {
|
|
7
7
|
}
|
|
8
8
|
declare const ShadowRoot: React.ForwardRefExoticComponent<ShadowRootProps & React.RefAttributes<HTMLDivElement>>;
|
package/client/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var core=require('@baseline-ui/core'),m=require('react'),
|
|
1
|
+
'use strict';var core=require('@baseline-ui/core'),m=require('react'),C=require('react-dom/client'),F=require('react-frame-component'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);var C__default=/*#__PURE__*/_interopDefault(C);var F__default=/*#__PURE__*/_interopDefault(F);/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
function
|
|
11
|
-
`)}var
|
|
10
|
+
function R(){let r=[],t=document;for(let o=0;o<t.styleSheets.length;o++){let n=t.styleSheets[o];if(n.cssRules){let c=n.cssRules;for(let a of c)r.push(a.cssText);}}return r.join(`
|
|
11
|
+
`)}var b=m__default.default.forwardRef(({head:r=jsxRuntime.jsx("style",{children:R()}),...t},o)=>jsxRuntime.jsx(F__default.default,{style:{width:"100vw",height:"100vh",border:"none"},ref:o,...t,head:r}));b.displayName="IFrame";var w=m__default.default.forwardRef(({children:r,style:t},o)=>{let n=core.useObjectRef(o),c=m__default.default.useRef(null),a=m__default.default.useRef(null),u=m__default.default.useRef(null),l=m__default.default.useRef(false),f=m__default.default.useMemo(()=>R(),[]);return m.useEffect(()=>{if(l.current=false,n.current&&!c.current){let e=n.current.attachShadow({mode:"open"});c.current=e;let i=document.createElement("style");i.textContent=f,e.append(i);let p=document.createElement("div");p.className="content-container",e.append(p);let s=document.createElement("div");s.className="overlay-portal",e.append(s),u.current=s;let h=C__default.default.createRoot(p);a.current=h;}return ()=>{l.current=true;let e=a.current;e&&(queueMicrotask(()=>{e.unmount();}),a.current=null),c.current=null,u.current=null;}},[f,n]),m.useEffect(()=>{if(l.current)return;let e=a.current,i=u.current;e&&i&&e.render(jsxRuntime.jsx(core.PortalContainerProvider,{portalContainer:i,children:r}));},[r]),jsxRuntime.jsx("div",{style:t,ref:n})});w.displayName="ShadowRoot";var G=({children:r,locale:t,theme:o,themeStyle:n,disableThemeProvider:c=false,disableFrameProvider:a=false,messages:u})=>{let[l,f]=m.useState(null),{document:e}=F.useFrame(),i=t==="ar"||t==="he";m.useLayoutEffect(()=>{i?e?.documentElement.setAttribute("dir","rtl"):e?.documentElement.removeAttribute("dir");},[i,e]);let p=l?.ownerDocument.body,s=r;return a||(s=jsxRuntime.jsx(core.FrameProvider,{container:p,portalContainer:l,children:s})),c||(s=jsxRuntime.jsx(core.ThemeProvider,{theme:o,style:n,children:s})),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(core.I18nProvider,{locale:t,messages:u,children:s}),jsxRuntime.jsx("div",{id:"portal-container",ref:f})]})};exports.IFrame=b;exports.ProvidersContainer=G;exports.ShadowRoot=w;exports.getRootStyles=R;
|
package/client/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useObjectRef,PortalContainerProvider,
|
|
1
|
+
import {useObjectRef,PortalContainerProvider,FrameProvider,ThemeProvider,I18nProvider}from'@baseline-ui/core';import m,{useEffect,useState,useLayoutEffect}from'react';import C from'react-dom/client';import F,{useFrame}from'react-frame-component';import {jsx,jsxs,Fragment}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,5 +7,5 @@ import {useObjectRef,PortalContainerProvider,I18nProvider,ThemeProvider,FramePro
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
function
|
|
11
|
-
`)}var
|
|
10
|
+
function R(){let r=[],t=document;for(let o=0;o<t.styleSheets.length;o++){let n=t.styleSheets[o];if(n.cssRules){let c=n.cssRules;for(let a of c)r.push(a.cssText);}}return r.join(`
|
|
11
|
+
`)}var b=m.forwardRef(({head:r=jsx("style",{children:R()}),...t},o)=>jsx(F,{style:{width:"100vw",height:"100vh",border:"none"},ref:o,...t,head:r}));b.displayName="IFrame";var w=m.forwardRef(({children:r,style:t},o)=>{let n=useObjectRef(o),c=m.useRef(null),a=m.useRef(null),u=m.useRef(null),l=m.useRef(false),f=m.useMemo(()=>R(),[]);return useEffect(()=>{if(l.current=false,n.current&&!c.current){let e=n.current.attachShadow({mode:"open"});c.current=e;let i=document.createElement("style");i.textContent=f,e.append(i);let p=document.createElement("div");p.className="content-container",e.append(p);let s=document.createElement("div");s.className="overlay-portal",e.append(s),u.current=s;let h=C.createRoot(p);a.current=h;}return ()=>{l.current=true;let e=a.current;e&&(queueMicrotask(()=>{e.unmount();}),a.current=null),c.current=null,u.current=null;}},[f,n]),useEffect(()=>{if(l.current)return;let e=a.current,i=u.current;e&&i&&e.render(jsx(PortalContainerProvider,{portalContainer:i,children:r}));},[r]),jsx("div",{style:t,ref:n})});w.displayName="ShadowRoot";var G=({children:r,locale:t,theme:o,themeStyle:n,disableThemeProvider:c=false,disableFrameProvider:a=false,messages:u})=>{let[l,f]=useState(null),{document:e}=useFrame(),i=t==="ar"||t==="he";useLayoutEffect(()=>{i?e?.documentElement.setAttribute("dir","rtl"):e?.documentElement.removeAttribute("dir");},[i,e]);let p=l?.ownerDocument.body,s=r;return a||(s=jsx(FrameProvider,{container:p,portalContainer:l,children:s})),c||(s=jsx(ThemeProvider,{theme:o,style:n,children:s})),jsxs(Fragment,{children:[jsx(I18nProvider,{locale:t,messages:u,children:s}),jsx("div",{id:"portal-container",ref:f})]})};export{b as IFrame,G as ProvidersContainer,w as ShadowRoot,R as getRootStyles};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _playwright_test from '@playwright/test';
|
|
2
2
|
import { Page, Locator, FrameLocator } from '@playwright/test';
|
|
3
3
|
import { SinonSpy } from 'sinon';
|
|
4
4
|
|
|
@@ -29,57 +29,57 @@ interface ToBeAccessibleOptions {
|
|
|
29
29
|
attachmentName?: string;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
declare const expect:
|
|
33
|
-
toBeWithinDelta(this:
|
|
32
|
+
declare const expect: _playwright_test.Expect<{
|
|
33
|
+
toBeWithinDelta(this: _playwright_test.ExpectMatcherState, received: number, expected: number, delta: number): {
|
|
34
34
|
message: () => string;
|
|
35
35
|
pass: true;
|
|
36
36
|
} | {
|
|
37
37
|
message: () => string;
|
|
38
38
|
pass: false;
|
|
39
39
|
};
|
|
40
|
-
toBeCalledOnce(this:
|
|
40
|
+
toBeCalledOnce(this: _playwright_test.ExpectMatcherState, fn: SinonSpy): Promise<{
|
|
41
41
|
message: () => string;
|
|
42
42
|
pass: true;
|
|
43
43
|
} | {
|
|
44
44
|
message: () => string;
|
|
45
45
|
pass: false;
|
|
46
46
|
}>;
|
|
47
|
-
toBeCalledTwice(this:
|
|
47
|
+
toBeCalledTwice(this: _playwright_test.ExpectMatcherState, fn: SinonSpy): Promise<{
|
|
48
48
|
message: () => string;
|
|
49
49
|
pass: true;
|
|
50
50
|
} | {
|
|
51
51
|
message: () => string;
|
|
52
52
|
pass: false;
|
|
53
53
|
}>;
|
|
54
|
-
toBeCalledThrice(this:
|
|
54
|
+
toBeCalledThrice(this: _playwright_test.ExpectMatcherState, fn: SinonSpy): Promise<{
|
|
55
55
|
message: () => string;
|
|
56
56
|
pass: true;
|
|
57
57
|
} | {
|
|
58
58
|
message: () => string;
|
|
59
59
|
pass: false;
|
|
60
60
|
}>;
|
|
61
|
-
toBeCalledWith(this:
|
|
61
|
+
toBeCalledWith(this: _playwright_test.ExpectMatcherState, fn: SinonSpy, ...args: unknown[]): Promise<{
|
|
62
62
|
message: () => string;
|
|
63
63
|
pass: true;
|
|
64
64
|
} | {
|
|
65
65
|
message: () => string;
|
|
66
66
|
pass: false;
|
|
67
67
|
}>;
|
|
68
|
-
toBeCalledWithExactly(this:
|
|
68
|
+
toBeCalledWithExactly(this: _playwright_test.ExpectMatcherState, fn: SinonSpy, ...args: unknown[]): Promise<{
|
|
69
69
|
message: () => string;
|
|
70
70
|
pass: true;
|
|
71
71
|
} | {
|
|
72
72
|
message: () => string;
|
|
73
73
|
pass: false;
|
|
74
74
|
}>;
|
|
75
|
-
toBeCalled(this:
|
|
75
|
+
toBeCalled(this: _playwright_test.ExpectMatcherState, fn: SinonSpy): {
|
|
76
76
|
message: () => string;
|
|
77
77
|
pass: true;
|
|
78
78
|
} | {
|
|
79
79
|
message: () => string;
|
|
80
80
|
pass: false;
|
|
81
81
|
};
|
|
82
|
-
toBeCalledTimes(this:
|
|
82
|
+
toBeCalledTimes(this: _playwright_test.ExpectMatcherState, fn: SinonSpy, times: number): Promise<{
|
|
83
83
|
message: () => string;
|
|
84
84
|
pass: true;
|
|
85
85
|
} | {
|
|
@@ -95,7 +95,7 @@ declare const expect: playwright_test.Expect<{
|
|
|
95
95
|
message: () => string;
|
|
96
96
|
pass: false;
|
|
97
97
|
}>;
|
|
98
|
-
toMatchClassTree(this:
|
|
98
|
+
toMatchClassTree(this: _playwright_test.ExpectMatcherState, locator: Locator, snapshotName?: string, options?: {
|
|
99
99
|
prefix?: string | string[];
|
|
100
100
|
ignoreHashed?: boolean;
|
|
101
101
|
}): Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _playwright_test from '@playwright/test';
|
|
2
2
|
import { Page, Locator, FrameLocator } from '@playwright/test';
|
|
3
3
|
import { SinonSpy } from 'sinon';
|
|
4
4
|
|
|
@@ -29,57 +29,57 @@ interface ToBeAccessibleOptions {
|
|
|
29
29
|
attachmentName?: string;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
declare const expect:
|
|
33
|
-
toBeWithinDelta(this:
|
|
32
|
+
declare const expect: _playwright_test.Expect<{
|
|
33
|
+
toBeWithinDelta(this: _playwright_test.ExpectMatcherState, received: number, expected: number, delta: number): {
|
|
34
34
|
message: () => string;
|
|
35
35
|
pass: true;
|
|
36
36
|
} | {
|
|
37
37
|
message: () => string;
|
|
38
38
|
pass: false;
|
|
39
39
|
};
|
|
40
|
-
toBeCalledOnce(this:
|
|
40
|
+
toBeCalledOnce(this: _playwright_test.ExpectMatcherState, fn: SinonSpy): Promise<{
|
|
41
41
|
message: () => string;
|
|
42
42
|
pass: true;
|
|
43
43
|
} | {
|
|
44
44
|
message: () => string;
|
|
45
45
|
pass: false;
|
|
46
46
|
}>;
|
|
47
|
-
toBeCalledTwice(this:
|
|
47
|
+
toBeCalledTwice(this: _playwright_test.ExpectMatcherState, fn: SinonSpy): Promise<{
|
|
48
48
|
message: () => string;
|
|
49
49
|
pass: true;
|
|
50
50
|
} | {
|
|
51
51
|
message: () => string;
|
|
52
52
|
pass: false;
|
|
53
53
|
}>;
|
|
54
|
-
toBeCalledThrice(this:
|
|
54
|
+
toBeCalledThrice(this: _playwright_test.ExpectMatcherState, fn: SinonSpy): Promise<{
|
|
55
55
|
message: () => string;
|
|
56
56
|
pass: true;
|
|
57
57
|
} | {
|
|
58
58
|
message: () => string;
|
|
59
59
|
pass: false;
|
|
60
60
|
}>;
|
|
61
|
-
toBeCalledWith(this:
|
|
61
|
+
toBeCalledWith(this: _playwright_test.ExpectMatcherState, fn: SinonSpy, ...args: unknown[]): Promise<{
|
|
62
62
|
message: () => string;
|
|
63
63
|
pass: true;
|
|
64
64
|
} | {
|
|
65
65
|
message: () => string;
|
|
66
66
|
pass: false;
|
|
67
67
|
}>;
|
|
68
|
-
toBeCalledWithExactly(this:
|
|
68
|
+
toBeCalledWithExactly(this: _playwright_test.ExpectMatcherState, fn: SinonSpy, ...args: unknown[]): Promise<{
|
|
69
69
|
message: () => string;
|
|
70
70
|
pass: true;
|
|
71
71
|
} | {
|
|
72
72
|
message: () => string;
|
|
73
73
|
pass: false;
|
|
74
74
|
}>;
|
|
75
|
-
toBeCalled(this:
|
|
75
|
+
toBeCalled(this: _playwright_test.ExpectMatcherState, fn: SinonSpy): {
|
|
76
76
|
message: () => string;
|
|
77
77
|
pass: true;
|
|
78
78
|
} | {
|
|
79
79
|
message: () => string;
|
|
80
80
|
pass: false;
|
|
81
81
|
};
|
|
82
|
-
toBeCalledTimes(this:
|
|
82
|
+
toBeCalledTimes(this: _playwright_test.ExpectMatcherState, fn: SinonSpy, times: number): Promise<{
|
|
83
83
|
message: () => string;
|
|
84
84
|
pass: true;
|
|
85
85
|
} | {
|
|
@@ -95,7 +95,7 @@ declare const expect: playwright_test.Expect<{
|
|
|
95
95
|
message: () => string;
|
|
96
96
|
pass: false;
|
|
97
97
|
}>;
|
|
98
|
-
toMatchClassTree(this:
|
|
98
|
+
toMatchClassTree(this: _playwright_test.ExpectMatcherState, locator: Locator, snapshotName?: string, options?: {
|
|
99
99
|
prefix?: string | string[];
|
|
100
100
|
ignoreHashed?: boolean;
|
|
101
101
|
}): Promise<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baseline-ui/test-utils",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A collection of test utilities for Baseline UI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"axe-core": "^4.11.4",
|
|
54
54
|
"react-frame-component": "^5.3.2",
|
|
55
|
-
"@baseline-ui/core": "3.
|
|
55
|
+
"@baseline-ui/core": "3.1.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "tsup",
|
package/sbom.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"$schema": "http://cyclonedx.org/schema/bom-1.6.schema.json",
|
|
3
3
|
"bomFormat": "CycloneDX",
|
|
4
4
|
"specVersion": "1.6",
|
|
5
|
-
"serialNumber": "urn:uuid:
|
|
5
|
+
"serialNumber": "urn:uuid:30c5d89d-f507-47cc-b72c-d9cb6299692d",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-09-
|
|
8
|
+
"timestamp": "2026-09-08T17:26:10.388Z",
|
|
9
9
|
"lifecycles": [
|
|
10
10
|
{
|
|
11
11
|
"phase": "pre-build"
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"component": {
|
|
24
24
|
"type": "library",
|
|
25
25
|
"name": "@baseline-ui/test-utils",
|
|
26
|
-
"version": "3.
|
|
27
|
-
"purl": "pkg:npm/@baseline-ui/test-utils@3.
|
|
28
|
-
"bom-ref": "pkg:npm/@baseline-ui/test-utils@3.
|
|
26
|
+
"version": "3.1.0",
|
|
27
|
+
"purl": "pkg:npm/@baseline-ui/test-utils@3.1.0",
|
|
28
|
+
"bom-ref": "pkg:npm/@baseline-ui/test-utils@3.1.0",
|
|
29
29
|
"licenses": [
|
|
30
30
|
{
|
|
31
31
|
"license": {
|
|
@@ -500,7 +500,7 @@
|
|
|
500
500
|
],
|
|
501
501
|
"dependencies": [
|
|
502
502
|
{
|
|
503
|
-
"ref": "pkg:npm/@baseline-ui/test-utils@3.
|
|
503
|
+
"ref": "pkg:npm/@baseline-ui/test-utils@3.1.0",
|
|
504
504
|
"dependsOn": [
|
|
505
505
|
"pkg:npm/%40neondatabase/serverless@1.1.0",
|
|
506
506
|
"pkg:npm/%40playwright/test@1.60.0",
|