lm-web-controls 1.0.18 → 1.0.19
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.
- package/package.json +1 -1
- package/src/blocks/copyright/index.tsx +1 -1
- package/src/blocks/email/index.tsx +1 -1
- package/src/blocks/instaFeed/index.tsx +14 -4
- package/src/blocks/map/index.tsx +4 -5
- package/src/blocks/phone/index.tsx +2 -2
- package/src/index.ts +1 -1
- package/src/styles/style.css +4 -0
- package/types/lm-web-controls.d.ts +20 -9
package/package.json
CHANGED
|
@@ -7,7 +7,13 @@ 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
|
-
|
|
10
|
+
import "../../styles/style.css";
|
|
11
|
+
|
|
12
|
+
type InstaFeedProps = {
|
|
13
|
+
apiKey: string;
|
|
14
|
+
sliderClassName?: string;
|
|
15
|
+
imgClassName?: string;
|
|
16
|
+
};
|
|
11
17
|
|
|
12
18
|
type InstagramPost = {
|
|
13
19
|
id: string;
|
|
@@ -19,7 +25,11 @@ type InstagramPost = {
|
|
|
19
25
|
|
|
20
26
|
type InstagramPostList = InstagramPost[];
|
|
21
27
|
|
|
22
|
-
export function InstaFeed({
|
|
28
|
+
export function InstaFeed({
|
|
29
|
+
apiKey,
|
|
30
|
+
sliderClassName,
|
|
31
|
+
imgClassName,
|
|
32
|
+
}: InstaFeedProps) {
|
|
23
33
|
const [igFeeds, setIgFeeds] = useState<InstagramPostList | null>(null);
|
|
24
34
|
const [fetchStatus, setFetchStatus] = useState<string>("Loading feeds...");
|
|
25
35
|
|
|
@@ -78,10 +88,10 @@ export function InstaFeed({ apiKey, className }: InstaFeedProps) {
|
|
|
78
88
|
return (
|
|
79
89
|
<>
|
|
80
90
|
{igFeeds ? (
|
|
81
|
-
<Slider {...settings} className={
|
|
91
|
+
<Slider {...settings} className={`${sliderClassName} lm-slider`}>
|
|
82
92
|
{igFeeds?.map((item, i) => {
|
|
83
93
|
return (
|
|
84
|
-
<div key={crypto.randomUUID()}>
|
|
94
|
+
<div key={crypto.randomUUID()} className={imgClassName}>
|
|
85
95
|
<img src={item.media_url} alt={`image-${i}`} />
|
|
86
96
|
</div>
|
|
87
97
|
);
|
package/src/blocks/map/index.tsx
CHANGED
|
@@ -3,12 +3,11 @@ import React from "react";
|
|
|
3
3
|
type MapProps = {
|
|
4
4
|
id?: string;
|
|
5
5
|
address: string;
|
|
6
|
-
height
|
|
7
|
-
width
|
|
8
|
-
key: string;
|
|
6
|
+
height?: string | number;
|
|
7
|
+
width?: string | number;
|
|
9
8
|
};
|
|
10
9
|
|
|
11
|
-
export function Map({ id, address, height, width
|
|
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={
|
|
18
|
+
src={address}
|
|
20
19
|
></iframe>
|
|
21
20
|
);
|
|
22
21
|
}
|
package/src/index.ts
CHANGED
|
@@ -3,25 +3,36 @@ import React, { Component, ChangeEvent } from "react";
|
|
|
3
3
|
declare module "lm-web-controls" {
|
|
4
4
|
type EmailProps = {
|
|
5
5
|
value: string;
|
|
6
|
-
className
|
|
6
|
+
className?: string;
|
|
7
7
|
};
|
|
8
|
-
export const Email: React.FC<EmailProps>;
|
|
9
8
|
|
|
10
9
|
type CopyrightProps = {
|
|
11
10
|
name: string;
|
|
12
|
-
className
|
|
11
|
+
className?: string;
|
|
13
12
|
};
|
|
14
|
-
export const Copyright: React.FC<CopyrightProps>;
|
|
15
13
|
|
|
16
14
|
type PhoneProps = {
|
|
17
15
|
value: string;
|
|
18
|
-
country
|
|
19
|
-
className
|
|
16
|
+
country?: string;
|
|
17
|
+
className?: string;
|
|
20
18
|
};
|
|
21
|
-
export const Phone: React.FC<PhoneProps>;
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
type MapProps = {
|
|
21
|
+
id?: string;
|
|
22
|
+
address: string;
|
|
23
|
+
height?: string | number;
|
|
24
|
+
width?: string | number;
|
|
25
|
+
};
|
|
24
26
|
|
|
25
|
-
type InstaFeedProps = {
|
|
27
|
+
type InstaFeedProps = {
|
|
28
|
+
apiKey: string;
|
|
29
|
+
sliderClassName?: string;
|
|
30
|
+
imgClassName?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Email: React.FC<EmailProps>;
|
|
34
|
+
export const Copyright: React.FC<CopyrightProps>;
|
|
35
|
+
export const Phone: React.FC<PhoneProps>;
|
|
36
|
+
export const Map: React.FC<MapProps>;
|
|
26
37
|
export const InstaFeed: React.FC<InstaFeedProps>;
|
|
27
38
|
}
|