@plurid/plurid-ui-components-react 0.0.0-13 → 0.0.0-16

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.
@@ -0,0 +1,37 @@
1
+ import React from 'react';
2
+ import { StateOfAny, head } from '@plurid/plurid-ui-state-react';
3
+ export declare type HeadState = StateOfAny & {
4
+ head: head.HeadState;
5
+ };
6
+ export declare type HeadSelectors = StateOfAny & {
7
+ head: typeof head.selectors;
8
+ };
9
+ export interface HeadDefaults {
10
+ robots?: string;
11
+ viewport?: string;
12
+ faviconIcon?: string;
13
+ favicon16?: string;
14
+ favicon32?: string;
15
+ manifest?: string;
16
+ themeColor?: string;
17
+ apiDomain?: string;
18
+ canonicalURL?: string;
19
+ ogImageWidth?: string;
20
+ ogImageHeight?: string;
21
+ ogSiteName?: string;
22
+ appleTouchIcon?: string;
23
+ }
24
+ export interface HeadOwnProperties {
25
+ defaults?: Partial<head.HeadState> & HeadDefaults;
26
+ selectors: HeadSelectors;
27
+ context: React.Context<any>;
28
+ children?: React.ReactNode;
29
+ }
30
+ export interface HeadStateProperties {
31
+ stateHead: head.HeadState;
32
+ }
33
+ export interface HeadDispatchProperties {
34
+ }
35
+ export declare type HeadProperties = HeadOwnProperties & HeadStateProperties & HeadDispatchProperties;
36
+ declare const ConnectedHead: import("react-redux").ConnectedComponent<React.FC<HeadProperties>, Omit<HeadProperties, "stateHead"> & HeadOwnProperties & import("react-redux").ConnectProps>;
37
+ export default ConnectedHead;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const head: {
3
+ Head: import("react-redux").ConnectedComponent<import("react").FC<import("./Head").HeadProperties>, Omit<import("./Head").HeadProperties, "stateHead"> & import("./Head").HeadOwnProperties & import("react-redux").ConnectProps>;
4
+ };
5
+ export default head;
@@ -1,5 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  declare const pluridal: {
3
+ head: {
4
+ Head: import("react-redux").ConnectedComponent<import("react").FC<import("./head/Head").HeadProperties>, Omit<import("./head/Head").HeadProperties, "stateHead"> & import("./head/Head").HeadOwnProperties & import("react-redux").ConnectProps>;
5
+ };
3
6
  notifications: {
4
7
  Notification: import("react").FC<import("./notifications/Notification").NotificationOwnProperties>;
5
8
  Notifications: import("react-redux").ConnectedComponent<import("react").FC<import("./notifications/Notifications").NotificationsProperties>, Omit<import("./notifications/Notifications").NotificationsProperties, "stateGeneralTheme" | "stateNotifications" | "dispatchRemoveNotification"> & import("./notifications/Notifications").NotificationsOwnProperties & import("react-redux").ConnectProps>;
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Theme } from '@plurid/plurid-themes';
3
- import { notifications } from '@plurid/plurid-ui-state-react';
3
+ import { DispatchAction, Notification, notifications } from '@plurid/plurid-ui-state-react';
4
4
  export interface NotificationOwnProperties {
5
- data: notifications.Types.Notification;
5
+ data: Notification;
6
6
  theme: Theme;
7
- remove: (payload: notifications.Types.RemoveNotificationPayload) => void;
7
+ remove: DispatchAction<typeof notifications.actions.remove>;
8
8
  elements?: Record<string, JSX.Element>;
9
9
  style?: React.CSSProperties;
10
10
  className?: string;
@@ -3,5 +3,8 @@ export interface IStyledNotification {
3
3
  theme: Theme;
4
4
  }
5
5
  export declare const StyledNotification: import("styled-components").StyledComponent<"div", any, IStyledNotification, never>;
6
- export declare const StyledNotificationContent: import("styled-components").StyledComponent<"div", any, {}, never>;
6
+ export interface IStyledNotificationContent {
7
+ wordBreak: string;
8
+ }
9
+ export declare const StyledNotificationContent: import("styled-components").StyledComponent<"div", any, IStyledNotificationContent, never>;
7
10
  export declare const StyledNotificationClose: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { StateOfAny, themes as themesStateService, notifications as notificationsStateService } from '@plurid/plurid-ui-state-react';
3
2
  import { Theme } from '@plurid/plurid-themes';
3
+ import { DispatchAction, StateOfAny, themes as themesStateService, notifications as notificationsStateService, Notification as INotification } from '@plurid/plurid-ui-state-react';
4
4
  export declare type NotificationsState = StateOfAny & {
5
- themes: themesStateService.Types.State;
6
- notifications: notificationsStateService.Types.State;
5
+ themes: themesStateService.ThemesState;
6
+ notifications: notificationsStateService.NotificationsState;
7
7
  };
8
8
  export declare type NotificationsSelectors = StateOfAny & {
9
9
  themes: typeof themesStateService.selectors;
@@ -16,10 +16,10 @@ export interface NotificationsOwnProperties {
16
16
  }
17
17
  export interface NotificationsStateProperties {
18
18
  stateGeneralTheme: Theme;
19
- stateNotifications: notificationsStateService.Types.Notification[];
19
+ stateNotifications: INotification[];
20
20
  }
21
21
  export interface NotificationsDispatchProperties {
22
- dispatchRemoveNotification: typeof notificationsStateService.actions.removeNotification;
22
+ dispatchRemoveNotification: DispatchAction<typeof notificationsStateService.actions.remove>;
23
23
  }
24
24
  export declare type NotificationsProperties = NotificationsOwnProperties & NotificationsStateProperties & NotificationsDispatchProperties;
25
25
  declare const ConnectedNotifications: import("react-redux").ConnectedComponent<React.FC<NotificationsProperties>, Omit<NotificationsProperties, "stateGeneralTheme" | "stateNotifications" | "dispatchRemoveNotification"> & NotificationsOwnProperties & import("react-redux").ConnectProps>;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Theme } from '@plurid/plurid-themes';
3
3
  export interface SittingsOwnProperties {
4
4
  selectors: any;
5
+ context: React.Context<any>;
5
6
  }
6
7
  export interface SittingsStateProperties {
7
8
  stateInteractionTheme: Theme;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { Theme } from '@plurid/plurid-themes';
3
3
  export interface StateImageOwnProperties {
4
4
  selectors: any;
5
+ context: React.Context<any>;
5
6
  }
6
7
  export interface StateImageStateProperties {
7
8
  stateInteractionTheme: Theme;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  export interface StateLineProperties {
3
3
  theme: any;
4
+ context: React.Context<any>;
4
5
  }
5
6
  declare const ConnectedStateLine: import("react-redux").ConnectedComponent<React.FC<StateLineProperties>, any>;
6
7
  export default ConnectedStateLine;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  export interface StateLinkProperties {
3
3
  theme: any;
4
4
  currentLink: string;
5
+ context: React.Context<any>;
5
6
  }
6
7
  declare const ConnectedStateLink: import("react-redux").ConnectedComponent<React.FC<StateLinkProperties>, any>;
7
8
  export default ConnectedStateLink;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { Theme } from '@plurid/plurid-themes';
3
3
  export interface SittingTrayOwnProperties {
4
4
  selectors: any;
5
- context: any;
5
+ context: React.Context<any>;
6
6
  }
7
7
  export interface SittingTrayStateProperties {
8
8
  stateInteractionTheme: Theme;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { sitting } from '@plurid/plurid-ui-state-react';
3
2
  import { Theme } from '@plurid/plurid-themes';
3
+ import { DispatchAction, sitting } from '@plurid/plurid-ui-state-react';
4
4
  import { ToolbarButton } from "../../../../data/interfaces";
5
5
  export interface ToolbarGeneralOwnProperties {
6
6
  buttons: ToolbarButton[];
7
7
  selectors: any;
8
- context: any;
8
+ context: React.Context<any>;
9
9
  handleClick: (type: any) => void;
10
10
  speakButton?: boolean;
11
11
  sittingButton?: boolean;
@@ -17,7 +17,7 @@ export interface ToolbarGeneralStateProperties {
17
17
  stateInteractionTheme: Theme;
18
18
  }
19
19
  export interface ToolbarGeneralDispatchProperties {
20
- dispatchToggleSittingTray: typeof sitting.actions.toggleSittingTray;
20
+ dispatchToggleSittingTray: DispatchAction<typeof sitting.actions.toggleSittingTray>;
21
21
  }
22
22
  export declare type ToolbarGeneralProperties = ToolbarGeneralOwnProperties & ToolbarGeneralStateProperties & ToolbarGeneralDispatchProperties;
23
23
  declare const ConnectedToolbarGeneral: import("react-redux").ConnectedComponent<React.FC<ToolbarGeneralProperties>, any>;
@@ -286,8 +286,9 @@ const StyledPureButton = styled.button`
286
286
  min-height: 40px;
287
287
  min-width: 160px;
288
288
 
289
- :hover {
290
- background-color: ${({theme: theme, level: level, isDisabled: isDisabled}) => {
289
+ @media (hover: hover) {
290
+ :hover {
291
+ background-color: ${({theme: theme, level: level, isDisabled: isDisabled}) => {
291
292
  if (isDisabled) {
292
293
  return theme.backgroundColorPrimaryAlpha;
293
294
  }
@@ -308,6 +309,7 @@ const StyledPureButton = styled.button`
308
309
  return theme.backgroundColorSecondary;
309
310
  }
310
311
  }};
312
+ }
311
313
  }
312
314
 
313
315
  :active {
@@ -1560,6 +1562,11 @@ const StyledInputBox = styled.div`
1560
1562
  color: ${({theme: theme}) => theme.colorPrimary};
1561
1563
  background-color: ${({theme: theme}) => theme.backgroundColorTertiary};
1562
1564
  box-shadow: inset 0px 4px 4px ${({theme: theme}) => theme.boxShadowUmbraColor};
1565
+
1566
+
1567
+ ::placeholder {
1568
+ color: ${({theme: theme}) => theme.colorSecondary};
1569
+ }
1563
1570
  }
1564
1571
  `;
1565
1572
 
@@ -2560,6 +2567,149 @@ const universal = {
2560
2567
  varia: varia
2561
2568
  };
2562
2569
 
2570
+ const Head = properties => {
2571
+ var _a, _b, _c, _d;
2572
+ const {defaults: defaults, children: children, stateHead: stateHead} = properties;
2573
+ const robots = (defaults === null || defaults === void 0 ? void 0 : defaults.robots) || "index,follow";
2574
+ const viewport = (defaults === null || defaults === void 0 ? void 0 : defaults.viewport) || "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0, shrink-to-fit=no";
2575
+ const faviconIcon = (_a = defaults === null || defaults === void 0 ? void 0 : defaults.faviconIcon) !== null && _a !== void 0 ? _a : "/favicon.ico";
2576
+ const favicon16 = (_b = defaults === null || defaults === void 0 ? void 0 : defaults.favicon16) !== null && _b !== void 0 ? _b : "/favicon-32x32.png";
2577
+ const favicon32 = (_c = defaults === null || defaults === void 0 ? void 0 : defaults.favicon32) !== null && _c !== void 0 ? _c : "/favicon-16x16.png";
2578
+ const manifest = (_d = defaults === null || defaults === void 0 ? void 0 : defaults.manifest) !== null && _d !== void 0 ? _d : "/site.webmanifest";
2579
+ const themeColor = (defaults === null || defaults === void 0 ? void 0 : defaults.themeColor) || "";
2580
+ const titleValue = stateHead.title || (defaults === null || defaults === void 0 ? void 0 : defaults.title) || "";
2581
+ const descriptionValue = stateHead.description || (defaults === null || defaults === void 0 ? void 0 : defaults.description) || "";
2582
+ const canonicalURL = stateHead.canonicalURL || (defaults === null || defaults === void 0 ? void 0 : defaults.canonicalURL) || "";
2583
+ const ogTitleValue = stateHead.ogTitle || titleValue;
2584
+ const ogDescriptionValue = stateHead.ogDescription || titleValue;
2585
+ const ogImageValue = stateHead.ogImage || (defaults === null || defaults === void 0 ? void 0 : defaults.ogImage) || "";
2586
+ const ogURLValue = stateHead.ogURL || (defaults === null || defaults === void 0 ? void 0 : defaults.ogURL) || "";
2587
+ const apiDomain = (defaults === null || defaults === void 0 ? void 0 : defaults.apiDomain) || "";
2588
+ const ogImageWidth = (defaults === null || defaults === void 0 ? void 0 : defaults.ogImageWidth) || "1200";
2589
+ const ogImageHeight = (defaults === null || defaults === void 0 ? void 0 : defaults.ogImageHeight) || "630";
2590
+ const ogSiteName = (defaults === null || defaults === void 0 ? void 0 : defaults.ogSiteName) || "";
2591
+ const appleTouchIcon = (defaults === null || defaults === void 0 ? void 0 : defaults.appleTouchIcon) || "";
2592
+ const {styles: styles, scripts: scripts} = stateHead;
2593
+ return React.createElement(React.Fragment, null, React.createElement("meta", {
2594
+ charSet: "utf-8"
2595
+ }), React.createElement("meta", {
2596
+ name: "robots",
2597
+ content: robots
2598
+ }), React.createElement("meta", {
2599
+ name: "viewport",
2600
+ content: viewport
2601
+ }), React.createElement("meta", {
2602
+ name: "description",
2603
+ content: descriptionValue
2604
+ }), React.createElement("title", null, titleValue), React.createElement("meta", {
2605
+ name: "title",
2606
+ content: titleValue
2607
+ }), React.createElement("meta", {
2608
+ name: "description",
2609
+ content: descriptionValue
2610
+ }), apiDomain && React.createElement(React.Fragment, null, React.createElement("link", {
2611
+ rel: "preconnect",
2612
+ href: apiDomain
2613
+ }), React.createElement("link", {
2614
+ rel: "dns-prefetch",
2615
+ href: apiDomain
2616
+ })), faviconIcon && React.createElement("link", {
2617
+ rel: "icon",
2618
+ sizes: "64x64",
2619
+ href: faviconIcon
2620
+ }), favicon32 && React.createElement("link", {
2621
+ rel: "icon",
2622
+ type: "image/png",
2623
+ sizes: "32x32",
2624
+ href: favicon32
2625
+ }), favicon16 && React.createElement("link", {
2626
+ rel: "icon",
2627
+ type: "image/png",
2628
+ sizes: "16x16",
2629
+ href: favicon16
2630
+ }), manifest && React.createElement("link", {
2631
+ rel: "manifest",
2632
+ href: manifest
2633
+ }), themeColor && React.createElement("meta", {
2634
+ name: "theme-color",
2635
+ content: themeColor
2636
+ }), canonicalURL && React.createElement("link", {
2637
+ rel: "canonical",
2638
+ href: canonicalURL
2639
+ }), React.createElement("meta", {
2640
+ property: "og:type",
2641
+ content: "website"
2642
+ }), React.createElement("meta", {
2643
+ property: "og:title",
2644
+ content: ogTitleValue
2645
+ }), React.createElement("meta", {
2646
+ property: "og:image",
2647
+ content: ogImageValue
2648
+ }), React.createElement("meta", {
2649
+ property: "og:image:width",
2650
+ content: ogImageWidth
2651
+ }), React.createElement("meta", {
2652
+ property: "og:image:height",
2653
+ content: ogImageHeight
2654
+ }), ogSiteName && React.createElement("meta", {
2655
+ property: "og:site_name",
2656
+ content: ogSiteName
2657
+ }), React.createElement("meta", {
2658
+ property: "og:url",
2659
+ content: ogURLValue
2660
+ }), React.createElement("meta", {
2661
+ property: "og:description",
2662
+ content: ogDescriptionValue
2663
+ }), React.createElement("meta", {
2664
+ property: "twitter:card",
2665
+ content: "summary_large_image"
2666
+ }), React.createElement("meta", {
2667
+ property: "twitter:url",
2668
+ content: ogURLValue
2669
+ }), React.createElement("meta", {
2670
+ property: "twitter:title",
2671
+ content: ogTitleValue
2672
+ }), React.createElement("meta", {
2673
+ property: "twitter:description",
2674
+ content: ogDescriptionValue
2675
+ }), React.createElement("meta", {
2676
+ property: "twitter:image",
2677
+ content: ogImageValue
2678
+ }), React.createElement("meta", {
2679
+ name: "apple-mobile-web-app-capable",
2680
+ content: "yes"
2681
+ }), React.createElement("meta", {
2682
+ name: "apple-mobile-web-app-status-bar-style",
2683
+ content: "default"
2684
+ }), React.createElement("meta", {
2685
+ name: "apple-mobile-web-app-title",
2686
+ content: titleValue
2687
+ }), appleTouchIcon && React.createElement("link", {
2688
+ rel: "apple-touch-icon",
2689
+ sizes: "180x180",
2690
+ href: appleTouchIcon
2691
+ }), children, styles === null || styles === void 0 ? void 0 : styles.map((style => React.createElement("link", {
2692
+ rel: "stylesheet",
2693
+ key: "head-style" + style,
2694
+ href: style
2695
+ }))), scripts === null || scripts === void 0 ? void 0 : scripts.map((script => React.createElement("script", {
2696
+ key: "head-script" + script,
2697
+ src: script
2698
+ }))));
2699
+ };
2700
+
2701
+ const mapStateToProperties$7 = (state, ownProperties) => ({
2702
+ stateHead: ownProperties.selectors.notifications.getAll(state)
2703
+ });
2704
+
2705
+ const mapDispatchToProperties$7 = dispatch => ({});
2706
+
2707
+ const ConnectedHead = connect(mapStateToProperties$7, mapDispatchToProperties$7)(Head);
2708
+
2709
+ const head = {
2710
+ Head: ConnectedHead
2711
+ };
2712
+
2563
2713
  const translateUp = keyframes`
2564
2714
  from {
2565
2715
  transform: translateY(2000px);
@@ -2592,7 +2742,7 @@ const StyledNotification = styled.div`
2592
2742
  const StyledNotificationContent = styled.div`
2593
2743
  font-size: 0.9rem;
2594
2744
  padding: 32px 16px;
2595
- word-break: break-all;
2745
+ word-break: ${({wordBreak: wordBreak}) => wordBreak};
2596
2746
  `;
2597
2747
 
2598
2748
  const StyledNotificationClose = styled.div`
@@ -2609,14 +2759,13 @@ const StyledNotificationClose = styled.div`
2609
2759
 
2610
2760
  const Notification = properties => {
2611
2761
  const {data: data, theme: theme, remove: remove, elements: elements, style: style, className: className} = properties;
2612
- const {id: id, text: text, html: html, react: react, timeout: timeout} = data;
2762
+ const {id: id, text: text, html: html, react: react, timeout: timeout, wordBreak: wordBreak} = data;
2763
+ const resolvedWordBreak = wordBreak === false ? "normal" : "break-all";
2613
2764
  const notificationTimeout = useRef(null);
2614
2765
  useEffect((() => {
2615
2766
  if (timeout) {
2616
2767
  notificationTimeout.current = setTimeout((() => {
2617
- remove({
2618
- id: id
2619
- });
2768
+ remove(id);
2620
2769
  }), timeout);
2621
2770
  }
2622
2771
  return () => {
@@ -2625,17 +2774,27 @@ const Notification = properties => {
2625
2774
  }
2626
2775
  };
2627
2776
  }), [ id, timeout, remove ]);
2628
- const content = html ? React.createElement(StyledNotificationContent, {
2629
- dangerouslySetInnerHTML: createMarkup(text)
2630
- }) : react && elements && elements[text] ? React.createElement(StyledNotificationContent, null, elements[text]) : React.createElement(StyledNotificationContent, null, text);
2777
+ const resolveRender = () => {
2778
+ const contentProperties = {
2779
+ wordBreak: resolvedWordBreak
2780
+ };
2781
+ if (html) {
2782
+ return React.createElement(StyledNotificationContent, Object.assign({
2783
+ dangerouslySetInnerHTML: createMarkup(text)
2784
+ }, contentProperties));
2785
+ }
2786
+ if (react && elements && elements[text]) {
2787
+ return React.createElement(StyledNotificationContent, Object.assign({}, contentProperties), elements[text]);
2788
+ }
2789
+ return React.createElement(StyledNotificationContent, Object.assign({}, contentProperties), text);
2790
+ };
2791
+ const content = resolveRender();
2631
2792
  return React.createElement(StyledNotification, {
2632
2793
  theme: theme,
2633
2794
  style: Object.assign({}, style),
2634
2795
  className: className
2635
2796
  }, content, React.createElement(StyledNotificationClose, null, React.createElement(PluridIconDelete, {
2636
- atClick: () => remove({
2637
- id: id
2638
- })
2797
+ atClick: () => remove(id)
2639
2798
  })));
2640
2799
  };
2641
2800
 
@@ -2668,7 +2827,7 @@ const mapStateToProperties$6 = (state, ownProperties) => ({
2668
2827
  });
2669
2828
 
2670
2829
  const mapDispatchToProperties$6 = dispatch => ({
2671
- dispatchRemoveNotification: payload => dispatch(notifications$1.actions.removeNotification(payload))
2830
+ dispatchRemoveNotification: payload => dispatch(notifications$1.actions.remove(payload))
2672
2831
  });
2673
2832
 
2674
2833
  const ConnectedNotifications = connect(mapStateToProperties$6, mapDispatchToProperties$6)(Notifications);
@@ -3116,17 +3275,19 @@ const StyledHorizontalToolbarButton = styled.div`
3116
3275
  color: ${props => props.theme.colorPrimary};
3117
3276
  font-family: ${props => props.theme.fontFamilySansSerif};
3118
3277
 
3119
- :hover {
3120
- background: ${props => props.theme.backgroundColorTertiary};
3121
- }
3278
+ @media (hover: hover) {
3279
+ :hover {
3280
+ background: ${props => props.theme.backgroundColorTertiary};
3281
+ }
3122
3282
 
3123
- :hover svg {
3124
- transform: ${props => {
3283
+ :hover svg {
3284
+ transform: ${props => {
3125
3285
  if (props.scaleIcon) {
3126
3286
  return "scale(1.2)";
3127
3287
  }
3128
3288
  return "";
3129
3289
  }};
3290
+ }
3130
3291
  }
3131
3292
 
3132
3293
  svg {
@@ -3279,17 +3440,19 @@ const StyledVerticalToolbarButton = styled.div`
3279
3440
  return "transparent";
3280
3441
  }};
3281
3442
 
3282
- :hover {
3283
- background: ${props => props.theme.backgroundColorTertiary};
3284
- }
3443
+ @media (hover: hover) {
3444
+ :hover {
3445
+ background: ${props => props.theme.backgroundColorTertiary};
3446
+ }
3285
3447
 
3286
- :hover svg {
3287
- transform: ${props => {
3448
+ :hover svg {
3449
+ transform: ${props => {
3288
3450
  if (props.scaleIcon) {
3289
3451
  return "scale(1.2)";
3290
3452
  }
3291
3453
  return "";
3292
3454
  }};
3455
+ }
3293
3456
  }
3294
3457
 
3295
3458
  svg {
@@ -3534,6 +3697,7 @@ const toolbars = {
3534
3697
  };
3535
3698
 
3536
3699
  const pluridal = {
3700
+ head: head,
3537
3701
  notifications: notifications,
3538
3702
  sitting: sitting,
3539
3703
  toolbars: toolbars