@plurid/plurid-ui-components-react 0.0.0-15 → 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>;
@@ -4,7 +4,7 @@ import { DispatchAction, Notification, notifications } from '@plurid/plurid-ui-s
4
4
  export interface NotificationOwnProperties {
5
5
  data: Notification;
6
6
  theme: Theme;
7
- remove: DispatchAction<typeof notifications.actions.removeNotification>;
7
+ remove: DispatchAction<typeof notifications.actions.remove>;
8
8
  elements?: Record<string, JSX.Element>;
9
9
  style?: React.CSSProperties;
10
10
  className?: string;
@@ -19,7 +19,7 @@ export interface NotificationsStateProperties {
19
19
  stateNotifications: INotification[];
20
20
  }
21
21
  export interface NotificationsDispatchProperties {
22
- dispatchRemoveNotification: DispatchAction<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>;
@@ -2567,6 +2567,149 @@ const universal = {
2567
2567
  varia: varia
2568
2568
  };
2569
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
+
2570
2713
  const translateUp = keyframes`
2571
2714
  from {
2572
2715
  transform: translateY(2000px);
@@ -2684,7 +2827,7 @@ const mapStateToProperties$6 = (state, ownProperties) => ({
2684
2827
  });
2685
2828
 
2686
2829
  const mapDispatchToProperties$6 = dispatch => ({
2687
- dispatchRemoveNotification: payload => dispatch(notifications$1.actions.removeNotification(payload))
2830
+ dispatchRemoveNotification: payload => dispatch(notifications$1.actions.remove(payload))
2688
2831
  });
2689
2832
 
2690
2833
  const ConnectedNotifications = connect(mapStateToProperties$6, mapDispatchToProperties$6)(Notifications);
@@ -3554,6 +3697,7 @@ const toolbars = {
3554
3697
  };
3555
3698
 
3556
3699
  const pluridal = {
3700
+ head: head,
3557
3701
  notifications: notifications,
3558
3702
  sitting: sitting,
3559
3703
  toolbars: toolbars