@pushwoosh/dumb-components 1.1.190 → 1.1.192

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.
@@ -75,6 +75,7 @@ function FreeCombobox({
75
75
  open,
76
76
  onClose,
77
77
  autoFocus,
78
+ disabled,
78
79
  inputRef
79
80
  });
80
81
  const dropdownItems = useMemo(() => filteredItems.map((item, idx) => {
@@ -232,6 +233,7 @@ function SelectCombobox({
232
233
  open,
233
234
  onClose,
234
235
  autoFocus,
236
+ disabled,
235
237
  inputRef
236
238
  });
237
239
  const dropdownItems = useMemo(() => filteredItems.map((item, idx) => {
@@ -133,6 +133,7 @@ export function ComboboxMulti({
133
133
  open,
134
134
  onClose,
135
135
  autoFocus,
136
+ disabled,
136
137
  inputRef
137
138
  });
138
139
  const toggleOpen = useToggleOpen(inputRef, isOpen, open, close);
@@ -3,6 +3,7 @@ import { Liquid } from 'liquidjs';
3
3
  import { useMemo, useState } from 'react';
4
4
  import { replaceLocalization, replacePlaceholders } from './helpers';
5
5
  import { IframeStyled } from './styles';
6
+ import { LIGHT_ISLAND_PROPS } from '../shared/lightIsland';
6
7
  const createLiquidInstance = () => {
7
8
  const liquidInstance = new Liquid();
8
9
  const tags = ['email_content', 'connected_content'];
@@ -47,6 +48,7 @@ export function EmailTemplatePreview(props) {
47
48
  }
48
49
  }, [template, localization, values, liquidInstance]);
49
50
  return _jsx(IframeStyled, {
51
+ ...LIGHT_ISLAND_PROPS,
50
52
  "$scale": scale,
51
53
  "$width": width,
52
54
  "$height": height,
@@ -11,6 +11,7 @@ import { parseNativeRichMediaConfig } from './parseNativeRichMediaConfig';
11
11
  import { resolveLocalization } from './resolveLocalization';
12
12
  import { BackdropLayer, ContentFlow, PreviewHost, ScaleViewport, ScrollLayer, SpinnerLayer } from './styles';
13
13
  import { NativeRichMediaBannerView, NativeRichMediaCarouselView, NativeRichMediaFullscreenView, NativeRichMediaInvalidView, NativeRichMediaModalView, NativeRichMediaPipView, NativeRichMediaScratchcardView, NativeRichMediaSheetView, NativeRichMediaSpinwheelView, NativeRichMediaStoriesView, NativeRichMediaVideoView } from './views';
14
+ import { LIGHT_ISLAND_PROPS } from '../shared/lightIsland';
14
15
  function dimsScreen(config) {
15
16
  if (!config) {
16
17
  return false;
@@ -200,6 +201,7 @@ export function NativeRichMediaPreview(props) {
200
201
  }, [content, localization, language]);
201
202
  const shouldDim = !isLoading && dimsScreen(config);
202
203
  return _jsxs(PreviewHost, {
204
+ ...LIGHT_ISLAND_PROPS,
203
205
  width: width,
204
206
  height: height,
205
207
  "$withBackground": withBackground,
@@ -6,6 +6,7 @@ import { PREVIEW_ICON_URL } from './constants';
6
6
  import { getLocalizedContent } from './helpers';
7
7
  import { PushBox, PushIcon, PushTitle, PushDescription } from './styles';
8
8
  import { RichMessageViewer } from '../RichMessageEditor';
9
+ import { LIGHT_ISLAND_PROPS } from '../shared/lightIsland';
9
10
  /**
10
11
  * Renders a realistic push-notification preview from a push preset, picking
11
12
  * localized strings by `language`, with compact/extended/silent/missed-content modes.
@@ -39,6 +40,7 @@ export function PushPreview({
39
40
  return _jsx(MissedContentPreview, {});
40
41
  }
41
42
  return _jsxs(PushBox, {
43
+ ...LIGHT_ISLAND_PROPS,
42
44
  view: view,
43
45
  "$width": width,
44
46
  "$loading": isLoading,
@@ -3,6 +3,7 @@ import { Color } from '@pushwoosh/kit-constants';
3
3
  import { Spinner } from '../Spinner';
4
4
  import { useRichmediaHtml } from './hooks';
5
5
  import { RichMediaPreviewContainer, RichMediaPreviewIframe } from './styles';
6
+ import { LIGHT_ISLAND_PROPS } from '../shared/lightIsland';
6
7
  /**
7
8
  * Renders a rich-media (in-app) template in a fully isolated sandboxed iframe, resolving
8
9
  * params and localization via {@link useRichmediaHtml}. Template scripts run in an opaque
@@ -32,6 +33,7 @@ export function RichmediaPreview(props) {
32
33
  baseUrl
33
34
  });
34
35
  return _jsx(RichMediaPreviewContainer, {
36
+ ...LIGHT_ISLAND_PROPS,
35
37
  width: width,
36
38
  height: height,
37
39
  "$isLoading": isLoading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/dumb-components",
3
- "version": "1.1.190",
3
+ "version": "1.1.192",
4
4
  "description": "React components to build Pushwoosh products",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -49,7 +49,7 @@
49
49
  "@codemirror/lang-liquid": "^6.2.2",
50
50
  "@floating-ui/react-dom": "^2.1.2",
51
51
  "@lezer/highlight": "^1.2.1",
52
- "@pushwoosh/kit-constants": "^1.7.0",
52
+ "@pushwoosh/kit-constants": "^1.9.0",
53
53
  "@pushwoosh/kit-helpers": "^4.11.0",
54
54
  "@pushwoosh/kit-icons": "^2.1.16",
55
55
  "@pushwoosh/kit-typography": "^1.7.5",
@@ -73,7 +73,7 @@ export function FieldShell({
73
73
  "$minWidth": minWidth,
74
74
  "$autosize": autosize,
75
75
  "$tightLeft": tightLeft,
76
- onMouseDown: onShellMouseDown,
76
+ onMouseDown: disabled ? undefined : onShellMouseDown,
77
77
  onBlur: onShellBlur,
78
78
  children: [_jsx(ShellInner, {
79
79
  children: children
@@ -90,6 +90,7 @@ export function FieldShell({
90
90
  })
91
91
  }), showChevron && _jsx(IndicatorButton, {
92
92
  tabIndex: -1,
93
+ disabled: disabled,
93
94
  "aria-label": isOpen ? 'Close' : 'Open',
94
95
  onMouseDown: e => {
95
96
  e.preventDefault();
@@ -55,7 +55,7 @@ export const IndicatorButton = styled.button.attrs({
55
55
  }).withConfig({
56
56
  displayName: "IndicatorButton",
57
57
  componentId: "sc-1pvwhhw-5"
58
- })(["display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;color:", ";cursor:pointer;border-radius:", ";transition:color 0.15s ease,background-color 0.15s ease;&:hover{color:", ";background-color:", ";}"], Color.PHANTOM, ShapeRadius.CONTROL, Color.MAIN, Color.FROZEN);
58
+ })(["display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;color:", ";cursor:pointer;border-radius:", ";transition:color 0.15s ease,background-color 0.15s ease;&:hover{color:", ";background-color:", ";}&:disabled{cursor:default;}"], Color.PHANTOM, ShapeRadius.CONTROL, Color.MAIN, Color.FROZEN);
59
59
  export const Dropdown = styled.div.withConfig({
60
60
  displayName: "Dropdown",
61
61
  componentId: "sc-1pvwhhw-6"
@@ -4,11 +4,12 @@ type Args = {
4
4
  open: () => void;
5
5
  onClose?: () => void;
6
6
  autoFocus?: boolean;
7
+ disabled?: boolean;
7
8
  inputRef: RefObject<HTMLInputElement>;
8
9
  };
9
10
  /**
10
11
  * Side effects tied to a Combobox field's open state: optional autofocus on mount
11
12
  * and firing `onClose` when the field closes.
12
13
  */
13
- export declare function useFieldOpenEffects({ isOpen, open, onClose, autoFocus, inputRef, }: Args): void;
14
+ export declare function useFieldOpenEffects({ isOpen, open, onClose, autoFocus, disabled, inputRef, }: Args): void;
14
15
  export {};
@@ -8,6 +8,7 @@ export function useFieldOpenEffects({
8
8
  open,
9
9
  onClose,
10
10
  autoFocus,
11
+ disabled,
11
12
  inputRef
12
13
  }) {
13
14
  const onCloseRef = useRef(onClose);
@@ -19,9 +20,9 @@ export function useFieldOpenEffects({
19
20
  }, [isOpen]);
20
21
  const didAutoFocusRef = useRef(false);
21
22
  useEffect(() => {
22
- if (!autoFocus || didAutoFocusRef.current) return;
23
+ if (!autoFocus || disabled || didAutoFocusRef.current) return;
23
24
  didAutoFocusRef.current = true;
24
25
  inputRef.current?.focus();
25
26
  open();
26
- }, [autoFocus, open, inputRef]);
27
+ }, [autoFocus, disabled, open, inputRef]);
27
28
  }
@@ -0,0 +1,3 @@
1
+ export declare const LIGHT_ISLAND_PROPS: {
2
+ readonly "data-theme": "light";
3
+ };
@@ -0,0 +1,4 @@
1
+ import { THEME_ATTRIBUTE } from '@pushwoosh/kit-constants';
2
+ export const LIGHT_ISLAND_PROPS = {
3
+ [THEME_ATTRIBUTE]: 'light'
4
+ };