ghost 5.27.0 → 5.29.0

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.
Files changed (121) hide show
  1. package/components/tryghost-adapter-manager-5.29.0.tgz +0 -0
  2. package/components/{tryghost-api-framework-5.27.0.tgz → tryghost-api-framework-5.29.0.tgz} +0 -0
  3. package/components/tryghost-api-version-compatibility-service-5.29.0.tgz +0 -0
  4. package/components/tryghost-audience-feedback-5.29.0.tgz +0 -0
  5. package/components/tryghost-bootstrap-socket-5.29.0.tgz +0 -0
  6. package/components/tryghost-constants-5.29.0.tgz +0 -0
  7. package/components/{tryghost-custom-theme-settings-service-5.27.0.tgz → tryghost-custom-theme-settings-service-5.29.0.tgz} +0 -0
  8. package/components/{tryghost-data-generator-5.27.0.tgz → tryghost-data-generator-5.29.0.tgz} +0 -0
  9. package/components/tryghost-domain-events-5.29.0.tgz +0 -0
  10. package/components/tryghost-email-analytics-provider-mailgun-5.29.0.tgz +0 -0
  11. package/components/tryghost-email-analytics-service-5.29.0.tgz +0 -0
  12. package/components/tryghost-email-content-generator-5.29.0.tgz +0 -0
  13. package/components/tryghost-email-events-5.29.0.tgz +0 -0
  14. package/components/{tryghost-email-service-5.27.0.tgz → tryghost-email-service-5.29.0.tgz} +0 -0
  15. package/components/tryghost-email-suppression-list-5.29.0.tgz +0 -0
  16. package/components/tryghost-express-dynamic-redirects-5.29.0.tgz +0 -0
  17. package/components/tryghost-extract-api-key-5.29.0.tgz +0 -0
  18. package/components/tryghost-html-to-plaintext-5.29.0.tgz +0 -0
  19. package/components/tryghost-importer-revue-5.29.0.tgz +0 -0
  20. package/components/{tryghost-job-manager-5.27.0.tgz → tryghost-job-manager-5.29.0.tgz} +0 -0
  21. package/components/tryghost-link-redirects-5.29.0.tgz +0 -0
  22. package/components/tryghost-link-replacer-5.29.0.tgz +0 -0
  23. package/components/{tryghost-link-tracking-5.27.0.tgz → tryghost-link-tracking-5.29.0.tgz} +0 -0
  24. package/components/{tryghost-magic-link-5.27.0.tgz → tryghost-magic-link-5.29.0.tgz} +0 -0
  25. package/components/tryghost-mailgun-client-5.29.0.tgz +0 -0
  26. package/components/tryghost-member-attribution-5.29.0.tgz +0 -0
  27. package/components/tryghost-member-events-5.29.0.tgz +0 -0
  28. package/components/{tryghost-members-api-5.27.0.tgz → tryghost-members-api-5.29.0.tgz} +0 -0
  29. package/components/tryghost-members-csv-5.29.0.tgz +0 -0
  30. package/components/{tryghost-members-events-service-5.27.0.tgz → tryghost-members-events-service-5.29.0.tgz} +0 -0
  31. package/components/tryghost-members-importer-5.29.0.tgz +0 -0
  32. package/components/tryghost-members-offers-5.29.0.tgz +0 -0
  33. package/components/tryghost-members-payments-5.29.0.tgz +0 -0
  34. package/components/tryghost-members-ssr-5.29.0.tgz +0 -0
  35. package/components/tryghost-members-stripe-service-5.29.0.tgz +0 -0
  36. package/components/tryghost-minifier-5.29.0.tgz +0 -0
  37. package/components/tryghost-mw-api-version-mismatch-5.29.0.tgz +0 -0
  38. package/components/tryghost-mw-cache-control-5.29.0.tgz +0 -0
  39. package/components/tryghost-mw-error-handler-5.29.0.tgz +0 -0
  40. package/components/tryghost-mw-session-from-token-5.29.0.tgz +0 -0
  41. package/components/tryghost-mw-update-user-last-seen-5.29.0.tgz +0 -0
  42. package/components/tryghost-mw-vhost-5.29.0.tgz +0 -0
  43. package/components/tryghost-oembed-service-5.29.0.tgz +0 -0
  44. package/components/tryghost-package-json-5.29.0.tgz +0 -0
  45. package/components/tryghost-referrers-5.29.0.tgz +0 -0
  46. package/components/{tryghost-security-5.27.0.tgz → tryghost-security-5.29.0.tgz} +0 -0
  47. package/components/tryghost-session-service-5.29.0.tgz +0 -0
  48. package/components/tryghost-settings-path-manager-5.29.0.tgz +0 -0
  49. package/components/{tryghost-staff-service-5.27.0.tgz → tryghost-staff-service-5.29.0.tgz} +0 -0
  50. package/components/tryghost-stats-service-5.29.0.tgz +0 -0
  51. package/components/tryghost-tiers-5.29.0.tgz +0 -0
  52. package/components/tryghost-update-check-service-5.29.0.tgz +0 -0
  53. package/components/tryghost-verification-trigger-5.29.0.tgz +0 -0
  54. package/components/tryghost-version-notifications-data-service-5.29.0.tgz +0 -0
  55. package/core/built/admin/assets/{chunk.143.90a7ca5db49aa2d315c8.js → chunk.143.b610199533b562d3f4bb.js} +19 -18
  56. package/core/built/admin/assets/{chunk.380.de3a9bf5161ab5300d23.js → chunk.45.87cd3fcd0323d4103a17.js} +61 -63
  57. package/core/built/admin/assets/{chunk.380.de3a9bf5161ab5300d23.js.LICENSE.txt → chunk.45.87cd3fcd0323d4103a17.js.LICENSE.txt} +0 -0
  58. package/core/built/admin/assets/{ghost-b2e01b65312f0de8a3fb6a3d87ed5d89.js → ghost-4005771a511aaabd6545fb9645cfa24a.js} +4288 -4303
  59. package/core/built/admin/assets/{vendor-dbf84caa0968ef5da0486055da6636da.js → vendor-88c5114bd6fdce352a32a0ac1fd4f32b.js} +12 -14
  60. package/core/built/admin/index.html +5 -5
  61. package/core/frontend/helpers/get.js +2 -2
  62. package/core/frontend/web/middleware/error-handler.js +0 -2
  63. package/core/server/api/endpoints/themes.js +13 -9
  64. package/core/server/data/migrations/versions/5.28/2023-01-05-15-13-add-active-theme-permissions.js +12 -0
  65. package/core/server/data/migrations/versions/5.29/2023-01-11-02-45-truncate-suppressions.js +12 -0
  66. package/core/server/data/schema/fixtures/fixtures.json +7 -2
  67. package/core/server/services/email-suppression-list/MailgunEmailSuppressionList.js +1 -1
  68. package/core/server/services/themes/activate.js +3 -3
  69. package/core/server/services/themes/index.js +4 -2
  70. package/core/server/services/themes/storage.js +3 -1
  71. package/core/server/services/themes/to-json.js +6 -6
  72. package/core/server/services/themes/validate.js +80 -8
  73. package/core/server/web/api/endpoints/admin/routes.js +5 -0
  74. package/core/shared/config/defaults.json +2 -1
  75. package/core/shared/labs.js +3 -3
  76. package/package.json +105 -105
  77. package/yarn.lock +1509 -1334
  78. package/components/tryghost-adapter-manager-5.27.0.tgz +0 -0
  79. package/components/tryghost-api-version-compatibility-service-5.27.0.tgz +0 -0
  80. package/components/tryghost-audience-feedback-5.27.0.tgz +0 -0
  81. package/components/tryghost-bootstrap-socket-5.27.0.tgz +0 -0
  82. package/components/tryghost-constants-5.27.0.tgz +0 -0
  83. package/components/tryghost-domain-events-5.27.0.tgz +0 -0
  84. package/components/tryghost-email-analytics-provider-mailgun-5.27.0.tgz +0 -0
  85. package/components/tryghost-email-analytics-service-5.27.0.tgz +0 -0
  86. package/components/tryghost-email-content-generator-5.27.0.tgz +0 -0
  87. package/components/tryghost-email-events-5.27.0.tgz +0 -0
  88. package/components/tryghost-email-suppression-list-5.27.0.tgz +0 -0
  89. package/components/tryghost-express-dynamic-redirects-5.27.0.tgz +0 -0
  90. package/components/tryghost-extract-api-key-5.27.0.tgz +0 -0
  91. package/components/tryghost-html-to-plaintext-5.27.0.tgz +0 -0
  92. package/components/tryghost-importer-revue-5.27.0.tgz +0 -0
  93. package/components/tryghost-link-redirects-5.27.0.tgz +0 -0
  94. package/components/tryghost-link-replacer-5.27.0.tgz +0 -0
  95. package/components/tryghost-mailgun-client-5.27.0.tgz +0 -0
  96. package/components/tryghost-member-attribution-5.27.0.tgz +0 -0
  97. package/components/tryghost-member-events-5.27.0.tgz +0 -0
  98. package/components/tryghost-members-csv-5.27.0.tgz +0 -0
  99. package/components/tryghost-members-importer-5.27.0.tgz +0 -0
  100. package/components/tryghost-members-offers-5.27.0.tgz +0 -0
  101. package/components/tryghost-members-payments-5.27.0.tgz +0 -0
  102. package/components/tryghost-members-ssr-5.27.0.tgz +0 -0
  103. package/components/tryghost-members-stripe-service-5.27.0.tgz +0 -0
  104. package/components/tryghost-minifier-5.27.0.tgz +0 -0
  105. package/components/tryghost-mw-api-version-mismatch-5.27.0.tgz +0 -0
  106. package/components/tryghost-mw-cache-control-5.27.0.tgz +0 -0
  107. package/components/tryghost-mw-error-handler-5.27.0.tgz +0 -0
  108. package/components/tryghost-mw-session-from-token-5.27.0.tgz +0 -0
  109. package/components/tryghost-mw-update-user-last-seen-5.27.0.tgz +0 -0
  110. package/components/tryghost-mw-vhost-5.27.0.tgz +0 -0
  111. package/components/tryghost-oembed-service-5.27.0.tgz +0 -0
  112. package/components/tryghost-package-json-5.27.0.tgz +0 -0
  113. package/components/tryghost-referrers-5.27.0.tgz +0 -0
  114. package/components/tryghost-session-service-5.27.0.tgz +0 -0
  115. package/components/tryghost-settings-path-manager-5.27.0.tgz +0 -0
  116. package/components/tryghost-stats-service-5.27.0.tgz +0 -0
  117. package/components/tryghost-tiers-5.27.0.tgz +0 -0
  118. package/components/tryghost-update-check-service-5.27.0.tgz +0 -0
  119. package/components/tryghost-verification-trigger-5.27.0.tgz +0 -0
  120. package/components/tryghost-version-notifications-data-service-5.27.0.tgz +0 -0
  121. package/core/built/admin/assets/chunk.178.4723d26b77c02377c107.js +0 -11
