@plasmicpkgs/react-twitter-widgets 0.0.2 → 0.0.7
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/dist/Twitter.d.ts +8 -3
- package/dist/react-twitter-widgets.cjs.development.js +59 -5
- package/dist/react-twitter-widgets.cjs.development.js.map +1 -1
- package/dist/react-twitter-widgets.cjs.production.min.js +1 -1
- package/dist/react-twitter-widgets.cjs.production.min.js.map +1 -1
- package/dist/react-twitter-widgets.esm.js +59 -5
- package/dist/react-twitter-widgets.esm.js.map +1 -1
- package/package.json +3 -2
package/dist/Twitter.d.ts
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import { ComponentMeta } from "@plasmicapp/host";
|
|
2
2
|
import registerComponent from "@plasmicapp/host/registerComponent";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
|
-
export declare function TimelineWrapper({ className, url, }: {
|
|
4
|
+
export declare function TimelineWrapper({ className, url, tweetLimit, chrome, theme, }: {
|
|
5
5
|
className?: string;
|
|
6
6
|
url?: string;
|
|
7
|
+
tweetLimit?: number;
|
|
8
|
+
chrome?: string;
|
|
9
|
+
theme?: string;
|
|
7
10
|
}): JSX.Element;
|
|
8
11
|
export declare const timelineWrapper: ComponentMeta<ComponentProps<typeof TimelineWrapper>>;
|
|
9
12
|
export declare function registerTimelineWrapper(loader?: {
|
|
10
13
|
registerComponent: typeof registerComponent;
|
|
11
14
|
}, customTimelineWrapper?: ComponentMeta<ComponentProps<typeof TimelineWrapper>>): void;
|
|
12
|
-
export declare function TweetWrapper({ className, tweetId, }: {
|
|
15
|
+
export declare function TweetWrapper({ className, tweetId, theme, }: {
|
|
13
16
|
className?: string;
|
|
14
17
|
tweetId?: string;
|
|
18
|
+
theme?: string;
|
|
15
19
|
}): JSX.Element;
|
|
16
20
|
export declare const tweetWrapper: ComponentMeta<ComponentProps<typeof TweetWrapper>>;
|
|
17
21
|
export declare function registerTweetWrapper(loader?: {
|
|
18
22
|
registerComponent: typeof registerComponent;
|
|
19
23
|
}, customTweetWrapper?: ComponentMeta<ComponentProps<typeof TweetWrapper>>): void;
|
|
20
|
-
export declare function FollowWrapper({ className, username, }: {
|
|
24
|
+
export declare function FollowWrapper({ className, username, large, }: {
|
|
21
25
|
className?: string;
|
|
22
26
|
username?: string;
|
|
27
|
+
large?: boolean;
|
|
23
28
|
}): JSX.Element;
|
|
24
29
|
export declare const followWrapper: ComponentMeta<ComponentProps<typeof FollowWrapper>>;
|
|
25
30
|
export declare function registerFollowWrapper(loader?: {
|
|
@@ -17,7 +17,10 @@ var reactTwitterWidgets = require('react-twitter-widgets');
|
|
|
17
17
|
|
|
18
18
|
function TimelineWrapper(_ref) {
|
|
19
19
|
var className = _ref.className,
|
|
20
|
-
url = _ref.url
|
|
20
|
+
url = _ref.url,
|
|
21
|
+
tweetLimit = _ref.tweetLimit,
|
|
22
|
+
chrome = _ref.chrome,
|
|
23
|
+
theme = _ref.theme;
|
|
21
24
|
|
|
22
25
|
if (!url) {
|
|
23
26
|
throw new Error("Timeline component requires a URL");
|
|
@@ -29,6 +32,11 @@ function TimelineWrapper(_ref) {
|
|
|
29
32
|
dataSource: {
|
|
30
33
|
sourceType: "url",
|
|
31
34
|
url: url
|
|
35
|
+
},
|
|
36
|
+
options: {
|
|
37
|
+
tweetLimit: tweetLimit,
|
|
38
|
+
chrome: chrome,
|
|
39
|
+
theme: theme
|
|
32
40
|
}
|
|
33
41
|
}));
|
|
34
42
|
}
|
|
@@ -42,7 +50,30 @@ var timelineWrapper = {
|
|
|
42
50
|
type: "string",
|
|
43
51
|
description: "URL to a Twitter user or list",
|
|
44
52
|
defaultValue: "https://twitter.com/plasmicapp"
|
|
53
|
+
},
|
|
54
|
+
tweetLimit: {
|
|
55
|
+
type: "number",
|
|
56
|
+
description: "Number of tweets to be displayed. Between 1 and 20",
|
|
57
|
+
min: 1,
|
|
58
|
+
max: 20
|
|
59
|
+
},
|
|
60
|
+
chrome: {
|
|
61
|
+
type: "choice",
|
|
62
|
+
description: "Toggle the display of design elements in the widget",
|
|
63
|
+
multiSelect: true,
|
|
64
|
+
options: ["noheader", "nofooter", "noborders", "transparent", "noscrollbar"]
|
|
65
|
+
},
|
|
66
|
+
theme: {
|
|
67
|
+
type: "choice",
|
|
68
|
+
description: "Toggle the default color scheme",
|
|
69
|
+
options: ["dark", "light"],
|
|
70
|
+
defaultValueHint: "light"
|
|
45
71
|
}
|
|
72
|
+
},
|
|
73
|
+
defaultStyles: {
|
|
74
|
+
display: "flex",
|
|
75
|
+
flexDirection: "column",
|
|
76
|
+
overflowY: "auto"
|
|
46
77
|
}
|
|
47
78
|
};
|
|
48
79
|
function registerTimelineWrapper(loader, customTimelineWrapper) {
|
|
@@ -54,7 +85,8 @@ function registerTimelineWrapper(loader, customTimelineWrapper) {
|
|
|
54
85
|
}
|
|
55
86
|
function TweetWrapper(_ref2) {
|
|
56
87
|
var className = _ref2.className,
|
|
57
|
-
tweetId = _ref2.tweetId
|
|
88
|
+
tweetId = _ref2.tweetId,
|
|
89
|
+
theme = _ref2.theme;
|
|
58
90
|
|
|
59
91
|
if (!tweetId) {
|
|
60
92
|
throw new Error("Tweet component requires a tweetId");
|
|
@@ -63,7 +95,10 @@ function TweetWrapper(_ref2) {
|
|
|
63
95
|
return React.createElement("div", {
|
|
64
96
|
className: className
|
|
65
97
|
}, React.createElement(reactTwitterWidgets.Tweet, {
|
|
66
|
-
tweetId: tweetId
|
|
98
|
+
tweetId: tweetId,
|
|
99
|
+
options: {
|
|
100
|
+
theme: theme
|
|
101
|
+
}
|
|
67
102
|
}));
|
|
68
103
|
}
|
|
69
104
|
var tweetWrapper = {
|
|
@@ -76,7 +111,18 @@ var tweetWrapper = {
|
|
|
76
111
|
type: "string",
|
|
77
112
|
description: "The tweet ID",
|
|
78
113
|
defaultValue: "1381980305305694209"
|
|
114
|
+
},
|
|
115
|
+
theme: {
|
|
116
|
+
type: "choice",
|
|
117
|
+
description: "Toggle the default color scheme",
|
|
118
|
+
options: ["dark", "light"],
|
|
119
|
+
defaultValueHint: "light"
|
|
79
120
|
}
|
|
121
|
+
},
|
|
122
|
+
defaultStyles: {
|
|
123
|
+
display: "flex",
|
|
124
|
+
flexDirection: "column",
|
|
125
|
+
overflowY: "auto"
|
|
80
126
|
}
|
|
81
127
|
};
|
|
82
128
|
function registerTweetWrapper(loader, customTweetWrapper) {
|
|
@@ -88,7 +134,8 @@ function registerTweetWrapper(loader, customTweetWrapper) {
|
|
|
88
134
|
}
|
|
89
135
|
function FollowWrapper(_ref3) {
|
|
90
136
|
var className = _ref3.className,
|
|
91
|
-
username = _ref3.username
|
|
137
|
+
username = _ref3.username,
|
|
138
|
+
large = _ref3.large;
|
|
92
139
|
|
|
93
140
|
if (!username) {
|
|
94
141
|
throw new Error("Follow component requires a username");
|
|
@@ -97,7 +144,10 @@ function FollowWrapper(_ref3) {
|
|
|
97
144
|
return React.createElement("div", {
|
|
98
145
|
className: className
|
|
99
146
|
}, React.createElement(reactTwitterWidgets.Follow, {
|
|
100
|
-
username: username
|
|
147
|
+
username: username,
|
|
148
|
+
options: {
|
|
149
|
+
size: large ? "large" : undefined
|
|
150
|
+
}
|
|
101
151
|
}));
|
|
102
152
|
}
|
|
103
153
|
var followWrapper = {
|
|
@@ -110,6 +160,10 @@ var followWrapper = {
|
|
|
110
160
|
type: "string",
|
|
111
161
|
description: "Twitter username to follow",
|
|
112
162
|
defaultValue: "plasmicapp"
|
|
163
|
+
},
|
|
164
|
+
large: {
|
|
165
|
+
type: "boolean",
|
|
166
|
+
description: "Toggle the button size"
|
|
113
167
|
}
|
|
114
168
|
}
|
|
115
169
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-twitter-widgets.cjs.development.js","sources":["../src/Twitter.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { ComponentProps } from \"react\";\nimport { Follow, Timeline, Tweet } from \"react-twitter-widgets\";\n\n//\n// This module registers Timeline, Tweet, and Follow, but not yet the Hashtag /\n// Mention / Share components (would be easy additions).\n//\n// The components auto-size their heights by default, so it's actually\n// sufficient to rely on just layout out an enclosing div.\n//\n\nexport function TimelineWrapper({\n className,\n url,\n}: {\n className?: string;\n url?: string;\n}) {\n if (!url) {\n throw new Error(\"Timeline component requires a URL\");\n }\n return (\n <div className={className}>\n <Timeline
|
|
1
|
+
{"version":3,"file":"react-twitter-widgets.cjs.development.js","sources":["../src/Twitter.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { ComponentProps } from \"react\";\nimport { Follow, Timeline, Tweet } from \"react-twitter-widgets\";\n\n//\n// This module registers Timeline, Tweet, and Follow, but not yet the Hashtag /\n// Mention / Share components (would be easy additions).\n//\n// The components auto-size their heights by default, so it's actually\n// sufficient to rely on just layout out an enclosing div.\n//\n\nexport function TimelineWrapper({\n className,\n url,\n tweetLimit,\n chrome,\n theme,\n}: {\n className?: string;\n url?: string;\n tweetLimit?: number;\n chrome?: string;\n theme?: string;\n}) {\n if (!url) {\n throw new Error(\"Timeline component requires a URL\");\n }\n return (\n <div className={className}>\n <Timeline\n dataSource={{ sourceType: \"url\", url }}\n options={{\n tweetLimit: tweetLimit,\n chrome: chrome,\n theme: theme,\n }}\n />\n </div>\n );\n}\n\nexport const timelineWrapper: ComponentMeta<ComponentProps<\n typeof TimelineWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-timeline\",\n displayName: \"Timeline\",\n importName: \"TimelineWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n url: {\n type: \"string\",\n description: \"URL to a Twitter user or list\",\n defaultValue: \"https://twitter.com/plasmicapp\",\n },\n tweetLimit: {\n type: \"number\",\n description: \"Number of tweets to be displayed. Between 1 and 20\",\n min: 1,\n max: 20,\n },\n chrome: {\n type: \"choice\",\n description: \"Toggle the display of design elements in the widget\",\n multiSelect: true,\n options: [\n \"noheader\",\n \"nofooter\",\n \"noborders\",\n \"transparent\",\n \"noscrollbar\",\n ],\n },\n theme: {\n type: \"choice\",\n description: \"Toggle the default color scheme\",\n options: [\"dark\", \"light\"],\n defaultValueHint: \"light\",\n },\n },\n defaultStyles: {\n display: \"flex\",\n flexDirection: \"column\",\n overflowY: \"auto\",\n },\n};\n\nexport function registerTimelineWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customTimelineWrapper?: ComponentMeta<ComponentProps<typeof TimelineWrapper>>\n) {\n if (loader) {\n loader.registerComponent(\n TimelineWrapper,\n customTimelineWrapper ?? timelineWrapper\n );\n } else {\n registerComponent(\n TimelineWrapper,\n customTimelineWrapper ?? timelineWrapper\n );\n }\n}\n\nexport function TweetWrapper({\n className,\n tweetId,\n theme,\n}: {\n className?: string;\n tweetId?: string;\n theme?: string;\n}) {\n if (!tweetId) {\n throw new Error(\"Tweet component requires a tweetId\");\n }\n return (\n <div className={className}>\n <Tweet tweetId={tweetId} options={{ theme: theme }} />\n </div>\n );\n}\n\nexport const tweetWrapper: ComponentMeta<ComponentProps<\n typeof TweetWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-tweet\",\n displayName: \"Tweet\",\n importName: \"TweetWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n tweetId: {\n type: \"string\",\n description: \"The tweet ID\",\n defaultValue: \"1381980305305694209\",\n },\n theme: {\n type: \"choice\",\n description: \"Toggle the default color scheme\",\n options: [\"dark\", \"light\"],\n defaultValueHint: \"light\",\n },\n },\n defaultStyles: {\n display: \"flex\",\n flexDirection: \"column\",\n overflowY: \"auto\",\n },\n};\n\nexport function registerTweetWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customTweetWrapper?: ComponentMeta<ComponentProps<typeof TweetWrapper>>\n) {\n if (loader) {\n loader.registerComponent(TweetWrapper, customTweetWrapper ?? tweetWrapper);\n } else {\n registerComponent(TweetWrapper, customTweetWrapper ?? tweetWrapper);\n }\n}\n\nexport function FollowWrapper({\n className,\n username,\n large,\n}: {\n className?: string;\n username?: string;\n large?: boolean;\n}) {\n if (!username) {\n throw new Error(\"Follow component requires a username\");\n }\n return (\n <div className={className}>\n <Follow\n username={username}\n options={{ size: large ? \"large\" : undefined }}\n />\n </div>\n );\n}\n\nexport const followWrapper: ComponentMeta<ComponentProps<\n typeof FollowWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-follow\",\n displayName: \"Follow\",\n importName: \"FollowWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n username: {\n type: \"string\",\n description: \"Twitter username to follow\",\n defaultValue: \"plasmicapp\",\n },\n large: {\n type: \"boolean\",\n description: \"Toggle the button size\",\n },\n },\n};\n\nexport function registerFollowWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customFollowWrapper?: ComponentMeta<ComponentProps<typeof FollowWrapper>>\n) {\n if (loader) {\n loader.registerComponent(\n FollowWrapper,\n customFollowWrapper ?? followWrapper\n );\n } else {\n registerComponent(FollowWrapper, customFollowWrapper ?? followWrapper);\n }\n}\n"],"names":["TimelineWrapper","className","url","tweetLimit","chrome","theme","Error","React","Timeline","dataSource","sourceType","options","timelineWrapper","name","displayName","importName","importPath","props","type","description","defaultValue","min","max","multiSelect","defaultValueHint","defaultStyles","display","flexDirection","overflowY","registerTimelineWrapper","loader","customTimelineWrapper","registerComponent","TweetWrapper","tweetId","Tweet","tweetWrapper","registerTweetWrapper","customTweetWrapper","FollowWrapper","username","large","Follow","size","undefined","followWrapper","registerFollowWrapper","customFollowWrapper"],"mappings":";;;;;;;;;;AAMA;AACA;AACA;AACA;AACA;AACA;;SAEgBA;MACdC,iBAAAA;MACAC,WAAAA;MACAC,kBAAAA;MACAC,cAAAA;MACAC,aAAAA;;AAQA,MAAI,CAACH,GAAL,EAAU;AACR,UAAM,IAAII,KAAJ,CAAU,mCAAV,CAAN;AACD;;AACD,SACEC,mBAAA,MAAA;AAAKN,IAAAA,SAAS,EAAEA;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iBAAiB,CAACO,aAAD,EAAgBQ,mBAAhB,WAAgBA,mBAAhB,GAAuCF,aAAvC,CAAjB;AACD;AACF;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),r=e(require("react")),
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@plasmicapp/host/registerComponent")),r=e(require("react")),o=require("react-twitter-widgets");function i(e){var t=e.className,i=e.url,l=e.tweetLimit,a=e.chrome,s=e.theme;if(!i)throw new Error("Timeline component requires a URL");return r.createElement("div",{className:t},r.createElement(o.Timeline,{dataSource:{sourceType:"url",url:i},options:{tweetLimit:l,chrome:a,theme:s}}))}var l={name:"hostless-react-twitter-widgets-timeline",displayName:"Timeline",importName:"TimelineWrapper",importPath:"@plasmicpkgs/react-twitter-widgets",props:{url:{type:"string",description:"URL to a Twitter user or list",defaultValue:"https://twitter.com/plasmicapp"},tweetLimit:{type:"number",description:"Number of tweets to be displayed. Between 1 and 20",min:1,max:20},chrome:{type:"choice",description:"Toggle the display of design elements in the widget",multiSelect:!0,options:["noheader","nofooter","noborders","transparent","noscrollbar"]},theme:{type:"choice",description:"Toggle the default color scheme",options:["dark","light"],defaultValueHint:"light"}},defaultStyles:{display:"flex",flexDirection:"column",overflowY:"auto"}};function a(e){var t=e.className,i=e.tweetId,l=e.theme;if(!i)throw new Error("Tweet component requires a tweetId");return r.createElement("div",{className:t},r.createElement(o.Tweet,{tweetId:i,options:{theme:l}}))}var s={name:"hostless-react-twitter-widgets-tweet",displayName:"Tweet",importName:"TweetWrapper",importPath:"@plasmicpkgs/react-twitter-widgets",props:{tweetId:{type:"string",description:"The tweet ID",defaultValue:"1381980305305694209"},theme:{type:"choice",description:"Toggle the default color scheme",options:["dark","light"],defaultValueHint:"light"}},defaultStyles:{display:"flex",flexDirection:"column",overflowY:"auto"}};function n(e){var t=e.className,i=e.username,l=e.large;if(!i)throw new Error("Follow component requires a username");return r.createElement("div",{className:t},r.createElement(o.Follow,{username:i,options:{size:l?"large":void 0}}))}var p={name:"hostless-react-twitter-widgets-follow",displayName:"Follow",importName:"FollowWrapper",importPath:"@plasmicpkgs/react-twitter-widgets",props:{username:{type:"string",description:"Twitter username to follow",defaultValue:"plasmicapp"},large:{type:"boolean",description:"Toggle the button size"}}};exports.FollowWrapper=n,exports.TimelineWrapper=i,exports.TweetWrapper=a,exports.followWrapper=p,exports.registerFollowWrapper=function(e,r){e?e.registerComponent(n,null!=r?r:p):t(n,null!=r?r:p)},exports.registerTimelineWrapper=function(e,r){e?e.registerComponent(i,null!=r?r:l):t(i,null!=r?r:l)},exports.registerTweetWrapper=function(e,r){e?e.registerComponent(a,null!=r?r:s):t(a,null!=r?r:s)},exports.timelineWrapper=l,exports.tweetWrapper=s;
|
|
2
2
|
//# sourceMappingURL=react-twitter-widgets.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-twitter-widgets.cjs.production.min.js","sources":["../src/Twitter.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { ComponentProps } from \"react\";\nimport { Follow, Timeline, Tweet } from \"react-twitter-widgets\";\n\n//\n// This module registers Timeline, Tweet, and Follow, but not yet the Hashtag /\n// Mention / Share components (would be easy additions).\n//\n// The components auto-size their heights by default, so it's actually\n// sufficient to rely on just layout out an enclosing div.\n//\n\nexport function TimelineWrapper({\n className,\n url,\n}: {\n className?: string;\n url?: string;\n}) {\n if (!url) {\n throw new Error(\"Timeline component requires a URL\");\n }\n return (\n <div className={className}>\n <Timeline
|
|
1
|
+
{"version":3,"file":"react-twitter-widgets.cjs.production.min.js","sources":["../src/Twitter.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { ComponentProps } from \"react\";\nimport { Follow, Timeline, Tweet } from \"react-twitter-widgets\";\n\n//\n// This module registers Timeline, Tweet, and Follow, but not yet the Hashtag /\n// Mention / Share components (would be easy additions).\n//\n// The components auto-size their heights by default, so it's actually\n// sufficient to rely on just layout out an enclosing div.\n//\n\nexport function TimelineWrapper({\n className,\n url,\n tweetLimit,\n chrome,\n theme,\n}: {\n className?: string;\n url?: string;\n tweetLimit?: number;\n chrome?: string;\n theme?: string;\n}) {\n if (!url) {\n throw new Error(\"Timeline component requires a URL\");\n }\n return (\n <div className={className}>\n <Timeline\n dataSource={{ sourceType: \"url\", url }}\n options={{\n tweetLimit: tweetLimit,\n chrome: chrome,\n theme: theme,\n }}\n />\n </div>\n );\n}\n\nexport const timelineWrapper: ComponentMeta<ComponentProps<\n typeof TimelineWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-timeline\",\n displayName: \"Timeline\",\n importName: \"TimelineWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n url: {\n type: \"string\",\n description: \"URL to a Twitter user or list\",\n defaultValue: \"https://twitter.com/plasmicapp\",\n },\n tweetLimit: {\n type: \"number\",\n description: \"Number of tweets to be displayed. Between 1 and 20\",\n min: 1,\n max: 20,\n },\n chrome: {\n type: \"choice\",\n description: \"Toggle the display of design elements in the widget\",\n multiSelect: true,\n options: [\n \"noheader\",\n \"nofooter\",\n \"noborders\",\n \"transparent\",\n \"noscrollbar\",\n ],\n },\n theme: {\n type: \"choice\",\n description: \"Toggle the default color scheme\",\n options: [\"dark\", \"light\"],\n defaultValueHint: \"light\",\n },\n },\n defaultStyles: {\n display: \"flex\",\n flexDirection: \"column\",\n overflowY: \"auto\",\n },\n};\n\nexport function registerTimelineWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customTimelineWrapper?: ComponentMeta<ComponentProps<typeof TimelineWrapper>>\n) {\n if (loader) {\n loader.registerComponent(\n TimelineWrapper,\n customTimelineWrapper ?? timelineWrapper\n );\n } else {\n registerComponent(\n TimelineWrapper,\n customTimelineWrapper ?? timelineWrapper\n );\n }\n}\n\nexport function TweetWrapper({\n className,\n tweetId,\n theme,\n}: {\n className?: string;\n tweetId?: string;\n theme?: string;\n}) {\n if (!tweetId) {\n throw new Error(\"Tweet component requires a tweetId\");\n }\n return (\n <div className={className}>\n <Tweet tweetId={tweetId} options={{ theme: theme }} />\n </div>\n );\n}\n\nexport const tweetWrapper: ComponentMeta<ComponentProps<\n typeof TweetWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-tweet\",\n displayName: \"Tweet\",\n importName: \"TweetWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n tweetId: {\n type: \"string\",\n description: \"The tweet ID\",\n defaultValue: \"1381980305305694209\",\n },\n theme: {\n type: \"choice\",\n description: \"Toggle the default color scheme\",\n options: [\"dark\", \"light\"],\n defaultValueHint: \"light\",\n },\n },\n defaultStyles: {\n display: \"flex\",\n flexDirection: \"column\",\n overflowY: \"auto\",\n },\n};\n\nexport function registerTweetWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customTweetWrapper?: ComponentMeta<ComponentProps<typeof TweetWrapper>>\n) {\n if (loader) {\n loader.registerComponent(TweetWrapper, customTweetWrapper ?? tweetWrapper);\n } else {\n registerComponent(TweetWrapper, customTweetWrapper ?? tweetWrapper);\n }\n}\n\nexport function FollowWrapper({\n className,\n username,\n large,\n}: {\n className?: string;\n username?: string;\n large?: boolean;\n}) {\n if (!username) {\n throw new Error(\"Follow component requires a username\");\n }\n return (\n <div className={className}>\n <Follow\n username={username}\n options={{ size: large ? \"large\" : undefined }}\n />\n </div>\n );\n}\n\nexport const followWrapper: ComponentMeta<ComponentProps<\n typeof FollowWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-follow\",\n displayName: \"Follow\",\n importName: \"FollowWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n username: {\n type: \"string\",\n description: \"Twitter username to follow\",\n defaultValue: \"plasmicapp\",\n },\n large: {\n type: \"boolean\",\n description: \"Toggle the button size\",\n },\n },\n};\n\nexport function registerFollowWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customFollowWrapper?: ComponentMeta<ComponentProps<typeof FollowWrapper>>\n) {\n if (loader) {\n loader.registerComponent(\n FollowWrapper,\n customFollowWrapper ?? followWrapper\n );\n } else {\n registerComponent(FollowWrapper, customFollowWrapper ?? followWrapper);\n }\n}\n"],"names":["TimelineWrapper","className","url","tweetLimit","chrome","theme","Error","React","Timeline","dataSource","sourceType","options","timelineWrapper","name","displayName","importName","importPath","props","type","description","defaultValue","min","max","multiSelect","defaultValueHint","defaultStyles","display","flexDirection","overflowY","TweetWrapper","tweetId","Tweet","tweetWrapper","FollowWrapper","username","large","Follow","size","undefined","followWrapper","loader","customFollowWrapper","registerComponent","customTimelineWrapper","customTweetWrapper"],"mappings":"mQAagBA,SACdC,IAAAA,UACAC,IAAAA,IACAC,IAAAA,WACAC,IAAAA,OACAC,IAAAA,UAQKH,QACG,IAAII,MAAM,4CAGhBC,uBAAKN,UAAWA,GACdM,gBAACC,YACCC,WAAY,CAAEC,WAAY,MAAOR,IAAAA,GACjCS,QAAS,CACPR,WAAYA,EACZC,OAAQA,EACRC,MAAOA,UAOJO,EAER,CACHC,KAAM,0CACNC,YAAa,WACbC,WAAY,kBACZC,WAAY,qCACZC,MAAO,CACLf,IAAK,CACHgB,KAAM,SACNC,YAAa,gCACbC,aAAc,kCAEhBjB,WAAY,CACVe,KAAM,SACNC,YAAa,qDACbE,IAAK,EACLC,IAAK,IAEPlB,OAAQ,CACNc,KAAM,SACNC,YAAa,sDACbI,aAAa,EACbZ,QAAS,CACP,WACA,WACA,YACA,cACA,gBAGJN,MAAO,CACLa,KAAM,SACNC,YAAa,kCACbR,QAAS,CAAC,OAAQ,SAClBa,iBAAkB,UAGtBC,cAAe,CACbC,QAAS,OACTC,cAAe,SACfC,UAAW,kBAqBCC,SACd5B,IAAAA,UACA6B,IAAAA,QACAzB,IAAAA,UAMKyB,QACG,IAAIxB,MAAM,6CAGhBC,uBAAKN,UAAWA,GACdM,gBAACwB,SAAMD,QAASA,EAASnB,QAAS,CAAEN,MAAOA,UAKpC2B,EAER,CACHnB,KAAM,uCACNC,YAAa,QACbC,WAAY,eACZC,WAAY,qCACZC,MAAO,CACLa,QAAS,CACPZ,KAAM,SACNC,YAAa,eACbC,aAAc,uBAEhBf,MAAO,CACLa,KAAM,SACNC,YAAa,kCACbR,QAAS,CAAC,OAAQ,SAClBa,iBAAkB,UAGtBC,cAAe,CACbC,QAAS,OACTC,cAAe,SACfC,UAAW,kBAeCK,SACdhC,IAAAA,UACAiC,IAAAA,SACAC,IAAAA,UAMKD,QACG,IAAI5B,MAAM,+CAGhBC,uBAAKN,UAAWA,GACdM,gBAAC6B,UACCF,SAAUA,EACVvB,QAAS,CAAE0B,KAAMF,EAAQ,aAAUG,UAM9BC,EAER,CACH1B,KAAM,wCACNC,YAAa,SACbC,WAAY,gBACZC,WAAY,qCACZC,MAAO,CACLiB,SAAU,CACRhB,KAAM,SACNC,YAAa,6BACbC,aAAc,cAEhBe,MAAO,CACLjB,KAAM,UACNC,YAAa,oKAMjBqB,EACAC,GAEID,EACFA,EAAOE,kBACLT,QACAQ,EAAAA,EAAuBF,GAGzBG,EAAkBT,QAAeQ,EAAAA,EAAuBF,6CA7H1DC,EACAG,GAEIH,EACFA,EAAOE,kBACL1C,QACA2C,EAAAA,EAAyB/B,GAG3B8B,EACE1C,QACA2C,EAAAA,EAAyB/B,0CAoD7B4B,EACAI,GAEIJ,EACFA,EAAOE,kBAAkBb,QAAce,EAAAA,EAAsBZ,GAE7DU,EAAkBb,QAAce,EAAAA,EAAsBZ"}
|
|
@@ -11,7 +11,10 @@ import { Timeline, Tweet, Follow } from 'react-twitter-widgets';
|
|
|
11
11
|
|
|
12
12
|
function TimelineWrapper(_ref) {
|
|
13
13
|
var className = _ref.className,
|
|
14
|
-
url = _ref.url
|
|
14
|
+
url = _ref.url,
|
|
15
|
+
tweetLimit = _ref.tweetLimit,
|
|
16
|
+
chrome = _ref.chrome,
|
|
17
|
+
theme = _ref.theme;
|
|
15
18
|
|
|
16
19
|
if (!url) {
|
|
17
20
|
throw new Error("Timeline component requires a URL");
|
|
@@ -23,6 +26,11 @@ function TimelineWrapper(_ref) {
|
|
|
23
26
|
dataSource: {
|
|
24
27
|
sourceType: "url",
|
|
25
28
|
url: url
|
|
29
|
+
},
|
|
30
|
+
options: {
|
|
31
|
+
tweetLimit: tweetLimit,
|
|
32
|
+
chrome: chrome,
|
|
33
|
+
theme: theme
|
|
26
34
|
}
|
|
27
35
|
}));
|
|
28
36
|
}
|
|
@@ -36,7 +44,30 @@ var timelineWrapper = {
|
|
|
36
44
|
type: "string",
|
|
37
45
|
description: "URL to a Twitter user or list",
|
|
38
46
|
defaultValue: "https://twitter.com/plasmicapp"
|
|
47
|
+
},
|
|
48
|
+
tweetLimit: {
|
|
49
|
+
type: "number",
|
|
50
|
+
description: "Number of tweets to be displayed. Between 1 and 20",
|
|
51
|
+
min: 1,
|
|
52
|
+
max: 20
|
|
53
|
+
},
|
|
54
|
+
chrome: {
|
|
55
|
+
type: "choice",
|
|
56
|
+
description: "Toggle the display of design elements in the widget",
|
|
57
|
+
multiSelect: true,
|
|
58
|
+
options: ["noheader", "nofooter", "noborders", "transparent", "noscrollbar"]
|
|
59
|
+
},
|
|
60
|
+
theme: {
|
|
61
|
+
type: "choice",
|
|
62
|
+
description: "Toggle the default color scheme",
|
|
63
|
+
options: ["dark", "light"],
|
|
64
|
+
defaultValueHint: "light"
|
|
39
65
|
}
|
|
66
|
+
},
|
|
67
|
+
defaultStyles: {
|
|
68
|
+
display: "flex",
|
|
69
|
+
flexDirection: "column",
|
|
70
|
+
overflowY: "auto"
|
|
40
71
|
}
|
|
41
72
|
};
|
|
42
73
|
function registerTimelineWrapper(loader, customTimelineWrapper) {
|
|
@@ -48,7 +79,8 @@ function registerTimelineWrapper(loader, customTimelineWrapper) {
|
|
|
48
79
|
}
|
|
49
80
|
function TweetWrapper(_ref2) {
|
|
50
81
|
var className = _ref2.className,
|
|
51
|
-
tweetId = _ref2.tweetId
|
|
82
|
+
tweetId = _ref2.tweetId,
|
|
83
|
+
theme = _ref2.theme;
|
|
52
84
|
|
|
53
85
|
if (!tweetId) {
|
|
54
86
|
throw new Error("Tweet component requires a tweetId");
|
|
@@ -57,7 +89,10 @@ function TweetWrapper(_ref2) {
|
|
|
57
89
|
return React.createElement("div", {
|
|
58
90
|
className: className
|
|
59
91
|
}, React.createElement(Tweet, {
|
|
60
|
-
tweetId: tweetId
|
|
92
|
+
tweetId: tweetId,
|
|
93
|
+
options: {
|
|
94
|
+
theme: theme
|
|
95
|
+
}
|
|
61
96
|
}));
|
|
62
97
|
}
|
|
63
98
|
var tweetWrapper = {
|
|
@@ -70,7 +105,18 @@ var tweetWrapper = {
|
|
|
70
105
|
type: "string",
|
|
71
106
|
description: "The tweet ID",
|
|
72
107
|
defaultValue: "1381980305305694209"
|
|
108
|
+
},
|
|
109
|
+
theme: {
|
|
110
|
+
type: "choice",
|
|
111
|
+
description: "Toggle the default color scheme",
|
|
112
|
+
options: ["dark", "light"],
|
|
113
|
+
defaultValueHint: "light"
|
|
73
114
|
}
|
|
115
|
+
},
|
|
116
|
+
defaultStyles: {
|
|
117
|
+
display: "flex",
|
|
118
|
+
flexDirection: "column",
|
|
119
|
+
overflowY: "auto"
|
|
74
120
|
}
|
|
75
121
|
};
|
|
76
122
|
function registerTweetWrapper(loader, customTweetWrapper) {
|
|
@@ -82,7 +128,8 @@ function registerTweetWrapper(loader, customTweetWrapper) {
|
|
|
82
128
|
}
|
|
83
129
|
function FollowWrapper(_ref3) {
|
|
84
130
|
var className = _ref3.className,
|
|
85
|
-
username = _ref3.username
|
|
131
|
+
username = _ref3.username,
|
|
132
|
+
large = _ref3.large;
|
|
86
133
|
|
|
87
134
|
if (!username) {
|
|
88
135
|
throw new Error("Follow component requires a username");
|
|
@@ -91,7 +138,10 @@ function FollowWrapper(_ref3) {
|
|
|
91
138
|
return React.createElement("div", {
|
|
92
139
|
className: className
|
|
93
140
|
}, React.createElement(Follow, {
|
|
94
|
-
username: username
|
|
141
|
+
username: username,
|
|
142
|
+
options: {
|
|
143
|
+
size: large ? "large" : undefined
|
|
144
|
+
}
|
|
95
145
|
}));
|
|
96
146
|
}
|
|
97
147
|
var followWrapper = {
|
|
@@ -104,6 +154,10 @@ var followWrapper = {
|
|
|
104
154
|
type: "string",
|
|
105
155
|
description: "Twitter username to follow",
|
|
106
156
|
defaultValue: "plasmicapp"
|
|
157
|
+
},
|
|
158
|
+
large: {
|
|
159
|
+
type: "boolean",
|
|
160
|
+
description: "Toggle the button size"
|
|
107
161
|
}
|
|
108
162
|
}
|
|
109
163
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-twitter-widgets.esm.js","sources":["../src/Twitter.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { ComponentProps } from \"react\";\nimport { Follow, Timeline, Tweet } from \"react-twitter-widgets\";\n\n//\n// This module registers Timeline, Tweet, and Follow, but not yet the Hashtag /\n// Mention / Share components (would be easy additions).\n//\n// The components auto-size their heights by default, so it's actually\n// sufficient to rely on just layout out an enclosing div.\n//\n\nexport function TimelineWrapper({\n className,\n url,\n}: {\n className?: string;\n url?: string;\n}) {\n if (!url) {\n throw new Error(\"Timeline component requires a URL\");\n }\n return (\n <div className={className}>\n <Timeline
|
|
1
|
+
{"version":3,"file":"react-twitter-widgets.esm.js","sources":["../src/Twitter.tsx"],"sourcesContent":["import { ComponentMeta } from \"@plasmicapp/host\";\nimport registerComponent from \"@plasmicapp/host/registerComponent\";\nimport React, { ComponentProps } from \"react\";\nimport { Follow, Timeline, Tweet } from \"react-twitter-widgets\";\n\n//\n// This module registers Timeline, Tweet, and Follow, but not yet the Hashtag /\n// Mention / Share components (would be easy additions).\n//\n// The components auto-size their heights by default, so it's actually\n// sufficient to rely on just layout out an enclosing div.\n//\n\nexport function TimelineWrapper({\n className,\n url,\n tweetLimit,\n chrome,\n theme,\n}: {\n className?: string;\n url?: string;\n tweetLimit?: number;\n chrome?: string;\n theme?: string;\n}) {\n if (!url) {\n throw new Error(\"Timeline component requires a URL\");\n }\n return (\n <div className={className}>\n <Timeline\n dataSource={{ sourceType: \"url\", url }}\n options={{\n tweetLimit: tweetLimit,\n chrome: chrome,\n theme: theme,\n }}\n />\n </div>\n );\n}\n\nexport const timelineWrapper: ComponentMeta<ComponentProps<\n typeof TimelineWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-timeline\",\n displayName: \"Timeline\",\n importName: \"TimelineWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n url: {\n type: \"string\",\n description: \"URL to a Twitter user or list\",\n defaultValue: \"https://twitter.com/plasmicapp\",\n },\n tweetLimit: {\n type: \"number\",\n description: \"Number of tweets to be displayed. Between 1 and 20\",\n min: 1,\n max: 20,\n },\n chrome: {\n type: \"choice\",\n description: \"Toggle the display of design elements in the widget\",\n multiSelect: true,\n options: [\n \"noheader\",\n \"nofooter\",\n \"noborders\",\n \"transparent\",\n \"noscrollbar\",\n ],\n },\n theme: {\n type: \"choice\",\n description: \"Toggle the default color scheme\",\n options: [\"dark\", \"light\"],\n defaultValueHint: \"light\",\n },\n },\n defaultStyles: {\n display: \"flex\",\n flexDirection: \"column\",\n overflowY: \"auto\",\n },\n};\n\nexport function registerTimelineWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customTimelineWrapper?: ComponentMeta<ComponentProps<typeof TimelineWrapper>>\n) {\n if (loader) {\n loader.registerComponent(\n TimelineWrapper,\n customTimelineWrapper ?? timelineWrapper\n );\n } else {\n registerComponent(\n TimelineWrapper,\n customTimelineWrapper ?? timelineWrapper\n );\n }\n}\n\nexport function TweetWrapper({\n className,\n tweetId,\n theme,\n}: {\n className?: string;\n tweetId?: string;\n theme?: string;\n}) {\n if (!tweetId) {\n throw new Error(\"Tweet component requires a tweetId\");\n }\n return (\n <div className={className}>\n <Tweet tweetId={tweetId} options={{ theme: theme }} />\n </div>\n );\n}\n\nexport const tweetWrapper: ComponentMeta<ComponentProps<\n typeof TweetWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-tweet\",\n displayName: \"Tweet\",\n importName: \"TweetWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n tweetId: {\n type: \"string\",\n description: \"The tweet ID\",\n defaultValue: \"1381980305305694209\",\n },\n theme: {\n type: \"choice\",\n description: \"Toggle the default color scheme\",\n options: [\"dark\", \"light\"],\n defaultValueHint: \"light\",\n },\n },\n defaultStyles: {\n display: \"flex\",\n flexDirection: \"column\",\n overflowY: \"auto\",\n },\n};\n\nexport function registerTweetWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customTweetWrapper?: ComponentMeta<ComponentProps<typeof TweetWrapper>>\n) {\n if (loader) {\n loader.registerComponent(TweetWrapper, customTweetWrapper ?? tweetWrapper);\n } else {\n registerComponent(TweetWrapper, customTweetWrapper ?? tweetWrapper);\n }\n}\n\nexport function FollowWrapper({\n className,\n username,\n large,\n}: {\n className?: string;\n username?: string;\n large?: boolean;\n}) {\n if (!username) {\n throw new Error(\"Follow component requires a username\");\n }\n return (\n <div className={className}>\n <Follow\n username={username}\n options={{ size: large ? \"large\" : undefined }}\n />\n </div>\n );\n}\n\nexport const followWrapper: ComponentMeta<ComponentProps<\n typeof FollowWrapper\n>> = {\n name: \"hostless-react-twitter-widgets-follow\",\n displayName: \"Follow\",\n importName: \"FollowWrapper\",\n importPath: \"@plasmicpkgs/react-twitter-widgets\",\n props: {\n username: {\n type: \"string\",\n description: \"Twitter username to follow\",\n defaultValue: \"plasmicapp\",\n },\n large: {\n type: \"boolean\",\n description: \"Toggle the button size\",\n },\n },\n};\n\nexport function registerFollowWrapper(\n loader?: { registerComponent: typeof registerComponent },\n customFollowWrapper?: ComponentMeta<ComponentProps<typeof FollowWrapper>>\n) {\n if (loader) {\n loader.registerComponent(\n FollowWrapper,\n customFollowWrapper ?? followWrapper\n );\n } else {\n registerComponent(FollowWrapper, customFollowWrapper ?? followWrapper);\n }\n}\n"],"names":["TimelineWrapper","className","url","tweetLimit","chrome","theme","Error","React","Timeline","dataSource","sourceType","options","timelineWrapper","name","displayName","importName","importPath","props","type","description","defaultValue","min","max","multiSelect","defaultValueHint","defaultStyles","display","flexDirection","overflowY","registerTimelineWrapper","loader","customTimelineWrapper","registerComponent","TweetWrapper","tweetId","Tweet","tweetWrapper","registerTweetWrapper","customTweetWrapper","FollowWrapper","username","large","Follow","size","undefined","followWrapper","registerFollowWrapper","customFollowWrapper"],"mappings":";;;;AAMA;AACA;AACA;AACA;AACA;AACA;;SAEgBA;MACdC,iBAAAA;MACAC,WAAAA;MACAC,kBAAAA;MACAC,cAAAA;MACAC,aAAAA;;AAQA,MAAI,CAACH,GAAL,EAAU;AACR,UAAM,IAAII,KAAJ,CAAU,mCAAV,CAAN;AACD;;AACD,SACEC,mBAAA,MAAA;AAAKN,IAAAA,SAAS,EAAEA;GAAhB,EACEM,mBAAA,CAACC,QAAD;AACEC,IAAAA,UAAU,EAAE;AAAEC,MAAAA,UAAU,EAAE,KAAd;AAAqBR,MAAAA,GAAG,EAAHA;AAArB;AACZS,IAAAA,OAAO,EAAE;AACPR,MAAAA,UAAU,EAAEA,UADL;AAEPC,MAAAA,MAAM,EAAEA,MAFD;AAGPC,MAAAA,KAAK,EAAEA;AAHA;GAFX,CADF,CADF;AAYD;IAEYO,eAAe,GAEvB;AACHC,EAAAA,IAAI,EAAE,yCADH;AAEHC,EAAAA,WAAW,EAAE,UAFV;AAGHC,EAAAA,UAAU,EAAE,iBAHT;AAIHC,EAAAA,UAAU,EAAE,oCAJT;AAKHC,EAAAA,KAAK,EAAE;AACLf,IAAAA,GAAG,EAAE;AACHgB,MAAAA,IAAI,EAAE,QADH;AA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MAAD;AACEF,IAAAA,QAAQ,EAAEA;AACV7B,IAAAA,OAAO,EAAE;AAAEgC,MAAAA,IAAI,EAAEF,KAAK,GAAG,OAAH,GAAaG;AAA1B;GAFX,CADF,CADF;AAQD;IAEYC,aAAa,GAErB;AACHhC,EAAAA,IAAI,EAAE,uCADH;AAEHC,EAAAA,WAAW,EAAE,QAFV;AAGHC,EAAAA,UAAU,EAAE,eAHT;AAIHC,EAAAA,UAAU,EAAE,oCAJT;AAKHC,EAAAA,KAAK,EAAE;AACLuB,IAAAA,QAAQ,EAAE;AACRtB,MAAAA,IAAI,EAAE,QADE;AAERC,MAAAA,WAAW,EAAE,4BAFL;AAGRC,MAAAA,YAAY,EAAE;AAHN,KADL;AAMLqB,IAAAA,KAAK,EAAE;AACLvB,MAAAA,IAAI,EAAE,SADD;AAELC,MAAAA,WAAW,EAAE;AAFR;AANF;AALJ;SAkBW2B,sBACdhB,QACAiB;AAEA,MAAIjB,MAAJ,EAAY;AACVA,IAAAA,MAAM,CAACE,iBAAP,CACEO,aADF,EAEEQ,mBAFF,WAEEA,mBAFF,GAEyBF,aAFzB;AAID,GALD,MAKO;AACLb,IAAAA,iBAAiB,CAACO,aAAD,EAAgBQ,mBAAhB,WAAgBA,mBAAhB,GAAuCF,aAAvC,CAAjB;AACD;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/react-twitter-widgets",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Plasmic registration calls for react-twitter-widgets",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"analyze": "size-limit --why"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
+
"@plasmicapp/host": "1.0.10",
|
|
31
32
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
32
33
|
"@types/node": "^14.0.26",
|
|
33
34
|
"size-limit": "^4.11.0",
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"typescript": "^3.9.7"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@plasmicapp/host": "^1.0.0",
|
|
40
40
|
"react-twitter-widgets": "^1.10.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
+
"@plasmicapp/host": "^1.0.0",
|
|
43
44
|
"react": ">=16.8.0",
|
|
44
45
|
"react-dom": ">=16.8.0"
|
|
45
46
|
}
|