ghost 4.21.0 → 4.22.3
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/.eslintrc.js +6 -0
- package/Gruntfile.js +2 -0
- package/content/themes/casper/assets/built/screen.css +1 -1
- package/content/themes/casper/assets/built/screen.css.map +1 -1
- package/content/themes/casper/assets/css/screen.css +263 -50
- package/content/themes/casper/default.hbs +12 -3
- package/content/themes/casper/index.hbs +25 -23
- package/content/themes/casper/package.json +91 -2
- package/content/themes/casper/partials/post-card.hbs +1 -1
- package/content/themes/casper/post.hbs +18 -14
- package/content/themes/casper/yarn.lock +245 -192
- package/core/boot.js +8 -0
- package/core/bridge.js +14 -0
- package/core/built/assets/{chunk.3.065ee3c3bdf674bd81a4.js → chunk.3.324fd0cc598c73650219.js} +59 -59
- package/core/built/assets/{ghost-dark-1328db4a7dd128305646305a8731bcfe.css → ghost-dark-39fb496d051565531062d7e047d1c0b1.css} +1 -1
- package/core/built/assets/{ghost.min-5abc69c04ad1d5301a857e01009b9c05.css → ghost.min-4207edfc1ae0a3f9f6505ca00d20b0c0.css} +1 -1
- package/core/built/assets/{ghost.min-6c546c322127ae6d1d1b0ddbf34be75b.js → ghost.min-7da921f6c6cac3fe10da1ba104575440.js} +1775 -1897
- package/core/built/assets/{vendor.min-c6ef90bfd7eff256e10b85583bfe9a74.js → vendor.min-413f887176a041e6dbf88214ca9a7481.js} +6849 -6688
- package/core/frontend/helpers/asset.js +9 -1
- package/core/frontend/helpers/ghost_head.js +13 -1
- package/core/frontend/services/card-assets/index.js +16 -0
- package/core/frontend/services/card-assets/service.js +109 -0
- package/core/frontend/services/theme-engine/config/defaults.json +4 -1
- package/core/frontend/services/theme-engine/config/index.js +1 -1
- package/core/frontend/src/cards/css/bookmark.css +83 -0
- package/core/frontend/src/cards/css/button.css +30 -0
- package/core/frontend/src/cards/css/callout.css +12 -0
- package/core/frontend/src/cards/css/gallery.css +36 -0
- package/core/frontend/src/cards/css/nft.css +85 -0
- package/core/frontend/src/cards/js/gallery.js +8 -0
- package/core/frontend/web/middleware/serve-public-file.js +10 -1
- package/core/frontend/web/routes.js +0 -1
- package/core/frontend/web/site.js +13 -9
- package/core/server/adapters/storage/LocalFilesStorage.js +17 -0
- package/core/server/adapters/storage/LocalImagesStorage.js +51 -0
- package/core/server/adapters/storage/LocalMediaStorage.js +24 -0
- package/core/server/adapters/storage/{LocalFileStorage.js → LocalStorageBase.js} +64 -51
- package/core/server/adapters/storage/index.js +1 -1
- package/core/server/adapters/storage/utils.js +2 -2
- package/core/server/api/canary/files.js +19 -0
- package/core/server/api/canary/index.js +8 -0
- package/core/server/api/canary/media.js +42 -0
- package/core/server/api/canary/oembed.js +3 -0
- package/core/server/api/canary/redirects.js +1 -6
- package/core/server/api/canary/utils/serializers/input/index.js +4 -0
- package/core/server/api/canary/utils/serializers/input/media.js +8 -0
- package/core/server/api/canary/utils/serializers/input/pages.js +8 -0
- package/core/server/api/canary/utils/serializers/output/config.js +21 -14
- package/core/server/api/canary/utils/serializers/output/files.js +27 -0
- package/core/server/api/canary/utils/serializers/output/index.js +8 -0
- package/core/server/api/canary/utils/serializers/output/media.js +37 -0
- package/core/server/api/canary/utils/validators/input/files.js +7 -0
- package/core/server/api/canary/utils/validators/input/index.js +8 -0
- package/core/server/api/canary/utils/validators/input/media.js +11 -0
- package/core/server/api/v2/redirects.js +1 -6
- package/core/server/api/v3/members.js +5 -1
- package/core/server/api/v3/redirects.js +1 -6
- package/core/server/data/migrations/utils.js +55 -16
- package/core/server/data/migrations/versions/4.22/01-add-is-launch-complete-setting.js +8 -0
- package/core/server/data/migrations/versions/4.22/02-update-launch-complete-setting-from-user-data.js +39 -0
- package/core/server/data/schema/default-settings.json +8 -0
- package/core/server/frontend/ghost.min.css +1 -1
- package/core/server/lib/image/blog-icon.js +2 -4
- package/core/server/lib/image/image-size.js +1 -1
- package/core/server/services/limits.js +3 -6
- package/core/server/services/mega/template.js +62 -1
- package/core/server/services/nft-oembed.js +71 -0
- package/core/server/services/oembed.js +145 -110
- package/core/server/services/offers/service.js +1 -31
- package/core/server/services/public-config/config.js +2 -1
- package/core/server/services/redirects/api.js +270 -0
- package/core/server/services/redirects/index.js +27 -12
- package/core/server/services/stripe/index.js +4 -2
- package/core/server/services/themes/ThemeStorage.js +5 -5
- package/core/server/services/url/Resource.js +1 -1
- package/core/server/services/url/Resources.js +28 -21
- package/core/server/services/url/UrlService.js +66 -8
- package/core/server/services/url/Urls.js +7 -2
- package/core/server/services/url/index.js +8 -1
- package/core/server/web/admin/views/default-prod.html +4 -4
- package/core/server/web/admin/views/default.html +4 -4
- package/core/server/web/api/canary/admin/routes.js +28 -4
- package/core/server/web/api/middleware/cors.js +7 -7
- package/core/server/web/api/middleware/upload.js +117 -10
- package/core/server/web/members/app.js +1 -1
- package/core/server/web/shared/middlewares/index.js +0 -4
- package/core/shared/config/defaults.json +5 -1
- package/core/shared/config/helpers.js +4 -0
- package/core/shared/config/overrides.json +8 -0
- package/core/shared/labs.js +12 -3
- package/package.json +28 -27
- package/urls.json +597 -0
- package/yarn.lock +972 -941
- package/core/built/assets/img/themes/Editorial-a25a4a34c04dedd858bd5e05ef388b1c.jpg +0 -0
- package/core/built/assets/img/themes/Massively-06edf00108429f7fb8e65f190fba34fe.jpg +0 -0
- package/core/server/services/redirects/settings.js +0 -234
- package/core/server/web/shared/middlewares/custom-redirects.js +0 -128
|
@@ -191,14 +191,8 @@ function addPermissionToRole(config) {
|
|
|
191
191
|
}).first();
|
|
192
192
|
|
|
193
193
|
if (!permission) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
action: 'remove',
|
|
197
|
-
permission: config.permission,
|
|
198
|
-
role: config.role,
|
|
199
|
-
resource: 'permission'
|
|
200
|
-
})
|
|
201
|
-
});
|
|
194
|
+
logging.warn(`Removing permission(${config.permission}) from role(${config.role}) - Permission not found.`);
|
|
195
|
+
return;
|
|
202
196
|
}
|
|
203
197
|
|
|
204
198
|
const role = await connection('roles').where({
|
|
@@ -206,14 +200,8 @@ function addPermissionToRole(config) {
|
|
|
206
200
|
}).first();
|
|
207
201
|
|
|
208
202
|
if (!role) {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
action: 'remove',
|
|
212
|
-
permission: config.permission,
|
|
213
|
-
role: config.role,
|
|
214
|
-
resource: 'role'
|
|
215
|
-
})
|
|
216
|
-
});
|
|
203
|
+
logging.warn(`Removing permission(${config.permission}) from role(${config.role}) - Role not found.`);
|
|
204
|
+
return;
|
|
217
205
|
}
|
|
218
206
|
|
|
219
207
|
const existingRelation = await connection('permissions_roles').where({
|
|
@@ -421,12 +409,63 @@ function createDropColumnMigration(table, column, columnDefinition) {
|
|
|
421
409
|
);
|
|
422
410
|
}
|
|
423
411
|
|
|
412
|
+
/**
|
|
413
|
+
* Creates a migration which will insert a new setting in settings table
|
|
414
|
+
* @param {object} settingSpec - setting key, value, group and type
|
|
415
|
+
*
|
|
416
|
+
* @returns {Object} migration object returning config/up/down properties
|
|
417
|
+
*/
|
|
418
|
+
function addSetting({key, value, type, group}) {
|
|
419
|
+
return createTransactionalMigration(
|
|
420
|
+
async function up(connection) {
|
|
421
|
+
const settingExists = await connection('settings')
|
|
422
|
+
.where('key', '=', key)
|
|
423
|
+
.first();
|
|
424
|
+
if (settingExists) {
|
|
425
|
+
logging.warn(`Skipping adding setting: ${key} - setting already exists`);
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
logging.info(`Adding setting: ${key}`);
|
|
430
|
+
const now = connection.raw('CURRENT_TIMESTAMP');
|
|
431
|
+
|
|
432
|
+
return connection('settings')
|
|
433
|
+
.insert({
|
|
434
|
+
id: ObjectId().toHexString(),
|
|
435
|
+
key,
|
|
436
|
+
value,
|
|
437
|
+
group,
|
|
438
|
+
type,
|
|
439
|
+
created_at: now,
|
|
440
|
+
created_by: MIGRATION_USER,
|
|
441
|
+
updated_at: now,
|
|
442
|
+
updated_by: MIGRATION_USER
|
|
443
|
+
});
|
|
444
|
+
},
|
|
445
|
+
async function down(connection) {
|
|
446
|
+
const settingExists = await connection('settings')
|
|
447
|
+
.where('key', '=', key)
|
|
448
|
+
.first();
|
|
449
|
+
if (!settingExists) {
|
|
450
|
+
logging.warn(`Skipping dropping setting: ${key} - setting does not exist`);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
logging.info(`Dropping setting: ${key}`);
|
|
455
|
+
return connection('settings')
|
|
456
|
+
.where('key', '=', key)
|
|
457
|
+
.del();
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
|
|
424
462
|
module.exports = {
|
|
425
463
|
addTable,
|
|
426
464
|
dropTables,
|
|
427
465
|
addPermission,
|
|
428
466
|
addPermissionToRole,
|
|
429
467
|
addPermissionWithRoles,
|
|
468
|
+
addSetting,
|
|
430
469
|
createTransactionalMigration,
|
|
431
470
|
createNonTransactionalMigration,
|
|
432
471
|
createIrreversibleMigration,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const logging = require('@tryghost/logging');
|
|
2
|
+
const {createTransactionalMigration} = require('../../utils.js');
|
|
3
|
+
|
|
4
|
+
module.exports = createTransactionalMigration(
|
|
5
|
+
async function up(knex) {
|
|
6
|
+
const userRows = await knex('users').select('accessibility').whereNotNull('accessibility');
|
|
7
|
+
const hasLaunchComplete = userRows.find((user) => {
|
|
8
|
+
try {
|
|
9
|
+
const userAccessibility = JSON.parse(user.accessibility);
|
|
10
|
+
return userAccessibility.launchComplete;
|
|
11
|
+
} catch (e) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
if (hasLaunchComplete) {
|
|
16
|
+
logging.info('Updating setting: "editor_is_launch_complete" to "true"');
|
|
17
|
+
await knex('settings')
|
|
18
|
+
.where({
|
|
19
|
+
key: 'editor_is_launch_complete'
|
|
20
|
+
})
|
|
21
|
+
.update({
|
|
22
|
+
value: 'true'
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
logging.warn('Skipped setting update: "editor_is_launch_complete" setting - is already correct value!');
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
async function down(knex) {
|
|
30
|
+
logging.info('Reverting setting: "editor_is_launch_complete" - to "false"');
|
|
31
|
+
await knex('settings')
|
|
32
|
+
.where({
|
|
33
|
+
key: 'editor_is_launch_complete'
|
|
34
|
+
})
|
|
35
|
+
.update({
|
|
36
|
+
value: 'false'
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
);
|
|
@@ -590,6 +590,14 @@
|
|
|
590
590
|
"editor_default_email_recipients_filter": {
|
|
591
591
|
"defaultValue": "all",
|
|
592
592
|
"type": "string"
|
|
593
|
+
},
|
|
594
|
+
"editor_is_launch_complete": {
|
|
595
|
+
"defaultValue": "false",
|
|
596
|
+
"validations": {
|
|
597
|
+
"isEmpty": false,
|
|
598
|
+
"isIn": [["true", "false"]]
|
|
599
|
+
},
|
|
600
|
+
"type": "boolean"
|
|
593
601
|
}
|
|
594
602
|
}
|
|
595
603
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-family:sans-serif}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.darkgrey{color:#343f44}.midgrey{color:#738a94}.lightgrey{color:#e5eff5}.blue{color:#3eb0ef}.red{color:#f05230}.orange{color:#fecd35}.green{color:#a4d037}.darkgrey-hover:hover{color:#343f44}.midgrey-hover:hover{color:#738a94}.lightgrey-hover:hover{color:#e5eff5}.blue-hover:hover{color:#3eb0ef}.red-hover:hover{color:#f05230}.orange-hover:hover{color:#fecd35}.green-hover:hover{color:#a4d037}*,:after,:before{box-sizing:border-box}html{-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:62.5%;letter-spacing:.2px;line-height:1.65;overflow:hidden}body,html{height:100%;width:100%}body{color:#343f44;font-size:1.4rem;overflow:auto;overflow-x:hidden}.gh-view{-ms-flex-positive:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;flex-grow:1}h1,h2{text-rendering:optimizeLegibility;color:#343f44;font-size:2.9rem;line-height:1.15em;margin:0 0 .3em;text-indent:-1px}@media (max-width:500px){h1{font-size:2.4rem}}.gh-input{-webkit-appearance:none;border:1px solid #d6e3eb;border-radius:4px;color:#4b5b62;display:block;font-size:1.6rem;font-weight:300;height:40px;line-height:1em;padding:10px 12px;transition:border-color .15s linear;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;width:100%}.gh-input:focus{border-color:#b4cbda;outline:0}.gh-btn{fill:#829aa8;-webkit-font-smoothing:subpixel-antialiased;border:1px solid #d6e3eb;border-radius:5px;color:#829aa8;display:inline-block;outline:none;text-decoration:none!important;text-shadow:0 1px 0 #fff;transition:all .2s ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.gh-btn span{border-radius:4px;display:block;font-size:1.3rem;font-weight:400;height:33px;letter-spacing:.2px;line-height:33px;padding:0 12px;text-align:center}.gh-btn:hover{border-color:#b4cbda}.gh-btn-hover-blue:hover{border-color:#3eb0ef;color:#3eb0ef}.gh-btn-blue{fill:#fff;background:linear-gradient(#3da1d6,#2288bf);border:0;box-shadow:0 1px 0 rgba(0,0,0,.12);color:#fff;padding:1px;text-shadow:0 -1px 0 rgba(0,0,0,.1);transition:none!important}.gh-btn-blue span{background:linear-gradient(#4ab6f0,#2fa5e4 60%,#2fa5e4 90%,#38a9e5);box-shadow:inset 0 1px 0
|
|
1
|
+
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-family:sans-serif}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.darkgrey{color:#343f44}.midgrey{color:#738a94}.lightgrey{color:#e5eff5}.blue{color:#3eb0ef}.red{color:#f05230}.orange{color:#fecd35}.green{color:#a4d037}.darkgrey-hover:hover{color:#343f44}.midgrey-hover:hover{color:#738a94}.lightgrey-hover:hover{color:#e5eff5}.blue-hover:hover{color:#3eb0ef}.red-hover:hover{color:#f05230}.orange-hover:hover{color:#fecd35}.green-hover:hover{color:#a4d037}*,:after,:before{box-sizing:border-box}html{-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:62.5%;letter-spacing:.2px;line-height:1.65;overflow:hidden}body,html{height:100%;width:100%}body{color:#343f44;font-size:1.4rem;overflow:auto;overflow-x:hidden}.gh-view{-ms-flex-positive:1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;flex-grow:1}h1,h2{text-rendering:optimizeLegibility;color:#343f44;font-size:2.9rem;line-height:1.15em;margin:0 0 .3em;text-indent:-1px}@media (max-width:500px){h1{font-size:2.4rem}}.gh-input{-webkit-appearance:none;border:1px solid #d6e3eb;border-radius:4px;color:#4b5b62;display:block;font-size:1.6rem;font-weight:300;height:40px;line-height:1em;padding:10px 12px;transition:border-color .15s linear;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;width:100%}.gh-input:focus{border-color:#b4cbda;outline:0}.gh-btn{fill:#829aa8;-webkit-font-smoothing:subpixel-antialiased;border:1px solid #d6e3eb;border-radius:5px;color:#829aa8;display:inline-block;outline:none;text-decoration:none!important;text-shadow:0 1px 0 #fff;transition:all .2s ease;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.gh-btn span{border-radius:4px;display:block;font-size:1.3rem;font-weight:400;height:33px;letter-spacing:.2px;line-height:33px;padding:0 12px;text-align:center}.gh-btn:hover{border-color:#b4cbda}.gh-btn-hover-blue:hover{border-color:#3eb0ef;color:#3eb0ef}.gh-btn-blue{fill:#fff;background:linear-gradient(#3da1d6,#2288bf);border:0;box-shadow:0 1px 0 rgba(0,0,0,.12);color:#fff;padding:1px;text-shadow:0 -1px 0 rgba(0,0,0,.1);transition:none!important}.gh-btn-blue span{background:linear-gradient(#4ab6f0,#2fa5e4 60%,#2fa5e4 90%,#38a9e5);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1)}.gh-btn-blue:active,.gh-btn-blue:focus{background:#1e78a9}.gh-btn-blue:active span,.gh-btn-blue:focus span{background:#29a0e0;box-shadow:none}.gh-btn-block{display:block;width:100%}.gh-input-icon{display:block;position:relative}.gh-input-icon svg{fill:color(var(--midgrey) l(15%));height:14px;left:10px;position:absolute;top:50%;transform:translateY(-7px);width:auto;z-index:2}.gh-input-icon input{padding-left:35px}.gh-app{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;overflow:hidden}.gh-viewport{max-height:100%;overflow:hidden}.gh-main,.gh-viewport{-ms-flex-positive:1;display:-ms-flexbox;display:flex;flex-grow:1}.gh-main{background:#fff;overflow-y:auto;position:relative}.gh-flow{-ms-flex-positive:1;-ms-flex-direction:column;flex-direction:column;flex-grow:1;min-height:100%;overflow-y:auto}.gh-flow,.gh-flow-head{display:-ms-flexbox;display:flex}.gh-flow-head{-ms-flex-negative:0;-ms-flex-pack:justify;flex-shrink:0;justify-content:space-between;padding-bottom:20px;padding-top:4vh}.gh-flow-content-wrap{-ms-flex-positive:1;-ms-flex-negative:0;-ms-flex-pack:center;flex-grow:1;flex-shrink:0;justify-content:center;margin:0 5%;padding-bottom:8vh}.gh-flow-back,.gh-flow-content-wrap{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}.gh-flow-back{border:1px solid transparent;border-radius:4px;color:#7d878a;font-weight:100;left:0;margin:0 0 0 3%;padding:2px 9px 2px 5px;position:absolute;top:0;transition:all .3s ease}.gh-flow-back svg{height:12px;line-height:14px;margin-right:4px}.gh-flow-back svg path{stroke:#7d878a;stroke-width:1.2px}.gh-flow-back:hover{border:1px solid #dae1e3}.gh-flow-back-plain{-ms-flex-align:center;align-items:center;color:#7d878a;display:-ms-flexbox;display:flex;font-weight:300;left:0;margin:0 0 0 3%;padding:2px 9px 2px 5px;position:absolute;text-decoration:none;top:0;transition:all .3s ease}.gh-flow-back-plain svg{height:12px;line-height:14px;margin-right:4px}.gh-flow-back-plain svg path{stroke:#7d878a;stroke-width:1.2px}.gh-flow-back-plain:hover{color:#15212a}.gh-flow-nav{-ms-flex:1;flex:1;position:relative}.gh-flow-content{color:#738a94;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:1.9rem;font-weight:100;line-height:1.5em;max-width:700px;text-align:center;width:100%}.gh-flow-content .gh-input-icon input{padding-left:35px}.gh-flow-content-unsubscribe{font-weight:300}@media (max-width:500px){.gh-flow-head-unsubscribe{padding-top:2.8vh}.gh-flow-content{font-size:4vw}.gh-flow-content-unsubscribe{font-size:1.8rem;line-height:1.6em}}.gh-flow-content header{margin:0 auto;max-width:520px}.gh-flow-content h1{font-size:4.2rem;font-weight:100}@media (max-width:600px){.gh-flow-content h1{font-size:7vw}}.gh-flow-content .gh-btn{display:block;margin:20px auto 0;max-width:400px}.gh-flow-content .form-group{margin-bottom:2.5rem}.gh-flow-content input{border:1px solid #dae1e3;font-size:1.6rem;font-weight:100;line-height:1.4em;padding:10px}.gh-flow-em{font-weight:500}.gh-signin{background:#f8fbfd;border:1px solid #dae1e3;border-radius:5px;margin:30px auto;max-width:400px;padding:40px;position:relative;text-align:left;width:100%}.gh-signin .form-group{margin-bottom:1.5rem}.gh-signin .gh-btn{margin:0}.error-content{flex-grow:1;justify-content:center;padding:8vw;user-select:text}.error-content,.error-details{align-items:center;display:flex}.error-details{margin-bottom:4rem}.error-ghost{height:115px;margin:15px}@media (max-width:630px){.error-ghost{display:none}}.error-code{color:#c5d2d9;font-size:10vw;font-weight:600;letter-spacing:-.4vw;line-height:.9em;margin:0}.error-description{border:none;color:#54666d;font-size:2.3rem;font-weight:300;line-height:1.3em;margin:0;padding:0}.error-message{align-items:center;display:flex;flex-direction:column;margin:15px}.error-message a{font-size:1.4rem;line-height:1;margin:8px 0}.error-link{background-color:transparent;color:#5ba4e5;text-decoration:none;transition:background .3s,color .3s}.error-stack{background-color:hsla(0,0%,100%,.3);margin:1rem auto;max-width:800px;padding:2rem}.error-stack-list{list-style-type:none;margin:0;padding:0}.error-stack-list li{display:block}.error-stack-list li:before{color:#bbb;content:"\21AA";display:inline-block;font-size:1.2rem;margin-right:.5rem}.error-stack-function{font-weight:700}
|
|
@@ -107,17 +107,15 @@ class BlogIcon {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* Return path for Blog icon without [subdirectory]/content/image prefix
|
|
111
|
-
* Always returns {string} getIconPath
|
|
112
|
-
* @returns {string} physical storage path of icon
|
|
113
110
|
* @description Checks if we have a custom uploaded icon. If no custom uploaded icon
|
|
114
111
|
* exists, we're returning the default `favicon.ico`
|
|
112
|
+
* @returns {string} physical storage path of site icon without [subdirectory]/content/image prefix
|
|
115
113
|
*/
|
|
116
114
|
getIconPath() {
|
|
117
115
|
const blogIcon = this.settingsCache.get('icon');
|
|
118
116
|
|
|
119
117
|
if (blogIcon) {
|
|
120
|
-
return this.storageUtils.
|
|
118
|
+
return this.storageUtils.getLocalImagesStoragePath(blogIcon);
|
|
121
119
|
} else {
|
|
122
120
|
return path.join(this.config.get('paths:publicFilePath'), 'favicon.ico');
|
|
123
121
|
}
|
|
@@ -214,7 +214,7 @@ class ImageSize {
|
|
|
214
214
|
imagePath = this.urlUtils.urlFor('image', {image: imagePath}, true);
|
|
215
215
|
|
|
216
216
|
// get the storage readable filePath
|
|
217
|
-
filePath = this.storageUtils.
|
|
217
|
+
filePath = this.storageUtils.getLocalImagesStoragePath(imagePath);
|
|
218
218
|
|
|
219
219
|
return this.storage.getStorage('images')
|
|
220
220
|
.read({path: filePath})
|
|
@@ -4,10 +4,7 @@ const db = require('../data/db');
|
|
|
4
4
|
const LimitService = require('@tryghost/limit-service');
|
|
5
5
|
let limitService = new LimitService();
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
* @param {Object} [limits] - An object containing limit configuration
|
|
9
|
-
**/
|
|
10
|
-
const initFn = (limits = {}) => {
|
|
7
|
+
const init = () => {
|
|
11
8
|
let helpLink;
|
|
12
9
|
|
|
13
10
|
if (config.get('hostSettings:billing:enabled') && config.get('hostSettings:billing:enabled') === true && config.get('hostSettings:billing:url')) {
|
|
@@ -28,7 +25,7 @@ const initFn = (limits = {}) => {
|
|
|
28
25
|
const hostLimits = config.get('hostSettings:limits') || {};
|
|
29
26
|
|
|
30
27
|
limitService.loadLimits({
|
|
31
|
-
limits:
|
|
28
|
+
limits: hostLimits,
|
|
32
29
|
subscription,
|
|
33
30
|
db,
|
|
34
31
|
helpLink,
|
|
@@ -38,4 +35,4 @@ const initFn = (limits = {}) => {
|
|
|
38
35
|
|
|
39
36
|
module.exports = limitService;
|
|
40
37
|
|
|
41
|
-
module.exports.init =
|
|
38
|
+
module.exports.init = init;
|
|
@@ -74,6 +74,10 @@ table td {
|
|
|
74
74
|
max-width: 600px;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
.content a {
|
|
78
|
+
overflow-wrap: anywhere;
|
|
79
|
+
}
|
|
80
|
+
|
|
77
81
|
/* -------------------------------------
|
|
78
82
|
POST CONTENT
|
|
79
83
|
------------------------------------- */
|
|
@@ -513,10 +517,12 @@ figure blockquote p {
|
|
|
513
517
|
display: block;
|
|
514
518
|
text-decoration: none !important;
|
|
515
519
|
}
|
|
520
|
+
|
|
516
521
|
.kg-video-preview table {
|
|
517
522
|
background-size: cover;
|
|
518
523
|
min-height: 200px; /* for when images aren't loaded */
|
|
519
524
|
}
|
|
525
|
+
|
|
520
526
|
.kg-video-play-button {
|
|
521
527
|
height: 2em;
|
|
522
528
|
width: 3em;
|
|
@@ -526,6 +532,7 @@ figure blockquote p {
|
|
|
526
532
|
font-size: 1em; /* change this to resize */
|
|
527
533
|
background-color: rgba(0,0,0,0.85);
|
|
528
534
|
}
|
|
535
|
+
|
|
529
536
|
.kg-video-play-button div {
|
|
530
537
|
display: block;
|
|
531
538
|
width: 0;
|
|
@@ -537,6 +544,61 @@ figure blockquote p {
|
|
|
537
544
|
border-width: 0.8em 0 0.8em 1.5em;
|
|
538
545
|
}
|
|
539
546
|
|
|
547
|
+
a.kg-nft-card {
|
|
548
|
+
display: flex;
|
|
549
|
+
flex-direction: column;
|
|
550
|
+
color: #15212A;
|
|
551
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
552
|
+
font-size: 15px;
|
|
553
|
+
text-decoration: none;
|
|
554
|
+
border-radius: 3px;
|
|
555
|
+
border: 1px solid #e5eff5;
|
|
556
|
+
width: 100%;
|
|
557
|
+
max-width: 512px;
|
|
558
|
+
color: #222;
|
|
559
|
+
background: #fff;
|
|
560
|
+
margin: 0 auto;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.kg-nft-metadata {
|
|
564
|
+
padding: 20px;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
.kg-nft-image {
|
|
568
|
+
border-radius: 2px 2px 0 0;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.kg-nft-header {
|
|
572
|
+
display: flex;
|
|
573
|
+
justify-content: space-between;
|
|
574
|
+
gap: 20px;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.kg-nft-title {
|
|
578
|
+
font-family: inherit;
|
|
579
|
+
font-size: 19px;
|
|
580
|
+
font-weight: 700;
|
|
581
|
+
margin: 0;
|
|
582
|
+
color: #222;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.kg-nft-creator {
|
|
586
|
+
font-family: inherit;
|
|
587
|
+
margin: 4px 0 0;
|
|
588
|
+
color: #ababab;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.kg-nft-creator-name {
|
|
592
|
+
font-weight: 500;
|
|
593
|
+
color: #222;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
.kg-nft-description {
|
|
597
|
+
font-family: inherit;
|
|
598
|
+
line-height: 1.4em;
|
|
599
|
+
margin: 12px 0 0;
|
|
600
|
+
color: #222;
|
|
601
|
+
}
|
|
540
602
|
|
|
541
603
|
/* -------------------------------------
|
|
542
604
|
HEADER, FOOTER, MAIN
|
|
@@ -610,7 +672,6 @@ figure blockquote p {
|
|
|
610
672
|
margin: 0;
|
|
611
673
|
padding: 12px 25px;
|
|
612
674
|
text-decoration: none;
|
|
613
|
-
text-transform: capitalize;
|
|
614
675
|
}
|
|
615
676
|
|
|
616
677
|
.btn-primary table td {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./oembed').ICustomProvider} ICustomProvider
|
|
3
|
+
* @typedef {import('./oembed').IExternalRequest} IExternalRequest
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const OPENSEA_PATH_REGEX = /^\/assets\/(0x[a-f0-9]+)\/(\d+)/;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @implements ICustomProvider
|
|
10
|
+
*/
|
|
11
|
+
class NFTOEmbedProvider {
|
|
12
|
+
/**
|
|
13
|
+
* @param {object} dependencies
|
|
14
|
+
*/
|
|
15
|
+
constructor(dependencies) {
|
|
16
|
+
this.dependencies = dependencies;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @param {URL} url
|
|
21
|
+
* @returns {Promise<boolean>}
|
|
22
|
+
*/
|
|
23
|
+
async canSupportRequest(url) {
|
|
24
|
+
return url.host === 'opensea.io' && OPENSEA_PATH_REGEX.test(url.pathname);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @param {URL} url
|
|
29
|
+
* @param {IExternalRequest} externalRequest
|
|
30
|
+
*
|
|
31
|
+
* @returns {Promise<import('oembed-parser').RichTypeData & Object<string, any>>}
|
|
32
|
+
*/
|
|
33
|
+
async getOEmbedData(url, externalRequest) {
|
|
34
|
+
const [match, transaction, asset] = url.pathname.match(OPENSEA_PATH_REGEX);
|
|
35
|
+
if (!match) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const result = await externalRequest(`https://api.opensea.io/api/v1/asset/${transaction}/${asset}/`, {
|
|
39
|
+
json: true
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
version: '1.0',
|
|
43
|
+
type: 'rich',
|
|
44
|
+
title: result.body.name,
|
|
45
|
+
author_name: result.body.creator.user.username,
|
|
46
|
+
author_url: `https://opensea.io/${result.body.creator.user.username}`,
|
|
47
|
+
provider_name: 'OpenSea',
|
|
48
|
+
provider_url: 'https://opensea.io',
|
|
49
|
+
html: `
|
|
50
|
+
<a href="${result.body.permalink}" class="kg-nft-card">
|
|
51
|
+
<img class="kg-nft-image" src="${result.body.image_url}">
|
|
52
|
+
<div class="kg-nft-metadata">
|
|
53
|
+
<div class="kg-nft-header">
|
|
54
|
+
<h4 class="kg-nft-title"> ${result.body.name} </h4>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="kg-nft-creator">
|
|
57
|
+
Created by <span class="kg-nft-creator-name">${result.body.creator.user.username}</span>
|
|
58
|
+
${(result.body.collection.name ? `• ${result.body.collection.name}` : ``)}
|
|
59
|
+
</div>
|
|
60
|
+
${(result.body.description ? `<p class="kg-nft-description">${result.body.description}</p>` : ``)}
|
|
61
|
+
</div>
|
|
62
|
+
</a>
|
|
63
|
+
`,
|
|
64
|
+
width: 1000,
|
|
65
|
+
height: 1000,
|
|
66
|
+
noIframe: true
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
module.exports = NFTOEmbedProvider;
|