lm-web-controls 1.0.19 → 1.0.21
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
|
|
2
|
+
import{__assign as e}from"../../_virtual/_tslib.js";import t,{useState as s,useEffect as i}from"react";import o from"react-slick";import"slick-carousel/slick/slick.css";import"slick-carousel/slick/slick-theme.css";import"../../styles/style.css";function n(n){var l=n.apiKey,c=n.className,r=s(null),a=r[0],m=r[1],d=s("Loading feeds..."),p=d[0],u=d[1];return i((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,s){return t.createElement("div",{key:crypto.randomUUID()},t.createElement("img",{src:e.media_url,alt:"image-".concat(s)}))}))):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.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.
|
|
3
|
+
"version": "1.0.21",
|
|
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,10 +4,12 @@ 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
|
{
|
|
10
11
|
input: "./src/index.ts",
|
|
12
|
+
external: ["./../../styles/style.css"],
|
|
11
13
|
output: [
|
|
12
14
|
// {
|
|
13
15
|
// preserveModules: true,
|
|
@@ -24,6 +26,10 @@ export default [
|
|
|
24
26
|
},
|
|
25
27
|
],
|
|
26
28
|
plugins: [
|
|
29
|
+
postcss({
|
|
30
|
+
extract: "styles/style.css",
|
|
31
|
+
minimize: true,
|
|
32
|
+
}),
|
|
27
33
|
babel({
|
|
28
34
|
exclude: "node_modules/**",
|
|
29
35
|
presets: ["@babel/preset-react"],
|
|
@@ -7,12 +7,11 @@ 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
|
-
import "
|
|
10
|
+
import "./../../styles/style.css";
|
|
11
11
|
|
|
12
12
|
type InstaFeedProps = {
|
|
13
13
|
apiKey: string;
|
|
14
|
-
|
|
15
|
-
imgClassName?: string;
|
|
14
|
+
className?: string;
|
|
16
15
|
};
|
|
17
16
|
|
|
18
17
|
type InstagramPost = {
|
|
@@ -25,11 +24,7 @@ type InstagramPost = {
|
|
|
25
24
|
|
|
26
25
|
type InstagramPostList = InstagramPost[];
|
|
27
26
|
|
|
28
|
-
export function InstaFeed({
|
|
29
|
-
apiKey,
|
|
30
|
-
sliderClassName,
|
|
31
|
-
imgClassName,
|
|
32
|
-
}: InstaFeedProps) {
|
|
27
|
+
export function InstaFeed({ apiKey, className }: InstaFeedProps) {
|
|
33
28
|
const [igFeeds, setIgFeeds] = useState<InstagramPostList | null>(null);
|
|
34
29
|
const [fetchStatus, setFetchStatus] = useState<string>("Loading feeds...");
|
|
35
30
|
|
|
@@ -88,10 +83,10 @@ export function InstaFeed({
|
|
|
88
83
|
return (
|
|
89
84
|
<>
|
|
90
85
|
{igFeeds ? (
|
|
91
|
-
<Slider {...settings} className={`${
|
|
86
|
+
<Slider {...settings} className={`${className} lm-slider`}>
|
|
92
87
|
{igFeeds?.map((item, i) => {
|
|
93
88
|
return (
|
|
94
|
-
<div key={crypto.randomUUID()}
|
|
89
|
+
<div key={crypto.randomUUID()}>
|
|
95
90
|
<img src={item.media_url} alt={`image-${i}`} />
|
|
96
91
|
</div>
|
|
97
92
|
);
|