lm-web-controls 1.0.18 → 1.0.20

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.
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{__assign as e}from"../../_virtual/_tslib.js";import t,{useState as i,useEffect as s}from"react";import o from"react-slick";import"slick-carousel/slick/slick.css";import"slick-carousel/slick/slick-theme.css";function n(n){var l=n.apiKey,r=n.className,c=i(null),a=c[0],m=c[1],d=i("Loading feeds..."),p=d[0],u=d[1];return s((function(){var e="https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,timestamp&access_token=".concat(l),t=fetch(e).then((function(e){return e.json()}));console.log(t),t.then((function(e){m(e.data)})).catch((function(e){u("Something went wrong!"),console.error(e)}))}),[]),t.createElement(t.Fragment,null,a?t.createElement(o,e({},{dots:!0,infinite:!0,autoplay:!0,speed:2e3,slidesToShow:6,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:3,infinite:!0,dots:!0}},{breakpoint:600,settings:{slidesToShow:2,slidesToScroll:2,infinite:!0,dots:!0}},{breakpoint:480,settings:{slidesToShow:2,slidesToScroll:2,infinite:!0,dots:!0}}]},{className:r}),null==a?void 0:a.map((function(e,i){return t.createElement("div",{key:crypto.randomUUID()},t.createElement("img",{src:e.media_url,alt:"image-".concat(i)}))}))):t.createElement("h3",{className:"text-center"},p))}export{n as InstaFeed};
2
+ import{__assign as e}from"../../_virtual/_tslib.js";import t,{useState as i,useEffect as s}from"react";import o from"react-slick";import"slick-carousel/slick/slick.css";import"slick-carousel/slick/slick-theme.css";function n(n){var l=n.apiKey,c=n.className,r=i(null),a=r[0],m=r[1],d=i("Loading feeds..."),p=d[0],u=d[1];return s((function(){var e="https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,timestamp&access_token=".concat(l),t=fetch(e).then((function(e){return e.json()}));console.log(t),t.then((function(e){m(e.data)})).catch((function(e){u("Something went wrong!"),console.error(e)}))}),[]),t.createElement(t.Fragment,null,a?t.createElement(o,e({},{dots:!0,infinite:!0,autoplay:!0,speed:2e3,slidesToShow:6,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:3,infinite:!0,dots:!0}},{breakpoint:600,settings:{slidesToShow:2,slidesToScroll:2,infinite:!0,dots:!0}},{breakpoint:480,settings:{slidesToShow:2,slidesToScroll:2,infinite:!0,dots:!0}}]},{className:"".concat(c," lm-slider")}),null==a?void 0:a.map((function(e,i){return t.createElement("div",{key:crypto.randomUUID()},t.createElement("img",{src:e.media_url,alt:"image-".concat(i)}))}))):t.createElement("h3",{className:"text-center"},p))}export{n as InstaFeed};
@@ -0,0 +1 @@
1
+ import r from"react";function e(e){var i=e.id,t=e.address,d=e.height,a=e.width;return r.createElement("iframe",{id:i,width:a,height:d,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",src:t})}export{e as Map};
package/dist/index.css ADDED
@@ -0,0 +1 @@
1
+ .lm-slider{background:red;height:100vh}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{Copyright}from"./blocks/copyright/index.js";export{Email}from"./blocks/email/index.js";export{InstaFeed}from"./blocks/instaFeed/index.js";export{Phone}from"./blocks/phone/index.js";
1
+ export{Copyright}from"./blocks/copyright/index.js";export{Email}from"./blocks/email/index.js";export{InstaFeed}from"./blocks/instaFeed/index.js";export{Map}from"./blocks/map/index.js";export{Phone}from"./blocks/phone/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lm-web-controls",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "leadmetrics-lm-web-controls",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -24,8 +24,10 @@
24
24
  "@rollup/plugin-alias": "5.1.0",
25
25
  "@types/react": "18.2.65",
26
26
  "babel-loader": "9.1.3",
27
+ "postcss": "^8.4.35",
27
28
  "react": "18.2.0",
28
29
  "react-dom": "18.2.0",
30
+ "rollup-plugin-postcss": "^4.0.2",
29
31
  "rollup-plugin-preserve-directives": "^0.4.0",
30
32
  "typescript": "5.4.2"
31
33
  },
package/rollup.config.mjs CHANGED
@@ -4,6 +4,7 @@ import external from "rollup-plugin-peer-deps-external";
4
4
  import { terser } from "rollup-plugin-terser";
5
5
  import typescript from "rollup-plugin-typescript2";
6
6
  import preserveDirectives from "rollup-plugin-preserve-directives";
7
+ import postcss from "rollup-plugin-postcss";
7
8
 
8
9
  export default [
9
10
  {
@@ -35,6 +36,10 @@ export default [
35
36
  terser(),
36
37
  typescript({ useTsconfigDeclarationDir: true }),
37
38
  preserveDirectives(),
39
+ postcss({
40
+ extract: true,
41
+ minimize: true,
42
+ }),
38
43
  ],
39
44
  },
40
45
  ];
@@ -2,7 +2,7 @@ import React from "react";
2
2
 
3
3
  type CopyrightProps = {
4
4
  name: string;
5
- className: string;
5
+ className?: string;
6
6
  };
7
7
 
8
8
  export function Copyright({ name, className }: CopyrightProps) {
@@ -2,7 +2,7 @@ import React from "react";
2
2
 
3
3
  type EmailProps = {
4
4
  value: string;
5
- className: string;
5
+ className?: string;
6
6
  };
7
7
 
8
8
  export function Email({ value, className }: EmailProps) {
@@ -7,7 +7,12 @@ import { useEffect, useState } from "react";
7
7
  import "slick-carousel/slick/slick.css";
8
8
  import "slick-carousel/slick/slick-theme.css";
9
9
 
10
- type InstaFeedProps = { apiKey: string; className: string };
10
+ import "../../styles/style.css";
11
+
12
+ type InstaFeedProps = {
13
+ apiKey: string;
14
+ className?: string;
15
+ };
11
16
 
12
17
  type InstagramPost = {
13
18
  id: string;
@@ -78,7 +83,7 @@ export function InstaFeed({ apiKey, className }: InstaFeedProps) {
78
83
  return (
79
84
  <>
80
85
  {igFeeds ? (
81
- <Slider {...settings} className={className}>
86
+ <Slider {...settings} className={`${className} lm-slider`}>
82
87
  {igFeeds?.map((item, i) => {
83
88
  return (
84
89
  <div key={crypto.randomUUID()}>
@@ -3,12 +3,11 @@ import React from "react";
3
3
  type MapProps = {
4
4
  id?: string;
5
5
  address: string;
6
- height: string | number;
7
- width: string | number;
8
- key: string;
6
+ height?: string | number;
7
+ width?: string | number;
9
8
  };
10
9
 
11
- export function Map({ id, address, height, width, key }: MapProps) {
10
+ export function Map({ id, address, height, width }: MapProps) {
12
11
  return (
13
12
  <iframe
14
13
  id={id}
@@ -16,7 +15,7 @@ export function Map({ id, address, height, width, key }: MapProps) {
16
15
  height={height}
17
16
  loading="lazy"
18
17
  referrerPolicy="no-referrer-when-downgrade"
19
- src={`https://www.google.com/maps/embed/v1/place?key=${process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}&q=place_id:ChIJaZ6ne_U_rjsRFN98AFmq6hg`}
18
+ src={address}
20
19
  ></iframe>
21
20
  );
22
21
  }
@@ -2,8 +2,8 @@ import React from "react";
2
2
 
3
3
  type PhoneProps = {
4
4
  value: string;
5
- country: string;
6
- className: string;
5
+ country?: string;
6
+ className?: string;
7
7
  };
8
8
 
9
9
  export function Phone({ value, country, className }: PhoneProps) {
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./blocks/copyright";
2
2
  export * from "./blocks/email";
3
3
  export * from "./blocks/instaFeed";
4
- //export * from "./blocks/map";
4
+ export * from "./blocks/map";
5
5
  export * from "./blocks/phone";
@@ -0,0 +1,4 @@
1
+ .lm-slider {
2
+ height: 100vh;
3
+ background: red;
4
+ }
@@ -3,25 +3,35 @@ import React, { Component, ChangeEvent } from "react";
3
3
  declare module "lm-web-controls" {
4
4
  type EmailProps = {
5
5
  value: string;
6
- className: string;
6
+ className?: string;
7
7
  };
8
- export const Email: React.FC<EmailProps>;
9
8
 
10
9
  type CopyrightProps = {
11
10
  name: string;
12
- className: string;
11
+ className?: string;
13
12
  };
14
- export const Copyright: React.FC<CopyrightProps>;
15
13
 
16
14
  type PhoneProps = {
17
15
  value: string;
18
- country: string;
19
- className: string;
16
+ country?: string;
17
+ className?: string;
20
18
  };
21
- export const Phone: React.FC<PhoneProps>;
22
19
 
23
- //email
20
+ type MapProps = {
21
+ id?: string;
22
+ address: string;
23
+ height?: string | number;
24
+ width?: string | number;
25
+ };
24
26
 
25
- type InstaFeedProps = { apiKey: string; className: string };
27
+ type InstaFeedProps = {
28
+ apiKey: string;
29
+ className?: string;
30
+ };
31
+
32
+ export const Email: React.FC<EmailProps>;
33
+ export const Copyright: React.FC<CopyrightProps>;
34
+ export const Phone: React.FC<PhoneProps>;
35
+ export const Map: React.FC<MapProps>;
26
36
  export const InstaFeed: React.FC<InstaFeedProps>;
27
37
  }