Skip to content

Commit

Permalink
fix: extend
Browse files Browse the repository at this point in the history
  • Loading branch information
arpowers committed Mar 24, 2020
1 parent f9e149e commit 5e7abd6
Show file tree
Hide file tree
Showing 18 changed files with 78 additions and 31 deletions.
3 changes: 2 additions & 1 deletion @apps/factor/src/extend/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const saveSingleExtension = async (params: {
const icon = extensionImage(files, cdnUrl, "icon.svg")
const extensionType = factor.extend ?? "plugin"
const tag = keywords.filter((_: string) => !_.includes("factor"))

const themeColor = factor.themeColor ?? "#FFFFFF"
const permalink = factor.permalink ?? packageName

const Model = getModel<FactorExtensionInfo>(postType)
Expand All @@ -101,6 +101,7 @@ export const saveSingleExtension = async (params: {
status: PostStatus.Published,
featured,
permalink,
themeColor,
title: factor.title ?? packageName,
demo: factor.demo,
category,
Expand Down
13 changes: 12 additions & 1 deletion @apps/factor/src/extend/grid-plugin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class="grid-item-plugin"
@click="$router.push({path: `/plugin/${encodeURIComponent(item.permalink)}`})"
>
<div class="entry-media" :style="mediaStyle(item)">
<div class="entry-media" :style="mediaStyle(item)" :class="imageStyle(item)">
<img :src="item.icon" :alt="`${item.title} Icon`" class="extend-icon" />
</div>
<div class="entry-content">
Expand All @@ -29,6 +29,9 @@ export default Vue.extend({
props: {
extensions: { type: Array, default: () => {} }
},
data() {
return {}
},
computed: {
post(this: any) {
return stored(this.postId) || {}
Expand All @@ -48,6 +51,10 @@ export default Vue.extend({
return screenshots[0] ?? ""
},
imageStyle(this: any, item: FactorExtensionInfo) {
const sc = this.getPrimaryScreenshot(item)
return sc ? "screenshot" : "icon"
},
mediaStyle(this: any, item: FactorExtensionInfo) {
const sc = this.getPrimaryScreenshot(item)
Expand All @@ -57,6 +64,7 @@ export default Vue.extend({
}
} else {
return {
backgroundColor: item.themeColor,
backgroundImage: `url(${item.icon})`,
backgroundPosition: "50% 50%"
}
Expand Down Expand Up @@ -101,6 +109,9 @@ export default Vue.extend({
position: relative;
padding: 25%;
box-shadow: 0px 1px 0 rgba(50, 50, 93, 0.13);
&.icon {
background-size: contain;
}
img {
width: 80px;
right: 0;
Expand Down
1 change: 1 addition & 0 deletions @apps/factor/src/extend/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default {
demo: { type: String },
version: { type: String },
homepage: { type: String },
themeColor: { type: String },
repositoryUrl: { type: String },
featured: { type: Boolean },
extensionAuthor: { type: String },
Expand Down
16 changes: 15 additions & 1 deletion @apps/factor/src/extend/single.vue
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,11 @@ export default Vue.extend({
}
.info {
padding: 1.5rem;
&.install,
&.overview,
&.meta {
padding: 1rem;
}
}
}
}
Expand Down Expand Up @@ -410,7 +415,9 @@ export default Vue.extend({
padding: 1rem 2rem;
letter-spacing: -0.03em;
border-radius: 10px;
overflow: hidden;
max-width: 100%;
text-overflow: ellipsis;
font-weight: 700;
box-shadow: var(--panel-shadow);
display: inline-block;
Expand Down Expand Up @@ -528,6 +535,8 @@ export default Vue.extend({
font-size: 3.5em;
letter-spacing: -0.03em;
font-weight: 700;
line-height: 1.1;
margin-bottom: 1rem;
}
.description {
font-size: 1.4em;
Expand All @@ -544,6 +553,11 @@ export default Vue.extend({
.text {
padding: 5rem 0;
}
@media (max-width: 900px) {
.title {
font-size: 2em;
}
}
}
.media {
position: relative;
Expand Down
1 change: 1 addition & 0 deletions @apps/factor/src/extend/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ export type FactorExtensionInfo = {
files?: { name: string; size: number; hash: string }[];
icon?: string;
screenshots?: string[];
themeColor?: string;
} & FactorPost
5 changes: 2 additions & 3 deletions @plugins/plugin-blog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"category": [
"blog"
],
"permalink": "standard-blog"
"permalink": "standard-blog",
"themeColor": "#2F80EE"
},
"dependencies": {
"@factor/plugin-highlight-code": "^1.5.4"
Expand All @@ -29,8 +30,6 @@
"factor",
"factor-plugin",
"fiction",
"webpack",
"vue",
"blog",
"post",
"writing"
Expand Down
9 changes: 4 additions & 5 deletions @plugins/plugin-bugsnag/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
"access": "public"
},
"factor": {
"_id": "bugsnag",
"category": "monitoring",
"load": {
"app": "index",
"server": "server"
},
"title": "Bugsnag"
"title": "Bugsnag",
"permalink": "bugsnag-factor-plugin",
"themeColor": "#020F46"
},
"dependencies": {
"@bugsnag/js": "^6.4.1",
Expand All @@ -22,9 +24,6 @@
"keywords": [
"factor",
"factor-plugin",
"fiction",
"webpack",
"vue",
"bugsnag",
"error",
"monitoring",
Expand Down
5 changes: 3 additions & 2 deletions @plugins/plugin-contact-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
"version": "1.5.5",
"license": "GPL-2.0",
"factor": {
"_id": "contactForm",
"load": {
"app": "index",
"server": "server"
},
"title": "Contact Form"
"title": "Contact Form",
"themeColor": "#0697FF",
"category": "forms"
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 4 additions & 2 deletions @plugins/plugin-email-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
"version": "1.5.4",
"license": "GPL-2.0",
"factor": {
"_id": "emailList",
"load": {
"app": "index",
"server": [
"server",
"index"
]
},
"title": "Email List"
"title": "Email List",
"themeColor": "#8C81EA",
"permalink": "email-list-factor-plugin",
"category": "forms"
},
"dependencies": {
"export-to-csv": "^0.2.1"
Expand Down
4 changes: 3 additions & 1 deletion @plugins/plugin-google-tag-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"app": "index",
"server": "server"
},
"title": "Google Tag Manager"
"title": "Google Tag Manager",
"category": "analytics",
"themeColor": "#F5F5F5"
},
"gitHead": "435e8535660c83acb445295cfb98a21b32c69434",
"keywords": [
Expand Down
4 changes: 3 additions & 1 deletion @plugins/plugin-highlight-code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"load": [
"app"
],
"title": "Syntax Highlight"
"title": "Syntax Highlight",
"category": "ui",
"themeColor": "#000000"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 3 additions & 1 deletion @plugins/plugin-jobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"app",
"server"
],
"title": "Job Board"
"title": "Job Board",
"themeColor": "#131C23",
"category": "listing"
},
"dependencies": {
"@factor/plugin-highlight-code": "^1.5.4"
Expand Down
4 changes: 3 additions & 1 deletion @plugins/plugin-notify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"load": [
"app"
],
"title": "Notify"
"title": "Notify",
"themeColor": "#ffffff",
"category": "ui"
},
"gitHead": "435e8535660c83acb445295cfb98a21b32c69434",
"keywords": [
Expand Down
9 changes: 4 additions & 5 deletions @plugins/plugin-seo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
"app",
"server"
],
"title": "SEO"
"title": "SEO",
"category": "seo",
"themeColor": "#09CF85"
},
"gitHead": "435e8535660c83acb445295cfb98a21b32c69434",
"keywords": [
"factor",
"factor-plugin",
"fiction",
"webpack",
"vue",
"seo",
""
"optimization"
]
}
4 changes: 3 additions & 1 deletion @plugins/plugin-server-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"load": [
"server"
],
"title": "Server Analytics"
"title": "Server Analytics",
"category": "analytics",
"permalink": "server-analytics-plugin"
},
"dependencies": {
"@types/universal-analytics": "^0.4.3",
Expand Down
3 changes: 2 additions & 1 deletion @plugins/plugin-sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"extend": "plugin",
"permalink": "sitemap-xml",
"title": "Sitemap",
"demo": "https://factor.dev/sitemap.xml"
"demo": "https://factor.dev/sitemap.xml",
"themeColor": "#172D45"
},
"dependencies": {
"node-cache": "^5.1.0",
Expand Down
5 changes: 4 additions & 1 deletion @plugins/plugin-ssr-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
"load": [
"app"
],
"title": "SSR Bar"
"title": "SSR Bar",
"category": "ui",
"permalink": "ssr-bar-plugin",
"themeColor": "#FFC35A"
},
"gitHead": "435e8535660c83acb445295cfb98a21b32c69434",
"keywords": [
Expand Down
13 changes: 9 additions & 4 deletions @plugins/plugin-storage-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"load": [
"server"
],
"title": "Storage S3"
"title": "Storage S3",
"category": "storage",
"themeColor": "#232F3E"
},
"publishConfig": {
"access": "public"
Expand All @@ -19,9 +21,12 @@
},
"keywords": [
"factor",
"factor-js",
"factor-plugin",
"fiction",
"webpack",
"vue"
"storage",
"amazon",
"s3",
"image-hosting",
"images"
]
}

0 comments on commit 5e7abd6

Please sign in to comment.