@@ -27,7 +27,7 @@ return t.default=t,t.moduleId=e,t.has=function(t){return h(c(t,e))},t},define=fu
27
27
  i&&"new"!==i.state||(arguments.length<2&&o(arguments.length),Array.isArray(t)||(r=t,t=[]),n[e]=r instanceof u?new s(r.id,t,r,!0):new s(e,t,r,!1))},define.exports=function(e,t){var r=n[e]
28
28
  if(!r||"new"===r.state)return(r=new s(e,[],l,null)).module.exports=t,r.state="finalized",n[e]=r,r},define.alias=function(e,t){return 2===arguments.length?define(t,new u(e)):new u(e)},requirejs.entries=requirejs._eak_seen=n,requirejs.has=h,requirejs.unsee=function(e){d(e,"(unsee)",!1).unsee()},requirejs.clear=function(){requirejs.entries=requirejs._eak_seen=n=t(),t()},define("foo",(function(){})),define("foo/bar",[],(function(){})),define("foo/asdf",["module","exports","require"],(function(e,t,r){r.has("foo/bar")&&r("foo/bar")})),define("foo/baz",[],define.alias("foo")),define("foo/quz",define.alias("foo")),define.alias("foo","foo/qux"),define("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],(function(){})),define("foo/main",["foo/bar"],(function(){})),define.exports("foo/exports",{}),require("foo/exports"),require("foo/main"),require.unsee("foo/bar"),requirejs.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:require,define:define})}(this),
29
29
  /*!
30
- * jQuery JavaScript Library v3.6.3
30
+ * jQuery JavaScript Library v3.6.1
31
31
  * https://jquery.com/
32
32
  *
33
33
  * Includes Sizzle.js
@@ -37,7 +37,7 @@ if(!r||"new"===r.state)return(r=new s(e,[],l,null)).module.exports=t,r.state="fi
37
37
  * Released under the MIT license
38
38
  * https://jquery.org/license
39
39
  *
40
- * Date: 2022-12-20T21:28Z
40
+ * Date: 2022-08-26T17:52Z
41
41
  */
42
42
  function(e,t){"use strict"
43
43
  "object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document")
@@ -45,7 +45,7 @@ return t(e)}:t(e)}("undefined"!=typeof window?window:this,(function(e,t){"use st
45
45
  var r=[],n=Object.getPrototypeOf,i=r.slice,o=r.flat?function(e){return r.flat.call(e)}:function(e){return r.concat.apply([],e)},a=r.push,s=r.indexOf,l={},u=l.toString,d=l.hasOwnProperty,c=d.toString,h=c.call(Object),p={},f=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},m=function(e){return null!=e&&e===e.window},g=e.document,v={type:!0,src:!0,nonce:!0,noModule:!0}
46
46
  function b(e,t,r){var n,i,o=(r=r||g).createElement("script")
47
47
  if(o.text=e,t)for(n in v)(i=t[n]||t.getAttribute&&t.getAttribute(n))&&o.setAttribute(n,i)
48
- r.head.appendChild(o).parentNode.removeChild(o)}function y(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[u.call(e)]||"object":typeof e}var _="3.6.3",E=function(e,t){return new E.fn.init(e,t)}
48
+ r.head.appendChild(o).parentNode.removeChild(o)}function y(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[u.call(e)]||"object":typeof e}var _="3.6.1",E=function(e,t){return new E.fn.init(e,t)}
49
49
  function k(e){var t=!!e&&"length"in e&&e.length,r=y(e)
50
50
  return!f(e)&&!m(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}E.fn=E.prototype={jquery:_,constructor:E,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=E.merge(this.constructor(),e)
51
51
  return t.prevObject=this,t},each:function(e){return E.each(this,e)},map:function(e){return this.pushStack(E.map(this,(function(t,r){return e.call(t,r,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(E.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(E.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,r=+e+(e<0?t:0)
@@ -65,14 +65,14 @@ else for(a in e)null!=(i=t(e[a],a,r))&&s.push(i)
65
65
  return o(s)},guid:1,support:p}),"function"==typeof Symbol&&(E.fn[Symbol.iterator]=r[Symbol.iterator]),E.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){l["[object "+t+"]"]=t.toLowerCase()}))
66
66
  var w=
67
67
  /*!
68
- * Sizzle CSS Selector Engine v2.3.9
68
+ * Sizzle CSS Selector Engine v2.3.6
69
69
  * https://sizzlejs.com/
70
70
  *
71
71
  * Copyright JS Foundation and other contributors
72
72
  * Released under the MIT license
73
73
  * https://js.foundation/
74
74
  *
75
- * Date: 2022-12-19
75
+ * Date: 2021-02-16
76
76
  */
77
77
  function(e){var t,r,n,i,o,a,s,l,u,d,c,h,p,f,m,g,v,b,y,_="sizzle"+1*new Date,E=e.document,k=0,w=0,x=le(),O=le(),C=le(),T=le(),M=function(e,t){return e===t&&(c=!0),0},S={}.hasOwnProperty,P=[],A=P.pop,R=P.push,j=P.push,D=P.slice,I=function(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r
78
78
  return-1},N="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",F="(?:\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\["+L+"*("+F+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+L+"*\\]",B=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",H=new RegExp(L+"+","g"),U=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),V=new RegExp("^"+L+"*,"+L+"*"),q=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),$=new RegExp(L+"|>"),W=new RegExp(B),G=new RegExp("^"+F+"$"),K={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+N+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),re=function(e,t){var r="0x"+e.slice(1)-65536
@@ -82,8 +82,7 @@ if(n=n||[],"string"!=typeof e||!e||1!==E&&9!==E&&11!==E)return n
82
82
  if(!i&&(h(t),t=t||p,m)){if(11!==E&&(c=Z.exec(e)))if(o=c[1]){if(9===E){if(!(u=t.getElementById(o)))return n
83
83
  if(u.id===o)return n.push(u),n}else if(b&&(u=b.getElementById(o))&&y(t,u)&&u.id===o)return n.push(u),n}else{if(c[2])return j.apply(n,t.getElementsByTagName(e)),n
84
84
  if((o=c[3])&&r.getElementsByClassName&&t.getElementsByClassName)return j.apply(n,t.getElementsByClassName(o)),n}if(r.qsa&&!T[e+" "]&&(!g||!g.test(e))&&(1!==E||"object"!==t.nodeName.toLowerCase())){if(v=e,b=t,1===E&&($.test(e)||q.test(e))){for((b=ee.test(e)&&ve(t.parentNode)||t)===t&&r.scope||((d=t.getAttribute("id"))?d=d.replace(ne,ie):t.setAttribute("id",d=_)),s=(f=a(e)).length;s--;)f[s]=(d?"#"+d:":scope")+" "+ye(f[s])
85
- v=f.join(",")}try{if(r.cssSupportsSelector&&!CSS.supports("selector(:is("+v+"))"))throw new Error
86
- return j.apply(n,b.querySelectorAll(v)),n}catch(k){T(e,!0)}finally{d===_&&t.removeAttribute("id")}}}return l(e.replace(U,"$1"),t,n,i)}function le(){var e=[]
85
+ v=f.join(",")}try{return j.apply(n,b.querySelectorAll(v)),n}catch(k){T(e,!0)}finally{d===_&&t.removeAttribute("id")}}}return l(e.replace(U,"$1"),t,n,i)}function le(){var e=[]
87
86
  return function t(r,i){return e.push(r+" ")>n.cacheLength&&delete t[e.shift()],t[r+" "]=i}}function ue(e){return e[_]=!0,e}function de(e){var t=p.createElement("fieldset")
88
87
  try{return!!e(t)}catch(Oe){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ce(e,t){for(var r=e.split("|"),i=r.length;i--;)n.attrHandle[r[i]]=t}function he(e,t){var r=t&&e,n=r&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex
89
88
  if(n)return n
@@ -91,7 +90,7 @@ if(r)for(;r=r.nextSibling;)if(r===t)return-1
91
90
  return e?1:-1}function pe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function fe(e){return function(t){var r=t.nodeName.toLowerCase()
92
91
  return("input"===r||"button"===r)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return ue((function(t){return t=+t,ue((function(r,n){for(var i,o=e([],r.length,t),a=o.length;a--;)r[i=o[a]]&&(r[i]=!(n[i]=r[i]))}))}))}function ve(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in r=se.support={},o=se.isXML=function(e){var t=e&&e.namespaceURI,r=e&&(e.ownerDocument||e).documentElement
93
92
  return!Y.test(t||r&&r.nodeName||"HTML")},h=se.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:E
94
- return a!=p&&9===a.nodeType&&a.documentElement?(f=(p=a).documentElement,m=!o(p),E!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),r.scope=de((function(e){return f.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),r.cssSupportsSelector=de((function(){return CSS.supports("selector(*)")&&p.querySelectorAll(":is(:jqfake)")&&!CSS.supports("selector(:is(*,:jqfake))")})),r.attributes=de((function(e){return e.className="i",!e.getAttribute("className")})),r.getElementsByTagName=de((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),r.getElementsByClassName=X.test(p.getElementsByClassName),r.getById=de((function(e){return f.appendChild(e).id=_,!p.getElementsByName||!p.getElementsByName(_).length})),r.getById?(n.filter.ID=function(e){var t=e.replace(te,re)
93
+ return a!=p&&9===a.nodeType&&a.documentElement?(f=(p=a).documentElement,m=!o(p),E!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),r.scope=de((function(e){return f.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),r.attributes=de((function(e){return e.className="i",!e.getAttribute("className")})),r.getElementsByTagName=de((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),r.getElementsByClassName=X.test(p.getElementsByClassName),r.getById=de((function(e){return f.appendChild(e).id=_,!p.getElementsByName||!p.getElementsByName(_).length})),r.getById?(n.filter.ID=function(e){var t=e.replace(te,re)
95
94
  return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r=t.getElementById(e)
96
95
  return r?[r]:[]}}):(n.filter.ID=function(e){var t=e.replace(te,re)
97
96
  return function(e){var r=void 0!==e.getAttributeNode&&e.getAttributeNode("id")
@@ -102,7 +101,7 @@ if("*"===e){for(;r=o[i++];)1===r.nodeType&&n.push(r)
102
101
  return n}return o},n.find.CLASS=r.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(r.qsa=X.test(p.querySelectorAll))&&(de((function(e){var t
103
102
  f.appendChild(e).innerHTML="<a id='"+_+"'></a><select id='"+_+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+L+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+L+"*(?:value|"+N+")"),e.querySelectorAll("[id~="+_+"-]").length||g.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),de((function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>"
104
103
  var t=p.createElement("input")
105
- t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(r.matchesSelector=X.test(b=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&de((function(e){r.disconnectedMatch=b.call(e,"*"),b.call(e,"[s!='']:x"),v.push("!=",B)})),r.cssSupportsSelector||g.push(":has"),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=X.test(f.compareDocumentPosition),y=t||X.test(f.contains)?function(e,t){var r=9===e.nodeType&&e.documentElement||e,n=t&&t.parentNode
104
+ t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(r.matchesSelector=X.test(b=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&de((function(e){r.disconnectedMatch=b.call(e,"*"),b.call(e,"[s!='']:x"),v.push("!=",B)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=X.test(f.compareDocumentPosition),y=t||X.test(f.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode
106
105
  return e===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0
107
106
  return!1},M=t?function(e,t){if(e===t)return c=!0,0
108
107
  var n=!e.compareDocumentPosition-!t.compareDocumentPosition
@@ -327,7 +326,7 @@ for(i in t)o[i]=e.style[i],e.style[i]=t[i]
327
326
  for(i in n=r.call(e),t)e.style[i]=o[i]
328
327
  return n},He=new RegExp(re.join("|"),"i"),Ue="[\\x20\\t\\r\\n\\f]",Ve=new RegExp("^"+Ue+"+|((?:^|[^\\\\])(?:\\\\.)*)"+Ue+"+$","g")
329
328
  function qe(e,t,r){var n,i,o,a,s=Fe.test(t),l=e.style
330
- return(r=r||ze(e))&&(a=r.getPropertyValue(t)||r[t],s&&a&&(a=a.replace(Ve,"$1")||void 0),""!==a||ie(e)||(a=E.style(e,t)),!p.pixelBoxStyles()&&Le.test(a)&&He.test(t)&&(n=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=r.width,l.width=n,l.minWidth=i,l.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments)
329
+ return(r=r||ze(e))&&(a=r.getPropertyValue(t)||r[t],s&&(a=a.replace(Ve,"$1")),""!==a||ie(e)||(a=E.style(e,t)),!p.pixelBoxStyles()&&Le.test(a)&&He.test(t)&&(n=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=r.width,l.width=n,l.minWidth=i,l.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments)
331
330
  delete this.get}}}(function(){function t(){if(d){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",d.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ne.appendChild(u).appendChild(d)
332
331
  var t=e.getComputedStyle(d)
333
332
  n="1%"!==t.top,l=12===r(t.marginLeft),d.style.right="60%",a=36===r(t.right),i=36===r(t.width),d.style.position="absolute",o=12===r(d.offsetWidth/3),ne.removeChild(u),d=null}}function r(e){return Math.round(parseFloat(e))}var n,i,o,a,s,l,u=g.createElement("div"),d=g.createElement("div")
@@ -12767,9 +12766,8 @@ return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r
12767
12766
  return Object.keys(n).forEach((function(e){o[e]=n[e]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.TOOLBAR_MARGIN=void 0
12768
12767
  const y=Ember.HTMLBars.template({id:"s/cCOs7I",block:'{"symbols":["@addSnippet"],"statements":[[8,"kg-action-bar",[],[["@class","@instantClose","@isVisible"],["relative",true,[32,0,["showToolbar"]]]],[["default"],[{"statements":[[2,"\\n "],[10,"li"],[14,0,"ma0 lh-solid"],[12],[2,"\\n "],[11,"button"],[24,"title","Bold"],[24,0,"dib dim-lite link h9 w9 nudge-top--1"],[24,4,"button"],[4,[38,0],["click",[30,[36,4],[[32,0,["_toggleMarkup"]],"strong"],null]],null],[12],[2,"\\n "],[1,[30,[36,1],["koenig/kg-bold"],[["class"],[[30,[36,5],[[30,[36,3],[[32,0,["activeMarkupTagNames","isStrong"]],"fill-green-l2","fill-white"],null]," w4 h4"],null]]]]],[2,"\\n "],[13],[2,"\\n "],[13],[2,"\\n "],[10,"li"],[14,0,"ma0 lh-solid"],[12],[2,"\\n "],[11,"button"],[24,"title","Italic"],[24,0,"dib dim-lite link h9 w9 nudge-top--1"],[24,4,"button"],[4,[38,0],["click",[30,[36,4],[[32,0,["_toggleMarkup"]],"em"],null]],null],[12],[2,"\\n "],[1,[30,[36,1],["koenig/kg-italic"],[["class"],[[30,[36,5],[[30,[36,3],[[30,[36,6],[[32,0,["activeMarkupTagNames","isEm"]],[32,0,["activeMarkupTagNames","isI"]]],null],"fill-green-l2","fill-white"],null]," w4 h4"],null]]]]],[2,"\\n "],[13],[2,"\\n "],[13],[2,"\\n"],[6,[37,2],[[32,0,["basicOnly"]]],null,[["default"],[{"statements":[[2," "],[10,"li"],[14,0,"ma0 lh-solid"],[12],[2,"\\n "],[11,"button"],[24,"title","Heading 2"],[24,0,"dib dim-lite link h9 w9 nudge-top--1"],[24,4,"button"],[4,[38,0],["click",[30,[36,4],[[32,0,["_toggleHeaderSection"]],"h2"],null]],null],[12],[2,"\\n "],[1,[30,[36,1],["koenig/kg-heading-1"],[["class"],[[30,[36,5],[[30,[36,3],[[32,0,["activeSectionTagNames","isH2"]],"fill-green-l2","fill-white"],null]," w4 h4"],null]]]]],[2,"\\n "],[13],[2,"\\n "],[13],[2,"\\n "],[10,"li"],[14,0,"ma0 lh-solid"],[12],[2,"\\n "],[11,"button"],[24,"title","Heading 3"],[24,0,"dib dim-lite link h9 w9 nudge-top--1"],[24,"data-test-button","toolbar-h3"],[24,4,"button"],[4,[38,0],["click",[30,[36,4],[[32,0,["_toggleHeaderSection"]],"h3"],null]],null],[12],[2,"\\n "],[1,[30,[36,1],["koenig/kg-heading-2"],[["class"],[[30,[36,5],[[30,[36,3],[[32,0,["activeSectionTagNames","isH3"]],"fill-green-l2","fill-white"],null]," w4 h4"],null]]]]],[2,"\\n "],[13],[2,"\\n "],[13],[2,"\\n"]],"parameters":[]}]]],[2,"\\n "],[10,"li"],[14,0,"ma0 ml1 mr1 lh-solid kg-action-bar-divider bg-darkgrey-l2 h5"],[14,"role","separator"],[12],[13],[2,"\\n\\n"],[6,[37,2],[[32,0,["basicOnly"]]],null,[["default"],[{"statements":[[2," "],[10,"li"],[14,0,"ma0 lh-solid"],[12],[2,"\\n "],[11,"button"],[24,"title","Quote"],[24,0,"dib dim-lite link h9 w9 nudge-top--1"],[24,4,"button"],[4,[38,0],["click",[32,0,["toggleQuoteSection"]]],null],[12],[2,"\\n"],[6,[37,3],[[32,0,["activeSectionTagNames","isBlockquote"]]],null,[["default","else"],[{"statements":[[2," "],[1,[30,[36,1],["koenig/kg-quote-1"],[["class"],["fill-green w4 h4"]]]],[2,"\\n"]],"parameters":[]},{"statements":[[6,[37,3],[[32,0,["activeSectionTagNames","isAside"]]],null,[["default","else"],[{"statements":[[2," "],[1,[30,[36,1],["koenig/kg-quote-2"],[["class"],["fill-green w4 h4"]]]],[2,"\\n"]],"parameters":[]},{"statements":[[2," "],[1,[30,[36,1],["koenig/kg-quote"],[["class"],["fill-white w4 h4"]]]],[2,"\\n "]],"parameters":[]}]]]],"parameters":[]}]]],[2," "],[13],[2,"\\n "],[13],[2,"\\n"]],"parameters":[]}]]],[2," "],[10,"li"],[14,0,"ma0 lh-solid"],[12],[2,"\\n "],[11,"button"],[24,"title","Link"],[24,0,"dib dim-lite link h9 w9 nudge-top--1"],[24,4,"button"],[4,[38,0],["click",[32,0,["_editLink"]]],null],[12],[2,"\\n "],[1,[30,[36,1],["koenig/kg-link"],[["class"],[[30,[36,5],[[30,[36,3],[[32,0,["activeMarkupTagNames","isA"]],"fill-green-l2","fill-white"],null]," w4 h4"],null]]]]],[2,"\\n "],[13],[2,"\\n "],[13],[2,"\\n\\n"],[6,[37,3],[[32,1]],null,[["default"],[{"statements":[[6,[37,2],[[32,0,["basicOnly"]]],null,[["default"],[{"statements":[[2," "],[10,"li"],[14,0,"ma0 ml1 mr1 lh-solid kg-action-bar-divider bg-darkgrey-l2 h5"],[14,"role","separator"],[12],[13],[2,"\\n "],[10,"li"],[14,0,"ma0 lh-solid"],[12],[2,"\\n "],[11,"button"],[24,"title","Create snippet"],[24,0,"dib dim-lite link h9 w9 nudge-top--1"],[24,4,"button"],[4,[38,0],["click",[32,1]],null],[12],[2,"\\n "],[1,[30,[36,1],["koenig/kg-snippet"],[["class"],["w4 h4"]]]],[2,"\\n "],[13],[2,"\\n "],[13],[2,"\\n"]],"parameters":[]}]]]],"parameters":[]}]]],[2,"\\n"]],"parameters":[]}]]],[2,"\\n"]],"hasEval":false,"upvars":["on","svg-jar","unless","if","fn","concat","or"]}',moduleName:"koenig-editor/components/koenig-toolbar.hbs"})
12769
12768
  e.TOOLBAR_MARGIN=15
12770
- let _=(n=(0,t.attributeBindings)("style"),i=(0,t.classNames)("absolute","z-999"),o=Ember.inject.service,a=Ember.computed("showToolbar","top","left","right"),s=Ember._action,l=Ember._action,u=Ember._action,d=Ember._action,c=(0,r.task)((function(){var e=this
12771
- let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0]
12772
- return function*(){t&&(e._skipMousemove=!0),yield(0,r.timeout)(50),e._hasSelectedRange&&e.editorRange===e._lastRange||(e._hasSelectedRange&&!e._isMouseDown?e._showToolbar(e._skipMousemove):e._hideToolbar(),e._skipMousemove=!1)}()})).restartable(),n(h=i((p=class extends Ember.Component{constructor(){super(...arguments),g(this,"feature",f,this),v(this,"basicOnly",!1),v(this,"editor",null),v(this,"editorRange",null),v(this,"activeMarkupTagNames",null),v(this,"activeSectionTagNames",null),v(this,"showToolbar",!1),v(this,"top",null),v(this,"left",-1e3),v(this,"right",null),v(this,"_isMouseDown",!1),v(this,"_hasSelectedRange",!1),v(this,"_onMousedownHandler",null),v(this,"_onMousemoveHandler",null),v(this,"_onMouseupHandler",null),v(this,"_onResizeHandler",null),g(this,"_toggleVisibility",m,this)}toggleMarkup(){}toggleSection(){}toggleHeaderSection(){}editLink(){}get style(){let e=this.getProperties("top","left","right"),t=Object.keys(e).map((t=>{if(null!==e[t])return`${t}: ${e[t]}px`}))
12769
+ let _=(n=(0,t.attributeBindings)("style"),i=(0,t.classNames)("absolute","z-999"),o=Ember.inject.service,a=Ember.computed("showToolbar","top","left","right"),s=Ember._action,l=Ember._action,u=Ember._action,d=Ember._action,c=(0,r.task)((function*(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0]
12770
+ e&&(this._skipMousemove=!0),yield(0,r.timeout)(50),this._hasSelectedRange&&this.editorRange===this._lastRange||(this._hasSelectedRange&&!this._isMouseDown?this._showToolbar(this._skipMousemove):this._hideToolbar(),this._skipMousemove=!1)})).restartable(),n(h=i((p=class extends Ember.Component{constructor(){super(...arguments),g(this,"feature",f,this),v(this,"basicOnly",!1),v(this,"editor",null),v(this,"editorRange",null),v(this,"activeMarkupTagNames",null),v(this,"activeSectionTagNames",null),v(this,"showToolbar",!1),v(this,"top",null),v(this,"left",-1e3),v(this,"right",null),v(this,"_isMouseDown",!1),v(this,"_hasSelectedRange",!1),v(this,"_onMousedownHandler",null),v(this,"_onMousemoveHandler",null),v(this,"_onMouseupHandler",null),v(this,"_onResizeHandler",null),g(this,"_toggleVisibility",m,this)}toggleMarkup(){}toggleSection(){}toggleHeaderSection(){}editLink(){}get style(){let e=this.getProperties("top","left","right"),t=Object.keys(e).map((t=>{if(null!==e[t])return`${t}: ${e[t]}px`}))
12773
12771
  return this.showToolbar?t.push("pointer-events: auto !important"):t.push("pointer-events: none !important"),Ember.String.htmlSafe(t.compact().join("; "))}init(){super.init(...arguments),this._onMousedownHandler=Ember.run.bind(this,this._handleMousedown),window.addEventListener("mousedown",this._onMousedownHandler),this._onMouseupHandler=Ember.run.bind(this,this._handleMouseup),window.addEventListener("mouseup",this._onMouseupHandler),this._onResizeHandler=Ember.run.bind(this,this._handleResize),window.addEventListener("resize",this._onResizeHandler)}didReceiveAttrs(){super.didReceiveAttrs(...arguments)
12774
12772
  let e=this.editorRange
12775
12773
  e&&!e.isCollapsed?this._hasSelectedRange=!0:this._hasSelectedRange=!1,(this._hasSelectedRange&&!this.showToolbar||!this._hasSelectedRange&&this.showToolbar)&&this._toggleVisibility.perform()}willDestroyElement(){super.willDestroyElement(...arguments),this._removeStyleElement(),Ember.run.cancel(this._throttleResize),window.removeEventListener("mousedown",this._onMousedownHandler),window.removeEventListener("mousemove",this._onMousemoveHandler),window.removeEventListener("mouseup",this._onMouseupHandler),window.removeEventListener("resize",this._onResizeHandler)}_toggleMarkup(e,t){t?.preventDefault(),"em"===e&&this.activeMarkupTagNames.isI&&(e="i"),this.toggleMarkup(e)}toggleQuoteSection(e){e?.preventDefault()
@@ -13679,4 +13677,4 @@ return void 0===n&&(n=(0,t.createStorage)(null,(()=>!1)),r.set(e,n)),n}dirtyStor
13679
13677
  r&&(0,t.setValue)(r,null)}constructor(e){o(this,"storages",new WeakMap),o(this,"vals",void 0),this.vals=new WeakSet(e)}has(e){return(0,t.getValue)(this.storageFor(e)),this.vals.has(e)}add(e){return this.vals.add(e),this.dirtyStorageFor(e),this}delete(e){return this.dirtyStorageFor(e),this.vals.delete(e)}get[i](){return this.vals[Symbol.toStringTag]}}e.TrackedWeakSet=s,Object.setPrototypeOf(s.prototype,WeakSet.prototype)})),define("tracked-built-ins/index",["exports","tracked-built-ins/-private/decorator","tracked-built-ins/-private/array","tracked-built-ins/-private/object","tracked-built-ins/-private/map","tracked-built-ins/-private/set"],(function(e,t,r,n,i,o){"use strict"
13680
13678
  Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"TrackedArray",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"TrackedMap",{enumerable:!0,get:function(){return i.TrackedMap}}),Object.defineProperty(e,"TrackedObject",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"TrackedSet",{enumerable:!0,get:function(){return o.TrackedSet}}),Object.defineProperty(e,"TrackedWeakMap",{enumerable:!0,get:function(){return i.TrackedWeakMap}}),Object.defineProperty(e,"TrackedWeakSet",{enumerable:!0,get:function(){return o.TrackedWeakSet}}),Object.defineProperty(e,"tracked",{enumerable:!0,get:function(){return t.default}})}))
13681
13679
 
13682
- //# sourceMappingURL=vendor-dbf84caa0968ef5da0486055da6636da.map
13680
+ //# sourceMappingURL=vendor-88c5114bd6fdce352a32a0ac1fd4f32b.map
@@ -8,7 +8,7 @@
8
8
  <title>Ghost Admin</title>
9
9
 
10
10
 
11
- <meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22trailing-hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%2C%22Array%22%3Atrue%2C%22String%22%3Atrue%2C%22Function%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_JQUERY_INTEGRATION%22%3Atrue%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22version%22%3A%225.27%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22%40sentry%2Fember%22%3A%7B%22disablePerformance%22%3Atrue%2C%22sentry%22%3A%7B%7D%7D%2C%22ember-cli-mirage%22%3A%7B%22usingProxy%22%3Afalse%2C%22useDefaultPassthroughs%22%3Atrue%7D%2C%22exportApplicationGlobal%22%3Afalse%2C%22ember-load%22%3A%7B%22loadingIndicatorClass%22%3A%22ember-load-indicator%22%7D%7D" />
11
+ <meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22trailing-hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%2C%22Array%22%3Atrue%2C%22String%22%3Atrue%2C%22Function%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_JQUERY_INTEGRATION%22%3Atrue%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22version%22%3A%225.29%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22%40sentry%2Fember%22%3A%7B%22disablePerformance%22%3Atrue%2C%22sentry%22%3A%7B%7D%7D%2C%22ember-cli-mirage%22%3A%7B%22usingProxy%22%3Afalse%2C%22useDefaultPassthroughs%22%3Atrue%7D%2C%22exportApplicationGlobal%22%3Afalse%2C%22ember-load%22%3A%7B%22loadingIndicatorClass%22%3A%22ember-load-indicator%22%7D%7D" />
12
12
 
13
13
  <meta name="HandheldFriendly" content="True" />
14
14
  <meta name="MobileOptimized" content="320" />
@@ -56,9 +56,9 @@
56
56
 
57
57
  <div id="ember-basic-dropdown-wormhole"></div>
58
58
 
59
- <script src="assets/vendor-dbf84caa0968ef5da0486055da6636da.js"></script>
60
- <script src="assets/chunk.380.de3a9bf5161ab5300d23.js"></script>
61
- <script src="assets/chunk.143.90a7ca5db49aa2d315c8.js"></script>
62
- <script src="assets/ghost-b2e01b65312f0de8a3fb6a3d87ed5d89.js"></script>
59
+ <script src="assets/vendor-88c5114bd6fdce352a32a0ac1fd4f32b.js"></script>
60
+ <script src="assets/chunk.45.87cd3fcd0323d4103a17.js"></script>
61
+ <script src="assets/chunk.143.b610199533b562d3f4bb.js"></script>
62
+ <script src="assets/ghost-4005771a511aaabd6545fb9645cfa24a.js"></script>
63
63
  </body>
64
64
  </html>
@@ -13,7 +13,7 @@ const jsonpath = require('jsonpath');
13
13
 
14
14
  const messages = {
15
15
  mustBeCalledAsBlock: 'The {\\{{helperName}}} helper must be called as a block. E.g. {{#{helperName}}}...{{/{helperName}}}',
16
- invalidResource: 'Invalid resource given to get helper'
16
+ invalidResource: 'Invalid "{resource}" resource given to get helper'
17
17
  };
18
18
 
19
19
  const createFrame = hbs.handlebars.createFrame;
@@ -193,7 +193,7 @@ module.exports = async function get(resource, options) {
193
193
  }
194
194
 
195
195
  if (!RESOURCES[resource]) {
196
- data.error = tpl(messages.invalidResource);
196
+ data.error = tpl(messages.invalidResource, {resource});
197
197
  logging.warn(data.error);
198
198
  return options.inverse(self, {data: data});
199
199
  }
@@ -47,8 +47,6 @@ const themeErrorRenderer = (err, req, res, next) => {
47
47
  // Format Data
48
48
  const data = {
49
49
  message: err.message,
50
- // @deprecated Remove in Ghost 5.0
51
- code: err.statusCode,
52
50
  statusCode: err.statusCode,
53
51
  errorDetails: err.errorDetails || []
54
52
  };
@@ -4,6 +4,7 @@ const models = require('../../models');
4
4
 
5
5
  // Used to emit theme.uploaded which is used in core/server/analytics-events
6
6
  const events = require('../../lib/common/events');
7
+ const {settingsCache} = require('../../services/settings-helpers');
7
8
 
8
9
  module.exports = {
9
10
  docName: 'themes',
@@ -15,6 +16,15 @@ module.exports = {
15
16
  }
16
17
  },
17
18
 
19
+ readActive: {
20
+ permissions: true,
21
+ async query() {
22
+ let themeName = settingsCache.get('active_theme');
23
+ const themeErrors = await themeService.api.getThemeErrors(themeName);
24
+ return themeService.api.getJSON(themeName, themeErrors);
25
+ }
26
+ },
27
+
18
28
  activate: {
19
29
  headers: {
20
30
  cacheInvalidate: true
@@ -42,15 +52,9 @@ module.exports = {
42
52
  value: themeName
43
53
  }];
44
54
 
45
- return themeService.api.activate(themeName)
46
- .then((checkedTheme) => {
47
- // @NOTE: we use the model, not the API here, as we don't want to trigger permissions
48
- return models.Settings.edit(newSettings, frame.options)
49
- .then(() => checkedTheme);
50
- })
51
- .then((checkedTheme) => {
52
- return themeService.api.getJSON(themeName, checkedTheme);
53
- });
55
+ const themeErrors = await themeService.api.activate(themeName);
56
+ await models.Settings.edit(newSettings, frame.options);
57
+ return themeService.api.getJSON(themeName, themeErrors);
54
58
  }
55
59
  },
56
60
 
@@ -0,0 +1,12 @@
1
+ const {addPermissionWithRoles} = require('../../utils');
2
+
3
+ module.exports = addPermissionWithRoles({
4
+ name: 'View active theme details',
5
+ action: 'readActive',
6
+ object: 'theme'
7
+ }, [
8
+ 'Author',
9
+ 'Editor',
10
+ 'Administrator',
11
+ 'Admin Integration'
12
+ ]);
@@ -0,0 +1,12 @@
1
+ const logging = require('@tryghost/logging');
2
+ const {createNonTransactionalMigration} = require('../../utils');
3
+
4
+ module.exports = createNonTransactionalMigration(
5
+ async function up(knex) {
6
+ logging.info('Clearing suppressions table');
7
+ await knex('suppressions').truncate();
8
+ },
9
+ async function down() {
10
+ logging.info('Not doing anything - table has been truncated');
11
+ }
12
+ );
@@ -214,6 +214,11 @@
214
214
  "action_type": "activate",
215
215
  "object_type": "theme"
216
216
  },
217
+ {
218
+ "name": "View active theme details",
219
+ "action_type": "readActive",
220
+ "object_type": "theme"
221
+ },
217
222
  {
218
223
  "name": "Upload themes",
219
224
  "action_type": "add",
@@ -804,7 +809,7 @@
804
809
  "user": "all",
805
810
  "role": "all",
806
811
  "invite": "all",
807
- "theme": ["browse"],
812
+ "theme": ["browse", "readActive"],
808
813
  "email_preview": "all",
809
814
  "email": "all",
810
815
  "snippet": "all",
@@ -819,7 +824,7 @@
819
824
  "tag": ["browse", "read", "add"],
820
825
  "user": ["browse", "read"],
821
826
  "role": ["browse"],
822
- "theme": ["browse"],
827
+ "theme": ["browse", "readActive"],
823
828
  "email_preview": "read",
824
829
  "email": "read",
825
830
  "snippet": ["browse", "read"],
@@ -101,7 +101,7 @@ class MailgunEmailSuppressionList extends AbstractEmailSuppressionList {
101
101
  if (!Number.isInteger(event.error?.code)) {
102
102
  return;
103
103
  }
104
- if (event.error.code < 500 || event.error.code > 599 && event.error.code !== 605) {
104
+ if (event.error.code !== 607 && event.error.code !== 605) {
105
105
  return;
106
106
  }
107
107
  }
@@ -21,7 +21,7 @@ module.exports.loadAndActivate = async (themeName) => {
21
21
  const loadedTheme = await themeLoader.loadOneTheme(themeName);
22
22
  // Validate
23
23
  // @NOTE: this is now the only usage of check, rather than checkSafe...
24
- const checkedTheme = await validate.check(loadedTheme);
24
+ const checkedTheme = await validate.check(themeName, loadedTheme);
25
25
 
26
26
  if (!validate.canActivate(checkedTheme)) {
27
27
  logging.error(validate.getThemeValidationError('activeThemeHasFatalErrors', themeName, checkedTheme));
@@ -57,6 +57,6 @@ module.exports.activate = async (themeName) => {
57
57
  const checkedTheme = await validate.checkSafe(themeName, loadedTheme);
58
58
  // Activate
59
59
  await activator.activateFromAPI(themeName, loadedTheme, checkedTheme);
60
- // Return the checked theme
61
- return checkedTheme;
60
+ // Return the theme errors
61
+ return validate.getErrorsFromCheckedTheme(checkedTheme);
62
62
  };
@@ -3,7 +3,7 @@ const themeLoader = require('./loader');
3
3
  const storage = require('./storage');
4
4
  const getJSON = require('./to-json');
5
5
  const installer = require('./installer');
6
-
6
+ const validate = require('./validate');
7
7
  const settingsCache = require('../../../shared/settings-cache');
8
8
 
9
9
  module.exports = {
@@ -11,8 +11,9 @@ module.exports = {
11
11
  * Load the currently active theme
12
12
  */
13
13
  init: async () => {
14
- const themeName = settingsCache.get('active_theme');
14
+ validate.init();
15
15
 
16
+ const themeName = settingsCache.get('active_theme');
16
17
  return activate.loadAndActivate(themeName);
17
18
  },
18
19
  /**
@@ -25,6 +26,7 @@ module.exports = {
25
26
  api: {
26
27
  getJSON,
27
28
  activate: activate.activate,
29
+ getThemeErrors: validate.getThemeErrors,
28
30
  getZip: storage.getZip,
29
31
  setFromZip: storage.setFromZip,
30
32
  installFromGithub: installer.installFromGithub,
@@ -86,10 +86,12 @@ module.exports = {
86
86
  await activator.activateFromAPIOverride(themeName, loadedTheme, checkedTheme);
87
87
  }
88
88
 
89
+ const themeErrors = validate.getErrorsFromCheckedTheme(checkedTheme);
90
+
89
91
  // @TODO: unify the name across gscan and Ghost!
90
92
  return {
91
93
  themeOverridden: overrideTheme,
92
- theme: toJSON(themeName, checkedTheme)
94
+ theme: toJSON(themeName, themeErrors)
93
95
  };
94
96
  } catch (error) {
95
97
  // restore backup if we renamed an existing theme but saving failed
@@ -13,10 +13,10 @@ const settingsCache = require('../../../shared/settings-cache');
13
13
  * @TODO: settingsCache.get('active_theme') vs. active.get().name
14
14
  *
15
15
  * @param {string} [name] - the theme to output
16
- * @param {object} [checkedTheme] - a theme result from gscan
16
+ * @param {{errors: Array, warnings: Array}} [themeErrors] - Error and warning results from checked theme (if available)
17
17
  * @return {}
18
18
  */
19
- module.exports = function toJSON(name, checkedTheme) {
19
+ module.exports = function toJSON(name, themeErrors) {
20
20
  let themeResult;
21
21
  let toFilter;
22
22
 
@@ -30,12 +30,12 @@ module.exports = function toJSON(name, checkedTheme) {
30
30
 
31
31
  themeResult = packageJSON.filter(toFilter, settingsCache.get('active_theme'));
32
32
 
33
- if (checkedTheme && checkedTheme.results.warning.length > 0) {
34
- themeResult[0].warnings = _.cloneDeep(checkedTheme.results.warning);
33
+ if (themeErrors && themeErrors.warnings.length) {
34
+ themeResult[0].warnings = _.cloneDeep(themeErrors.warnings);
35
35
  }
36
36
 
37
- if (checkedTheme && checkedTheme.results.error.length > 0) {
38
- themeResult[0].errors = _.cloneDeep(checkedTheme.results.error);
37
+ if (themeErrors && themeErrors.errors.length) {
38
+ themeResult[0].errors = _.cloneDeep(themeErrors.errors);
39
39
  }
40
40
  }
41
41
 
@@ -5,20 +5,46 @@ const config = require('../../../shared/config');
5
5
  const labs = require('../../../shared/labs');
6
6
  const tpl = require('@tryghost/tpl');
7
7
  const errors = require('@tryghost/errors');
8
+ const adapterManager = require('../adapter-manager');
9
+ const logging = require('@tryghost/logging');
10
+ const list = require('./list');
8
11
 
9
12
  const messages = {
10
13
  themeHasErrors: 'Theme "{theme}" is not compatible or contains errors.',
11
14
  activeThemeHasFatalErrors: 'The currently active theme "{theme}" has fatal errors.',
12
- activeThemeHasErrors: 'The currently active theme "{theme}" has errors, but will still work.'
15
+ activeThemeHasErrors: 'The currently active theme "{theme}" has errors, but will still work.',
16
+ themeNotLoaded: 'Theme "{themeName}" is not loaded and cannot be checked.'
17
+ };
18
+
19
+ /**
20
+ * @typedef {Object} CacheStore
21
+ * @property {(key: string) => Promise<any>} get - get a value from the cache. Returns undefined if not found
22
+ * @property {(key: string, value: any) => Promise<void>} set - set a value in the cache
23
+ * @property {() => Promise<void>} reset - reset the cache
24
+ */
25
+
26
+ /**
27
+ * The cache store for storing the result of the last theme validation
28
+ * @type {CacheStore}
29
+ */
30
+ let gscanCacheStore;
31
+
32
+ module.exports.init = () => {
33
+ gscanCacheStore = adapterManager.getAdapter('cache:gscan');
13
34
  };
14
35
 
15
36
  const canActivate = function canActivate(checkedTheme) {
16
- // CASE: production and no fatal errors
17
- // CASE: development returns fatal and none fatal errors, theme is only invalid if fatal errors
18
- return !checkedTheme.results.error.length || (config.get('env') === 'development') && !checkedTheme.results.hasFatalErrors;
37
+ return !checkedTheme.results.hasFatalErrors;
19
38
  };
20
39
 
21
- const check = async function check(theme, isZip) {
40
+ const getErrorsFromCheckedTheme = function getErrorsFromCheckedTheme(checkedTheme) {
41
+ return {
42
+ errors: checkedTheme.results.error ?? [],
43
+ warnings: checkedTheme.results.warning ?? []
44
+ };
45
+ };
46
+
47
+ const check = async function check(themeName, theme, isZip) {
22
48
  debug('Begin: Check');
23
49
  // gscan can slow down boot time if we require on boot, for now nest the require.
24
50
  const gscan = require('gscan');
@@ -41,16 +67,59 @@ const check = async function check(theme, isZip) {
41
67
  }
42
68
 
43
69
  checkedTheme = gscan.format(checkedTheme, {
44
- onlyFatalErrors: config.get('env') === 'production',
70
+ onlyFatalErrors: false,
45
71
  checkVersion: checkedVersion
46
72
  });
47
73
 
74
+ // In production we don't want to show warnings
75
+ // Warnings are meant for developers only
76
+ if (config.get('env') === 'production') {
77
+ checkedTheme.results.warning = [];
78
+ }
79
+
80
+ // Cache warnings and errors
81
+ try {
82
+ await gscanCacheStore.set(themeName, getErrorsFromCheckedTheme(checkedTheme));
83
+ } catch (err) {
84
+ logging.error('Failed to cache gscan result');
85
+ logging.error(err);
86
+ }
87
+
48
88
  debug('End: Check');
49
89
  return checkedTheme;
50
90
  };
51
91
 
92
+ /**
93
+ * Returns the last cached errors and warnings of check() if available.
94
+ * Otherwise runs check() on the loaded theme with that name (which will always cache the error and warning results)
95
+ * @returns {Promise<{errors: Array, warnings: Array}>}
96
+ */
97
+ const getThemeErrors = async function getThemeErrors(themeName) {
98
+ try {
99
+ const cachedThemeErrors = await gscanCacheStore.get(themeName);
100
+ if (cachedThemeErrors) {
101
+ return cachedThemeErrors;
102
+ }
103
+ } catch (err) {
104
+ logging.error('Failed to get gscan result from cache');
105
+ logging.error(err);
106
+ }
107
+
108
+ const loadedTheme = list.get(themeName);
109
+
110
+ if (!loadedTheme) {
111
+ throw new errors.ValidationError({
112
+ message: tpl(messages.themeNotLoaded, {themeName: themeName}),
113
+ errorDetails: themeName
114
+ });
115
+ }
116
+
117
+ const result = await check(themeName, loadedTheme);
118
+ return getErrorsFromCheckedTheme(result);
119
+ };
120
+
52
121
  const checkSafe = async function checkSafe(themeName, theme, isZip) {
53
- const checkedTheme = await check(theme, isZip);
122
+ const checkedTheme = await check(themeName, theme, isZip);
54
123
 
55
124
  if (canActivate(checkedTheme)) {
56
125
  return checkedTheme;
@@ -74,7 +143,8 @@ const getThemeValidationError = (message, themeName, checkedTheme) => {
74
143
  message: tpl(messages[message], {theme: themeName}),
75
144
  errorDetails: Object.assign(
76
145
  _.pick(checkedTheme, ['checkedVersion', 'name', 'path', 'version']), {
77
- errors: checkedTheme.results.error
146
+ errors: checkedTheme.results.error,
147
+ warnings: checkedTheme.results.warning
78
148
  }
79
149
  )
80
150
  });
@@ -83,4 +153,6 @@ const getThemeValidationError = (message, themeName, checkedTheme) => {
83
153
  module.exports.check = check;
84
154
  module.exports.checkSafe = checkSafe;
85
155
  module.exports.canActivate = canActivate;
156
+ module.exports.getErrorsFromCheckedTheme = getErrorsFromCheckedTheme;
86
157
  module.exports.getThemeValidationError = getThemeValidationError;
158
+ module.exports.getThemeErrors = getThemeErrors;
@@ -159,6 +159,11 @@ module.exports = function apiRoutes() {
159
159
  http(api.themes.download)
160
160
  );
161
161
 
162
+ router.get('/themes/active',
163
+ mw.authAdminApi,
164
+ http(api.themes.readActive)
165
+ );
166
+
162
167
  router.post('/themes/upload',
163
168
  mw.authAdminApi,
164
169
  apiMw.upload.single('file'),
@@ -27,7 +27,8 @@
27
27
  "cache": {
28
28
  "active": "Memory",
29
29
  "settings": {},
30
- "imageSizes": {}
30
+ "imageSizes": {},
31
+ "gscan": {}
31
32
  }
32
33
  },
33
34
  "storage": {
@@ -17,7 +17,8 @@ const messages = {
17
17
  const GA_FEATURES = [
18
18
  'sourceAttribution',
19
19
  'memberAttribution',
20
- 'audienceFeedback'
20
+ 'audienceFeedback',
21
+ 'themeErrorsNotification'
21
22
  ];
22
23
 
23
24
  // NOTE: this allowlist is meant to be used to filter out any unexpected
@@ -31,8 +32,7 @@ const ALPHA_FEATURES = [
31
32
  'beforeAfterCard',
32
33
  'lexicalEditor',
33
34
  'suppressionList',
34
- 'emailStability',
35
- 'themeErrorsNotification'
35
+ 'emailStability'
36
36
  ];
37
37
 
38
38
  module.exports.GA_KEYS = [...GA_FEATURES];