@wix/site-ui 1.232.0 → 1.233.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/dist/Toast/index.d.ts +6 -1
- package/dist/Toast/index.js +11 -3
- package/dist/index.d.ts +5 -1
- package/package.json +2 -2
package/dist/Toast/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent } from 'react';
|
|
2
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
3
|
import { Padding } from '@floating-ui/react-dom';
|
|
3
4
|
import * as React_2 from 'react';
|
|
4
5
|
import { Rect } from '@floating-ui/utils';
|
|
@@ -128,6 +129,10 @@ declare type OffsetFunction = (data: {
|
|
|
128
129
|
};
|
|
129
130
|
}) => number;
|
|
130
131
|
|
|
132
|
+
declare const Portal: ({ container, ...props }: PortalProps) => JSX_2.Element;
|
|
133
|
+
|
|
134
|
+
declare type PortalProps = React_2.ComponentPropsWithoutRef<typeof Toast_2.Portal>;
|
|
135
|
+
|
|
131
136
|
declare const Root: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<ToastRootProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
132
137
|
className?: string;
|
|
133
138
|
} & {
|
|
@@ -368,7 +373,7 @@ export declare interface ToastManagerUpdateOptions<Data extends object> extends
|
|
|
368
373
|
|
|
369
374
|
declare type ToastNamespace = {
|
|
370
375
|
Provider: typeof Toast_2.Provider;
|
|
371
|
-
Portal: typeof
|
|
376
|
+
Portal: typeof Portal;
|
|
372
377
|
Viewport: typeof Viewport;
|
|
373
378
|
Root: typeof Root;
|
|
374
379
|
Title: typeof Title;
|
package/dist/Toast/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import clsx from "clsx";
|
|
3
|
+
import { FloatingPortalLite_FloatingPortalLite } from "../8960.js";
|
|
3
4
|
import { useRefWithInit, useRenderElement, esm_formatErrorMessage } from "../8272.js";
|
|
4
5
|
import { Timeout, useTimeout } from "../42.js";
|
|
5
6
|
import { getTarget, contains, activeElement } from "../4549.js";
|
|
@@ -19,9 +20,9 @@ import { useId } from "../2205.js";
|
|
|
19
20
|
import { useButton } from "../9189.js";
|
|
20
21
|
import { ReactStore, createSelector } from "../2445.js";
|
|
21
22
|
import { useOnMount } from "../2861.js";
|
|
22
|
-
import { FloatingPortalLite_FloatingPortalLite } from "../8960.js";
|
|
23
23
|
import * as __rspack_external_react from "react";
|
|
24
24
|
import * as __rspack_external_react_dom_7136dc57 from "react-dom";
|
|
25
|
+
const ToastPortal = FloatingPortalLite_FloatingPortalLite;
|
|
25
26
|
const ToastContext = /*#__PURE__*/ __rspack_external_react.createContext(void 0);
|
|
26
27
|
if ("production" !== process.env.NODE_ENV) ToastContext.displayName = "ToastContext";
|
|
27
28
|
function useToastProviderContext() {
|
|
@@ -1127,7 +1128,6 @@ const ToastProvider_ToastProvider = function(props) {
|
|
|
1127
1128
|
});
|
|
1128
1129
|
};
|
|
1129
1130
|
if ("production" !== process.env.NODE_ENV) ToastProvider_ToastProvider.displayName = "ToastProvider";
|
|
1130
|
-
const ToastPortal = FloatingPortalLite_FloatingPortalLite;
|
|
1131
1131
|
function useToastManager() {
|
|
1132
1132
|
const store = __rspack_external_react.useContext(ToastContext);
|
|
1133
1133
|
if (!store) throw new Error("production" !== process.env.NODE_ENV ? 'Base UI: useToastManager must be used within <Toast.Provider>.' : esm_formatErrorMessage(73));
|
|
@@ -1164,6 +1164,10 @@ const Close = ({ size, ...props })=>/*#__PURE__*/ jsx("svg", {
|
|
|
1164
1164
|
d: "M19.2928932,3.99989322 L20,4.707 L12.7068932,11.9998932 L20,19.2928932 L19.2928932,20 L11.9998932,12.7068932 L4.707,20 L3.99989322,19.2928932 L11.2928932,11.9998932 L3.99989322,4.707 L4.707,3.99989322 L11.9998932,11.2928932 L19.2928932,3.99989322 Z"
|
|
1165
1165
|
})
|
|
1166
1166
|
});
|
|
1167
|
+
const getDefaultContainer = ()=>{
|
|
1168
|
+
if ("u" < typeof document) return;
|
|
1169
|
+
return document.querySelector('#SITE_PAGES > .theme-vars') ?? document.body;
|
|
1170
|
+
};
|
|
1167
1171
|
function getSkinClassName(skin) {
|
|
1168
1172
|
switch(skin){
|
|
1169
1173
|
case 'success':
|
|
@@ -1177,6 +1181,10 @@ function getSkinClassName(skin) {
|
|
|
1177
1181
|
return Toast_module.status;
|
|
1178
1182
|
}
|
|
1179
1183
|
}
|
|
1184
|
+
const Portal = ({ container, ...props })=>/*#__PURE__*/ jsx(ToastPortal, {
|
|
1185
|
+
container: container ?? getDefaultContainer(),
|
|
1186
|
+
...props
|
|
1187
|
+
});
|
|
1180
1188
|
const Viewport = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(ToastViewport_ToastViewport, {
|
|
1181
1189
|
ref: ref,
|
|
1182
1190
|
className: clsx(Toast_module.viewport, 'theme-vars', className),
|
|
@@ -1204,7 +1212,7 @@ const CloseButton = /*#__PURE__*/ __rspack_external_react.forwardRef(({ classNam
|
|
|
1204
1212
|
}));
|
|
1205
1213
|
const Toast = {
|
|
1206
1214
|
Provider: ToastProvider_ToastProvider,
|
|
1207
|
-
Portal:
|
|
1215
|
+
Portal: Portal,
|
|
1208
1216
|
Viewport: Viewport,
|
|
1209
1217
|
Root: Root,
|
|
1210
1218
|
Title: Title,
|
package/dist/index.d.ts
CHANGED
|
@@ -7796,6 +7796,10 @@ declare class PopupTriggerMap {
|
|
|
7796
7796
|
get size(): number;
|
|
7797
7797
|
}
|
|
7798
7798
|
|
|
7799
|
+
declare const Portal: ({ container, ...props }: PortalProps) => JSX_2.Element;
|
|
7800
|
+
|
|
7801
|
+
declare type PortalProps = React_2.ComponentPropsWithoutRef<typeof Toast_2.Portal>;
|
|
7802
|
+
|
|
7799
7803
|
export declare const PreviewCard: {
|
|
7800
7804
|
Positioner: React_2.ForwardRefExoticComponent<Omit<Omit<Omit<PreviewCardPositionerProps_2, "ref"> & React_2.RefAttributes<HTMLDivElement>, "ref">, "className"> & {
|
|
7801
7805
|
className?: string;
|
|
@@ -12781,7 +12785,7 @@ export declare interface ToastManagerUpdateOptions<Data extends object> extends
|
|
|
12781
12785
|
|
|
12782
12786
|
declare type ToastNamespace = {
|
|
12783
12787
|
Provider: typeof Toast_2.Provider;
|
|
12784
|
-
Portal: typeof
|
|
12788
|
+
Portal: typeof Portal;
|
|
12785
12789
|
Viewport: typeof Viewport;
|
|
12786
12790
|
Root: typeof Root_6;
|
|
12787
12791
|
Title: typeof Title_2;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/site-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.233.0",
|
|
4
4
|
"description": "Pure UI components for the Wix site builder",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"registry": "https://registry.npmjs.org/",
|
|
95
95
|
"access": "public"
|
|
96
96
|
},
|
|
97
|
-
"falconPackageHash": "
|
|
97
|
+
"falconPackageHash": "aaa2ac8f445402908b853f97f3d5165fd7daf29c54a616be17c2b5ed"
|
|
98
98
|
}
|