From 3fda083bc25cfb6a862802d4edd9dcc55a969482 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Tue, 26 Nov 2024 13:51:45 -0500 Subject: [PATCH 01/20] add a hover effect with theme details button --- assets/css/build/admin.css | 80 +++++++---- assets/css/build/admin.css.map | 2 +- assets/css/src/admin/_theme_garden.scss | 134 ++++++++++++------ assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- assets/js/src/components/theme-garden-list.js | 29 ++-- 6 files changed, 161 insertions(+), 88 deletions(-) diff --git a/assets/css/build/admin.css b/assets/css/build/admin.css index fd55287..c5477bd 100644 --- a/assets/css/build/admin.css +++ b/assets/css/build/admin.css @@ -130,13 +130,61 @@ body.admin-color-sunrise { box-shadow: -2px -2px 0 0 var(--t3-background), 0 -2px 0 0 var(--t3-background), -2px 0 0 0 var(--t3-background), 0 2px 0 0 var(--t3-background), 2px 0 0 0 var(--t3-background), 0 0 0 2px var(--t3-text), -4px -4px 0 0 var(--t3-text), 0 -4px 0 0 var(--t3-text), -4px 0 0 0 var(--t3-text), 0 4px 0 0 var(--t3-text), 4px 0 0 0 var(--t3-text); } -.tumblr-theme-thumbnail { +.tumblr-theme-details { width: calc(100% - 4px); + border: 2px solid var(--t3-secondary); + border-radius: 4px; + display: block; + position: relative; + overflow: hidden; +} +.tumblr-theme-details label { + display: none; + z-index: 2; + position: absolute; +} +.tumblr-theme-details img { + width: 100%; height: auto; aspect-ratio: 100/67; object-fit: contain; - border: 2px solid var(--t3-secondary); + margin-bottom: -6px; + z-index: 1; +} +.tumblr-theme-details:hover label { + top: 0; + left: 0; + width: 100%; + height: auto; + aspect-ratio: 100/67; + object-fit: contain; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + background: radial-gradient(closest-side, var(--t3-secondary) calc(100% - 1px), rgba(0, 0, 0, 0)) 0/4px 4px space; + box-shadow: inset 0 0 10px #000; +} +.tumblr-theme-details:hover .tumblr-theme-detail-button { + display: inline-block; + line-height: 24px; + padding: 0 20px; + font-size: 1em; + text-decoration: none; border-radius: 4px; + color: var(--t3-button-text); + border: 1px solid var(--t3-primary); + background: var(--t3-primary); + background: repeating-linear-gradient(90deg, var(--t3-red) 0%, var(--t3-orange), var(--t3-yellow), var(--t3-green), var(--t3-violet), var(--t3-red) 50%); + background-size: 90px 100%; + animation: play 1.5s linear infinite; + color: #000; + font-size: 16px; + font-weight: 600; + padding: 5px 20px; +} +.tumblr-theme-details:hover img { + filter: grayscale(100%); } .tumblr-theme-title { @@ -152,41 +200,25 @@ body.admin-color-sunrise { box-shadow: -2px 4px 0 var(--t3-background), 0 -2px 0 var(--t3-background), -2px 0 0 var(--t3-background), 2px 0 0 var(--t3-background), 4px 2px 0 var(--t3-background), 6px 4px 0 var(--t3-background), 8px 6px 0 var(--t3-background), 10px 8px 0 var(--t3-background), 12px 10px 0 var(--t3-background), 14px 12px 0 var(--t3-background), 16px 14px 0 var(--t3-background), 18px 16px 0 var(--t3-background), 20px 18px 0 var(--t3-background), -4px 0 0 var(--t3-text), 0 -4px 0 var(--t3-text), -2px -2px 0 var(--t3-text), 2px -2px 0 var(--t3-text), 4px 0 0 var(--t3-text), 6px 2px 0 var(--t3-text), 8px 4px 0 var(--t3-text), 10px 6px 0 var(--t3-text), 12px 8px 0 var(--t3-text), 14px 10px 0 var(--t3-text), 16px 12px 0 var(--t3-text), 18px 14px 0 var(--t3-text), 20px 16px 0 var(--t3-text); } -.tumblr-theme-buttons { - display: flex; - justify-content: flex-end; - align-items: center; +.tumblr-theme-footer { position: relative; + text-align: right; margin: 10px 0 0; padding: 0; width: 100%; } - -.tumblr-theme-buttons li { - flex: none; - display: block; - overflow: hidden; - position: relative; - margin-left: 10px; - border-radius: 4px; -} - -.tumblr-theme-buttons li a { +.tumblr-theme-footer a { display: inline-block; - overflow: hidden; - width: 90px; line-height: 24px; + padding: 0 20px; font-size: 1em; - white-space: nowrap; - text-align: center; text-decoration: none; - border-radius: inherit; + border-radius: 4px; color: var(--t3-button-text); border: 1px solid var(--t3-primary); background: var(--t3-primary); } - -.tumblr-theme-buttons li a:hover { +.tumblr-theme-footer a:hover { background: repeating-linear-gradient(90deg, var(--t3-red) 0%, var(--t3-orange), var(--t3-yellow), var(--t3-green), var(--t3-violet), var(--t3-red) 50%); background-size: 90px 100%; animation: play 1.5s linear infinite; diff --git a/assets/css/build/admin.css.map b/assets/css/build/admin.css.map index 5b32c41..6fb6a07 100644 --- a/assets/css/build/admin.css.map +++ b/assets/css/build/admin.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/admin/_theme_garden.scss","../src/admin.scss"],"names":[],"mappings":"AAEA;EACC,qBAAA;EACA,uBAAA;EACA,wBAAA;EACA,kBAAA;EACA,sBAAA;EACA,iBAAA;EACA,oBAAA;EACA,oBAAA;EACA,mBAAA;EACA,oBAAA;ACDD;;ADIA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;ACDD;;ADIA;EACC,qBAAA;EACA,kBAAA;ACDD;;ADIA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;ACDD;;ADIA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;ACDD;;ADIA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;ACDD;;ADIA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;ACDD;;ADIA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;ACDD;;ADIA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;ACDD;;ADIA;EACC,aAAA;EACA,0BAAA;EACA,uBAAA;EACA,UAAA;EACA,cAAA;ACDD;;ADIA;EACC,WAAA;EACA,qBAAA;EACA,mBAAA;EACA,sBAAA;EACA,6CAAA;ACDD;ADGC;EACC,gDAAA;ACDF;ADIC;EACC,gDAAA;ACFF;ADKC;EACC,+CAAA;ACHF;ADMC;EACC,gDAAA;ACJF;;ADQA;EAEC;IACC,sCAAA;IACA,8BAAA;ECNA;AACF;ADSA;EAEC;IACC,kCAAA;IACA,8BAAA;ECRA;AACF;ADWA;EAEC;IAC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nED;;ADsEA;EACC,cAAA;ACnED","file":"admin.css","sourcesContent":["$buttonWidth: 70px;\n\nbody {\n\t--t3-primary: #49a2c4;\n\t--t3-secondary: #8eb2c0;\n\t--t3-background: #f1f1f1;\n\t--t3-text: #49a2c4;\n\t--t3-button-text: #fff;\n\t--t3-red: #f8c7c3;\n\t--t3-orange: #f8d8bf;\n\t--t3-yellow: #f0e794;\n\t--t3-green: #b9ebc8;\n\t--t3-violet: #d4caf7;\n}\n\nbody.admin-color-light {\n\t--t3-primary: #04a4cc;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #999;\n}\n\nbody.admin-color-modern {\n\t--t3-primary: #3858e9;\n\t--t3-text: #1e1e1e;\n}\n\nbody.admin-color-blue {\n\t--t3-primary: #4796b3;\n\t--t3-secondary: #74b6ce;\n\t--t3-text: #096484;\n}\n\nbody.admin-color-coffee {\n\t--t3-primary: #c7a589;\n\t--t3-secondary: #9ea476;\n\t--t3-text: #46403c;\n}\n\nbody.admin-color-ectoplasm {\n\t--t3-primary: #a3b745;\n\t--t3-secondary: #a3b745;\n\t--t3-text: #523f6d;\n}\n\nbody.admin-color-midnight {\n\t--t3-primary: #e14d43;\n\t--t3-secondary: #363b3f;\n\t--t3-text: #25282b;\n}\n\nbody.admin-color-ocean {\n\t--t3-primary: #9ebaa0;\n\t--t3-secondary: #738e96;\n\t--t3-text: #627c83;\n}\n\nbody.admin-color-sunrise {\n\t--t3-primary: #dd823b;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #000;\n}\n\n.tumblr-themes {\n\tdisplay: grid;\n\tgrid-template-columns: 95%;\n\tjustify-content: center;\n\twidth: 98%;\n\tmargin: 0 auto;\n}\n\n.tumblr-theme {\n\twidth: 100%;\n\tcolor: var(--t3-text);\n\tmargin-bottom: 40px;\n\tfont-family: monospace;\n\tfilter: drop-shadow(-8px 8px 0 var(--t3-red));\n\n\t&:nth-child(5n + 2) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-orange));\n\t}\n\n\t&:nth-child(5n + 3) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-yellow));\n\t}\n\n\t&:nth-child(5n + 4) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-green));\n\t}\n\n\t&:nth-child(5n + 5) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-violet));\n\t}\n}\n\n@media screen and (min-width: 1601px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 22% 22% 22% 22%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 1301px) and (max-width: 1600px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 30% 30% 30%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 730px) and (max-width: 1300px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 47% 47%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n.tumblr-theme-header {\n\tdisplay: flex;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: -8px;\n\twidth: calc(100% + 8px);\n\theight: 26px;\n}\n\n.tumblr-theme-title-wrapper {\n\tflex: initial;\n\tdisplay: block;\n\tposition: relative;\n\tmargin-left: 4px;\n\tpadding: 4px 4px 0 4px;\n\tmax-width: 80%;\n\ttext-overflow: ellipsis;\n}\n\n.tumblr-theme-content {\n\tbackground-color: var(--t3-background);\n\tpadding: 10px;\n\tbox-shadow:\n\t\t-2px -2px 0 0 var(--t3-background),\n\t\t0 -2px 0 0 var(--t3-background),\n\t\t-2px 0 0 0 var(--t3-background),\n\t\t0 2px 0 0 var(--t3-background),\n\t\t2px 0 0 0 var(--t3-background),\n\t\t0 0 0 2px var(--t3-text),\n\t\t-4px -4px 0 0 var(--t3-text),\n\t\t0 -4px 0 0 var(--t3-text),\n\t\t-4px 0 0 0 var(--t3-text),\n\t\t0 4px 0 0 var(--t3-text),\n\t\t4px 0 0 0 var(--t3-text);\n}\n\n.tumblr-theme-thumbnail {\n\twidth: calc(100% - 4px);\n\theight: auto;\n\taspect-ratio: 100/67;\n\tobject-fit: contain;\n\tborder: 2px solid var(--t3-secondary);\n\tborder-radius: 4px;\n}\n\n.tumblr-theme-title {\n\tdisplay: block;\n\tposition: relative;\n\tbackground-color: var(--t3-background);\n\tpadding: 3px 12px 0 10px;\n\theight: 18px;\n\tline-height: 18px;\n\tfont-family: monospace;\n\tfont-size: 1em;\n\tfont-weight: 700;\n\tbox-shadow:\n\t\t-2px 4px 0 var(--t3-background),\n\t\t0 -2px 0 var(--t3-background),\n\t\t-2px 0 0 var(--t3-background),\n\t\t2px 0 0 var(--t3-background),\n\t\t4px 2px 0 var(--t3-background),\n\t\t6px 4px 0 var(--t3-background),\n\t\t8px 6px 0 var(--t3-background),\n\t\t10px 8px 0 var(--t3-background),\n\t\t12px 10px 0 var(--t3-background),\n\t\t14px 12px 0 var(--t3-background),\n\t\t16px 14px 0 var(--t3-background),\n\t\t18px 16px 0 var(--t3-background),\n\t\t20px 18px 0 var(--t3-background),\n\t\t-4px 0 0 var(--t3-text),\n\t\t0 -4px 0 var(--t3-text),\n\t\t-2px -2px 0 var(--t3-text),\n\t\t2px -2px 0 var(--t3-text),\n\t\t4px 0 0 var(--t3-text),\n\t\t6px 2px 0 var(--t3-text),\n\t\t8px 4px 0 var(--t3-text),\n\t\t10px 6px 0 var(--t3-text),\n\t\t12px 8px 0 var(--t3-text),\n\t\t14px 10px 0 var(--t3-text),\n\t\t16px 12px 0 var(--t3-text),\n\t\t18px 14px 0 var(--t3-text),\n\t\t20px 16px 0 var(--t3-text);\n}\n\n.tumblr-theme-buttons {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 10px 0 0;\n\tpadding: 0;\n\twidth: 100%;\n}\n\n.tumblr-theme-buttons li {\n\tflex: none;\n\tdisplay: block;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: 10px;\n\tborder-radius: 4px;\n}\n\n\n.tumblr-theme-buttons li a {\n\tdisplay: inline-block;\n\toverflow: hidden;\n\twidth: 90px;\n\tline-height: 24px;\n\tfont-size: 1em;\n\twhite-space: nowrap;\n\ttext-align: center;\n\ttext-decoration: none;\n\tborder-radius: inherit;\n\tcolor: var(--t3-button-text);\n\tborder: 1px solid var(--t3-primary);\n\tbackground: var(--t3-primary);\n}\n\n.tumblr-theme-buttons li a:hover {\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n\tbackground-size: 90px 100%;\n\tanimation: play 1.5s linear infinite;\n\tcolor: #000;\n}\n\n\n#t3-categories {\n\tmargin: 10px;\n}\n\n#t3-category-select-form {\n\tdisplay: inline;\n}\n\n@keyframes play {\n\t100% {\n\t\tbackground-position: -90px top;\n\t}\n}\n\n#theme-garden-heading {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.tumblr-logo-icon {\n\twidth: 30px;\n\tmargin: 0 12px;\n}\n\n.tumblr-theme-garden-list-item {\n\tpadding: 4px 10px;\n\tbackground: #000;\n\tborder-radius: 6px;\n}\n\n.tumblr-theme-garden-link {\n\tcursor: pointer;\n\tborder: none;\n\toutline: none;\n\twidth: 80px;\n\theight: 16px;\n\tmask-image: url(../../images/tumblr-logo.png) ;\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n}\n\n.tumblr-theme-garden-link:hover {\n\tanimation: play 1.5s linear infinite;\n}\n\n#tumblr-no-themes {\n\tdisplay: block;\n}\n","@import \"admin/theme_garden\";\n"]} \ No newline at end of file +{"version":3,"sources":["../src/admin/_theme_garden.scss","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A;EACA,qDAAA;UAAA,6CAAA;EACA,wJAAA;ACnED;;AD8EA;EACC,oCAAA;AC3ED;;AD8EA;EACC,cAAA;AC3ED","file":"admin.css","sourcesContent":["$buttonWidth: 70px;\n\n@mixin rainbow-button {\n\tdisplay: inline-block;\n\tline-height: 24px;\n\tpadding: 0 20px;\n\tfont-size: 1em;\n\ttext-decoration: none;\n\tborder-radius: 4px;\n\tcolor: var(--t3-button-text);\n\tborder: 1px solid var(--t3-primary);\n\tbackground: var(--t3-primary);\n}\n\n@mixin rainbow-button-hover {\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n\tbackground-size: 90px 100%;\n\tanimation: play 1.5s linear infinite;\n\tcolor: #000;\n}\n\nbody {\n\t--t3-primary: #49a2c4;\n\t--t3-secondary: #8eb2c0;\n\t--t3-background: #f1f1f1;\n\t--t3-text: #49a2c4;\n\t--t3-button-text: #fff;\n\t--t3-red: #f8c7c3;\n\t--t3-orange: #f8d8bf;\n\t--t3-yellow: #f0e794;\n\t--t3-green: #b9ebc8;\n\t--t3-violet: #d4caf7;\n}\n\nbody.admin-color-light {\n\t--t3-primary: #04a4cc;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #999;\n}\n\nbody.admin-color-modern {\n\t--t3-primary: #3858e9;\n\t--t3-text: #1e1e1e;\n}\n\nbody.admin-color-blue {\n\t--t3-primary: #4796b3;\n\t--t3-secondary: #74b6ce;\n\t--t3-text: #096484;\n}\n\nbody.admin-color-coffee {\n\t--t3-primary: #c7a589;\n\t--t3-secondary: #9ea476;\n\t--t3-text: #46403c;\n}\n\nbody.admin-color-ectoplasm {\n\t--t3-primary: #a3b745;\n\t--t3-secondary: #a3b745;\n\t--t3-text: #523f6d;\n}\n\nbody.admin-color-midnight {\n\t--t3-primary: #e14d43;\n\t--t3-secondary: #363b3f;\n\t--t3-text: #25282b;\n}\n\nbody.admin-color-ocean {\n\t--t3-primary: #9ebaa0;\n\t--t3-secondary: #738e96;\n\t--t3-text: #627c83;\n}\n\nbody.admin-color-sunrise {\n\t--t3-primary: #dd823b;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #000;\n}\n\n.tumblr-themes {\n\tdisplay: grid;\n\tgrid-template-columns: 95%;\n\tjustify-content: center;\n\twidth: 98%;\n\tmargin: 0 auto;\n}\n\n.tumblr-theme {\n\twidth: 100%;\n\tcolor: var(--t3-text);\n\tmargin-bottom: 40px;\n\tfont-family: monospace;\n\tfilter: drop-shadow(-8px 8px 0 var(--t3-red));\n\n\t&:nth-child(5n + 2) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-orange));\n\t}\n\n\t&:nth-child(5n + 3) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-yellow));\n\t}\n\n\t&:nth-child(5n + 4) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-green));\n\t}\n\n\t&:nth-child(5n + 5) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-violet));\n\t}\n}\n\n@media screen and (min-width: 1601px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 22% 22% 22% 22%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 1301px) and (max-width: 1600px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 30% 30% 30%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 730px) and (max-width: 1300px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 47% 47%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n.tumblr-theme-header {\n\tdisplay: flex;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: -8px;\n\twidth: calc(100% + 8px);\n\theight: 26px;\n}\n\n.tumblr-theme-title-wrapper {\n\tflex: initial;\n\tdisplay: block;\n\tposition: relative;\n\tmargin-left: 4px;\n\tpadding: 4px 4px 0 4px;\n\tmax-width: 80%;\n\ttext-overflow: ellipsis;\n}\n\n.tumblr-theme-content {\n\tbackground-color: var(--t3-background);\n\tpadding: 10px;\n\tbox-shadow:\n\t\t-2px -2px 0 0 var(--t3-background),\n\t\t0 -2px 0 0 var(--t3-background),\n\t\t-2px 0 0 0 var(--t3-background),\n\t\t0 2px 0 0 var(--t3-background),\n\t\t2px 0 0 0 var(--t3-background),\n\t\t0 0 0 2px var(--t3-text),\n\t\t-4px -4px 0 0 var(--t3-text),\n\t\t0 -4px 0 0 var(--t3-text),\n\t\t-4px 0 0 0 var(--t3-text),\n\t\t0 4px 0 0 var(--t3-text),\n\t\t4px 0 0 0 var(--t3-text);\n}\n\n.tumblr-theme-details {\n\twidth: calc(100% - 4px);\n\tborder: 2px solid var(--t3-secondary);\n\tborder-radius: 4px;\n\tdisplay: block;\n\tposition: relative;\n\toverflow: hidden;\n\n\tlabel {\n\t\tdisplay: none;\n\t\tz-index: 2;\n\t\tposition: absolute;\n\t}\n\n\timg {\n\t\twidth: 100%;\n\t\theight: auto;\n\t\taspect-ratio: 100/67;\n\t\tobject-fit: contain;\n\t\tmargin-bottom: -6px;\n\t\tz-index: 1;\n\t}\n\n\t&:hover {\n\t\tlabel {\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\taspect-ratio: 100/67;\n\t\t\tobject-fit: contain;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: radial-gradient(\n\t\t\t\t\tclosest-side,\n\t\t\t\t\tvar(--t3-secondary) calc(100% - 1px),\n\t\t\t\t\t#0000\n\t\t\t) 0/ 4px 4px space;\n\t\t\tbox-shadow: inset 0 0 10px #000;\n\t\t}\n\n\t\t.tumblr-theme-detail-button {\n\t\t\t@include rainbow-button;\n\t\t\t@include rainbow-button-hover;\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tpadding: 5px 20px;\n\t\t}\n\n\t\timg {\n\t\t\tfilter: grayscale(100%);\n\t\t}\n\t}\n}\n\n.tumblr-theme-title {\n\tdisplay: block;\n\tposition: relative;\n\tbackground-color: var(--t3-background);\n\tpadding: 3px 12px 0 10px;\n\theight: 18px;\n\tline-height: 18px;\n\tfont-family: monospace;\n\tfont-size: 1em;\n\tfont-weight: 700;\n\tbox-shadow:\n\t\t-2px 4px 0 var(--t3-background),\n\t\t0 -2px 0 var(--t3-background),\n\t\t-2px 0 0 var(--t3-background),\n\t\t2px 0 0 var(--t3-background),\n\t\t4px 2px 0 var(--t3-background),\n\t\t6px 4px 0 var(--t3-background),\n\t\t8px 6px 0 var(--t3-background),\n\t\t10px 8px 0 var(--t3-background),\n\t\t12px 10px 0 var(--t3-background),\n\t\t14px 12px 0 var(--t3-background),\n\t\t16px 14px 0 var(--t3-background),\n\t\t18px 16px 0 var(--t3-background),\n\t\t20px 18px 0 var(--t3-background),\n\t\t-4px 0 0 var(--t3-text),\n\t\t0 -4px 0 var(--t3-text),\n\t\t-2px -2px 0 var(--t3-text),\n\t\t2px -2px 0 var(--t3-text),\n\t\t4px 0 0 var(--t3-text),\n\t\t6px 2px 0 var(--t3-text),\n\t\t8px 4px 0 var(--t3-text),\n\t\t10px 6px 0 var(--t3-text),\n\t\t12px 8px 0 var(--t3-text),\n\t\t14px 10px 0 var(--t3-text),\n\t\t16px 12px 0 var(--t3-text),\n\t\t18px 14px 0 var(--t3-text),\n\t\t20px 16px 0 var(--t3-text);\n}\n\n.tumblr-theme-footer {\n\tposition: relative;\n\ttext-align: right;\n\tmargin: 10px 0 0;\n\tpadding: 0;\n\twidth: 100%;\n\n\ta {\n\t\t@include rainbow-button;\n\n\t\t&:hover {\n\t\t\t@include rainbow-button-hover;\n\t\t}\n\t}\n}\n\n#t3-categories {\n\tmargin: 10px;\n}\n\n#t3-category-select-form {\n\tdisplay: inline;\n}\n\n@keyframes play {\n\t100% {\n\t\tbackground-position: -90px top;\n\t}\n}\n\n#theme-garden-heading {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.tumblr-logo-icon {\n\twidth: 30px;\n\tmargin: 0 12px;\n}\n\n.tumblr-theme-garden-list-item {\n\tpadding: 4px 10px;\n\tbackground: #000;\n\tborder-radius: 6px;\n}\n\n.tumblr-theme-garden-link {\n\tcursor: pointer;\n\tborder: none;\n\toutline: none;\n\twidth: 80px;\n\theight: 16px;\n\tmask-image: url(../../images/tumblr-logo.png) ;\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n}\n\n.tumblr-theme-garden-link:hover {\n\tanimation: play 1.5s linear infinite;\n}\n\n#tumblr-no-themes {\n\tdisplay: block;\n}\n","@import \"admin/theme_garden\";\n"]} \ No newline at end of file diff --git a/assets/css/src/admin/_theme_garden.scss b/assets/css/src/admin/_theme_garden.scss index 16f6deb..b8cbedf 100644 --- a/assets/css/src/admin/_theme_garden.scss +++ b/assets/css/src/admin/_theme_garden.scss @@ -1,5 +1,32 @@ $buttonWidth: 70px; +@mixin rainbow-button { + display: inline-block; + line-height: 24px; + padding: 0 20px; + font-size: 1em; + text-decoration: none; + border-radius: 4px; + color: var(--t3-button-text); + border: 1px solid var(--t3-primary); + background: var(--t3-primary); +} + +@mixin rainbow-button-hover { + background: repeating-linear-gradient( + 90deg, + var(--t3-red) 0%, + var(--t3-orange), + var(--t3-yellow), + var(--t3-green), + var(--t3-violet), + var(--t3-red) 50% + ); + background-size: 90px 100%; + animation: play 1.5s linear infinite; + color: #000; +} + body { --t3-primary: #49a2c4; --t3-secondary: #8eb2c0; @@ -153,13 +180,61 @@ body.admin-color-sunrise { 4px 0 0 0 var(--t3-text); } -.tumblr-theme-thumbnail { +.tumblr-theme-details { width: calc(100% - 4px); - height: auto; - aspect-ratio: 100/67; - object-fit: contain; border: 2px solid var(--t3-secondary); border-radius: 4px; + display: block; + position: relative; + overflow: hidden; + + label { + display: none; + z-index: 2; + position: absolute; + } + + img { + width: 100%; + height: auto; + aspect-ratio: 100/67; + object-fit: contain; + margin-bottom: -6px; + z-index: 1; + } + + &:hover { + label { + top: 0; + left: 0; + width: 100%; + height: auto; + aspect-ratio: 100/67; + object-fit: contain; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + background: radial-gradient( + closest-side, + var(--t3-secondary) calc(100% - 1px), + #0000 + ) 0/ 4px 4px space; + box-shadow: inset 0 0 10px #000; + } + + .tumblr-theme-detail-button { + @include rainbow-button; + @include rainbow-button-hover; + font-size: 16px; + font-weight: 600; + padding: 5px 20px; + } + + img { + filter: grayscale(100%); + } + } } .tumblr-theme-title { @@ -201,57 +276,22 @@ body.admin-color-sunrise { 20px 16px 0 var(--t3-text); } -.tumblr-theme-buttons { - display: flex; - justify-content: flex-end; - align-items: center; +.tumblr-theme-footer { position: relative; + text-align: right; margin: 10px 0 0; padding: 0; width: 100%; -} - -.tumblr-theme-buttons li { - flex: none; - display: block; - overflow: hidden; - position: relative; - margin-left: 10px; - border-radius: 4px; -} + a { + @include rainbow-button; -.tumblr-theme-buttons li a { - display: inline-block; - overflow: hidden; - width: 90px; - line-height: 24px; - font-size: 1em; - white-space: nowrap; - text-align: center; - text-decoration: none; - border-radius: inherit; - color: var(--t3-button-text); - border: 1px solid var(--t3-primary); - background: var(--t3-primary); -} - -.tumblr-theme-buttons li a:hover { - background: repeating-linear-gradient( - 90deg, - var(--t3-red) 0%, - var(--t3-orange), - var(--t3-yellow), - var(--t3-green), - var(--t3-violet), - var(--t3-red) 50% - ); - background-size: 90px 100%; - animation: play 1.5s linear infinite; - color: #000; + &:hover { + @include rainbow-button-hover; + } + } } - #t3-categories { margin: 10px; } diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index ba9ec76..e1474e4 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'fd810d3ceda54951e88a'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '7d2750de13fecca2ee9a'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index 58a588a..f7fc19e 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,r=window.wp.element,a=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1},o={receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),prefetchThemes:()=>({type:"PREFETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}}},h={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getThemes:e=>e.themes},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},u=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"PREFETCH_THEMES":return{...e,isFetchingThemes:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};default:return e}},actions:o,selectors:h,controls:i,resolvers:{}});(0,s.register)(u);const d=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({prefetchThemes:()=>e("tumblr3/theme-garden-store").prefetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:c,receiveThemes:o,prefetchThemes:h,searchThemes:i})=>{const[u,d]=(0,r.useState)(s),[g,E]=(0,r.useState)(l),[p,w]=(0,r.useState)(m),T=(0,r.useRef)();(0,r.useEffect)((()=>{w(m)}),[m]),(0,r.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const b=async e=>{h();const t=await c(e);o(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",r=e.get("search")||"";""!==r?E(r):(await b(t),d(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},p.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,a.__)("Categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const r=t.value;await b(r),d(r),E(""),window.history.pushState({},"",e+"&category="+r)}},(0,t.createElement)("option",{value:"featured"},(0,a._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:u===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},"Search Themes"),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:g,onChange:async({currentTarget:t})=>{const r=t.value;clearTimeout(T.current),E(r),T.current=setTimeout((async()=>{await(async e=>{h();const t=await i(e);o(t)})(r),window.history.pushState({},"",e+"&search="+r),d("")}),500)}})))})),g=()=>{const e=[(0,a._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],r=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[r])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))))((({themes:e,isFetchingThemes:s})=>{const[n,l]=(0,r.useState)(e);return(0,r.useEffect)((()=>{l(e)}),[e]),s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===n.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("img",{className:"tumblr-theme-thumbnail",src:e.thumbnail,alt:""}),(0,t.createElement)("ul",{className:"tumblr-theme-buttons"},(0,t.createElement)("li",null,(0,t.createElement)("a",{href:e.activate_url},(0,a._x)("Activate","Text on a button to activate a theme.","tumblr3")))))))))})),p=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,a.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(d,null),(0,t.createElement)(E,null)))),w=document.getElementById("tumblr-theme-garden");w?(0,r.createRoot)(w).render((0,t.createElement)(p,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const o={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1},c={receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),prefetchThemes:()=>({type:"PREFETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}}},h={getLogoUrl:()=>o.logoUrl,getInitialFilterBarProps:()=>({categories:o.categories,selectedCategory:o.selectedCategory,baseUrl:o.baseUrl,search:o.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getThemes:e=>e.themes},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=o,t)=>{switch(t.type){case"PREFETCH_THEMES":return{...e,isFetchingThemes:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};default:return e}},actions:c,selectors:h,controls:i,resolvers:{}});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({prefetchThemes:()=>e("tumblr3/theme-garden-store").prefetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:o,receiveThemes:c,prefetchThemes:h,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[g,E]=(0,a.useState)(l),[w,p]=(0,a.useState)(m),T=(0,a.useRef)();(0,a.useEffect)((()=>{p(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",f),()=>{window.removeEventListener("popstate",f)})),[]);const b=async e=>{h();const t=await o(e);c(t)},f=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?E(a):(await b(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},w.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r.__)("Categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await b(a),u(a),E(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},"Search Themes"),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:g,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(T.current),E(a),T.current=setTimeout((async()=>{await(async e=>{h();const t=await i(e);c(t)})(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),g=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))))((({themes:e,isFetchingThemes:s})=>{const[n,l]=(0,a.useState)(e);return(0,a.useEffect)((()=>{l(e)}),[e]),s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===n.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("a",{className:"tumblr-theme-details",href:"#"},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(E,null)))),p=document.getElementById("tumblr-theme-garden");p?(0,a.createRoot)(p).render((0,t.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index d31535c..238cf66 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -43,24 +43,25 @@ const _ThemeGardenList = ( { themes, isFetchingThemes } ) => {
- - + + + + +
+ Activate +
- ) ) } + ))} ); }; export const ThemeGardenList = compose( - withSelect( select => ( { - themes: select( 'tumblr3/theme-garden-store' ).getThemes(), - isFetchingThemes: select( 'tumblr3/theme-garden-store' ).getIsFetchingThemes(), - } ) ) -)( _ThemeGardenList ); + withSelect(select => ({ + themes: select('tumblr3/theme-garden-store').getThemes(), + isFetchingThemes: select('tumblr3/theme-garden-store').getIsFetchingThemes(), + })) +)(_ThemeGardenList); From 9dd9205700f37b83e828b97a0f967a65df6d5856 Mon Sep 17 00:00:00 2001 From: Aaron John-Baptiste Date: Fri, 29 Nov 2024 13:23:01 +0000 Subject: [PATCH 02/20] added BlockExtensions on php side for rendering the tumblr audio block --- src/BlockExtensions.php | 81 +++++++++++++++++++++++++++++++++++++++++ src/Plugin.php | 13 +++++++ 2 files changed, 94 insertions(+) create mode 100644 src/BlockExtensions.php diff --git a/src/BlockExtensions.php b/src/BlockExtensions.php new file mode 100644 index 0000000..4e32e7a --- /dev/null +++ b/src/BlockExtensions.php @@ -0,0 +1,81 @@ +is_tumblr3_active = $is_tumblr3_active; + + // Only run if the Tumblr3 theme is active. + if ( $this->is_tumblr3_active ) { + add_filter( 'render_block', array( $this, 'tumblr_audio_block_output' ), 10, 2 ); + } + } + + /** + * Modifies the front-end rendering of the audio block to render Tumblr audio block markup. + * + * @param string $block_content The block content. + * @param array $block The full block, including name and attributes. + * @return string Modified block content. + */ + public function tumblr_audio_block_output( $block_content, $block ) { + if ( $block['blockName'] !== 'core/audio' ) { + return $block_content; + } + + $attrs = $block['attrs']; + + // Only modify if we have the Tumblr custom attributes + if ( $this->is_tumblr3_active && empty( $attrs['mediaURL'] ) && empty( $attrs['mediaTitle'] ) ) { + return $block_content; + } + + $media_url = $attrs['mediaURL'] ?? ''; + $media_title = $attrs['mediaTitle'] ?? ''; + $media_artist = $attrs['mediaArtist'] ?? ''; + $media_album = $attrs['mediaAlbum'] ?? ''; + $poster_url = $attrs['poster']['url'] ?? ''; + + // TODO verify how Tumblr handles missing attributes, it probably does not render empty spans + $output = sprintf( + '
+
+ + %s + %s + %s + + %s +
+ +
', + esc_html( $media_title ), + esc_html( $media_artist ), + esc_html( $media_album ), + $poster_url ? sprintf( 'image', esc_url( $poster_url ) ) : '', + esc_url( $media_url ) + ); + + return $output; + } +} diff --git a/src/Plugin.php b/src/Plugin.php index 22866f2..fa67789 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -67,6 +67,16 @@ class Plugin { */ public ?Parser $parser = null; + /** + * The block extensions component. + * + * @since 1.0.0 + * @version 1.0.0 + * + * @var BlockExtensions|null + */ + public ?BlockExtensions $block_extensions = null; + /** * Plugin constructor. * @@ -141,6 +151,9 @@ public function initialize(): void { $this->theme_garden = new ThemeGarden(); $this->theme_garden->initialize(); + $this->block_extensions = new BlockExtensions(); + $this->block_extensions->initialize( $this->tumblr3_active ); + // In the frontend, setup the parser. if ( ! is_admin() ) { $this->parser = new Parser(); From 54c589cc2e95248b844d1a6b9c4ec26b74824d78 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Mon, 2 Dec 2024 12:36:16 -0500 Subject: [PATCH 03/20] adjust hover state --- assets/css/build/admin.css | 6 +----- assets/css/build/admin.css.map | 2 +- assets/css/src/admin/_theme_garden.scss | 9 ++------- assets/js/src/components/theme-garden-filterbar.js | 2 +- assets/js/src/components/theme-garden-list.js | 2 +- assets/js/src/components/theme-garden-no-themes.js | 2 +- assets/js/src/components/theme-garden-overlay.js | 0 7 files changed, 7 insertions(+), 16 deletions(-) create mode 100644 assets/js/src/components/theme-garden-overlay.js diff --git a/assets/css/build/admin.css b/assets/css/build/admin.css index c5477bd..4403a0e 100644 --- a/assets/css/build/admin.css +++ b/assets/css/build/admin.css @@ -162,8 +162,7 @@ body.admin-color-sunrise { align-items: center; justify-content: center; cursor: pointer; - background: radial-gradient(closest-side, var(--t3-secondary) calc(100% - 1px), rgba(0, 0, 0, 0)) 0/4px 4px space; - box-shadow: inset 0 0 10px #000; + background: radial-gradient(closest-side, rgba(0, 0, 0, 0) calc(100% - 1px), var(--t3-background)) 0/4px 4px space; } .tumblr-theme-details:hover .tumblr-theme-detail-button { display: inline-block; @@ -183,9 +182,6 @@ body.admin-color-sunrise { font-weight: 600; padding: 5px 20px; } -.tumblr-theme-details:hover img { - filter: grayscale(100%); -} .tumblr-theme-title { display: block; diff --git a/assets/css/build/admin.css.map b/assets/css/build/admin.css.map index 6fb6a07..66a2e85 100644 --- a/assets/css/build/admin.css.map +++ b/assets/css/build/admin.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/admin/_theme_garden.scss","../src/admin.scss"],"names":[],"mappings":"AA6BA;EACC,qBAAA;EACA,uBAAA;EACA,wBAAA;EACA,kBAAA;EACA,sBAAA;EACA,iBAAA;EACA,oBAAA;EACA,oBAAA;EACA,mBAAA;EACA,oBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;AC5BD;;AD+BA;EACC,aAAA;EACA,0BAAA;EACA,uBAAA;EACA,UAAA;EACA,cAAA;AC5BD;;AD+BA;EACC,WAAA;EACA,qBAAA;EACA,mBAAA;EACA,sBAAA;EACA,6CAAA;AC5BD;AD8BC;EACC,gDAAA;AC5BF;AD+BC;EACC,gDAAA;AC7BF;ADgCC;EACC,+CAAA;AC9BF;ADiCC;EACC,gDAAA;AC/BF;;ADmCA;EAEC;IACC,sCAAA;IACA,8BAAA;ECjCA;AACF;ADoCA;EAEC;IACC,kCAAA;IACA,8BAAA;ECnCA;AACF;ADsCA;EAEC;IACC,8BAAA;IACA,8BAAA;ECrCA;AACF;ADwCA;EACC,aAAA;EACA,uB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ED;;ADqEA;EACC,eAAA;AClED;;ADqEA;EACC;IACC,8BAAA;EClEA;AACF;ADqEA;EACC,aAAA;EACA,mBAAA;ACnED;;ADsEA;EACC,WAAA;EACA,cAAA;ACnED;;ADsEA;EACC,iBAAA;EACA,gBAAA;EACA,kBAAA;ACnED;;ADsEA;EACC,eAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,qDAAA;UAAA,6CAAA;EACA,wJAAA;ACnED;;AD8EA;EACC,oCAAA;AC3ED;;AD8EA;EACC,cAAA;AC3ED","file":"admin.css","sourcesContent":["$buttonWidth: 70px;\n\n@mixin rainbow-button {\n\tdisplay: inline-block;\n\tline-height: 24px;\n\tpadding: 0 20px;\n\tfont-size: 1em;\n\ttext-decoration: none;\n\tborder-radius: 4px;\n\tcolor: var(--t3-button-text);\n\tborder: 1px solid var(--t3-primary);\n\tbackground: var(--t3-primary);\n}\n\n@mixin rainbow-button-hover {\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n\tbackground-size: 90px 100%;\n\tanimation: play 1.5s linear infinite;\n\tcolor: #000;\n}\n\nbody {\n\t--t3-primary: #49a2c4;\n\t--t3-secondary: #8eb2c0;\n\t--t3-background: #f1f1f1;\n\t--t3-text: #49a2c4;\n\t--t3-button-text: #fff;\n\t--t3-red: #f8c7c3;\n\t--t3-orange: #f8d8bf;\n\t--t3-yellow: #f0e794;\n\t--t3-green: #b9ebc8;\n\t--t3-violet: #d4caf7;\n}\n\nbody.admin-color-light {\n\t--t3-primary: #04a4cc;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #999;\n}\n\nbody.admin-color-modern {\n\t--t3-primary: #3858e9;\n\t--t3-text: #1e1e1e;\n}\n\nbody.admin-color-blue {\n\t--t3-primary: #4796b3;\n\t--t3-secondary: #74b6ce;\n\t--t3-text: #096484;\n}\n\nbody.admin-color-coffee {\n\t--t3-primary: #c7a589;\n\t--t3-secondary: #9ea476;\n\t--t3-text: #46403c;\n}\n\nbody.admin-color-ectoplasm {\n\t--t3-primary: #a3b745;\n\t--t3-secondary: #a3b745;\n\t--t3-text: #523f6d;\n}\n\nbody.admin-color-midnight {\n\t--t3-primary: #e14d43;\n\t--t3-secondary: #363b3f;\n\t--t3-text: #25282b;\n}\n\nbody.admin-color-ocean {\n\t--t3-primary: #9ebaa0;\n\t--t3-secondary: #738e96;\n\t--t3-text: #627c83;\n}\n\nbody.admin-color-sunrise {\n\t--t3-primary: #dd823b;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #000;\n}\n\n.tumblr-themes {\n\tdisplay: grid;\n\tgrid-template-columns: 95%;\n\tjustify-content: center;\n\twidth: 98%;\n\tmargin: 0 auto;\n}\n\n.tumblr-theme {\n\twidth: 100%;\n\tcolor: var(--t3-text);\n\tmargin-bottom: 40px;\n\tfont-family: monospace;\n\tfilter: drop-shadow(-8px 8px 0 var(--t3-red));\n\n\t&:nth-child(5n + 2) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-orange));\n\t}\n\n\t&:nth-child(5n + 3) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-yellow));\n\t}\n\n\t&:nth-child(5n + 4) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-green));\n\t}\n\n\t&:nth-child(5n + 5) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-violet));\n\t}\n}\n\n@media screen and (min-width: 1601px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 22% 22% 22% 22%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 1301px) and (max-width: 1600px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 30% 30% 30%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 730px) and (max-width: 1300px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 47% 47%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n.tumblr-theme-header {\n\tdisplay: flex;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: -8px;\n\twidth: calc(100% + 8px);\n\theight: 26px;\n}\n\n.tumblr-theme-title-wrapper {\n\tflex: initial;\n\tdisplay: block;\n\tposition: relative;\n\tmargin-left: 4px;\n\tpadding: 4px 4px 0 4px;\n\tmax-width: 80%;\n\ttext-overflow: ellipsis;\n}\n\n.tumblr-theme-content {\n\tbackground-color: var(--t3-background);\n\tpadding: 10px;\n\tbox-shadow:\n\t\t-2px -2px 0 0 var(--t3-background),\n\t\t0 -2px 0 0 var(--t3-background),\n\t\t-2px 0 0 0 var(--t3-background),\n\t\t0 2px 0 0 var(--t3-background),\n\t\t2px 0 0 0 var(--t3-background),\n\t\t0 0 0 2px var(--t3-text),\n\t\t-4px -4px 0 0 var(--t3-text),\n\t\t0 -4px 0 0 var(--t3-text),\n\t\t-4px 0 0 0 var(--t3-text),\n\t\t0 4px 0 0 var(--t3-text),\n\t\t4px 0 0 0 var(--t3-text);\n}\n\n.tumblr-theme-details {\n\twidth: calc(100% - 4px);\n\tborder: 2px solid var(--t3-secondary);\n\tborder-radius: 4px;\n\tdisplay: block;\n\tposition: relative;\n\toverflow: hidden;\n\n\tlabel {\n\t\tdisplay: none;\n\t\tz-index: 2;\n\t\tposition: absolute;\n\t}\n\n\timg {\n\t\twidth: 100%;\n\t\theight: auto;\n\t\taspect-ratio: 100/67;\n\t\tobject-fit: contain;\n\t\tmargin-bottom: -6px;\n\t\tz-index: 1;\n\t}\n\n\t&:hover {\n\t\tlabel {\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\taspect-ratio: 100/67;\n\t\t\tobject-fit: contain;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: radial-gradient(\n\t\t\t\t\tclosest-side,\n\t\t\t\t\tvar(--t3-secondary) calc(100% - 1px),\n\t\t\t\t\t#0000\n\t\t\t) 0/ 4px 4px space;\n\t\t\tbox-shadow: inset 0 0 10px #000;\n\t\t}\n\n\t\t.tumblr-theme-detail-button {\n\t\t\t@include rainbow-button;\n\t\t\t@include rainbow-button-hover;\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tpadding: 5px 20px;\n\t\t}\n\n\t\timg {\n\t\t\tfilter: grayscale(100%);\n\t\t}\n\t}\n}\n\n.tumblr-theme-title {\n\tdisplay: block;\n\tposition: relative;\n\tbackground-color: var(--t3-background);\n\tpadding: 3px 12px 0 10px;\n\theight: 18px;\n\tline-height: 18px;\n\tfont-family: monospace;\n\tfont-size: 1em;\n\tfont-weight: 700;\n\tbox-shadow:\n\t\t-2px 4px 0 var(--t3-background),\n\t\t0 -2px 0 var(--t3-background),\n\t\t-2px 0 0 var(--t3-background),\n\t\t2px 0 0 var(--t3-background),\n\t\t4px 2px 0 var(--t3-background),\n\t\t6px 4px 0 var(--t3-background),\n\t\t8px 6px 0 var(--t3-background),\n\t\t10px 8px 0 var(--t3-background),\n\t\t12px 10px 0 var(--t3-background),\n\t\t14px 12px 0 var(--t3-background),\n\t\t16px 14px 0 var(--t3-background),\n\t\t18px 16px 0 var(--t3-background),\n\t\t20px 18px 0 var(--t3-background),\n\t\t-4px 0 0 var(--t3-text),\n\t\t0 -4px 0 var(--t3-text),\n\t\t-2px -2px 0 var(--t3-text),\n\t\t2px -2px 0 var(--t3-text),\n\t\t4px 0 0 var(--t3-text),\n\t\t6px 2px 0 var(--t3-text),\n\t\t8px 4px 0 var(--t3-text),\n\t\t10px 6px 0 var(--t3-text),\n\t\t12px 8px 0 var(--t3-text),\n\t\t14px 10px 0 var(--t3-text),\n\t\t16px 12px 0 var(--t3-text),\n\t\t18px 14px 0 var(--t3-text),\n\t\t20px 16px 0 var(--t3-text);\n}\n\n.tumblr-theme-footer {\n\tposition: relative;\n\ttext-align: right;\n\tmargin: 10px 0 0;\n\tpadding: 0;\n\twidth: 100%;\n\n\ta {\n\t\t@include rainbow-button;\n\n\t\t&:hover {\n\t\t\t@include rainbow-button-hover;\n\t\t}\n\t}\n}\n\n#t3-categories {\n\tmargin: 10px;\n}\n\n#t3-category-select-form {\n\tdisplay: inline;\n}\n\n@keyframes play {\n\t100% {\n\t\tbackground-position: -90px top;\n\t}\n}\n\n#theme-garden-heading {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.tumblr-logo-icon {\n\twidth: 30px;\n\tmargin: 0 12px;\n}\n\n.tumblr-theme-garden-list-item {\n\tpadding: 4px 10px;\n\tbackground: #000;\n\tborder-radius: 6px;\n}\n\n.tumblr-theme-garden-link {\n\tcursor: pointer;\n\tborder: none;\n\toutline: none;\n\twidth: 80px;\n\theight: 16px;\n\tmask-image: url(../../images/tumblr-logo.png) ;\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n}\n\n.tumblr-theme-garden-link:hover {\n\tanimation: play 1.5s linear infinite;\n}\n\n#tumblr-no-themes {\n\tdisplay: block;\n}\n","@import \"admin/theme_garden\";\n"]} \ No newline at end of file +{"version":3,"sources":["../src/admin/_theme_garden.scss","../src/admin.scss"],"names":[],"mappings":"AA6BA;EACC,qBAAA;EACA,uBAAA;EACA,wBAAA;EACA,kBAAA;EACA,sBAAA;EACA,iBAAA;EACA,oBAAA;EACA,oBAAA;EACA,mBAAA;EACA,oBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA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AA;EACA,uBAAA;EACA,eAAA;EACA,kHAAA;ACpDH;AD2DE;EA7ND,qBAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,qBAAA;EACA,kBAAA;EACA,4BAAA;EACA,mCAAA;EACA,6BAAA;EAIA,wJAAA;EASA,0BAAA;EACA,oCAAA;EACA,WAAA;EAyME,eAAA;EACA,gBAAA;EACA,iBAAA;AC9CH;;ADmDA;EACC,cAAA;EACA,kBAAA;EACA,sCAAA;EACA,wBAAA;EACA,YAAA;EACA,iBAAA;EACA,sBAAA;EACA,cAAA;EACA,gBAAA;EACA,6wBACC;ACjDF;;AD6EA;EACC,kBAAA;EACA,iBAAA;EACA,gBAAA;EACA,UAAA;EACA,WAAA;AC1ED;AD4EC;EArRA,qBAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,qBAAA;EACA,kBAAA;EACA,4BAAA;EACA,mCAAA;EACA,6BAAA;AC4MD;ADoEE;EA5QD,wJAAA;EASA,0BAAA;EACA,oCAAA;EACA,WAAA;ACmMD;;ADoEA;EACC,YAAA;ACjED;;ADoEA;EACC,eAAA;ACjED;;ADoEA;EACC;IACC,8BAAA;ECjEA;AACF;ADoEA;EACC,aAAA;EACA,mBAAA;AClED;;ADqEA;EACC,WAAA;EACA,cAAA;AClED;;ADqEA;EACC,iBAAA;EACA,gBAAA;EACA,kBAAA;AClED;;ADqEA;EACC,eAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,qDAAA;UAAA,6CAAA;EACA,wJAAA;AClED;;AD6EA;EACC,oCAAA;AC1ED;;AD6EA;EACC,cAAA;AC1ED","file":"admin.css","sourcesContent":["$buttonWidth: 70px;\n\n@mixin rainbow-button {\n\tdisplay: inline-block;\n\tline-height: 24px;\n\tpadding: 0 20px;\n\tfont-size: 1em;\n\ttext-decoration: none;\n\tborder-radius: 4px;\n\tcolor: var(--t3-button-text);\n\tborder: 1px solid var(--t3-primary);\n\tbackground: var(--t3-primary);\n}\n\n@mixin rainbow-button-hover {\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n\tbackground-size: 90px 100%;\n\tanimation: play 1.5s linear infinite;\n\tcolor: #000;\n}\n\nbody {\n\t--t3-primary: #49a2c4;\n\t--t3-secondary: #8eb2c0;\n\t--t3-background: #f1f1f1;\n\t--t3-text: #49a2c4;\n\t--t3-button-text: #fff;\n\t--t3-red: #f8c7c3;\n\t--t3-orange: #f8d8bf;\n\t--t3-yellow: #f0e794;\n\t--t3-green: #b9ebc8;\n\t--t3-violet: #d4caf7;\n}\n\nbody.admin-color-light {\n\t--t3-primary: #04a4cc;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #999;\n}\n\nbody.admin-color-modern {\n\t--t3-primary: #3858e9;\n\t--t3-text: #1e1e1e;\n}\n\nbody.admin-color-blue {\n\t--t3-primary: #4796b3;\n\t--t3-secondary: #74b6ce;\n\t--t3-text: #096484;\n}\n\nbody.admin-color-coffee {\n\t--t3-primary: #c7a589;\n\t--t3-secondary: #9ea476;\n\t--t3-text: #46403c;\n}\n\nbody.admin-color-ectoplasm {\n\t--t3-primary: #a3b745;\n\t--t3-secondary: #a3b745;\n\t--t3-text: #523f6d;\n}\n\nbody.admin-color-midnight {\n\t--t3-primary: #e14d43;\n\t--t3-secondary: #363b3f;\n\t--t3-text: #25282b;\n}\n\nbody.admin-color-ocean {\n\t--t3-primary: #9ebaa0;\n\t--t3-secondary: #738e96;\n\t--t3-text: #627c83;\n}\n\nbody.admin-color-sunrise {\n\t--t3-primary: #dd823b;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #000;\n}\n\n.tumblr-themes {\n\tdisplay: grid;\n\tgrid-template-columns: 95%;\n\tjustify-content: center;\n\twidth: 98%;\n\tmargin: 0 auto;\n}\n\n.tumblr-theme {\n\twidth: 100%;\n\tcolor: var(--t3-text);\n\tmargin-bottom: 40px;\n\tfont-family: monospace;\n\tfilter: drop-shadow(-8px 8px 0 var(--t3-red));\n\n\t&:nth-child(5n + 2) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-orange));\n\t}\n\n\t&:nth-child(5n + 3) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-yellow));\n\t}\n\n\t&:nth-child(5n + 4) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-green));\n\t}\n\n\t&:nth-child(5n + 5) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-violet));\n\t}\n}\n\n@media screen and (min-width: 1601px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 22% 22% 22% 22%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 1301px) and (max-width: 1600px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 30% 30% 30%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 730px) and (max-width: 1300px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 47% 47%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n.tumblr-theme-header {\n\tdisplay: flex;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: -8px;\n\twidth: calc(100% + 8px);\n\theight: 26px;\n}\n\n.tumblr-theme-title-wrapper {\n\tflex: initial;\n\tdisplay: block;\n\tposition: relative;\n\tmargin-left: 4px;\n\tpadding: 4px 4px 0 4px;\n\tmax-width: 80%;\n\ttext-overflow: ellipsis;\n}\n\n.tumblr-theme-content {\n\tbackground-color: var(--t3-background);\n\tpadding: 10px;\n\tbox-shadow:\n\t\t-2px -2px 0 0 var(--t3-background),\n\t\t0 -2px 0 0 var(--t3-background),\n\t\t-2px 0 0 0 var(--t3-background),\n\t\t0 2px 0 0 var(--t3-background),\n\t\t2px 0 0 0 var(--t3-background),\n\t\t0 0 0 2px var(--t3-text),\n\t\t-4px -4px 0 0 var(--t3-text),\n\t\t0 -4px 0 0 var(--t3-text),\n\t\t-4px 0 0 0 var(--t3-text),\n\t\t0 4px 0 0 var(--t3-text),\n\t\t4px 0 0 0 var(--t3-text);\n}\n\n.tumblr-theme-details {\n\twidth: calc(100% - 4px);\n\tborder: 2px solid var(--t3-secondary);\n\tborder-radius: 4px;\n\tdisplay: block;\n\tposition: relative;\n\toverflow: hidden;\n\n\tlabel {\n\t\tdisplay: none;\n\t\tz-index: 2;\n\t\tposition: absolute;\n\t}\n\n\timg {\n\t\twidth: 100%;\n\t\theight: auto;\n\t\taspect-ratio: 100/67;\n\t\tobject-fit: contain;\n\t\tmargin-bottom: -6px;\n\t\tz-index: 1;\n\t}\n\n\t&:hover {\n\t\tlabel {\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\taspect-ratio: 100/67;\n\t\t\tobject-fit: contain;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: radial-gradient(\n\t\t\t\t\tclosest-side,\n\t\t\t\t\t#0000 calc(100% - 1px),\n\t\t\t\t\tvar(--t3-background)\n\t\t\t) 0/ 4px 4px space;\n\t\t}\n\n\t\t.tumblr-theme-detail-button {\n\t\t\t@include rainbow-button;\n\t\t\t@include rainbow-button-hover;\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tpadding: 5px 20px;\n\t\t}\n\t}\n}\n\n.tumblr-theme-title {\n\tdisplay: block;\n\tposition: relative;\n\tbackground-color: var(--t3-background);\n\tpadding: 3px 12px 0 10px;\n\theight: 18px;\n\tline-height: 18px;\n\tfont-family: monospace;\n\tfont-size: 1em;\n\tfont-weight: 700;\n\tbox-shadow:\n\t\t-2px 4px 0 var(--t3-background),\n\t\t0 -2px 0 var(--t3-background),\n\t\t-2px 0 0 var(--t3-background),\n\t\t2px 0 0 var(--t3-background),\n\t\t4px 2px 0 var(--t3-background),\n\t\t6px 4px 0 var(--t3-background),\n\t\t8px 6px 0 var(--t3-background),\n\t\t10px 8px 0 var(--t3-background),\n\t\t12px 10px 0 var(--t3-background),\n\t\t14px 12px 0 var(--t3-background),\n\t\t16px 14px 0 var(--t3-background),\n\t\t18px 16px 0 var(--t3-background),\n\t\t20px 18px 0 var(--t3-background),\n\t\t-4px 0 0 var(--t3-text),\n\t\t0 -4px 0 var(--t3-text),\n\t\t-2px -2px 0 var(--t3-text),\n\t\t2px -2px 0 var(--t3-text),\n\t\t4px 0 0 var(--t3-text),\n\t\t6px 2px 0 var(--t3-text),\n\t\t8px 4px 0 var(--t3-text),\n\t\t10px 6px 0 var(--t3-text),\n\t\t12px 8px 0 var(--t3-text),\n\t\t14px 10px 0 var(--t3-text),\n\t\t16px 12px 0 var(--t3-text),\n\t\t18px 14px 0 var(--t3-text),\n\t\t20px 16px 0 var(--t3-text);\n}\n\n.tumblr-theme-footer {\n\tposition: relative;\n\ttext-align: right;\n\tmargin: 10px 0 0;\n\tpadding: 0;\n\twidth: 100%;\n\n\ta {\n\t\t@include rainbow-button;\n\n\t\t&:hover {\n\t\t\t@include rainbow-button-hover;\n\t\t}\n\t}\n}\n\n#t3-categories {\n\tmargin: 10px;\n}\n\n#t3-category-select-form {\n\tdisplay: inline;\n}\n\n@keyframes play {\n\t100% {\n\t\tbackground-position: -90px top;\n\t}\n}\n\n#theme-garden-heading {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.tumblr-logo-icon {\n\twidth: 30px;\n\tmargin: 0 12px;\n}\n\n.tumblr-theme-garden-list-item {\n\tpadding: 4px 10px;\n\tbackground: #000;\n\tborder-radius: 6px;\n}\n\n.tumblr-theme-garden-link {\n\tcursor: pointer;\n\tborder: none;\n\toutline: none;\n\twidth: 80px;\n\theight: 16px;\n\tmask-image: url(../../images/tumblr-logo.png) ;\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n}\n\n.tumblr-theme-garden-link:hover {\n\tanimation: play 1.5s linear infinite;\n}\n\n#tumblr-no-themes {\n\tdisplay: block;\n}\n","@import \"admin/theme_garden\";\n"]} \ No newline at end of file diff --git a/assets/css/src/admin/_theme_garden.scss b/assets/css/src/admin/_theme_garden.scss index b8cbedf..bcbea72 100644 --- a/assets/css/src/admin/_theme_garden.scss +++ b/assets/css/src/admin/_theme_garden.scss @@ -217,10 +217,9 @@ body.admin-color-sunrise { cursor: pointer; background: radial-gradient( closest-side, - var(--t3-secondary) calc(100% - 1px), - #0000 + #0000 calc(100% - 1px), + var(--t3-background) ) 0/ 4px 4px space; - box-shadow: inset 0 0 10px #000; } .tumblr-theme-detail-button { @@ -230,10 +229,6 @@ body.admin-color-sunrise { font-weight: 600; padding: 5px 20px; } - - img { - filter: grayscale(100%); - } } } diff --git a/assets/js/src/components/theme-garden-filterbar.js b/assets/js/src/components/theme-garden-filterbar.js index 412f2c4..69dd2e8 100644 --- a/assets/js/src/components/theme-garden-filterbar.js +++ b/assets/js/src/components/theme-garden-filterbar.js @@ -7,7 +7,7 @@ import './theme-garden-store'; /** * This component appears at the top of the theme browser, and has a category selector and a search bar. * - * Class names reference built-in wp-admin styles, and styles declared in _theme_garden.scss. + * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. * * @param {Object} props * @param {Object} props.initialProps diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index 238cf66..a94b990 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -8,7 +8,7 @@ import './theme-garden-store'; /** * Displays a list of Tumblr themes. * - * Class names reference built-in wp-admin styles, and styles declared in _theme_garden.scss. + * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. * * @param {Object} props * @param {Array} props.themes diff --git a/assets/js/src/components/theme-garden-no-themes.js b/assets/js/src/components/theme-garden-no-themes.js index f17b92a..a520391 100644 --- a/assets/js/src/components/theme-garden-no-themes.js +++ b/assets/js/src/components/theme-garden-no-themes.js @@ -3,7 +3,7 @@ import { _x } from '@wordpress/i18n'; /** * These playful messages were written by Tumblr staff. * - * Class names reference built-in wp-admin styles, and styles declared in _theme_garden.scss. + * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. */ export const ThemeGardenNoThemes = () => { const playfulNoThemesText = [ diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js new file mode 100644 index 0000000..e69de29 From 331046ec5dfc05991db024748940e55df44d596d Mon Sep 17 00:00:00 2001 From: roccotrip Date: Mon, 2 Dec 2024 12:40:20 -0500 Subject: [PATCH 04/20] adjust hover state --- assets/css/build/admin.css | 2 +- assets/css/build/admin.css.map | 2 +- assets/css/src/admin/_theme_garden.scss | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/css/build/admin.css b/assets/css/build/admin.css index 4403a0e..f301c51 100644 --- a/assets/css/build/admin.css +++ b/assets/css/build/admin.css @@ -162,7 +162,7 @@ body.admin-color-sunrise { align-items: center; justify-content: center; cursor: pointer; - background: radial-gradient(closest-side, rgba(0, 0, 0, 0) calc(100% - 1px), var(--t3-background)) 0/4px 4px space; + background: radial-gradient(closest-side, rgba(0, 0, 0, 0) calc(100% - 1px), var(--t3-background)) 0/3px 3px space; } .tumblr-theme-details:hover .tumblr-theme-detail-button { display: inline-block; diff --git a/assets/css/build/admin.css.map b/assets/css/build/admin.css.map index 66a2e85..6f93ec8 100644 --- a/assets/css/build/admin.css.map +++ b/assets/css/build/admin.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/admin/_theme_garden.scss","../src/admin.scss"],"names":[],"mappings":"AA6BA;EACC,qBAAA;EACA,uBAAA;EACA,wBAAA;EACA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AA;EACA,UAAA;EACA,kBAAA;ACjDF;ADoDC;EACC,WAAA;EACA,YAAA;EACA,oBAAA;EACA,mBAAA;EACA,mBAAA;EACA,UAAA;AClDF;ADsDE;EACC,MAAA;EACA,OAAA;EACA,WAAA;EACA,YAAA;EACA,oBAAA;EACA,mBAAA;EACA,aAAA;EACA,mBAAA;EACA,uBAAA;EACA,eAAA;EACA,kHAAA;ACpDH;AD2DE;EA7ND,qBAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,qBAAA;EACA,kBAAA;EACA,4BAAA;EACA,mCAAA;EACA,6BAAA;EAIA,wJAAA;EASA,0BAAA;EACA,oCAAA;EACA,WAAA;EAyME,eAAA;EACA,gBAAA;EACA,iBAAA;AC9CH;;ADmDA;EACC,cAAA;EACA,kBAAA;EACA,sCAAA;EACA,wBAAA;EACA,YAAA;EACA,iBAAA;EACA,sBAAA;EACA,cAAA;EACA,gBAAA;EACA,6wBACC;ACjDF;;AD6EA;EACC,kBAAA;EACA,iBAAA;EACA,gBAAA;EACA,UAAA;EACA,WAAA;AC1ED;AD4EC;EArRA,qBAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,qBAAA;EACA,kBAAA;EACA,4BAAA;EACA,mCAAA;EACA,6BAAA;AC4MD;ADoEE;EA5QD,wJAAA;EASA,0BAAA;EACA,oCAAA;EACA,WAAA;ACmMD;;ADoEA;EACC,YAAA;ACjED;;ADoEA;EACC,eAAA;ACjED;;ADoEA;EACC;IACC,8BAAA;ECjEA;AACF;ADoEA;EACC,aAAA;EACA,mBAAA;AClED;;ADqEA;EACC,WAAA;EACA,cAAA;AClED;;ADqEA;EACC,iBAAA;EACA,gBAAA;EACA,kBAAA;AClED;;ADqEA;EACC,eAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,qDAAA;UAAA,6CAAA;EACA,wJAAA;AClED;;AD6EA;EACC,oCAAA;AC1ED;;AD6EA;EACC,cAAA;AC1ED","file":"admin.css","sourcesContent":["$buttonWidth: 70px;\n\n@mixin rainbow-button {\n\tdisplay: inline-block;\n\tline-height: 24px;\n\tpadding: 0 20px;\n\tfont-size: 1em;\n\ttext-decoration: none;\n\tborder-radius: 4px;\n\tcolor: var(--t3-button-text);\n\tborder: 1px solid var(--t3-primary);\n\tbackground: var(--t3-primary);\n}\n\n@mixin rainbow-button-hover {\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n\tbackground-size: 90px 100%;\n\tanimation: play 1.5s linear infinite;\n\tcolor: #000;\n}\n\nbody {\n\t--t3-primary: #49a2c4;\n\t--t3-secondary: #8eb2c0;\n\t--t3-background: #f1f1f1;\n\t--t3-text: #49a2c4;\n\t--t3-button-text: #fff;\n\t--t3-red: #f8c7c3;\n\t--t3-orange: #f8d8bf;\n\t--t3-yellow: #f0e794;\n\t--t3-green: #b9ebc8;\n\t--t3-violet: #d4caf7;\n}\n\nbody.admin-color-light {\n\t--t3-primary: #04a4cc;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #999;\n}\n\nbody.admin-color-modern {\n\t--t3-primary: #3858e9;\n\t--t3-text: #1e1e1e;\n}\n\nbody.admin-color-blue {\n\t--t3-primary: #4796b3;\n\t--t3-secondary: #74b6ce;\n\t--t3-text: #096484;\n}\n\nbody.admin-color-coffee {\n\t--t3-primary: #c7a589;\n\t--t3-secondary: #9ea476;\n\t--t3-text: #46403c;\n}\n\nbody.admin-color-ectoplasm {\n\t--t3-primary: #a3b745;\n\t--t3-secondary: #a3b745;\n\t--t3-text: #523f6d;\n}\n\nbody.admin-color-midnight {\n\t--t3-primary: #e14d43;\n\t--t3-secondary: #363b3f;\n\t--t3-text: #25282b;\n}\n\nbody.admin-color-ocean {\n\t--t3-primary: #9ebaa0;\n\t--t3-secondary: #738e96;\n\t--t3-text: #627c83;\n}\n\nbody.admin-color-sunrise {\n\t--t3-primary: #dd823b;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #000;\n}\n\n.tumblr-themes {\n\tdisplay: grid;\n\tgrid-template-columns: 95%;\n\tjustify-content: center;\n\twidth: 98%;\n\tmargin: 0 auto;\n}\n\n.tumblr-theme {\n\twidth: 100%;\n\tcolor: var(--t3-text);\n\tmargin-bottom: 40px;\n\tfont-family: monospace;\n\tfilter: drop-shadow(-8px 8px 0 var(--t3-red));\n\n\t&:nth-child(5n + 2) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-orange));\n\t}\n\n\t&:nth-child(5n + 3) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-yellow));\n\t}\n\n\t&:nth-child(5n + 4) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-green));\n\t}\n\n\t&:nth-child(5n + 5) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-violet));\n\t}\n}\n\n@media screen and (min-width: 1601px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 22% 22% 22% 22%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 1301px) and (max-width: 1600px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 30% 30% 30%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 730px) and (max-width: 1300px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 47% 47%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n.tumblr-theme-header {\n\tdisplay: flex;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: -8px;\n\twidth: calc(100% + 8px);\n\theight: 26px;\n}\n\n.tumblr-theme-title-wrapper {\n\tflex: initial;\n\tdisplay: block;\n\tposition: relative;\n\tmargin-left: 4px;\n\tpadding: 4px 4px 0 4px;\n\tmax-width: 80%;\n\ttext-overflow: ellipsis;\n}\n\n.tumblr-theme-content {\n\tbackground-color: var(--t3-background);\n\tpadding: 10px;\n\tbox-shadow:\n\t\t-2px -2px 0 0 var(--t3-background),\n\t\t0 -2px 0 0 var(--t3-background),\n\t\t-2px 0 0 0 var(--t3-background),\n\t\t0 2px 0 0 var(--t3-background),\n\t\t2px 0 0 0 var(--t3-background),\n\t\t0 0 0 2px var(--t3-text),\n\t\t-4px -4px 0 0 var(--t3-text),\n\t\t0 -4px 0 0 var(--t3-text),\n\t\t-4px 0 0 0 var(--t3-text),\n\t\t0 4px 0 0 var(--t3-text),\n\t\t4px 0 0 0 var(--t3-text);\n}\n\n.tumblr-theme-details {\n\twidth: calc(100% - 4px);\n\tborder: 2px solid var(--t3-secondary);\n\tborder-radius: 4px;\n\tdisplay: block;\n\tposition: relative;\n\toverflow: hidden;\n\n\tlabel {\n\t\tdisplay: none;\n\t\tz-index: 2;\n\t\tposition: absolute;\n\t}\n\n\timg {\n\t\twidth: 100%;\n\t\theight: auto;\n\t\taspect-ratio: 100/67;\n\t\tobject-fit: contain;\n\t\tmargin-bottom: -6px;\n\t\tz-index: 1;\n\t}\n\n\t&:hover {\n\t\tlabel {\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\taspect-ratio: 100/67;\n\t\t\tobject-fit: contain;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: radial-gradient(\n\t\t\t\t\tclosest-side,\n\t\t\t\t\t#0000 calc(100% - 1px),\n\t\t\t\t\tvar(--t3-background)\n\t\t\t) 0/ 4px 4px space;\n\t\t}\n\n\t\t.tumblr-theme-detail-button {\n\t\t\t@include rainbow-button;\n\t\t\t@include rainbow-button-hover;\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tpadding: 5px 20px;\n\t\t}\n\t}\n}\n\n.tumblr-theme-title {\n\tdisplay: block;\n\tposition: relative;\n\tbackground-color: var(--t3-background);\n\tpadding: 3px 12px 0 10px;\n\theight: 18px;\n\tline-height: 18px;\n\tfont-family: monospace;\n\tfont-size: 1em;\n\tfont-weight: 700;\n\tbox-shadow:\n\t\t-2px 4px 0 var(--t3-background),\n\t\t0 -2px 0 var(--t3-background),\n\t\t-2px 0 0 var(--t3-background),\n\t\t2px 0 0 var(--t3-background),\n\t\t4px 2px 0 var(--t3-background),\n\t\t6px 4px 0 var(--t3-background),\n\t\t8px 6px 0 var(--t3-background),\n\t\t10px 8px 0 var(--t3-background),\n\t\t12px 10px 0 var(--t3-background),\n\t\t14px 12px 0 var(--t3-background),\n\t\t16px 14px 0 var(--t3-background),\n\t\t18px 16px 0 var(--t3-background),\n\t\t20px 18px 0 var(--t3-background),\n\t\t-4px 0 0 var(--t3-text),\n\t\t0 -4px 0 var(--t3-text),\n\t\t-2px -2px 0 var(--t3-text),\n\t\t2px -2px 0 var(--t3-text),\n\t\t4px 0 0 var(--t3-text),\n\t\t6px 2px 0 var(--t3-text),\n\t\t8px 4px 0 var(--t3-text),\n\t\t10px 6px 0 var(--t3-text),\n\t\t12px 8px 0 var(--t3-text),\n\t\t14px 10px 0 var(--t3-text),\n\t\t16px 12px 0 var(--t3-text),\n\t\t18px 14px 0 var(--t3-text),\n\t\t20px 16px 0 var(--t3-text);\n}\n\n.tumblr-theme-footer {\n\tposition: relative;\n\ttext-align: right;\n\tmargin: 10px 0 0;\n\tpadding: 0;\n\twidth: 100%;\n\n\ta {\n\t\t@include rainbow-button;\n\n\t\t&:hover {\n\t\t\t@include rainbow-button-hover;\n\t\t}\n\t}\n}\n\n#t3-categories {\n\tmargin: 10px;\n}\n\n#t3-category-select-form {\n\tdisplay: inline;\n}\n\n@keyframes play {\n\t100% {\n\t\tbackground-position: -90px top;\n\t}\n}\n\n#theme-garden-heading {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.tumblr-logo-icon {\n\twidth: 30px;\n\tmargin: 0 12px;\n}\n\n.tumblr-theme-garden-list-item {\n\tpadding: 4px 10px;\n\tbackground: #000;\n\tborder-radius: 6px;\n}\n\n.tumblr-theme-garden-link {\n\tcursor: pointer;\n\tborder: none;\n\toutline: none;\n\twidth: 80px;\n\theight: 16px;\n\tmask-image: url(../../images/tumblr-logo.png) ;\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n}\n\n.tumblr-theme-garden-link:hover {\n\tanimation: play 1.5s linear infinite;\n}\n\n#tumblr-no-themes {\n\tdisplay: block;\n}\n","@import \"admin/theme_garden\";\n"]} \ No newline at end of file +{"version":3,"sources":["../src/admin/_theme_garden.scss","../src/admin.scss"],"names":[],"mappings":"AA6BA;EACC,qBAAA;EACA,uBAAA;EACA,wBAAA;EACA,kBAAA;EACA,sBAAA;EACA,iBAAA;EACA,oBAAA;EACA,oBAAA;EACA,mBAAA;EACA,oBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;AC5BD;;AD+BA;EACC,aAAA;EACA,0BAAA;EACA,uBAAA;EACA,UAAA;EACA,cAAA;AC5BD;;AD+BA;EACC,WAAA;EACA,qBAAA;EACA,mBAAA;EACA,sBAAA;EACA,6CAAA;AC5BD;AD8BC;EACC,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AA;EACA,WAAA;AC1ED;AD4EC;EArRA,qBAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,qBAAA;EACA,kBAAA;EACA,4BAAA;EACA,mCAAA;EACA,6BAAA;AC4MD;ADoEE;EA5QD,wJAAA;EASA,0BAAA;EACA,oCAAA;EACA,WAAA;ACmMD;;ADoEA;EACC,YAAA;ACjED;;ADoEA;EACC,eAAA;ACjED;;ADoEA;EACC;IACC,8BAAA;ECjEA;AACF;ADoEA;EACC,aAAA;EACA,mBAAA;AClED;;ADqEA;EACC,WAAA;EACA,cAAA;AClED;;ADqEA;EACC,iBAAA;EACA,gBAAA;EACA,kBAAA;AClED;;ADqEA;EACC,eAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,qDAAA;UAAA,6CAAA;EACA,wJAAA;AClED;;AD6EA;EACC,oCAAA;AC1ED;;AD6EA;EACC,cAAA;AC1ED","file":"admin.css","sourcesContent":["$buttonWidth: 70px;\n\n@mixin rainbow-button {\n\tdisplay: inline-block;\n\tline-height: 24px;\n\tpadding: 0 20px;\n\tfont-size: 1em;\n\ttext-decoration: none;\n\tborder-radius: 4px;\n\tcolor: var(--t3-button-text);\n\tborder: 1px solid var(--t3-primary);\n\tbackground: var(--t3-primary);\n}\n\n@mixin rainbow-button-hover {\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n\tbackground-size: 90px 100%;\n\tanimation: play 1.5s linear infinite;\n\tcolor: #000;\n}\n\nbody {\n\t--t3-primary: #49a2c4;\n\t--t3-secondary: #8eb2c0;\n\t--t3-background: #f1f1f1;\n\t--t3-text: #49a2c4;\n\t--t3-button-text: #fff;\n\t--t3-red: #f8c7c3;\n\t--t3-orange: #f8d8bf;\n\t--t3-yellow: #f0e794;\n\t--t3-green: #b9ebc8;\n\t--t3-violet: #d4caf7;\n}\n\nbody.admin-color-light {\n\t--t3-primary: #04a4cc;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #999;\n}\n\nbody.admin-color-modern {\n\t--t3-primary: #3858e9;\n\t--t3-text: #1e1e1e;\n}\n\nbody.admin-color-blue {\n\t--t3-primary: #4796b3;\n\t--t3-secondary: #74b6ce;\n\t--t3-text: #096484;\n}\n\nbody.admin-color-coffee {\n\t--t3-primary: #c7a589;\n\t--t3-secondary: #9ea476;\n\t--t3-text: #46403c;\n}\n\nbody.admin-color-ectoplasm {\n\t--t3-primary: #a3b745;\n\t--t3-secondary: #a3b745;\n\t--t3-text: #523f6d;\n}\n\nbody.admin-color-midnight {\n\t--t3-primary: #e14d43;\n\t--t3-secondary: #363b3f;\n\t--t3-text: #25282b;\n}\n\nbody.admin-color-ocean {\n\t--t3-primary: #9ebaa0;\n\t--t3-secondary: #738e96;\n\t--t3-text: #627c83;\n}\n\nbody.admin-color-sunrise {\n\t--t3-primary: #dd823b;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #000;\n}\n\n.tumblr-themes {\n\tdisplay: grid;\n\tgrid-template-columns: 95%;\n\tjustify-content: center;\n\twidth: 98%;\n\tmargin: 0 auto;\n}\n\n.tumblr-theme {\n\twidth: 100%;\n\tcolor: var(--t3-text);\n\tmargin-bottom: 40px;\n\tfont-family: monospace;\n\tfilter: drop-shadow(-8px 8px 0 var(--t3-red));\n\n\t&:nth-child(5n + 2) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-orange));\n\t}\n\n\t&:nth-child(5n + 3) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-yellow));\n\t}\n\n\t&:nth-child(5n + 4) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-green));\n\t}\n\n\t&:nth-child(5n + 5) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-violet));\n\t}\n}\n\n@media screen and (min-width: 1601px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 22% 22% 22% 22%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 1301px) and (max-width: 1600px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 30% 30% 30%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 730px) and (max-width: 1300px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 47% 47%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n.tumblr-theme-header {\n\tdisplay: flex;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: -8px;\n\twidth: calc(100% + 8px);\n\theight: 26px;\n}\n\n.tumblr-theme-title-wrapper {\n\tflex: initial;\n\tdisplay: block;\n\tposition: relative;\n\tmargin-left: 4px;\n\tpadding: 4px 4px 0 4px;\n\tmax-width: 80%;\n\ttext-overflow: ellipsis;\n}\n\n.tumblr-theme-content {\n\tbackground-color: var(--t3-background);\n\tpadding: 10px;\n\tbox-shadow:\n\t\t-2px -2px 0 0 var(--t3-background),\n\t\t0 -2px 0 0 var(--t3-background),\n\t\t-2px 0 0 0 var(--t3-background),\n\t\t0 2px 0 0 var(--t3-background),\n\t\t2px 0 0 0 var(--t3-background),\n\t\t0 0 0 2px var(--t3-text),\n\t\t-4px -4px 0 0 var(--t3-text),\n\t\t0 -4px 0 0 var(--t3-text),\n\t\t-4px 0 0 0 var(--t3-text),\n\t\t0 4px 0 0 var(--t3-text),\n\t\t4px 0 0 0 var(--t3-text);\n}\n\n.tumblr-theme-details {\n\twidth: calc(100% - 4px);\n\tborder: 2px solid var(--t3-secondary);\n\tborder-radius: 4px;\n\tdisplay: block;\n\tposition: relative;\n\toverflow: hidden;\n\n\tlabel {\n\t\tdisplay: none;\n\t\tz-index: 2;\n\t\tposition: absolute;\n\t}\n\n\timg {\n\t\twidth: 100%;\n\t\theight: auto;\n\t\taspect-ratio: 100/67;\n\t\tobject-fit: contain;\n\t\tmargin-bottom: -6px;\n\t\tz-index: 1;\n\t}\n\n\t&:hover {\n\t\tlabel {\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\taspect-ratio: 100/67;\n\t\t\tobject-fit: contain;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: radial-gradient(\n\t\t\t\t\tclosest-side,\n\t\t\t\t\t#0000 calc(100% - 1px),\n\t\t\t\t\tvar(--t3-background)\n\t\t\t) 0/ 3px 3px space;\n\t\t}\n\n\t\t.tumblr-theme-detail-button {\n\t\t\t@include rainbow-button;\n\t\t\t@include rainbow-button-hover;\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tpadding: 5px 20px;\n\t\t}\n\t}\n}\n\n.tumblr-theme-title {\n\tdisplay: block;\n\tposition: relative;\n\tbackground-color: var(--t3-background);\n\tpadding: 3px 12px 0 10px;\n\theight: 18px;\n\tline-height: 18px;\n\tfont-family: monospace;\n\tfont-size: 1em;\n\tfont-weight: 700;\n\tbox-shadow:\n\t\t-2px 4px 0 var(--t3-background),\n\t\t0 -2px 0 var(--t3-background),\n\t\t-2px 0 0 var(--t3-background),\n\t\t2px 0 0 var(--t3-background),\n\t\t4px 2px 0 var(--t3-background),\n\t\t6px 4px 0 var(--t3-background),\n\t\t8px 6px 0 var(--t3-background),\n\t\t10px 8px 0 var(--t3-background),\n\t\t12px 10px 0 var(--t3-background),\n\t\t14px 12px 0 var(--t3-background),\n\t\t16px 14px 0 var(--t3-background),\n\t\t18px 16px 0 var(--t3-background),\n\t\t20px 18px 0 var(--t3-background),\n\t\t-4px 0 0 var(--t3-text),\n\t\t0 -4px 0 var(--t3-text),\n\t\t-2px -2px 0 var(--t3-text),\n\t\t2px -2px 0 var(--t3-text),\n\t\t4px 0 0 var(--t3-text),\n\t\t6px 2px 0 var(--t3-text),\n\t\t8px 4px 0 var(--t3-text),\n\t\t10px 6px 0 var(--t3-text),\n\t\t12px 8px 0 var(--t3-text),\n\t\t14px 10px 0 var(--t3-text),\n\t\t16px 12px 0 var(--t3-text),\n\t\t18px 14px 0 var(--t3-text),\n\t\t20px 16px 0 var(--t3-text);\n}\n\n.tumblr-theme-footer {\n\tposition: relative;\n\ttext-align: right;\n\tmargin: 10px 0 0;\n\tpadding: 0;\n\twidth: 100%;\n\n\ta {\n\t\t@include rainbow-button;\n\n\t\t&:hover {\n\t\t\t@include rainbow-button-hover;\n\t\t}\n\t}\n}\n\n#t3-categories {\n\tmargin: 10px;\n}\n\n#t3-category-select-form {\n\tdisplay: inline;\n}\n\n@keyframes play {\n\t100% {\n\t\tbackground-position: -90px top;\n\t}\n}\n\n#theme-garden-heading {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.tumblr-logo-icon {\n\twidth: 30px;\n\tmargin: 0 12px;\n}\n\n.tumblr-theme-garden-list-item {\n\tpadding: 4px 10px;\n\tbackground: #000;\n\tborder-radius: 6px;\n}\n\n.tumblr-theme-garden-link {\n\tcursor: pointer;\n\tborder: none;\n\toutline: none;\n\twidth: 80px;\n\theight: 16px;\n\tmask-image: url(../../images/tumblr-logo.png) ;\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n}\n\n.tumblr-theme-garden-link:hover {\n\tanimation: play 1.5s linear infinite;\n}\n\n#tumblr-no-themes {\n\tdisplay: block;\n}\n","@import \"admin/theme_garden\";\n"]} \ No newline at end of file diff --git a/assets/css/src/admin/_theme_garden.scss b/assets/css/src/admin/_theme_garden.scss index bcbea72..eaf1a23 100644 --- a/assets/css/src/admin/_theme_garden.scss +++ b/assets/css/src/admin/_theme_garden.scss @@ -219,7 +219,7 @@ body.admin-color-sunrise { closest-side, #0000 calc(100% - 1px), var(--t3-background) - ) 0/ 4px 4px space; + ) 0/ 3px 3px space; } .tumblr-theme-detail-button { From 378d6c682db6399061d6728b1c5d65c084fa3845 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Mon, 2 Dec 2024 16:31:18 -0500 Subject: [PATCH 05/20] open / close --- assets/css/build/admin.css | 1 + assets/css/build/admin.css.map | 2 +- assets/css/src/admin/_theme_garden.scss | 1 + assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- .../src/components/theme-garden-filterbar.js | 12 ++--- assets/js/src/components/theme-garden-list.js | 22 +++++--- .../js/src/components/theme-garden-overlay.js | 53 +++++++++++++++++++ .../js/src/components/theme-garden-store.js | 31 +++++++---- assets/js/src/theme-garden.js | 4 +- 10 files changed, 105 insertions(+), 25 deletions(-) diff --git a/assets/css/build/admin.css b/assets/css/build/admin.css index f301c51..f7b7492 100644 --- a/assets/css/build/admin.css +++ b/assets/css/build/admin.css @@ -137,6 +137,7 @@ body.admin-color-sunrise { display: block; position: relative; overflow: hidden; + padding: 0; } .tumblr-theme-details label { display: none; diff --git a/assets/css/build/admin.css.map b/assets/css/build/admin.css.map index 6f93ec8..059979a 100644 --- a/assets/css/build/admin.css.map +++ b/assets/css/build/admin.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/admin/_theme_garden.scss","../src/admin.scss"],"names":[],"mappings":"AA6BA;EACC,qBAAA;EACA,uBAAA;EACA,wBAAA;EACA,kBAAA;EACA,sBAAA;EACA,iBAAA;EACA,oBAAA;EACA,oBAAA;EACA,mBAAA;EACA,oBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EAC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BAAA;EACA,kBAAA;EACA,4BAAA;EACA,mCAAA;EACA,6BAAA;EAIA,wJAAA;EASA,0BAAA;EACA,oCAAA;EACA,WAAA;EAyME,eAAA;EACA,gBAAA;EACA,iBAAA;AC9CH;;ADmDA;EACC,cAAA;EACA,kBAAA;EACA,sCAAA;EACA,wBAAA;EACA,YAAA;EACA,iBAAA;EACA,sBAAA;EACA,cAAA;EACA,gBAAA;EACA,6wBACC;ACjDF;;AD6EA;EACC,kBAAA;EACA,iBAAA;EACA,gBAAA;EACA,UAAA;EACA,WAAA;AC1ED;AD4EC;EArRA,qBAAA;EACA,iBAAA;EACA,eAAA;EACA,cAAA;EACA,qBAAA;EACA,kBAAA;EACA,4BAAA;EACA,mCAAA;EACA,6BAAA;AC4MD;ADoEE;EA5QD,wJAAA;EASA,0BAAA;EACA,oCAAA;EACA,WAAA;ACmMD;;ADoEA;EACC,YAAA;ACjED;;ADoEA;EACC,eAAA;ACjED;;ADoEA;EACC;IACC,8BAAA;ECjEA;AACF;ADoEA;EACC,aAAA;EACA,mBAAA;AClED;;ADqEA;EACC,WAAA;EACA,cAAA;AClED;;ADqEA;EACC,iBAAA;EACA,gBAAA;EACA,kBAAA;AClED;;ADqEA;EACC,eAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,qDAAA;UAAA,6CAAA;EACA,wJAAA;AClED;;AD6EA;EACC,oCAAA;AC1ED;;AD6EA;EACC,cAAA;AC1ED","file":"admin.css","sourcesContent":["$buttonWidth: 70px;\n\n@mixin rainbow-button {\n\tdisplay: inline-block;\n\tline-height: 24px;\n\tpadding: 0 20px;\n\tfont-size: 1em;\n\ttext-decoration: none;\n\tborder-radius: 4px;\n\tcolor: var(--t3-button-text);\n\tborder: 1px solid var(--t3-primary);\n\tbackground: var(--t3-primary);\n}\n\n@mixin rainbow-button-hover {\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n\tbackground-size: 90px 100%;\n\tanimation: play 1.5s linear infinite;\n\tcolor: #000;\n}\n\nbody {\n\t--t3-primary: #49a2c4;\n\t--t3-secondary: #8eb2c0;\n\t--t3-background: #f1f1f1;\n\t--t3-text: #49a2c4;\n\t--t3-button-text: #fff;\n\t--t3-red: #f8c7c3;\n\t--t3-orange: #f8d8bf;\n\t--t3-yellow: #f0e794;\n\t--t3-green: #b9ebc8;\n\t--t3-violet: #d4caf7;\n}\n\nbody.admin-color-light {\n\t--t3-primary: #04a4cc;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #999;\n}\n\nbody.admin-color-modern {\n\t--t3-primary: #3858e9;\n\t--t3-text: #1e1e1e;\n}\n\nbody.admin-color-blue {\n\t--t3-primary: #4796b3;\n\t--t3-secondary: #74b6ce;\n\t--t3-text: #096484;\n}\n\nbody.admin-color-coffee {\n\t--t3-primary: #c7a589;\n\t--t3-secondary: #9ea476;\n\t--t3-text: #46403c;\n}\n\nbody.admin-color-ectoplasm {\n\t--t3-primary: #a3b745;\n\t--t3-secondary: #a3b745;\n\t--t3-text: #523f6d;\n}\n\nbody.admin-color-midnight {\n\t--t3-primary: #e14d43;\n\t--t3-secondary: #363b3f;\n\t--t3-text: #25282b;\n}\n\nbody.admin-color-ocean {\n\t--t3-primary: #9ebaa0;\n\t--t3-secondary: #738e96;\n\t--t3-text: #627c83;\n}\n\nbody.admin-color-sunrise {\n\t--t3-primary: #dd823b;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #000;\n}\n\n.tumblr-themes {\n\tdisplay: grid;\n\tgrid-template-columns: 95%;\n\tjustify-content: center;\n\twidth: 98%;\n\tmargin: 0 auto;\n}\n\n.tumblr-theme {\n\twidth: 100%;\n\tcolor: var(--t3-text);\n\tmargin-bottom: 40px;\n\tfont-family: monospace;\n\tfilter: drop-shadow(-8px 8px 0 var(--t3-red));\n\n\t&:nth-child(5n + 2) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-orange));\n\t}\n\n\t&:nth-child(5n + 3) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-yellow));\n\t}\n\n\t&:nth-child(5n + 4) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-green));\n\t}\n\n\t&:nth-child(5n + 5) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-violet));\n\t}\n}\n\n@media screen and (min-width: 1601px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 22% 22% 22% 22%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 1301px) and (max-width: 1600px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 30% 30% 30%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 730px) and (max-width: 1300px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 47% 47%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n.tumblr-theme-header {\n\tdisplay: flex;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: -8px;\n\twidth: calc(100% + 8px);\n\theight: 26px;\n}\n\n.tumblr-theme-title-wrapper {\n\tflex: initial;\n\tdisplay: block;\n\tposition: relative;\n\tmargin-left: 4px;\n\tpadding: 4px 4px 0 4px;\n\tmax-width: 80%;\n\ttext-overflow: ellipsis;\n}\n\n.tumblr-theme-content {\n\tbackground-color: var(--t3-background);\n\tpadding: 10px;\n\tbox-shadow:\n\t\t-2px -2px 0 0 var(--t3-background),\n\t\t0 -2px 0 0 var(--t3-background),\n\t\t-2px 0 0 0 var(--t3-background),\n\t\t0 2px 0 0 var(--t3-background),\n\t\t2px 0 0 0 var(--t3-background),\n\t\t0 0 0 2px var(--t3-text),\n\t\t-4px -4px 0 0 var(--t3-text),\n\t\t0 -4px 0 0 var(--t3-text),\n\t\t-4px 0 0 0 var(--t3-text),\n\t\t0 4px 0 0 var(--t3-text),\n\t\t4px 0 0 0 var(--t3-text);\n}\n\n.tumblr-theme-details {\n\twidth: calc(100% - 4px);\n\tborder: 2px solid var(--t3-secondary);\n\tborder-radius: 4px;\n\tdisplay: block;\n\tposition: relative;\n\toverflow: hidden;\n\n\tlabel {\n\t\tdisplay: none;\n\t\tz-index: 2;\n\t\tposition: absolute;\n\t}\n\n\timg {\n\t\twidth: 100%;\n\t\theight: auto;\n\t\taspect-ratio: 100/67;\n\t\tobject-fit: contain;\n\t\tmargin-bottom: -6px;\n\t\tz-index: 1;\n\t}\n\n\t&:hover {\n\t\tlabel {\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\taspect-ratio: 100/67;\n\t\t\tobject-fit: contain;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: radial-gradient(\n\t\t\t\t\tclosest-side,\n\t\t\t\t\t#0000 calc(100% - 1px),\n\t\t\t\t\tvar(--t3-background)\n\t\t\t) 0/ 3px 3px space;\n\t\t}\n\n\t\t.tumblr-theme-detail-button {\n\t\t\t@include rainbow-button;\n\t\t\t@include rainbow-button-hover;\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tpadding: 5px 20px;\n\t\t}\n\t}\n}\n\n.tumblr-theme-title {\n\tdisplay: block;\n\tposition: relative;\n\tbackground-color: var(--t3-background);\n\tpadding: 3px 12px 0 10px;\n\theight: 18px;\n\tline-height: 18px;\n\tfont-family: monospace;\n\tfont-size: 1em;\n\tfont-weight: 700;\n\tbox-shadow:\n\t\t-2px 4px 0 var(--t3-background),\n\t\t0 -2px 0 var(--t3-background),\n\t\t-2px 0 0 var(--t3-background),\n\t\t2px 0 0 var(--t3-background),\n\t\t4px 2px 0 var(--t3-background),\n\t\t6px 4px 0 var(--t3-background),\n\t\t8px 6px 0 var(--t3-background),\n\t\t10px 8px 0 var(--t3-background),\n\t\t12px 10px 0 var(--t3-background),\n\t\t14px 12px 0 var(--t3-background),\n\t\t16px 14px 0 var(--t3-background),\n\t\t18px 16px 0 var(--t3-background),\n\t\t20px 18px 0 var(--t3-background),\n\t\t-4px 0 0 var(--t3-text),\n\t\t0 -4px 0 var(--t3-text),\n\t\t-2px -2px 0 var(--t3-text),\n\t\t2px -2px 0 var(--t3-text),\n\t\t4px 0 0 var(--t3-text),\n\t\t6px 2px 0 var(--t3-text),\n\t\t8px 4px 0 var(--t3-text),\n\t\t10px 6px 0 var(--t3-text),\n\t\t12px 8px 0 var(--t3-text),\n\t\t14px 10px 0 var(--t3-text),\n\t\t16px 12px 0 var(--t3-text),\n\t\t18px 14px 0 var(--t3-text),\n\t\t20px 16px 0 var(--t3-text);\n}\n\n.tumblr-theme-footer {\n\tposition: relative;\n\ttext-align: right;\n\tmargin: 10px 0 0;\n\tpadding: 0;\n\twidth: 100%;\n\n\ta {\n\t\t@include rainbow-button;\n\n\t\t&:hover {\n\t\t\t@include rainbow-button-hover;\n\t\t}\n\t}\n}\n\n#t3-categories {\n\tmargin: 10px;\n}\n\n#t3-category-select-form {\n\tdisplay: inline;\n}\n\n@keyframes play {\n\t100% {\n\t\tbackground-position: -90px top;\n\t}\n}\n\n#theme-garden-heading {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.tumblr-logo-icon {\n\twidth: 30px;\n\tmargin: 0 12px;\n}\n\n.tumblr-theme-garden-list-item {\n\tpadding: 4px 10px;\n\tbackground: #000;\n\tborder-radius: 6px;\n}\n\n.tumblr-theme-garden-link {\n\tcursor: pointer;\n\tborder: none;\n\toutline: none;\n\twidth: 80px;\n\theight: 16px;\n\tmask-image: url(../../images/tumblr-logo.png) ;\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n}\n\n.tumblr-theme-garden-link:hover {\n\tanimation: play 1.5s linear infinite;\n}\n\n#tumblr-no-themes {\n\tdisplay: block;\n}\n","@import \"admin/theme_garden\";\n"]} \ No newline at end of file +{"version":3,"sources":["../src/admin/_theme_garden.scss","../src/admin.scss"],"names":[],"mappings":"AA6BA;EACC,qBAAA;EACA,uBAAA;EACA,wBAAA;EACA,kBAAA;EACA,sBAAA;EACA,iBAAA;EACA,oBAAA;EACA,oBAAA;EACA,mBAAA;EACA,oBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,kBAAA;AC5BD;;AD+BA;EACC,qBAAA;EACA,uBAAA;EACA,eAAA;AC5BD;;AD+BA;EACC,aAAA;EACA,0BAAA;EACA,uBAAA;EACA,UAAA;EACA,cAAA;AC5BD;;AD+BA;EACC,WAAA;EACA,qBAAA;EACA,mBAAA;EACA,sBAAA;EACA,6CAAA;AC5BD;AD8BC;EACC,gDAAA;AC5BF;AD+BC;EACC,gDAAA;AC7BF;ADgCC;EACC,+CAAA;AC9BF;ADiCC;EACC,gDAAA;AC/BF;;ADmCA;EAEC;IACC,sCAAA;IACA,8BAAA;ECjCA;AACF;ADoCA;EAEC;IACC,kCAAA;IACA,8BAAA;ECnCA;AACF;ADsCA;EAEC;IACC,8BAAA;IACA,8BAAA;ECrCA;AACF;ADwCA;EACC,aAAA;EACA,uBAAA;EACA,gBAAA;EACA,kBAAA;EACA,iBAAA;EACA,uB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ACC,aAAA;EACA,mBAAA;AClED;;ADqEA;EACC,WAAA;EACA,cAAA;AClED;;ADqEA;EACC,iBAAA;EACA,gBAAA;EACA,kBAAA;AClED;;ADqEA;EACC,eAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;EACA,YAAA;EACA,qDAAA;UAAA,6CAAA;EACA,wJAAA;AClED;;AD6EA;EACC,oCAAA;AC1ED;;AD6EA;EACC,cAAA;AC1ED","file":"admin.css","sourcesContent":["$buttonWidth: 70px;\n\n@mixin rainbow-button {\n\tdisplay: inline-block;\n\tline-height: 24px;\n\tpadding: 0 20px;\n\tfont-size: 1em;\n\ttext-decoration: none;\n\tborder-radius: 4px;\n\tcolor: var(--t3-button-text);\n\tborder: 1px solid var(--t3-primary);\n\tbackground: var(--t3-primary);\n}\n\n@mixin rainbow-button-hover {\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n\tbackground-size: 90px 100%;\n\tanimation: play 1.5s linear infinite;\n\tcolor: #000;\n}\n\nbody {\n\t--t3-primary: #49a2c4;\n\t--t3-secondary: #8eb2c0;\n\t--t3-background: #f1f1f1;\n\t--t3-text: #49a2c4;\n\t--t3-button-text: #fff;\n\t--t3-red: #f8c7c3;\n\t--t3-orange: #f8d8bf;\n\t--t3-yellow: #f0e794;\n\t--t3-green: #b9ebc8;\n\t--t3-violet: #d4caf7;\n}\n\nbody.admin-color-light {\n\t--t3-primary: #04a4cc;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #999;\n}\n\nbody.admin-color-modern {\n\t--t3-primary: #3858e9;\n\t--t3-text: #1e1e1e;\n}\n\nbody.admin-color-blue {\n\t--t3-primary: #4796b3;\n\t--t3-secondary: #74b6ce;\n\t--t3-text: #096484;\n}\n\nbody.admin-color-coffee {\n\t--t3-primary: #c7a589;\n\t--t3-secondary: #9ea476;\n\t--t3-text: #46403c;\n}\n\nbody.admin-color-ectoplasm {\n\t--t3-primary: #a3b745;\n\t--t3-secondary: #a3b745;\n\t--t3-text: #523f6d;\n}\n\nbody.admin-color-midnight {\n\t--t3-primary: #e14d43;\n\t--t3-secondary: #363b3f;\n\t--t3-text: #25282b;\n}\n\nbody.admin-color-ocean {\n\t--t3-primary: #9ebaa0;\n\t--t3-secondary: #738e96;\n\t--t3-text: #627c83;\n}\n\nbody.admin-color-sunrise {\n\t--t3-primary: #dd823b;\n\t--t3-secondary: #e5e5e5;\n\t--t3-text: #000;\n}\n\n.tumblr-themes {\n\tdisplay: grid;\n\tgrid-template-columns: 95%;\n\tjustify-content: center;\n\twidth: 98%;\n\tmargin: 0 auto;\n}\n\n.tumblr-theme {\n\twidth: 100%;\n\tcolor: var(--t3-text);\n\tmargin-bottom: 40px;\n\tfont-family: monospace;\n\tfilter: drop-shadow(-8px 8px 0 var(--t3-red));\n\n\t&:nth-child(5n + 2) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-orange));\n\t}\n\n\t&:nth-child(5n + 3) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-yellow));\n\t}\n\n\t&:nth-child(5n + 4) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-green));\n\t}\n\n\t&:nth-child(5n + 5) {\n\t\tfilter: drop-shadow(-8px 8px 0 var(--t3-violet));\n\t}\n}\n\n@media screen and (min-width: 1601px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 22% 22% 22% 22%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 1301px) and (max-width: 1600px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 30% 30% 30%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n@media screen and (min-width: 730px) and (max-width: 1300px) {\n\n\t.tumblr-themes {\n\t\tgrid-template-columns: 47% 47%;\n\t\tjustify-content: space-between;\n\t}\n}\n\n.tumblr-theme-header {\n\tdisplay: flex;\n\talign-items: flex-start;\n\toverflow: hidden;\n\tposition: relative;\n\tmargin-left: -8px;\n\twidth: calc(100% + 8px);\n\theight: 26px;\n}\n\n.tumblr-theme-title-wrapper {\n\tflex: initial;\n\tdisplay: block;\n\tposition: relative;\n\tmargin-left: 4px;\n\tpadding: 4px 4px 0 4px;\n\tmax-width: 80%;\n\ttext-overflow: ellipsis;\n}\n\n.tumblr-theme-content {\n\tbackground-color: var(--t3-background);\n\tpadding: 10px;\n\tbox-shadow:\n\t\t-2px -2px 0 0 var(--t3-background),\n\t\t0 -2px 0 0 var(--t3-background),\n\t\t-2px 0 0 0 var(--t3-background),\n\t\t0 2px 0 0 var(--t3-background),\n\t\t2px 0 0 0 var(--t3-background),\n\t\t0 0 0 2px var(--t3-text),\n\t\t-4px -4px 0 0 var(--t3-text),\n\t\t0 -4px 0 0 var(--t3-text),\n\t\t-4px 0 0 0 var(--t3-text),\n\t\t0 4px 0 0 var(--t3-text),\n\t\t4px 0 0 0 var(--t3-text);\n}\n\n.tumblr-theme-details {\n\twidth: calc(100% - 4px);\n\tborder: 2px solid var(--t3-secondary);\n\tborder-radius: 4px;\n\tdisplay: block;\n\tposition: relative;\n\toverflow: hidden;\n\tpadding: 0;\n\n\tlabel {\n\t\tdisplay: none;\n\t\tz-index: 2;\n\t\tposition: absolute;\n\t}\n\n\timg {\n\t\twidth: 100%;\n\t\theight: auto;\n\t\taspect-ratio: 100/67;\n\t\tobject-fit: contain;\n\t\tmargin-bottom: -6px;\n\t\tz-index: 1;\n\t}\n\n\t&:hover {\n\t\tlabel {\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100%;\n\t\t\theight: auto;\n\t\t\taspect-ratio: 100/67;\n\t\t\tobject-fit: contain;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: radial-gradient(\n\t\t\t\t\tclosest-side,\n\t\t\t\t\t#0000 calc(100% - 1px),\n\t\t\t\t\tvar(--t3-background)\n\t\t\t) 0/ 3px 3px space;\n\t\t}\n\n\t\t.tumblr-theme-detail-button {\n\t\t\t@include rainbow-button;\n\t\t\t@include rainbow-button-hover;\n\t\t\tfont-size: 16px;\n\t\t\tfont-weight: 600;\n\t\t\tpadding: 5px 20px;\n\t\t}\n\t}\n}\n\n.tumblr-theme-title {\n\tdisplay: block;\n\tposition: relative;\n\tbackground-color: var(--t3-background);\n\tpadding: 3px 12px 0 10px;\n\theight: 18px;\n\tline-height: 18px;\n\tfont-family: monospace;\n\tfont-size: 1em;\n\tfont-weight: 700;\n\tbox-shadow:\n\t\t-2px 4px 0 var(--t3-background),\n\t\t0 -2px 0 var(--t3-background),\n\t\t-2px 0 0 var(--t3-background),\n\t\t2px 0 0 var(--t3-background),\n\t\t4px 2px 0 var(--t3-background),\n\t\t6px 4px 0 var(--t3-background),\n\t\t8px 6px 0 var(--t3-background),\n\t\t10px 8px 0 var(--t3-background),\n\t\t12px 10px 0 var(--t3-background),\n\t\t14px 12px 0 var(--t3-background),\n\t\t16px 14px 0 var(--t3-background),\n\t\t18px 16px 0 var(--t3-background),\n\t\t20px 18px 0 var(--t3-background),\n\t\t-4px 0 0 var(--t3-text),\n\t\t0 -4px 0 var(--t3-text),\n\t\t-2px -2px 0 var(--t3-text),\n\t\t2px -2px 0 var(--t3-text),\n\t\t4px 0 0 var(--t3-text),\n\t\t6px 2px 0 var(--t3-text),\n\t\t8px 4px 0 var(--t3-text),\n\t\t10px 6px 0 var(--t3-text),\n\t\t12px 8px 0 var(--t3-text),\n\t\t14px 10px 0 var(--t3-text),\n\t\t16px 12px 0 var(--t3-text),\n\t\t18px 14px 0 var(--t3-text),\n\t\t20px 16px 0 var(--t3-text);\n}\n\n.tumblr-theme-footer {\n\tposition: relative;\n\ttext-align: right;\n\tmargin: 10px 0 0;\n\tpadding: 0;\n\twidth: 100%;\n\n\ta {\n\t\t@include rainbow-button;\n\n\t\t&:hover {\n\t\t\t@include rainbow-button-hover;\n\t\t}\n\t}\n}\n\n#t3-categories {\n\tmargin: 10px;\n}\n\n#t3-category-select-form {\n\tdisplay: inline;\n}\n\n@keyframes play {\n\t100% {\n\t\tbackground-position: -90px top;\n\t}\n}\n\n#theme-garden-heading {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.tumblr-logo-icon {\n\twidth: 30px;\n\tmargin: 0 12px;\n}\n\n.tumblr-theme-garden-list-item {\n\tpadding: 4px 10px;\n\tbackground: #000;\n\tborder-radius: 6px;\n}\n\n.tumblr-theme-garden-link {\n\tcursor: pointer;\n\tborder: none;\n\toutline: none;\n\twidth: 80px;\n\theight: 16px;\n\tmask-image: url(../../images/tumblr-logo.png) ;\n\tbackground: repeating-linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--t3-red) 0%,\n\t\t\tvar(--t3-orange),\n\t\t\tvar(--t3-yellow),\n\t\t\tvar(--t3-green),\n\t\t\tvar(--t3-violet),\n\t\t\tvar(--t3-red) 50%\n\t);\n}\n\n.tumblr-theme-garden-link:hover {\n\tanimation: play 1.5s linear infinite;\n}\n\n#tumblr-no-themes {\n\tdisplay: block;\n}\n","@import \"admin/theme_garden\";\n"]} \ No newline at end of file diff --git a/assets/css/src/admin/_theme_garden.scss b/assets/css/src/admin/_theme_garden.scss index eaf1a23..1205b4b 100644 --- a/assets/css/src/admin/_theme_garden.scss +++ b/assets/css/src/admin/_theme_garden.scss @@ -187,6 +187,7 @@ body.admin-color-sunrise { display: block; position: relative; overflow: hidden; + padding: 0; label { display: none; diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index e1474e4..07f20d2 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '7d2750de13fecca2ee9a'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '6385305e8e27dec3d4dc'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index f7fc19e..6606f5d 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const o={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1},c={receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),prefetchThemes:()=>({type:"PREFETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}}},h={getLogoUrl:()=>o.logoUrl,getInitialFilterBarProps:()=>({categories:o.categories,selectedCategory:o.selectedCategory,baseUrl:o.baseUrl,search:o.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getThemes:e=>e.themes},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=o,t)=>{switch(t.type){case"PREFETCH_THEMES":return{...e,isFetchingThemes:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};default:return e}},actions:c,selectors:h,controls:i,resolvers:{}});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({prefetchThemes:()=>e("tumblr3/theme-garden-store").prefetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:o,receiveThemes:c,prefetchThemes:h,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[g,E]=(0,a.useState)(l),[w,p]=(0,a.useState)(m),T=(0,a.useRef)();(0,a.useEffect)((()=>{p(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",f),()=>{window.removeEventListener("popstate",f)})),[]);const b=async e=>{h();const t=await o(e);c(t)},f=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?E(a):(await b(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},w.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r.__)("Categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await b(a),u(a),E(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},"Search Themes"),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:g,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(T.current),E(a),T.current=setTimeout((async()=>{await(async e=>{h();const t=await i(e);c(t)})(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),g=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))))((({themes:e,isFetchingThemes:s})=>{const[n,l]=(0,a.useState)(e);return(0,a.useEffect)((()=>{l(e)}),[e]),s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===n.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("a",{className:"tumblr-theme-details",href:"#"},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(E,null)))),p=document.getElementById("tumblr-theme-garden");p?(0,a.createRoot)(p).render((0,t.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1,isOverlayOpen:!1,themeDetails:!1},o={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:()=>({type:"RECEIVE_THEME"}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}}},h={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isOverlayOpen:!0};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1};default:return e}},actions:o,selectors:h,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:c,receiveThemes:o,beforeFetchThemes:h,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(l),[p,w]=(0,a.useState)(m),b=(0,a.useRef)();(0,a.useEffect)((()=>{w(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const T=async e=>{h();const t=await c(e);o(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?g(a):(await T(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},p.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r.__)("Categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await T(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},"Search Themes"),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(b.current),g(a),b.current=setTimeout((async()=>{await(async e=>{h();const t=await i(e);o(t)})(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:t=>e("tumblr3/theme-garden-store").receiveTheme()}))))((({themes:e,isFetchingThemes:s,receiveTheme:n})=>{const[l,m]=(0,a.useState)(e);(0,a.useEffect)((()=>{m(e)}),[e]);const c=()=>{n()};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===l.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:c},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),p=(0,n.compose)((0,s.withSelect)((e=>({isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen()}))),(0,s.withDispatch)((e=>({closeOverlay:t=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({isOverlayOpen:e,closeOverlay:a})=>e?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:a},(0,t.createElement)("span",{className:"screen-reader-text"},"Close details dialog"))),(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:"https://i.ytimg.com/vi/tfBIpzdckeU/maxresdefault.jpg",alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},"Banana Phone"),(0,t.createElement)("div",null,"It's a phone that can banana."))))):null)),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(p,null)))),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-filterbar.js b/assets/js/src/components/theme-garden-filterbar.js index 69dd2e8..e16ebcc 100644 --- a/assets/js/src/components/theme-garden-filterbar.js +++ b/assets/js/src/components/theme-garden-filterbar.js @@ -18,7 +18,7 @@ import './theme-garden-store'; * @param {Array} props.themes * @param {Function} props.fetchThemes * @param {Function} props.receiveThemes - * @param {Function} props.prefetchThemes + * @param {Function} props.beforeFetchThemes * @param {Function} props.searchThemes */ const _ThemeGardenFilterBar = ( { @@ -31,7 +31,7 @@ const _ThemeGardenFilterBar = ( { themes, fetchThemes, receiveThemes, - prefetchThemes, + beforeFetchThemes, searchThemes, } ) => { const [ selectedCategory, setSelectedCategory ] = useState( initialSelectedCategory ); @@ -57,13 +57,13 @@ const _ThemeGardenFilterBar = ( { }, [] ); const fetchThemesByCategory = async category => { - prefetchThemes(); + beforeFetchThemes(); const response = await fetchThemes( category ); receiveThemes( response ); }; const fetchThemesByQuery = async newSearch => { - prefetchThemes(); + beforeFetchThemes(); const response = await searchThemes( newSearch ); receiveThemes( response ); }; @@ -148,8 +148,8 @@ export const ThemeGardenFilterBar = compose( themes: select( 'tumblr3/theme-garden-store' ).getThemes(), } ) ), withDispatch( dispatch => ( { - prefetchThemes: () => { - return dispatch( 'tumblr3/theme-garden-store' ).prefetchThemes(); + beforeFetchThemes: () => { + return dispatch( 'tumblr3/theme-garden-store' ).beforeFetchThemes(); }, fetchThemes: category => { return dispatch( 'tumblr3/theme-garden-store' ).fetchThemes( category ); diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index a94b990..60e9310 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -1,5 +1,5 @@ import { useEffect, useState } from '@wordpress/element'; -import { withSelect } from '@wordpress/data'; +import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { _x } from '@wordpress/i18n'; import { ThemeGardenNoThemes } from './theme-garden-no-themes'; @@ -13,14 +13,20 @@ import './theme-garden-store'; * @param {Object} props * @param {Array} props.themes * @param {boolean} props.isFetchingThemes + * @param {Function} props.receiveTheme + * */ -const _ThemeGardenList = ( { themes, isFetchingThemes } ) => { +const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme } ) => { const [ localThemes, setLocalThemes ] = useState( themes ); useEffect( () => { setLocalThemes( themes ); }, [ themes ] ); + const handleDetailsClick = () => { + receiveTheme(); + } + if ( isFetchingThemes ) { return (
@@ -43,12 +49,11 @@ const _ThemeGardenList = ( { themes, isFetchingThemes } ) => {
- + @@ -63,5 +68,10 @@ export const ThemeGardenList = compose( withSelect(select => ({ themes: select('tumblr3/theme-garden-store').getThemes(), isFetchingThemes: select('tumblr3/theme-garden-store').getIsFetchingThemes(), - })) + })), + withDispatch( dispatch => ( { + receiveTheme: themes => { + return dispatch( 'tumblr3/theme-garden-store' ).receiveTheme(); + }, + } ) ) )(_ThemeGardenList); diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js index e69de29..ededc7f 100644 --- a/assets/js/src/components/theme-garden-overlay.js +++ b/assets/js/src/components/theme-garden-overlay.js @@ -0,0 +1,53 @@ +import { withDispatch, withSelect } from '@wordpress/data'; +import { compose } from '@wordpress/compose'; + +/** + * Displays an overlay with details about a Tumblr theme. + * + * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. + * + * @param {Object} props + * @param {boolean} props.isOverlayOpen + * @param {Function} props.closeOverlay + */ +const _ThemeGardenOverlay = ({isOverlayOpen, closeOverlay}) => { + const handleCloseOverlay = () => { + closeOverlay(); + } + if ( !isOverlayOpen ) { + return null; + } + + return( +
+
+
+
+ +
+
+
+
+ +
+
+
+

Banana Phone

+
It's a phone that can banana.
+
+
+
+
+ ) +} + +export const ThemeGardenOverlay = compose( + withSelect( select => ( { + isOverlayOpen: select( 'tumblr3/theme-garden-store' ).getIsOverlayOpen(), + } ) ), + withDispatch( dispatch => ( { + closeOverlay: themes => { + return dispatch( 'tumblr3/theme-garden-store' ).closeOverlay(); + }, + } ) ) +)( _ThemeGardenOverlay ); diff --git a/assets/js/src/components/theme-garden-store.js b/assets/js/src/components/theme-garden-store.js index 373235c..f40afdc 100644 --- a/assets/js/src/components/theme-garden-store.js +++ b/assets/js/src/components/theme-garden-store.js @@ -4,8 +4,6 @@ import { createReduxStore, register } from '@wordpress/data'; /** * Default state is loaded from an inline script declared in ThemeGarden.php. */ - -/*ignore jslint start*/ const DEFAULT_STATE = { logoUrl: themeGardenData.logoUrl, // eslint-disable-line no-undef themes: themeGardenData.themes, // eslint-disable-line no-undef @@ -14,29 +12,44 @@ const DEFAULT_STATE = { search: themeGardenData.search, // eslint-disable-line no-undef baseUrl: themeGardenData.baseUrl, // eslint-disable-line no-undef isFetchingThemes: false, + isOverlayOpen: false, + themeDetails: false }; -/*ignore jslint end*/ const reducer = ( state = DEFAULT_STATE, action ) => { switch ( action.type ) { - case 'PREFETCH_THEMES': + case 'BEFORE_FETCH_THEMES': return { ...state, isFetchingThemes: true }; case 'RECEIVE_THEMES': return { ...state, themes: action.themes, isFetchingThemes: false }; + case 'RECEIVE_THEME': + return { ...state, isOverlayOpen: true }; + case 'CLOSE_OVERLAY': + return { ...state, isOverlayOpen: false }; default: return state; } }; const actions = { + closeOverlay() { + return { + type: 'CLOSE_OVERLAY' + }; + }, + receiveTheme() { + return { + type: 'RECEIVE_THEME' + }; + }, receiveThemes( themes ) { return { type: 'RECEIVE_THEMES', themes, }; }, - prefetchThemes() { - return { type: 'PREFETCH_THEMES' }; + beforeFetchThemes() { + return { type: 'BEFORE_FETCH_THEMES' }; }, *fetchThemes( category ) { try { @@ -72,6 +85,9 @@ const selectors = { getThemes( state ) { return state.themes; }, + getIsOverlayOpen( state ) { + return state.isOverlayOpen; + }, }; const controls = { @@ -102,14 +118,11 @@ const controls = { }, }; -const resolvers = {}; - const store = createReduxStore( 'tumblr3/theme-garden-store', { reducer, actions, selectors, controls, - resolvers, } ); register( store ); diff --git a/assets/js/src/theme-garden.js b/assets/js/src/theme-garden.js index c73ec51..9f43a2c 100644 --- a/assets/js/src/theme-garden.js +++ b/assets/js/src/theme-garden.js @@ -5,13 +5,14 @@ import { __ } from '@wordpress/i18n'; import { withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import './components/theme-garden-store'; +import {ThemeGardenOverlay} from "./components/theme-garden-overlay"; /** * ThemeGarden Component * * This component provides a user interface for browsing themes from Tumblr's theme garden. * - * Class names reference built-in wp-admin styles, and styles declared in _theme_garden.scss. + * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. * * @param {Object} props * @param {string} props.logoUrl @@ -25,6 +26,7 @@ const ThemeGarden = ( { logoUrl } ) => { +
); }; From 16463928bc46cd8654ed53c583f6c0a315d77914 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Mon, 2 Dec 2024 16:55:26 -0500 Subject: [PATCH 06/20] adds new rest api route --- assets/css/build/admin.css | 2 +- assets/css/build/index.css | 2 +- src/ThemeGarden.php | 110 +++++++++++++++++++++++++------------ 3 files changed, 78 insertions(+), 36 deletions(-) diff --git a/assets/css/build/admin.css b/assets/css/build/admin.css index f7b7492..f535d10 100644 --- a/assets/css/build/admin.css +++ b/assets/css/build/admin.css @@ -269,4 +269,4 @@ body.admin-color-sunrise { #tumblr-no-themes { display: block; } -/*# sourceMappingURL=admin.css.map */ \ No newline at end of file +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9hZG1pbi9fdGhlbWVfZ2FyZGVuLnNjc3MiLCIuLi9zcmMvYWRtaW4uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2QkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0Esd0JBQUE7RUFDQSxrQkFBQTtFQUNBLHNCQUFBO0VBQ0EsaUJBQUE7RUFDQSxvQkFBQTtFQUNBLG9CQUFBO0VBQ0EsbUJBQUE7RUFDQSxvQkFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0EsZUFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLGtCQUFBO0FDNUJEOztBRCtCQTtFQUNDLHFCQUFBO0VBQ0EsdUJBQUE7RUFDQSxrQkFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0Esa0JBQUE7QUM1QkQ7O0FEK0JBO0VBQ0MscUJBQUE7RUFDQSx1QkFBQTtFQUNBLGtCQUFBO0FDNUJEOztBRCtCQTtFQUNDLHFCQUFBO0VBQ0EsdUJBQUE7RUFDQSxrQkFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0Esa0JBQUE7QUM1QkQ7O0FEK0JBO0VBQ0MscUJBQUE7RUFDQSx1QkFBQTtFQUNBLGVBQUE7QUM1QkQ7O0FEK0JBO0VBQ0MsYUFBQTtFQUNBLDBCQUFBO0VBQ0EsdUJBQUE7RUFDQSxVQUFBO0VBQ0EsY0FBQTtBQzVCRDs7QUQr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ibHItbm8tdGhlbWVzIHtcblx0ZGlzcGxheTogYmxvY2s7XG59XG4iLCJAaW1wb3J0IFwiYWRtaW4vdGhlbWVfZ2FyZGVuXCI7XG4iXX0= */ \ No newline at end of file diff --git a/assets/css/build/index.css b/assets/css/build/index.css index 841e011..0689c04 100644 --- a/assets/css/build/index.css +++ b/assets/css/build/index.css @@ -297,4 +297,4 @@ body div.npf_row + div.npf_row { font-size: 0.875em; line-height: 1.5; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5zY3NzJTIzc2FzcyIsIi4uL3NyYy9mcm9udGVuZC9fZ2xvYmFsLnNjc3MiLCIuLi9zcmMvaW5kZXguc2NzcyIsIi4uL3NyYy9mcm9udGVuZC9fdGV4dC5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL192YXJpYWJsZXMuc2NzcyIsIi4uL3NyYy9mcm9udGVuZC9fbGluay5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL192aWRlby5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL19pbWFnZS5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL19hdWRpby5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlHQUFBO0FDQ0M7RUNDRCxhQUFBO0FBQ0E7QURFQztFQ0FELGFBQUE7QUFDQTs7QUNEQTtFQUNDLHFEQUFBO0VBQ0EsZUFBQTtBRElEOztBQ0RBO0VBQ0MsNkJBQUE7RUFDQSxlQ29CNEI7RURuQjVCLGtCQ29COEI7QUZoQi9COztBQ0RBO0VBQ0MseUNBQUE7QURJRDs7QUNEQTs7RUFFQyxjQ3FEWTtBRmpEYjs7QUNEQTs7RUFFQyxjQ2lEYztBRjdDZjs7QUNEQTs7RUFFQyxjQzZDYztBRnpDZjs7QUNEQTs7RUFFQyxjQ3lDWTtBRnJDYjs7QUNEQTs7RUFFQyxjQ3FDYztBRmpDZjs7QUNE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ICAgICAgICAgIHBhZGRpbmctbGVmdDogMnB4O1xuICAgICAgICAgICAgcGFkZGluZy1yaWdodDogMnB4O1xuXG4gICAgICAgICAgICAmOmZpcnN0LWNoaWxkIHtcbiAgICAgICAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICY6bGFzdC1jaGlsZCB7XG4gICAgICAgICAgICAgICAgcGFkZGluZy1yaWdodDogMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGltZyB7XG4gICAgICAgICAgICBoZWlnaHQ6IGF1dG87XG4gICAgICAgIH1cblxuICAgICAgICAubnBmX2NvbCB7XG4gICAgICAgICAgICBmbGV4OiAxO1xuXG4gICAgICAgICAgICBmaWd1cmUge1xuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTtcbiAgICAgICAgICAgICAgICBtYXJnaW46IDA7XG4gICAgICAgICAgICAgICAgdGV4dC1hbGlnbjogbGVmdDtcblxuICAgICAgICAgICAgICAgIGltZyB7XG4gICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxMDAlO1xuICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7XG4gICAgICAgICAgICAgICAgICAgIG9iamVjdC1maXQ6IGNvdmVyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHAudG1ibHItYXR0cmlidXRpb24ge1xuICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICAgICAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmaWd1cmVbZGF0YS1lbmFibGUtbGlnaHRib3g9XCIxXCJdIHtcbiAgICAgICAgY3Vyc29yOiBwb2ludGVyO1xuICAgIH1cblxuICAg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lbnQ6IGNlbnRlcjtcbiAgICAgICAgYWxpZ24taXRlbXM6IGZsZXgtc3RhcnQ7XG4gICAgICAgIHBhZGRpbmc6IDAgMjBweDtcbiAgICB9XG5cbiAgICAudGl0bGUge1xuICAgICAgICBmb250LXdlaWdodDogYm9sZDtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDEuNTtcbiAgICB9XG5cbiAgICAuYXJ0aXN0LFxuICAgIC5hbGJ1bSB7XG4gICAgICAgIGZvbnQtc2l6ZTogMC44NzVlbTtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDEuNTtcbiAgICB9XG59XG4iXX0= */ \ No newline at end of file +/*# sourceMappingURL=index.css.map */ \ No newline at end of file diff --git a/src/ThemeGarden.php b/src/ThemeGarden.php index 6c588a7..8f4e61a 100644 --- a/src/ThemeGarden.php +++ b/src/ThemeGarden.php @@ -16,18 +16,27 @@ */ class ThemeGarden { const THEME_GARDEN_ENDPOINT = 'https://www.tumblr.com/api/v2/theme_garden'; + const ADMIN_MENU_SLUG = 'tumblr-themes'; /** - * This holds the currently selected category of themes. + * The `category` param in the current URL. If present, we'll search Tumblr's API for the given category. + * Defaults to featured if no param is present. * - * @var string + * @var string $selected_category */ public string $selected_category = 'featured'; /** - * This holds the current search query. + * The `theme` param in the current URL. If present, we'll render a theme details overlay. * - * @var string + * @var string $selected_theme_id + */ + public string $selected_theme_id = ''; + + /** + * The `search` param in the current URL. If present, we'll search Tumblr's API for the given query. + * + * @var string $search */ public string $search = ''; @@ -57,6 +66,9 @@ public function initialize(): void { // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nonce is verified in maybe_activate_theme. $this->search = ( isset( $_GET['search'] ) ) ? sanitize_text_field( wp_unslash( $_GET['search'] ) ) : ''; + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nonce is verified in maybe_activate_theme. + $this->selected_theme_id = ( isset( $_GET['theme'] ) ) ? sanitize_text_field( wp_unslash( $_GET['theme'] ) ) : ''; } /** @@ -67,7 +79,7 @@ public function initialize(): void { * @return void */ public function enqueue_assets( string $hook ): void { - if ( 'appearance_page_tumblr-themes' === $hook ) { + if ( 'appearance_page_' . self::ADMIN_MENU_SLUG === $hook ) { $deps = tumblr3_get_asset_meta( TUMBLR3_PATH . 'assets/js/build/theme-garden.asset.php' ); $this->enqueue_admin_styles( $deps['version'] ); $themes_and_categories = $this->get_themes_and_categories(); @@ -108,7 +120,7 @@ public function enqueue_assets( string $hook ): void { 'tumblr-theme-install', 'const T3_Install = ' . wp_json_encode( array( - 'browseUrl' => admin_url( 'admin.php?page=tumblr-themes' ), + 'browseUrl' => admin_url( 'admin.php?page=' . self::ADMIN_MENU_SLUG ), 'buttonText' => __( 'Browse Tumblr themes', 'tumblr3' ), ) ), @@ -142,6 +154,30 @@ public function enqueue_admin_styles( $version ): void { ); } + /** + * Fetches and theme object from Tumblr's API. + * + * @param string $theme_id The theme id to send to Tumblr's API. + * + * @return \WP_Error | object + */ + public function get_theme( string $theme_id ) { + $response = wp_remote_get( self::THEME_GARDEN_ENDPOINT . '/theme/' . esc_attr( $theme_id ) . '?time=' . time() ); + $status = wp_remote_retrieve_response_code( $response ); + + if ( 200 !== $status ) { + return new \WP_Error(); + } + + $body = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( ! isset( $body->response->theme ) ) { + return new \WP_Error(); + } + + return $body->response; + } + /** * Register REST routes. * @@ -153,7 +189,19 @@ public function register_rest_routes(): void { '/themes', array( 'methods' => 'GET', - 'callback' => array( $this, 'get_themes' ), + 'callback' => array( $this, 'rest_api_get_themes' ), + 'permission_callback' => function () { + return current_user_can( 'manage_options' ); + }, + ) + ); + + register_rest_route( + 'tumblr3/v1', + '/theme', + array( + 'methods' => 'GET', + 'callback' => array( $this, 'rest_api_get_theme' ), 'permission_callback' => function () { return current_user_can( 'manage_options' ); }, @@ -166,11 +214,21 @@ public function register_rest_routes(): void { * * @return \WP_REST_Response The settings for the queue. */ - public function get_themes(): \WP_REST_Response { + public function rest_api_get_themes(): \WP_REST_Response { $themes_and_categories = $this->get_themes_and_categories(); return new \WP_REST_Response( $themes_and_categories['themes'], 200 ); } + /** + * Gets theme details for an ajax request. + * + * @return \WP_REST_Response The settings for the queue. + */ + public function rest_api_get_theme(): \WP_REST_Response { + $themes_and_categories = $this->get_theme( $this->selected_theme_id ); + return new \WP_REST_Response( $themes_and_categories['themes'], 200 ); + } + /** * Checks URL query for a tumblr theme id to activate. * @@ -181,45 +239,29 @@ public function maybe_activate_theme(): void { return; } - $theme_id = isset( $_GET['activate_tumblr_theme'] ) ? absint( wp_unslash( $_GET['activate_tumblr_theme'] ) ) : 0; + $theme_id_to_activate = sanitize_text_field( wp_unslash( $_GET['activate_tumblr_theme'] ) ); + $theme = $this->get_theme( $theme_id_to_activate ); - // Returns early if theme id was not set. - if ( 0 === $theme_id ) { + if ( is_wp_error( $theme ) ) { return; } - - // During development, we don't want to be so limited by cache. So we'll send a cache invalidator to every request. - // TODO: remove once we are confident that api response will be stable. - $response = wp_remote_get( self::THEME_GARDEN_ENDPOINT . '/theme/' . esc_attr( $theme_id ) . '?time=' . time() ); - $status = wp_remote_retrieve_response_code( $response ); - - if ( 200 !== $status ) { - return; - } - - $body = json_decode( wp_remote_retrieve_body( $response ) ); - - if ( ! isset( $body->response->theme ) ) { - return; - } - // Save theme details to options. - update_option( 'tumblr3_theme_html', $body->response->theme ); + update_option( 'tumblr3_theme_html', $theme->theme ); // Save all external theme details to an option. $external_theme_details = array( - 'id' => $theme_id, - 'title' => isset( $body->response->title ) ? $body->response->title : '', - 'thumbnail' => isset( $body->response->thumbnail ) ? $body->response->thumbnail : '', - 'author_name' => isset( $body->response->author->name ) ? $body->response->author->name : '', - 'author_url' => isset( $body->response->author->url ) ? $body->response->author->url : '', + 'id' => $theme_id_to_activate, + 'title' => isset( $theme->title ) ? $theme->title : '', + 'thumbnail' => isset( $theme->thumbnail ) ? $theme->thumbnail : '', + 'author_name' => isset( $theme->author->name) ? $theme->author->name : '', + 'author_url' => isset( $theme->author->url ) ? $theme->author->url : '', ); update_option( 'tumblr3_external_theme', $external_theme_details ); update_option( 'tumblr3_use_theme', '1' ); // Setup theme option defaults. - $this->option_defaults_helper( maybe_unserialize( $body->response->default_params ) ); + $this->option_defaults_helper( maybe_unserialize( $theme->default_params ) ); // Finally, redirect to the customizer with the new theme active. wp_safe_redirect( wp_customize_url() ); From 65d51889f9f1f2088bfef044a178c1fa83d2f845 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Tue, 3 Dec 2024 10:20:26 -0500 Subject: [PATCH 07/20] ajax fetch --- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- .../src/components/theme-garden-filterbar.js | 6 +-- assets/js/src/components/theme-garden-list.js | 20 +++++-- .../js/src/components/theme-garden-overlay.js | 54 +++++++++++++------ .../js/src/components/theme-garden-store.js | 44 ++++++++++++--- src/ThemeGarden.php | 4 +- 7 files changed, 98 insertions(+), 34 deletions(-) diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index 07f20d2..12889e0 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '6385305e8e27dec3d4dc'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'f0433944739670b014e8'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index 6606f5d..6ecd280 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1,isOverlayOpen:!1,themeDetails:!1},o={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:()=>({type:"RECEIVE_THEME"}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to update settings")}}},h={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isOverlayOpen:!0};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1};default:return e}},actions:o,selectors:h,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:c,receiveThemes:o,beforeFetchThemes:h,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(l),[p,w]=(0,a.useState)(m),b=(0,a.useRef)();(0,a.useEffect)((()=>{w(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const T=async e=>{h();const t=await c(e);o(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?g(a):(await T(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},p.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r.__)("Categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await T(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},"Search Themes"),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(b.current),g(a),b.current=setTimeout((async()=>{await(async e=>{h();const t=await i(e);o(t)})(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:t=>e("tumblr3/theme-garden-store").receiveTheme()}))))((({themes:e,isFetchingThemes:s,receiveTheme:n})=>{const[l,m]=(0,a.useState)(e);(0,a.useEffect)((()=>{m(e)}),[e]);const c=()=>{n()};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===l.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:c},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),p=(0,n.compose)((0,s.withSelect)((e=>({isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen()}))),(0,s.withDispatch)((e=>({closeOverlay:t=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({isOverlayOpen:e,closeOverlay:a})=>e?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:a},(0,t.createElement)("span",{className:"screen-reader-text"},"Close details dialog"))),(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:"https://i.ytimg.com/vi/tfBIpzdckeU/maxresdefault.jpg",alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},"Banana Phone"),(0,t.createElement)("div",null,"It's a phone that can banana."))))):null)),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(p,null)))),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1,isOverlayOpen:!1,themeDetails:!1,isFetchingTheme:!1},h={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:e=>({type:"RECEIVE_THEME",theme:e}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>m()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1};default:return e}},actions:h,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:c,receiveThemes:h,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(l),[T,p]=(0,a.useState)(m),b=(0,a.useRef)();(0,a.useEffect)((()=>{p(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",f),()=>{window.removeEventListener("popstate",f)})),[]);const w=async e=>{o();const t=await c(e);h(t)},f=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?g(a):(await w(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},T.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await w(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(b.current),g(a),b.current=setTimeout((async()=>{await(async e=>{o();const t=await i(e);h(t)})(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:t=>e("tumblr3/theme-garden-store").receiveTheme(),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:l,beforeFetchTheme:m})=>{const[c,h]=(0,a.useState)(e);(0,a.useEffect)((()=>{h(e)}),[e]);const o=async({currentTarget:e})=>{console.info("start fetch"),m();const t=await l(e.value);console.info("end fetch",t),n(t)};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===c.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:o,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,n.compose)((0,s.withSelect)((e=>({isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({isOverlayOpen:e,isFetchingTheme:a,closeOverlay:s,fetchTheme:n})=>e?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:s},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),a?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:"https://i.ytimg.com/vi/tfBIpzdckeU/maxresdefault.jpg",alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},"Banana Phone"),(0,t.createElement)("div",null,"It's a phone that can banana."))))):null)),p=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(T,null)))),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(p,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-filterbar.js b/assets/js/src/components/theme-garden-filterbar.js index e16ebcc..81adb18 100644 --- a/assets/js/src/components/theme-garden-filterbar.js +++ b/assets/js/src/components/theme-garden-filterbar.js @@ -1,5 +1,5 @@ import { useState, useEffect, useRef } from '@wordpress/element'; -import { __, _x } from '@wordpress/i18n'; +import { _x } from '@wordpress/i18n'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import './theme-garden-store'; @@ -109,7 +109,7 @@ const _ThemeGardenFilterBar = ( {
{ themeList.length }
- +

- + { +const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme, fetchTheme, beforeFetchTheme } ) => { const [ localThemes, setLocalThemes ] = useState( themes ); useEffect( () => { setLocalThemes( themes ); }, [ themes ] ); - const handleDetailsClick = () => { - receiveTheme(); + const handleDetailsClick = async ( { currentTarget } ) => { + console.info('start fetch'); + beforeFetchTheme(); + const response = await fetchTheme( currentTarget.value ); + console.info('end fetch', response); + receiveTheme( response ); } if ( isFetchingThemes ) { @@ -49,7 +55,7 @@ const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme } ) => {

- -
-
-
-
- -
-
-
-

Banana Phone

-
It's a phone that can banana.
-
+
+ { renderThemeDetails() } ) @@ -44,10 +62,14 @@ const _ThemeGardenOverlay = ({isOverlayOpen, closeOverlay}) => { export const ThemeGardenOverlay = compose( withSelect( select => ( { isOverlayOpen: select( 'tumblr3/theme-garden-store' ).getIsOverlayOpen(), + isFetchingTheme: select( 'tumblr3/theme-garden-store' ).getIsFetchingTheme(), } ) ), withDispatch( dispatch => ( { - closeOverlay: themes => { + closeOverlay: () => { return dispatch( 'tumblr3/theme-garden-store' ).closeOverlay(); }, + fetchTheme: ( id ) => { + return dispatch( 'tumblr3/theme-garden-store' ).fetchTheme( id ); + }, } ) ) )( _ThemeGardenOverlay ); diff --git a/assets/js/src/components/theme-garden-store.js b/assets/js/src/components/theme-garden-store.js index f40afdc..3c6379c 100644 --- a/assets/js/src/components/theme-garden-store.js +++ b/assets/js/src/components/theme-garden-store.js @@ -13,19 +13,22 @@ const DEFAULT_STATE = { baseUrl: themeGardenData.baseUrl, // eslint-disable-line no-undef isFetchingThemes: false, isOverlayOpen: false, - themeDetails: false + themeDetails: false, + isFetchingTheme: false, }; const reducer = ( state = DEFAULT_STATE, action ) => { switch ( action.type ) { case 'BEFORE_FETCH_THEMES': return { ...state, isFetchingThemes: true }; + case 'BEFORE_FETCH_THEME': + return { ...state, isFetchingTheme: true, isOverlayOpen: true, }; case 'RECEIVE_THEMES': return { ...state, themes: action.themes, isFetchingThemes: false }; case 'RECEIVE_THEME': - return { ...state, isOverlayOpen: true }; + return { ...state, isFetchingTheme: false, themeDetails: action.theme }; case 'CLOSE_OVERLAY': - return { ...state, isOverlayOpen: false }; + return { ...state, isOverlayOpen: false, isFetchingTheme: false }; default: return state; } @@ -37,9 +40,10 @@ const actions = { type: 'CLOSE_OVERLAY' }; }, - receiveTheme() { + receiveTheme( theme ) { return { - type: 'RECEIVE_THEME' + type: 'RECEIVE_THEME', + theme: theme, }; }, receiveThemes( themes ) { @@ -48,6 +52,9 @@ const actions = { themes, }; }, + beforeFetchTheme() { + return { type: 'BEFORE_FETCH_THEME' }; + }, beforeFetchThemes() { return { type: 'BEFORE_FETCH_THEMES' }; }, @@ -55,16 +62,23 @@ const actions = { try { return controls.FETCH_THEMES( category ); } catch ( error ) { - throw new Error( 'Failed to update settings' ); + throw new Error( 'Failed to fetch themes' ); } }, *searchThemes( query ) { try { return controls.SEARCH_THEMES( query ); } catch ( error ) { - throw new Error( 'Failed to update settings' ); + throw new Error( 'Failed to search themes' ); } }, + *fetchTheme( id ) { + try { + return controls.FETCH_THEME( id ); + } catch ( error ) { + throw new Error( 'Failed to fetch theme' ); + } + } }; const selectors = { @@ -82,6 +96,9 @@ const selectors = { getIsFetchingThemes( state ) { return state.isFetchingThemes; }, + getIsFetchingTheme( state ) { + return state.isFetchingTheme; + }, getThemes( state ) { return state.themes; }, @@ -116,6 +133,19 @@ const controls = { throw error; } ); }, + FETCH_THEME( id ) { + return apiFetch( { + path: '/tumblr3/v1/theme?theme=' + id, + method: 'GET', + } ) + .then( response => { + return response; + } ) + .catch( error => { + console.error( 'API Error:', error ); // eslint-disable-line no-console + throw error; + } ); + }, }; const store = createReduxStore( 'tumblr3/theme-garden-store', { diff --git a/src/ThemeGarden.php b/src/ThemeGarden.php index 8f4e61a..ae053ee 100644 --- a/src/ThemeGarden.php +++ b/src/ThemeGarden.php @@ -225,8 +225,8 @@ public function rest_api_get_themes(): \WP_REST_Response { * @return \WP_REST_Response The settings for the queue. */ public function rest_api_get_theme(): \WP_REST_Response { - $themes_and_categories = $this->get_theme( $this->selected_theme_id ); - return new \WP_REST_Response( $themes_and_categories['themes'], 200 ); + $theme = $this->get_theme( $this->selected_theme_id ); + return new \WP_REST_Response( $theme, 200 ); } /** From d8e2698a538c91c7a80465148547e58cfe3e9f98 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Tue, 3 Dec 2024 11:09:22 -0500 Subject: [PATCH 08/20] render actual theme details --- assets/css/build/admin.css | 2 +- assets/css/build/index.css | 2 +- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- assets/js/src/components/theme-garden-list.js | 6 ++--- .../js/src/components/theme-garden-overlay.js | 24 ++++++++++++------- .../js/src/components/theme-garden-store.js | 4 ++++ 7 files changed, 25 insertions(+), 17 deletions(-) diff --git a/assets/css/build/admin.css b/assets/css/build/admin.css index f535d10..f7b7492 100644 --- a/assets/css/build/admin.css +++ b/assets/css/build/admin.css @@ -269,4 +269,4 @@ body.admin-color-sunrise { #tumblr-no-themes { display: block; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9hZG1pbi9fdGhlbWVfZ2FyZGVuLnNjc3MiLCIuLi9zcmMvYWRtaW4uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2QkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0Esd0JBQUE7RUFDQSxrQkFBQTtFQUNBLHNCQUFBO0VBQ0EsaUJBQUE7RUFDQSxvQkFBQTtFQUNBLG9CQUFBO0VBQ0EsbUJBQUE7RUFDQSxvQkFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0EsZUFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLGtCQUFBO0FDNUJEOztBRCtCQTtFQUNDLHFCQUFBO0VBQ0EsdUJBQUE7RUFDQSxrQkFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0Esa0JBQUE7QUM1QkQ7O0FEK0JBO0VBQ0MscUJBQUE7RUFDQSx1QkFBQTtFQUNBLGtCQUFBO0FDNUJEOztBRCtCQTtFQUNDLHFCQUFBO0VBQ0EsdUJBQUE7RUFDQSxrQkFBQTtBQzVCRDs7QUQr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cdFx0dmFyKC0tdDMtZ3JlZW4pLFxuXHRcdFx0dmFyKC0tdDMtdmlvbGV0KSxcblx0XHRcdHZhcigtLXQzLXJlZCkgNTAlXG5cdCk7XG59XG5cbi50dW1ibHItdGhlbWUtZ2FyZGVuLWxpbms6aG92ZXIge1xuXHRhbmltYXRpb246IHBsYXkgMS41cyBsaW5lYXIgaW5maW5pdGU7XG59XG5cbiN0dW1ibHItbm8tdGhlbWVzIHtcblx0ZGlzcGxheTogYmxvY2s7XG59XG4iLCJAaW1wb3J0IFwiYWRtaW4vdGhlbWVfZ2FyZGVuXCI7XG4iXX0= */ \ No newline at end of file +/*# sourceMappingURL=admin.css.map */ \ No newline at end of file diff --git a/assets/css/build/index.css b/assets/css/build/index.css index 0689c04..841e011 100644 --- a/assets/css/build/index.css +++ b/assets/css/build/index.css @@ -297,4 +297,4 @@ body div.npf_row + div.npf_row { font-size: 0.875em; line-height: 1.5; } -/*# sourceMappingURL=index.css.map */ \ No newline at end of file +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5zY3NzJTIzc2FzcyIsIi4uL3NyYy9mcm9udGVuZC9fZ2xvYmFsLnNjc3MiLCIuLi9zcmMvaW5kZXguc2NzcyIsIi4uL3NyYy9mcm9udGVuZC9fdGV4dC5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL192YXJpYWJsZXMuc2NzcyIsIi4uL3NyYy9mcm9udGVuZC9fbGluay5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL192aWRlby5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL19pbWFnZS5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL19hdWRpby5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlHQUFBO0FDQ0M7RUNDRCxhQUFBO0FBQ0E7QURFQztFQ0FELGFBQUE7QUFDQTs7QUNEQTtFQUNDLHFEQUFBO0VBQ0Es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biAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICAgICAgICAgIG1hcmdpbjogMDtcbiAgICAgICAgICAgIG92ZXJmbG93LXk6IGhpZGRlbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZpZ3VyZS50bWJsci1mdWxsLFxuICAgICAgICAubnBmX2NvbCB7XG4gICAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICAgICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMnB4O1xuICAgICAgICAgICAgcGFkZGluZy1yaWdodDogMnB4O1xuXG4gICAgICAgICAgICAmOmZpcnN0LWNoaWxkIHtcbiAgICAgICAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICY6bGFzdC1jaGlsZCB7XG4gICAgICAgICAgICAgICAgcGFkZGluZy1yaWdodDogMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGltZyB7XG4gICAgICAgICAgICBoZWlnaHQ6IGF1dG87XG4gICAgICAgIH1cblxuICAgICAgICAubnBmX2NvbCB7XG4gICAgICAgICAgICBmbGV4OiAxO1xuXG4gICAgICAgICAgICBmaWd1cmUge1xuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTtcbiAgICAgICAgICAgICAgICBtYXJnaW46IDA7XG4gICAgICAgICAgICAgICAgdGV4dC1hbGlnbjogbGVmdDtcblxuICAgICAgICAgICAgICAgIGltZyB7XG4gICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxMDAlO1xuICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7XG4gICAgICAgICAgICAgICAgICAgIG9iamVjdC1maXQ6IGNvdmVyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICA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ICBmbGV4LWRpcmVjdGlvbjogcm93O1xuXG4gICAgLmFsYnVtLWNvdmVyIHtcbiAgICAgICAgd2lkdGg6IDg1cHg7XG4gICAgICAgIGhlaWdodDogODVweDtcbiAgICB9XG5cbiAgICAuYXVkaW8tZGV0YWlscyB7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGZsZXg6IDEgMCBhdXRvO1xuICAgICAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbiAgICAgICAgYWxpZ24taXRlbXM6IGZsZXgtc3RhcnQ7XG4gICAgICAgIHBhZGRpbmc6IDAgMjBweDtcbiAgICB9XG5cbiAgICAudGl0bGUge1xuICAgICAgICBmb250LXdlaWdodDogYm9sZDtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDEuNTtcbiAgICB9XG5cbiAgICAuYXJ0aXN0LFxuICAgIC5hbGJ1bSB7XG4gICAgICAgIGZvbnQtc2l6ZTogMC44NzVlbTtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDEuNTtcbiAgICB9XG59XG4iXX0= */ \ No newline at end of file diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index 12889e0..45211aa 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'f0433944739670b014e8'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b4e82ef1ee1e98b5a980'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index 6ecd280..5e19290 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1,isOverlayOpen:!1,themeDetails:!1,isFetchingTheme:!1},h={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:e=>({type:"RECEIVE_THEME",theme:e}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>m()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1};default:return e}},actions:h,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:c,receiveThemes:h,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(l),[T,p]=(0,a.useState)(m),b=(0,a.useRef)();(0,a.useEffect)((()=>{p(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",f),()=>{window.removeEventListener("popstate",f)})),[]);const w=async e=>{o();const t=await c(e);h(t)},f=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?g(a):(await w(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},T.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await w(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(b.current),g(a),b.current=setTimeout((async()=>{await(async e=>{o();const t=await i(e);h(t)})(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:t=>e("tumblr3/theme-garden-store").receiveTheme(),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:l,beforeFetchTheme:m})=>{const[c,h]=(0,a.useState)(e);(0,a.useEffect)((()=>{h(e)}),[e]);const o=async({currentTarget:e})=>{console.info("start fetch"),m();const t=await l(e.value);console.info("end fetch",t),n(t)};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===c.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:o,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,n.compose)((0,s.withSelect)((e=>({isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({isOverlayOpen:e,isFetchingTheme:a,closeOverlay:s,fetchTheme:n})=>e?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:s},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),a?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:"https://i.ytimg.com/vi/tfBIpzdckeU/maxresdefault.jpg",alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},"Banana Phone"),(0,t.createElement)("div",null,"It's a phone that can banana."))))):null)),p=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(T,null)))),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(p,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1,isOverlayOpen:!1,themeDetails:!1,isFetchingTheme:!1},h={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:e=>(console.log("adtion receive theme",e),{type:"RECEIVE_THEME",theme:e}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>m()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1};default:return e}},actions:h,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:c,receiveThemes:h,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(l),[T,p]=(0,a.useState)(m),b=(0,a.useRef)();(0,a.useEffect)((()=>{p(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",f),()=>{window.removeEventListener("popstate",f)})),[]);const w=async e=>{o();const t=await c(e);h(t)},f=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?g(a):(await w(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},T.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await w(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(b.current),g(a),b.current=setTimeout((async()=>{await(async e=>{o();const t=await i(e);h(t)})(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:t=>e("tumblr3/theme-garden-store").receiveTheme(t),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:l,beforeFetchTheme:m})=>{const[c,h]=(0,a.useState)(e);(0,a.useEffect)((()=>{h(e)}),[e]);const o=async({currentTarget:e})=>{m();const t=await l(e.value);n(t)};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===c.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:o,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,n.compose)((0,s.withSelect)((e=>({isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({isOverlayOpen:e,isFetchingTheme:s,closeOverlay:n,fetchTheme:l,themeDetails:m})=>{const c=(0,a.useCallback)((()=>{if(s||!m)return(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"}));const e={__html:m.description};return(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:m.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},m.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:e})))}),[m]);return e?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:n},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),c())):null})),p=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(T,null)))),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(p,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index 9bc11c2..36a34b8 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -26,10 +26,8 @@ const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme, fetchTheme, }, [ themes ] ); const handleDetailsClick = async ( { currentTarget } ) => { - console.info('start fetch'); beforeFetchTheme(); const response = await fetchTheme( currentTarget.value ); - console.info('end fetch', response); receiveTheme( response ); } @@ -76,8 +74,8 @@ export const ThemeGardenList = compose( isFetchingThemes: select('tumblr3/theme-garden-store').getIsFetchingThemes(), })), withDispatch( dispatch => ( { - receiveTheme: themes => { - return dispatch( 'tumblr3/theme-garden-store' ).receiveTheme(); + receiveTheme: ( theme ) => { + return dispatch( 'tumblr3/theme-garden-store' ).receiveTheme( theme ); }, beforeFetchTheme: () => { return dispatch( 'tumblr3/theme-garden-store' ).beforeFetchTheme(); diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js index 36f267a..5251f9b 100644 --- a/assets/js/src/components/theme-garden-overlay.js +++ b/assets/js/src/components/theme-garden-overlay.js @@ -1,3 +1,4 @@ +import { useCallback } from '@wordpress/element'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { _x } from '@wordpress/i18n'; @@ -12,34 +13,38 @@ import { _x } from '@wordpress/i18n'; * @param {boolean} props.isFetchingTheme * @param {Function} props.closeOverlay * @param {Function} props.fetchTheme + * @param {Object} props.themeDetails */ -const _ThemeGardenOverlay = ({isOverlayOpen, isFetchingTheme, closeOverlay, fetchTheme}) => { +const _ThemeGardenOverlay = ({isOverlayOpen, isFetchingTheme, closeOverlay, fetchTheme, themeDetails}) => { const handleCloseOverlay = () => { closeOverlay(); } - const renderThemeDetails = () => { - if( isFetchingTheme ) { + const renderThemeDetails = useCallback(() => { + if( isFetchingTheme || !themeDetails ) { return ( -
+
); } + + const description = { __html: themeDetails.description }; + return (
- +
-

Banana Phone

-
It's a phone that can banana.
+

{themeDetails.title}

+
- ) - } + ); + }, [themeDetails] ); if (!isOverlayOpen) { return null; @@ -63,6 +68,7 @@ export const ThemeGardenOverlay = compose( withSelect( select => ( { isOverlayOpen: select( 'tumblr3/theme-garden-store' ).getIsOverlayOpen(), isFetchingTheme: select( 'tumblr3/theme-garden-store' ).getIsFetchingTheme(), + themeDetails: select( 'tumblr3/theme-garden-store' ).getThemeDetails(), } ) ), withDispatch( dispatch => ( { closeOverlay: () => { diff --git a/assets/js/src/components/theme-garden-store.js b/assets/js/src/components/theme-garden-store.js index 3c6379c..b4f888f 100644 --- a/assets/js/src/components/theme-garden-store.js +++ b/assets/js/src/components/theme-garden-store.js @@ -41,6 +41,7 @@ const actions = { }; }, receiveTheme( theme ) { + console.log('adtion receive theme', theme); return { type: 'RECEIVE_THEME', theme: theme, @@ -105,6 +106,9 @@ const selectors = { getIsOverlayOpen( state ) { return state.isOverlayOpen; }, + getThemeDetails( state ) { + return state.themeDetails; + }, }; const controls = { From 180d54eb54fe9aba1db4dfbd83fa4d8281a1d56a Mon Sep 17 00:00:00 2001 From: roccotrip Date: Tue, 3 Dec 2024 12:24:00 -0500 Subject: [PATCH 09/20] fix bug in search --- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- assets/js/src/components/theme-garden-filterbar.js | 3 ++- assets/js/src/components/theme-garden-store.js | 5 ++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index 45211aa..4d5902e 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b4e82ef1ee1e98b5a980'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '1e024abd0668511266b4'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index 5e19290..eff4d0b 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var m=e.n(l);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1,isOverlayOpen:!1,themeDetails:!1,isFetchingTheme:!1},h={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:e=>(console.log("adtion receive theme",e),{type:"RECEIVE_THEME",theme:e}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>m()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1};default:return e}},actions:h,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:l},themes:m,fetchThemes:c,receiveThemes:h,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(l),[T,p]=(0,a.useState)(m),b=(0,a.useRef)();(0,a.useEffect)((()=>{p(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",f),()=>{window.removeEventListener("popstate",f)})),[]);const w=async e=>{o();const t=await c(e);h(t)},f=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?g(a):(await w(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},T.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await w(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(b.current),g(a),b.current=setTimeout((async()=>{await(async e=>{o();const t=await i(e);h(t)})(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:t=>e("tumblr3/theme-garden-store").receiveTheme(t),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:l,beforeFetchTheme:m})=>{const[c,h]=(0,a.useState)(e);(0,a.useEffect)((()=>{h(e)}),[e]);const o=async({currentTarget:e})=>{m();const t=await l(e.value);n(t)};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===c.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:o,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,n.compose)((0,s.withSelect)((e=>({isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({isOverlayOpen:e,isFetchingTheme:s,closeOverlay:n,fetchTheme:l,themeDetails:m})=>{const c=(0,a.useCallback)((()=>{if(s||!m)return(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"}));const e={__html:m.description};return(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:m.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},m.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:e})))}),[m]);return e?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:n},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),c())):null})),p=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(T,null)))),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(p,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,l=window.wp.compose,n=window.wp.apiFetch;var m=e.n(n);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1,isOverlayOpen:!1,themeDetails:null,isFetchingTheme:!1},h={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:e=>({type:"RECEIVE_THEME",theme:e}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>m()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:h,selectors:o,controls:i});(0,s.register)(d);const u=(0,l.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:l,search:n},themes:m,fetchThemes:c,receiveThemes:h,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(n),[T,p]=(0,a.useState)(m),b=(0,a.useRef)();(0,a.useEffect)((()=>{p(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const w=async e=>{o();const t=await c(e);h(t)},f=async e=>{o();const t=await i(e);h(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?(await f(a),g(a)):(await w(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},T.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await w(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),l.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(b.current),g(a),b.current=setTimeout((async()=>{await f(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,l.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:t=>e("tumblr3/theme-garden-store").receiveTheme(t),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isFetchingThemes:s,receiveTheme:l,fetchTheme:n,beforeFetchTheme:m})=>{const[c,h]=(0,a.useState)(e);(0,a.useEffect)((()=>{h(e)}),[e]);const o=async({currentTarget:e})=>{m();const t=await n(e.value);l(t)};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===c.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:o,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,l.compose)((0,s.withSelect)((e=>({isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({isOverlayOpen:e,isFetchingTheme:s,closeOverlay:l,fetchTheme:n,themeDetails:m})=>{const c=(0,a.useCallback)((()=>{if(s||!m)return(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"}));const e={__html:m.description};return(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:m.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},m.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:e})))}),[m]);return e?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:l},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),c())):null})),p=(0,l.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(T,null)))),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(p,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-filterbar.js b/assets/js/src/components/theme-garden-filterbar.js index 81adb18..64f3b6b 100644 --- a/assets/js/src/components/theme-garden-filterbar.js +++ b/assets/js/src/components/theme-garden-filterbar.js @@ -78,7 +78,8 @@ const _ThemeGardenFilterBar = ( { const category = urlParams.get( 'category' ) || 'featured'; const searchParam = urlParams.get( 'search' ) || ''; if ( searchParam !== '' ) { - setSearch( searchParam ); + await fetchThemesByQuery( searchParam ); + setSearch(searchParam); } else { await fetchThemesByCategory( category ); setSelectedCategory( category ); diff --git a/assets/js/src/components/theme-garden-store.js b/assets/js/src/components/theme-garden-store.js index b4f888f..7eb9dab 100644 --- a/assets/js/src/components/theme-garden-store.js +++ b/assets/js/src/components/theme-garden-store.js @@ -13,7 +13,7 @@ const DEFAULT_STATE = { baseUrl: themeGardenData.baseUrl, // eslint-disable-line no-undef isFetchingThemes: false, isOverlayOpen: false, - themeDetails: false, + themeDetails: null, isFetchingTheme: false, }; @@ -28,7 +28,7 @@ const reducer = ( state = DEFAULT_STATE, action ) => { case 'RECEIVE_THEME': return { ...state, isFetchingTheme: false, themeDetails: action.theme }; case 'CLOSE_OVERLAY': - return { ...state, isOverlayOpen: false, isFetchingTheme: false }; + return { ...state, isOverlayOpen: false, isFetchingTheme: false, themeDetails: null }; default: return state; } @@ -41,7 +41,6 @@ const actions = { }; }, receiveTheme( theme ) { - console.log('adtion receive theme', theme); return { type: 'RECEIVE_THEME', theme: theme, From 075806f0be2796d58eb2115ef07b3aa0dca81464 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Tue, 3 Dec 2024 16:57:32 -0500 Subject: [PATCH 10/20] imporve url navigation --- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- .../src/components/theme-garden-filterbar.js | 5 ++-- assets/js/src/components/theme-garden-list.js | 15 ++++++++--- .../js/src/components/theme-garden-overlay.js | 25 +++++++++++++------ .../js/src/components/theme-garden-store.js | 21 +++++++--------- assets/js/src/theme-garden.js | 2 ++ src/ThemeGarden.php | 3 +++ 8 files changed, 48 insertions(+), 27 deletions(-) diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index 4d5902e..b352240 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '1e024abd0668511266b4'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'e4d3f47a3e149b0d6345'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index eff4d0b..0258c66 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,l=window.wp.compose,n=window.wp.apiFetch;var m=e.n(n);const c={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,isFetchingThemes:!1,isOverlayOpen:!1,themeDetails:null,isFetchingTheme:!1},h={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:e=>({type:"RECEIVE_THEME",theme:e}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>c.logoUrl,getInitialFilterBarProps:()=>({categories:c.categories,selectedCategory:c.selectedCategory,baseUrl:c.baseUrl,search:c.search}),getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>m()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>m()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:h,selectors:o,controls:i});(0,s.register)(d);const u=(0,l.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getInitialFilterBarProps(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:l,search:n},themes:m,fetchThemes:c,receiveThemes:h,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(n),[T,p]=(0,a.useState)(m),b=(0,a.useRef)();(0,a.useEffect)((()=>{p(m)}),[m]),(0,a.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const w=async e=>{o();const t=await c(e);h(t)},f=async e=>{o();const t=await i(e);h(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?(await f(a),g(a)):(await w(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},T.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await w(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),l.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;clearTimeout(b.current),g(a),b.current=setTimeout((async()=>{await f(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,l.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:t=>e("tumblr3/theme-garden-store").receiveTheme(t),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isFetchingThemes:s,receiveTheme:l,fetchTheme:n,beforeFetchTheme:m})=>{const[c,h]=(0,a.useState)(e);(0,a.useEffect)((()=>{h(e)}),[e]);const o=async({currentTarget:e})=>{m();const t=await n(e.value);l(t)};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===c.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:o,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,l.compose)((0,s.withSelect)((e=>({isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({isOverlayOpen:e,isFetchingTheme:s,closeOverlay:l,fetchTheme:n,themeDetails:m})=>{const c=(0,a.useCallback)((()=>{if(s||!m)return(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"}));const e={__html:m.description};return(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:m.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},m.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:e})))}),[m]);return e?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:l},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),c())):null})),p=(0,l.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(T,null)))),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(p,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,m=window.wp.apiFetch;var l=e.n(m);const h={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},c={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>h.logoUrl,getDefaultState:()=>h,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>l()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:c,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getDefaultState(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:m},themes:l,fetchThemes:h,receiveThemes:c,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(m),[T,w]=(0,a.useState)(l),p=(0,a.useRef)();(0,a.useEffect)((()=>{w(l)}),[l]),(0,a.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const b=async e=>{o();const t=await h(e);c(t)},f=async e=>{o();const t=await i(e);c(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?(await f(a),g(a)):(await b(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},T.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await b(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;g(a),clearTimeout(p.current),p.current=setTimeout((async()=>{await f(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes(),globals:e("tumblr3/theme-garden-store").getDefaultState()}))),(0,s.withDispatch)((e=>({receiveTheme:(t,a)=>e("tumblr3/theme-garden-store").receiveTheme(t,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:m,beforeFetchTheme:l})=>{const[h,c]=(0,a.useState)(e);(0,a.useEffect)((()=>{c(e)}),[e]);const o=async({currentTarget:e})=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),r=e.value;a.append("theme",r),t.search=a.toString(),l();const s=await m(r);n(s,r),window.history.pushState({},"",t.toString())};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===h.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:o,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:m,fetchTheme:l,themeDetails:h})=>{const[c,o]=(0,a.useState)(e);(0,a.useEffect)((()=>{o(e)}),[e]);const i=(0,a.useCallback)((()=>n||!h?(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:h.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},h.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:h.description}})))),[h]);return s?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),m()}},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),i())):null})),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(T,null)))),p=document.getElementById("tumblr-theme-garden");p?(0,a.createRoot)(p).render((0,t.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-filterbar.js b/assets/js/src/components/theme-garden-filterbar.js index 64f3b6b..b9887a7 100644 --- a/assets/js/src/components/theme-garden-filterbar.js +++ b/assets/js/src/components/theme-garden-filterbar.js @@ -96,8 +96,9 @@ const _ThemeGardenFilterBar = ( { const onChangeSearch = async ( { currentTarget } ) => { const newSearch = currentTarget.value; - clearTimeout( timerRef.current ); setSearch( newSearch ); + // Debounce so we don't send multiple requests while user is typing. + clearTimeout( timerRef.current ); timerRef.current = setTimeout( async () => { await fetchThemesByQuery( newSearch ); window.history.pushState( {}, '', baseUrl + '&search=' + newSearch ); @@ -145,7 +146,7 @@ const _ThemeGardenFilterBar = ( { export const ThemeGardenFilterBar = compose( withSelect( select => ( { - initialProps: select( 'tumblr3/theme-garden-store' ).getInitialFilterBarProps(), + initialProps: select( 'tumblr3/theme-garden-store' ).getDefaultState(), themes: select( 'tumblr3/theme-garden-store' ).getThemes(), } ) ), withDispatch( dispatch => ( { diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index 36a34b8..22599a9 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -26,9 +26,15 @@ const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme, fetchTheme, }, [ themes ] ); const handleDetailsClick = async ( { currentTarget } ) => { + const currentUrl = new URL(window.location.href); + const params = new URLSearchParams(currentUrl.search); + const themeId = currentTarget.value; + params.append('theme', themeId); + currentUrl.search = params.toString(); beforeFetchTheme(); - const response = await fetchTheme( currentTarget.value ); - receiveTheme( response ); + const response = await fetchTheme( themeId ); + receiveTheme( response, themeId ); + window.history.pushState( {}, '', currentUrl.toString() ); } if ( isFetchingThemes ) { @@ -72,10 +78,11 @@ export const ThemeGardenList = compose( withSelect(select => ({ themes: select('tumblr3/theme-garden-store').getThemes(), isFetchingThemes: select('tumblr3/theme-garden-store').getIsFetchingThemes(), + globals: select('tumblr3/theme-garden-store').getDefaultState(), })), withDispatch( dispatch => ( { - receiveTheme: ( theme ) => { - return dispatch( 'tumblr3/theme-garden-store' ).receiveTheme( theme ); + receiveTheme: ( theme, themeId ) => { + return dispatch( 'tumblr3/theme-garden-store' ).receiveTheme( theme, themeId ); }, beforeFetchTheme: () => { return dispatch( 'tumblr3/theme-garden-store' ).beforeFetchTheme(); diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js index 5251f9b..f5f2eef 100644 --- a/assets/js/src/components/theme-garden-overlay.js +++ b/assets/js/src/components/theme-garden-overlay.js @@ -1,4 +1,4 @@ -import { useCallback } from '@wordpress/element'; +import { useCallback, useState, useEffect } from '@wordpress/element'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { _x } from '@wordpress/i18n'; @@ -9,14 +9,26 @@ import { _x } from '@wordpress/i18n'; * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. * * @param {Object} props + * @param {Array} props.themes * @param {boolean} props.isOverlayOpen * @param {boolean} props.isFetchingTheme * @param {Function} props.closeOverlay * @param {Function} props.fetchTheme * @param {Object} props.themeDetails */ -const _ThemeGardenOverlay = ({isOverlayOpen, isFetchingTheme, closeOverlay, fetchTheme, themeDetails}) => { - const handleCloseOverlay = () => { +const _ThemeGardenOverlay = ({themes, isOverlayOpen, isFetchingTheme, closeOverlay, fetchTheme, themeDetails}) => { + const [ localThemes, setLocalThemes ] = useState( themes ); + + useEffect( () => { + setLocalThemes( themes ); + }, [ themes ] ); + + const handleCloseClick = () => { + const currentUrl = new URL(window.location.href); + const params = new URLSearchParams(currentUrl.search); + params.delete('theme'); + currentUrl.search = params.toString(); + window.history.pushState( {}, '', currentUrl.toString() ); closeOverlay(); } @@ -29,8 +41,6 @@ const _ThemeGardenOverlay = ({isOverlayOpen, isFetchingTheme, closeOverlay, fetc ); } - const description = { __html: themeDetails.description }; - return (
@@ -40,7 +50,7 @@ const _ThemeGardenOverlay = ({isOverlayOpen, isFetchingTheme, closeOverlay, fetc

{themeDetails.title}

-
+
); @@ -55,7 +65,7 @@ const _ThemeGardenOverlay = ({isOverlayOpen, isFetchingTheme, closeOverlay, fetc
-
{ renderThemeDetails() } @@ -66,6 +76,7 @@ const _ThemeGardenOverlay = ({isOverlayOpen, isFetchingTheme, closeOverlay, fetc export const ThemeGardenOverlay = compose( withSelect( select => ( { + themes: select('tumblr3/theme-garden-store').getThemes(), isOverlayOpen: select( 'tumblr3/theme-garden-store' ).getIsOverlayOpen(), isFetchingTheme: select( 'tumblr3/theme-garden-store' ).getIsFetchingTheme(), themeDetails: select( 'tumblr3/theme-garden-store' ).getThemeDetails(), diff --git a/assets/js/src/components/theme-garden-store.js b/assets/js/src/components/theme-garden-store.js index 7eb9dab..8db7e86 100644 --- a/assets/js/src/components/theme-garden-store.js +++ b/assets/js/src/components/theme-garden-store.js @@ -11,9 +11,10 @@ const DEFAULT_STATE = { selectedCategory: themeGardenData.selectedCategory, // eslint-disable-line no-undef search: themeGardenData.search, // eslint-disable-line no-undef baseUrl: themeGardenData.baseUrl, // eslint-disable-line no-undef + selectedThemeId: themeGardenData.selectedThemeId, // eslint-disable-line no-undef + themeDetails: themeGardenData.themeDetails, // eslint-disable-line no-undef isFetchingThemes: false, - isOverlayOpen: false, - themeDetails: null, + isOverlayOpen: !!themeGardenData.selectedThemeId, isFetchingTheme: false, }; @@ -26,7 +27,7 @@ const reducer = ( state = DEFAULT_STATE, action ) => { case 'RECEIVE_THEMES': return { ...state, themes: action.themes, isFetchingThemes: false }; case 'RECEIVE_THEME': - return { ...state, isFetchingTheme: false, themeDetails: action.theme }; + return { ...state, isFetchingTheme: false, themeDetails: action.theme, selectedThemeId: action.id }; case 'CLOSE_OVERLAY': return { ...state, isOverlayOpen: false, isFetchingTheme: false, themeDetails: null }; default: @@ -40,10 +41,11 @@ const actions = { type: 'CLOSE_OVERLAY' }; }, - receiveTheme( theme ) { + receiveTheme( theme, id ) { return { type: 'RECEIVE_THEME', - theme: theme, + theme, + id }; }, receiveThemes( themes ) { @@ -85,13 +87,8 @@ const selectors = { getLogoUrl() { return DEFAULT_STATE.logoUrl; }, - getInitialFilterBarProps() { - return { - categories: DEFAULT_STATE.categories, - selectedCategory: DEFAULT_STATE.selectedCategory, - baseUrl: DEFAULT_STATE.baseUrl, - search: DEFAULT_STATE.search, - }; + getDefaultState() { + return DEFAULT_STATE; }, getIsFetchingThemes( state ) { return state.isFetchingThemes; diff --git a/assets/js/src/theme-garden.js b/assets/js/src/theme-garden.js index 9f43a2c..61a104b 100644 --- a/assets/js/src/theme-garden.js +++ b/assets/js/src/theme-garden.js @@ -18,6 +18,7 @@ import {ThemeGardenOverlay} from "./components/theme-garden-overlay"; * @param {string} props.logoUrl */ const ThemeGarden = ( { logoUrl } ) => { + return (

@@ -34,6 +35,7 @@ const ThemeGarden = ( { logoUrl } ) => { export const ConnectedThemeGarden = compose( withSelect( select => ( { logoUrl: select( 'tumblr3/theme-garden-store' ).getLogoUrl(), + themes: select( 'tumblr3/theme-garden-store' ).getThemes(), } ) ) )( ThemeGarden ); diff --git a/src/ThemeGarden.php b/src/ThemeGarden.php index ae053ee..48f097e 100644 --- a/src/ThemeGarden.php +++ b/src/ThemeGarden.php @@ -83,6 +83,7 @@ public function enqueue_assets( string $hook ): void { $deps = tumblr3_get_asset_meta( TUMBLR3_PATH . 'assets/js/build/theme-garden.asset.php' ); $this->enqueue_admin_styles( $deps['version'] ); $themes_and_categories = $this->get_themes_and_categories(); + $theme_details = $this->selected_theme_id ? $this->get_theme($this->selected_theme_id) : null; wp_enqueue_script( 'tumblr-theme-garden', TUMBLR3_URL . 'assets/js/build/theme-garden.js', @@ -100,6 +101,8 @@ public function enqueue_assets( string $hook ): void { 'selectedCategory' => $this->selected_category, 'search' => $this->search, 'baseUrl' => admin_url( 'admin.php?page=tumblr-themes' ), + 'selectedThemeId' => $this->selected_theme_id, + 'themeDetails' => $theme_details, ) ), 'before' From 56b3dc6e808f564c7abd0a943273034025d34327 Mon Sep 17 00:00:00 2001 From: Aaron John-Baptiste Date: Wed, 4 Dec 2024 12:37:55 +0000 Subject: [PATCH 11/20] restrict render block hook to text post types only --- src/BlockExtensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BlockExtensions.php b/src/BlockExtensions.php index 4e32e7a..107d4ff 100644 --- a/src/BlockExtensions.php +++ b/src/BlockExtensions.php @@ -37,7 +37,7 @@ public function initialize( $is_tumblr3_active ): void { * @return string Modified block content. */ public function tumblr_audio_block_output( $block_content, $block ) { - if ( $block['blockName'] !== 'core/audio' ) { + if ( get_post_format() !== false && $block['blockName'] !== 'core/audio' ) { return $block_content; } From 1a81a0ee906b2fc7c7c844feeb72c9e76522f3f0 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Wed, 4 Dec 2024 09:50:47 -0500 Subject: [PATCH 12/20] basic navigation in overlay --- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- .../src/components/theme-garden-filterbar.js | 7 ++-- assets/js/src/components/theme-garden-list.js | 35 +++++++++++++++++-- .../js/src/components/theme-garden-overlay.js | 6 ---- .../js/src/components/theme-garden-store.js | 2 +- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index b352240..cdacf21 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'e4d3f47a3e149b0d6345'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '105462a053449c8acd62'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index 0258c66..e7013ec 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,m=window.wp.apiFetch;var l=e.n(m);const h={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},c={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>h.logoUrl,getDefaultState:()=>h,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>l()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:c,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getDefaultState(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:m},themes:l,fetchThemes:h,receiveThemes:c,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[E,g]=(0,a.useState)(m),[T,w]=(0,a.useState)(l),p=(0,a.useRef)();(0,a.useEffect)((()=>{w(l)}),[l]),(0,a.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const b=async e=>{o();const t=await h(e);c(t)},f=async e=>{o();const t=await i(e);c(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";""!==a?(await f(a),g(a)):(await b(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},T.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await b(a),u(a),g(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:E,onChange:async({currentTarget:t})=>{const a=t.value;g(a),clearTimeout(p.current),p.current=setTimeout((async()=>{await f(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),E=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},g=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes(),globals:e("tumblr3/theme-garden-store").getDefaultState()}))),(0,s.withDispatch)((e=>({receiveTheme:(t,a)=>e("tumblr3/theme-garden-store").receiveTheme(t,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:m,beforeFetchTheme:l})=>{const[h,c]=(0,a.useState)(e);(0,a.useEffect)((()=>{c(e)}),[e]);const o=async({currentTarget:e})=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),r=e.value;a.append("theme",r),t.search=a.toString(),l();const s=await m(r);n(s,r),window.history.pushState({},"",t.toString())};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===h.length?(0,t.createElement)(E,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:o,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:m,fetchTheme:l,themeDetails:h})=>{const[c,o]=(0,a.useState)(e);(0,a.useEffect)((()=>{o(e)}),[e]);const i=(0,a.useCallback)((()=>n||!h?(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:h.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},h.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:h.description}})))),[h]);return s?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),m()}},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),i())):null})),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(g,null),(0,t.createElement)(T,null)))),p=document.getElementById("tumblr-theme-garden");p?(0,a.createRoot)(p).render((0,t.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,m=window.wp.apiFetch;var l=e.n(m);const h={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},c={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>h.logoUrl,getDefaultState:()=>h,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>l()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:c,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getDefaultState(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:m},themes:l,fetchThemes:h,receiveThemes:c,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[g,E]=(0,a.useState)(m),[w,T]=(0,a.useState)(l),p=(0,a.useRef)();(0,a.useEffect)((()=>{T(l)}),[l]),(0,a.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const b=async e=>{o();const t=await h(e);c(t)},f=async e=>{o();const t=await i(e);c(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";console.info("detected browser navigation"),""!==a&&a!==g?(console.info("fetching themes by search"),await f(a),E(a)):""!==t&&t!==d&&(console.info("fetching themes by category"),await b(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},w.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await b(a),u(a),E(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:g,onChange:async({currentTarget:t})=>{const a=t.value;E(a),clearTimeout(p.current),p.current=setTimeout((async()=>{await f(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),g=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes(),globals:e("tumblr3/theme-garden-store").getDefaultState()}))),(0,s.withDispatch)((e=>({receiveTheme:(t,a)=>e("tumblr3/theme-garden-store").receiveTheme(t,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:m,beforeFetchTheme:l,closeOverlay:h})=>{const[c,o]=(0,a.useState)(e);(0,a.useEffect)((()=>{o(e)}),[e]),(0,a.useEffect)((()=>(window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i)})),[]);const i=async()=>{const e=new URLSearchParams(window.location.search).get("theme")||"";if(""!==e){l();const t=await m(e);n(t,e)}else h()},d=async({currentTarget:e})=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),r=e.value;a.append("theme",r),t.search=a.toString(),l();const s=await m(r);n(s,r),window.history.pushState({},"",t.toString())};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===c.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:d,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),w=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:m,fetchTheme:l,themeDetails:h})=>{const c=(0,a.useCallback)((()=>n||!h?(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:h.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},h.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:h.description}})))),[h]);return s?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),m()}},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),c())):null})),T=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(E,null),(0,t.createElement)(w,null)))),p=document.getElementById("tumblr-theme-garden");p?(0,a.createRoot)(p).render((0,t.createElement)(T,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-filterbar.js b/assets/js/src/components/theme-garden-filterbar.js index b9887a7..947d70e 100644 --- a/assets/js/src/components/theme-garden-filterbar.js +++ b/assets/js/src/components/theme-garden-filterbar.js @@ -77,10 +77,13 @@ const _ThemeGardenFilterBar = ( { const urlParams = new URLSearchParams( window.location.search ); const category = urlParams.get( 'category' ) || 'featured'; const searchParam = urlParams.get( 'search' ) || ''; - if ( searchParam !== '' ) { + console.info('detected browser navigation'); + if ( searchParam !== '' && searchParam !== search ) { + console.info('fetching themes by search'); await fetchThemesByQuery( searchParam ); setSearch(searchParam); - } else { + } else if ( category !== '' && category !== selectedCategory) { + console.info('fetching themes by category'); await fetchThemesByCategory( category ); setSelectedCategory( category ); } diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index 22599a9..24ca8b3 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -16,15 +16,43 @@ import './theme-garden-store'; * @param {Function} props.receiveTheme * @param {Function} props.fetchTheme * @param {Function} props.beforeFetchTheme + * @param {Function} props.closeOverlay * */ -const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme, fetchTheme, beforeFetchTheme } ) => { +const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme, fetchTheme, beforeFetchTheme, closeOverlay } ) => { const [ localThemes, setLocalThemes ] = useState( themes ); useEffect( () => { setLocalThemes( themes ); }, [ themes ] ); + /** + * Detect backwards and forwards browser navigation. + */ + useEffect( () => { + window.addEventListener( 'popstate', onBrowserNavigation ); + return () => { + window.removeEventListener( 'popstate', onBrowserNavigation ); + }; + }, [] ); + + /** + * After backwards or forwards navigation, check URL search params for indicators that we have to re-fetch themes. + * + * @return {Promise} + */ + const onBrowserNavigation = async () => { + const urlParams = new URLSearchParams( window.location.search ); + const theme = urlParams.get( 'theme' ) || ''; + if ( theme !== '' ) { + beforeFetchTheme(); + const response = await fetchTheme( theme ); + receiveTheme( response, theme ); + } else { + closeOverlay(); + } + }; + const handleDetailsClick = async ( { currentTarget } ) => { const currentUrl = new URL(window.location.href); const params = new URLSearchParams(currentUrl.search); @@ -89,6 +117,9 @@ export const ThemeGardenList = compose( }, fetchTheme: ( id ) => { return dispatch( 'tumblr3/theme-garden-store' ).fetchTheme( id ); - } + }, + closeOverlay: () => { + return dispatch( 'tumblr3/theme-garden-store' ).closeOverlay(); + }, } ) ) )(_ThemeGardenList); diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js index f5f2eef..5ce8d1a 100644 --- a/assets/js/src/components/theme-garden-overlay.js +++ b/assets/js/src/components/theme-garden-overlay.js @@ -17,12 +17,6 @@ import { _x } from '@wordpress/i18n'; * @param {Object} props.themeDetails */ const _ThemeGardenOverlay = ({themes, isOverlayOpen, isFetchingTheme, closeOverlay, fetchTheme, themeDetails}) => { - const [ localThemes, setLocalThemes ] = useState( themes ); - - useEffect( () => { - setLocalThemes( themes ); - }, [ themes ] ); - const handleCloseClick = () => { const currentUrl = new URL(window.location.href); const params = new URLSearchParams(currentUrl.search); diff --git a/assets/js/src/components/theme-garden-store.js b/assets/js/src/components/theme-garden-store.js index 8db7e86..a546ec7 100644 --- a/assets/js/src/components/theme-garden-store.js +++ b/assets/js/src/components/theme-garden-store.js @@ -14,7 +14,7 @@ const DEFAULT_STATE = { selectedThemeId: themeGardenData.selectedThemeId, // eslint-disable-line no-undef themeDetails: themeGardenData.themeDetails, // eslint-disable-line no-undef isFetchingThemes: false, - isOverlayOpen: !!themeGardenData.selectedThemeId, + isOverlayOpen: !!themeGardenData.selectedThemeId, // eslint-disable-line no-undef isFetchingTheme: false, }; From 4009805c2b0a4cf05ad7762df27ceb113324e94a Mon Sep 17 00:00:00 2001 From: Aaron John-Baptiste Date: Wed, 4 Dec 2024 15:43:05 +0000 Subject: [PATCH 13/20] removed todo - tumblr leaves markup in --- src/BlockExtensions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/BlockExtensions.php b/src/BlockExtensions.php index 107d4ff..8398857 100644 --- a/src/BlockExtensions.php +++ b/src/BlockExtensions.php @@ -54,7 +54,6 @@ public function tumblr_audio_block_output( $block_content, $block ) { $media_album = $attrs['mediaAlbum'] ?? ''; $poster_url = $attrs['poster']['url'] ?? ''; - // TODO verify how Tumblr handles missing attributes, it probably does not render empty spans $output = sprintf( '
From a79ba99a5d7409b6dc9898f4a5b10b18a3e41041 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Wed, 4 Dec 2024 15:15:31 -0500 Subject: [PATCH 14/20] recalibrating data flow --- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- .../src/components/theme-garden-filterbar.js | 130 ++++++------------ assets/js/src/components/theme-garden-list.js | 62 ++++++--- .../js/src/components/theme-garden-overlay.js | 63 +++++---- .../js/src/components/theme-garden-store.js | 49 +++++-- assets/js/src/theme-garden.js | 82 +++++++++-- 7 files changed, 228 insertions(+), 162 deletions(-) diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index cdacf21..dac5d83 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '105462a053449c8acd62'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b8b85a059ed18aaf1c1e'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index e7013ec..9b191b5 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,m=window.wp.apiFetch;var l=e.n(m);const h={logoUrl:themeGardenData.logoUrl,themes:themeGardenData.themes,categories:themeGardenData.categories,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,baseUrl:themeGardenData.baseUrl,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},c={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:e=>({type:"RECEIVE_THEMES",themes:e}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getLogoUrl:()=>h.logoUrl,getDefaultState:()=>h,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>l()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:c,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({initialProps:e("tumblr3/theme-garden-store").getDefaultState(),themes:e("tumblr3/theme-garden-store").getThemes()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:t=>e("tumblr3/theme-garden-store").receiveThemes(t)}))))((({initialProps:{baseUrl:e,selectedCategory:s,categories:n,search:m},themes:l,fetchThemes:h,receiveThemes:c,beforeFetchThemes:o,searchThemes:i})=>{const[d,u]=(0,a.useState)(s),[g,E]=(0,a.useState)(m),[w,T]=(0,a.useState)(l),p=(0,a.useRef)();(0,a.useEffect)((()=>{T(l)}),[l]),(0,a.useEffect)((()=>(window.addEventListener("popstate",y),()=>{window.removeEventListener("popstate",y)})),[]);const b=async e=>{o();const t=await h(e);c(t)},f=async e=>{o();const t=await i(e);c(t)},y=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";console.info("detected browser navigation"),""!==a&&a!==g?(console.info("fetching themes by search"),await f(a),E(a)):""!==t&&t!==d&&(console.info("fetching themes by category"),await b(t),u(t))};return(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},w.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;await b(a),u(a),E(""),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:d===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:g,onChange:async({currentTarget:t})=>{const a=t.value;E(a),clearTimeout(p.current),p.current=setTimeout((async()=>{await f(a),window.history.pushState({},"",e+"&search="+a),u("")}),500)}})))})),g=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes(),globals:e("tumblr3/theme-garden-store").getDefaultState()}))),(0,s.withDispatch)((e=>({receiveTheme:(t,a)=>e("tumblr3/theme-garden-store").receiveTheme(t,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:m,beforeFetchTheme:l,closeOverlay:h})=>{const[c,o]=(0,a.useState)(e);(0,a.useEffect)((()=>{o(e)}),[e]),(0,a.useEffect)((()=>(window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i)})),[]);const i=async()=>{const e=new URLSearchParams(window.location.search).get("theme")||"";if(""!==e){l();const t=await m(e);n(t,e)}else h()},d=async({currentTarget:e})=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),r=e.value;a.append("theme",r),t.search=a.toString(),l();const s=await m(r);n(s,r),window.history.pushState({},"",t.toString())};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===c.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:d,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),w=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t)}))))((({themes:e,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:m,fetchTheme:l,themeDetails:h})=>{const c=(0,a.useCallback)((()=>n||!h?(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:h.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},h.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:h.description}})))),[h]);return s?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),m()}},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),c())):null})),T=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({logoUrl:e})=>(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,null),(0,t.createElement)(E,null),(0,t.createElement)(w,null)))),p=document.getElementById("tumblr-theme-garden");p?(0,a.createRoot)(p).render((0,t.createElement)(T,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,m=window.wp.apiFetch;var l=e.n(m);const c={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},h={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,a)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:a}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getBaseUrl:()=>c.baseUrl,getCategories:()=>c.categories,getLogoUrl:()=>c.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>l()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:h,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:e,selectedCategory:s,categories:n,search:m,themes:l,fetchThemesByQuery:c,fetchThemesByCategory:h})=>{const[o,i]=(0,a.useState)(s),[d,u]=(0,a.useState)(m),[g,E]=(0,a.useState)(l),w=(0,a.useRef)();return(0,a.useEffect)((()=>{E(l)}),[l]),(0,a.useEffect)((()=>{i(s)}),[s]),(0,a.useEffect)((()=>{u(m)}),[m]),(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},g.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;i(a),await h(a),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:o===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:t})=>{const a=t.value;u(a),clearTimeout(w.current),w.current=setTimeout((async()=>{await c(a),window.history.pushState({},"",e+"&search="+a)}),500)}})))})),g=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:(t,a)=>e("tumblr3/theme-garden-store").receiveTheme(t,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:m,beforeFetchTheme:l,closeOverlay:c})=>{const[h,o]=(0,a.useState)(e);(0,a.useEffect)((()=>{o(e)}),[e]),(0,a.useEffect)((()=>(window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i)})),[]);const i=async()=>{const e=new URLSearchParams(window.location.search).get("theme")||"";if(""!==e){l();const t=await m(e);n(t,e)}else c()},d=async({currentTarget:e})=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),r=e.value;a.append("theme",r),t.search=a.toString(),l();const s=await m(r);n(s,r),window.history.pushState({},"",t.toString())};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===h.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:d,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),w=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:m,themeDetails:l})=>{const c=(0,a.useCallback)((()=>n||!l?(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:l.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},l.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:l.description}})))),[l,n]);return s?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),m()}},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),c())):null})),T=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,a,r)=>e("tumblr3/theme-garden-store").receiveThemes(t,a,r)}))))((({logoUrl:e,beforeFetchThemes:s,fetchThemes:n,receiveThemes:m,searchThemes:l})=>{(0,a.useEffect)((()=>(window.addEventListener("popstate",o),()=>{window.removeEventListener("popstate",o)})),[]);const c=async e=>{s();const t=await n(e);m(t,e,"")},h=async e=>{s();const t=await l(e);m(t,"",e)},o=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";console.info("detected browser navigation"),""!==a?(console.info("fetching themes by search"),await h(a)):""!==t&&(console.info("fetching themes by category"),await c(t))};return(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,{fetchThemesByCategory:c,fetchThemesByQuery:h}),(0,t.createElement)(E,null),(0,t.createElement)(w,null))})),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(T,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-filterbar.js b/assets/js/src/components/theme-garden-filterbar.js index 947d70e..fac720f 100644 --- a/assets/js/src/components/theme-garden-filterbar.js +++ b/assets/js/src/components/theme-garden-filterbar.js @@ -1,6 +1,6 @@ import { useState, useEffect, useRef } from '@wordpress/element'; import { _x } from '@wordpress/i18n'; -import { withDispatch, withSelect } from '@wordpress/data'; +import { withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import './theme-garden-store'; @@ -10,111 +10,68 @@ import './theme-garden-store'; * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. * * @param {Object} props - * @param {Object} props.initialProps - * @param {string} props.initialProps.baseUrl - * @param {string} props.initialProps.selectedCategory - * @param {Array} props.initialProps.categories - * @param {string } props.initialProps.search + * @param {string} props.baseUrl + * @param {string} props.selectedCategory + * @param {Array} props.categories + * @param {string } props.search * @param {Array} props.themes - * @param {Function} props.fetchThemes - * @param {Function} props.receiveThemes - * @param {Function} props.beforeFetchThemes - * @param {Function} props.searchThemes + * @param {Function} props.fetchThemesByCategory + * @param {Function} props.fetchThemesByQuery */ const _ThemeGardenFilterBar = ( { - initialProps: { - baseUrl, - selectedCategory: initialSelectedCategory, - categories, - search: initialSearch, - }, + baseUrl, + selectedCategory, + categories, + search, themes, - fetchThemes, - receiveThemes, - beforeFetchThemes, - searchThemes, + fetchThemesByQuery, + fetchThemesByCategory, } ) => { - const [ selectedCategory, setSelectedCategory ] = useState( initialSelectedCategory ); - const [ search, setSearch ] = useState( initialSearch ); - const [ themeList, setThemeList ] = useState( themes ); + const [ localSelectedCategory, setLocalSelectedCategory ] = useState( selectedCategory ); + const [ localSearch, setLocalSearch ] = useState( search ); + const [ localThemes, setLocalThemes ] = useState( themes ); const timerRef = useRef(); /** - * Whenever themes from the store change, re-render the component. + * Listeners to detect changes in the store, and update local state. + * Changes in the store will come from back/forward browser navigation which is handled in theme-garden.js. */ useEffect( () => { - setThemeList( themes ); + setLocalThemes( themes ); }, [ themes ] ); - - /** - * Detect backwards and forwards browser navigation. - */ useEffect( () => { - window.addEventListener( 'popstate', onBrowserNavigation ); - return () => { - window.removeEventListener( 'popstate', onBrowserNavigation ); - }; - }, [] ); - - const fetchThemesByCategory = async category => { - beforeFetchThemes(); - const response = await fetchThemes( category ); - receiveThemes( response ); - }; - - const fetchThemesByQuery = async newSearch => { - beforeFetchThemes(); - const response = await searchThemes( newSearch ); - receiveThemes( response ); - }; - - /** - * After backwards or forwards navigation, check URL search params for indicators that we have to re-fetch themes. - * - * @return {Promise} - */ - const onBrowserNavigation = async () => { - const urlParams = new URLSearchParams( window.location.search ); - const category = urlParams.get( 'category' ) || 'featured'; - const searchParam = urlParams.get( 'search' ) || ''; - console.info('detected browser navigation'); - if ( searchParam !== '' && searchParam !== search ) { - console.info('fetching themes by search'); - await fetchThemesByQuery( searchParam ); - setSearch(searchParam); - } else if ( category !== '' && category !== selectedCategory) { - console.info('fetching themes by category'); - await fetchThemesByCategory( category ); - setSelectedCategory( category ); - } - }; + setLocalSelectedCategory( selectedCategory ); + }, [ selectedCategory ] ); + useEffect( () => { + setLocalSearch( search ); + }, [ search ] ); const onChangeCategory = async ( { currentTarget } ) => { const newCategory = currentTarget.value; + setLocalSelectedCategory( newCategory ); await fetchThemesByCategory( newCategory ); - setSelectedCategory( newCategory ); - setSearch( '' ); window.history.pushState( {}, '', baseUrl + '&category=' + newCategory ); }; const onChangeSearch = async ( { currentTarget } ) => { const newSearch = currentTarget.value; - setSearch( newSearch ); + setLocalSearch( newSearch ); // Debounce so we don't send multiple requests while user is typing. clearTimeout( timerRef.current ); timerRef.current = setTimeout( async () => { await fetchThemesByQuery( newSearch ); window.history.pushState( {}, '', baseUrl + '&search=' + newSearch ); - setSelectedCategory( '' ); }, 500 ); }; return (
- { themeList.length } + { localThemes.length }
- +

- +

@@ -149,21 +108,10 @@ const _ThemeGardenFilterBar = ( { export const ThemeGardenFilterBar = compose( withSelect( select => ( { - initialProps: select( 'tumblr3/theme-garden-store' ).getDefaultState(), + baseUrl: select( 'tumblr3/theme-garden-store' ).getBaseUrl(), + selectedCategory: select( 'tumblr3/theme-garden-store' ).getSelectedCategory(), + categories: select( 'tumblr3/theme-garden-store' ).getCategories(), + search: select( 'tumblr3/theme-garden-store' ).getSearch(), themes: select( 'tumblr3/theme-garden-store' ).getThemes(), - } ) ), - withDispatch( dispatch => ( { - beforeFetchThemes: () => { - return dispatch( 'tumblr3/theme-garden-store' ).beforeFetchThemes(); - }, - fetchThemes: category => { - return dispatch( 'tumblr3/theme-garden-store' ).fetchThemes( category ); - }, - searchThemes: query => { - return dispatch( 'tumblr3/theme-garden-store' ).searchThemes( query ); - }, - receiveThemes: themes => { - return dispatch( 'tumblr3/theme-garden-store' ).receiveThemes( themes ); - }, } ) ) )( _ThemeGardenFilterBar ); diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index 24ca8b3..3e98f51 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -10,16 +10,22 @@ import './theme-garden-store'; * * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. * - * @param {Object} props - * @param {Array} props.themes - * @param {boolean} props.isFetchingThemes + * @param {Object} props + * @param {Array} props.themes + * @param {boolean} props.isFetchingThemes * @param {Function} props.receiveTheme * @param {Function} props.fetchTheme * @param {Function} props.beforeFetchTheme * @param {Function} props.closeOverlay - * */ -const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme, fetchTheme, beforeFetchTheme, closeOverlay } ) => { +const _ThemeGardenList = ( { + themes, + isFetchingThemes, + receiveTheme, + fetchTheme, + beforeFetchTheme, + closeOverlay, +} ) => { const [ localThemes, setLocalThemes ] = useState( themes ); useEffect( () => { @@ -54,16 +60,16 @@ const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme, fetchTheme, }; const handleDetailsClick = async ( { currentTarget } ) => { - const currentUrl = new URL(window.location.href); - const params = new URLSearchParams(currentUrl.search); + const currentUrl = new URL( window.location.href ); + const params = new URLSearchParams( currentUrl.search ); const themeId = currentTarget.value; - params.append('theme', themeId); + params.append( 'theme', themeId ); currentUrl.search = params.toString(); beforeFetchTheme(); const response = await fetchTheme( themeId ); receiveTheme( response, themeId ); window.history.pushState( {}, '', currentUrl.toString() ); - } + }; if ( isFetchingThemes ) { return ( @@ -87,27 +93,39 @@ const _ThemeGardenList = ( { themes, isFetchingThemes, receiveTheme, fetchTheme,
-
- ))} + ) ) }

); }; export const ThemeGardenList = compose( - withSelect(select => ({ - themes: select('tumblr3/theme-garden-store').getThemes(), - isFetchingThemes: select('tumblr3/theme-garden-store').getIsFetchingThemes(), - globals: select('tumblr3/theme-garden-store').getDefaultState(), - })), + withSelect( select => ( { + themes: select( 'tumblr3/theme-garden-store' ).getThemes(), + isFetchingThemes: select( 'tumblr3/theme-garden-store' ).getIsFetchingThemes(), + } ) ), withDispatch( dispatch => ( { receiveTheme: ( theme, themeId ) => { return dispatch( 'tumblr3/theme-garden-store' ).receiveTheme( theme, themeId ); @@ -115,11 +133,11 @@ export const ThemeGardenList = compose( beforeFetchTheme: () => { return dispatch( 'tumblr3/theme-garden-store' ).beforeFetchTheme(); }, - fetchTheme: ( id ) => { + fetchTheme: id => { return dispatch( 'tumblr3/theme-garden-store' ).fetchTheme( id ); }, closeOverlay: () => { return dispatch( 'tumblr3/theme-garden-store' ).closeOverlay(); }, } ) ) -)(_ThemeGardenList); +)( _ThemeGardenList ); diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js index 5ce8d1a..46968dc 100644 --- a/assets/js/src/components/theme-garden-overlay.js +++ b/assets/js/src/components/theme-garden-overlay.js @@ -1,4 +1,4 @@ -import { useCallback, useState, useEffect } from '@wordpress/element'; +import { useCallback } from '@wordpress/element'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { _x } from '@wordpress/i18n'; @@ -8,26 +8,31 @@ import { _x } from '@wordpress/i18n'; * * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. * - * @param {Object} props - * @param {Array} props.themes - * @param {boolean} props.isOverlayOpen - * @param {boolean} props.isFetchingTheme + * @param {Object} props + * @param {Array} props.themes + * @param {boolean} props.isOverlayOpen + * @param {boolean} props.isFetchingTheme * @param {Function} props.closeOverlay - * @param {Function} props.fetchTheme - * @param {Object} props.themeDetails + * @param {Object} props.themeDetails */ -const _ThemeGardenOverlay = ({themes, isOverlayOpen, isFetchingTheme, closeOverlay, fetchTheme, themeDetails}) => { +const _ThemeGardenOverlay = ( { + themes, + isOverlayOpen, + isFetchingTheme, + closeOverlay, + themeDetails, +} ) => { const handleCloseClick = () => { - const currentUrl = new URL(window.location.href); - const params = new URLSearchParams(currentUrl.search); - params.delete('theme'); + const currentUrl = new URL( window.location.href ); + const params = new URLSearchParams( currentUrl.search ); + params.delete( 'theme' ); currentUrl.search = params.toString(); window.history.pushState( {}, '', currentUrl.toString() ); closeOverlay(); - } + }; - const renderThemeDetails = useCallback(() => { - if( isFetchingTheme || !themeDetails ) { + const renderThemeDetails = useCallback( () => { + if ( isFetchingTheme || ! themeDetails ) { return (
@@ -39,18 +44,18 @@ const _ThemeGardenOverlay = ({themes, isOverlayOpen, isFetchingTheme, closeOverl
- +
-

{themeDetails.title}

-
+

{ themeDetails.title }

+
); - }, [themeDetails] ); + }, [ themeDetails, isFetchingTheme ] ); - if (!isOverlayOpen) { + if ( ! isOverlayOpen ) { return null; } @@ -59,18 +64,25 @@ const _ThemeGardenOverlay = ({themes, isOverlayOpen, isFetchingTheme, closeOverl
- +
{ renderThemeDetails() }
- ) -} + ); +}; export const ThemeGardenOverlay = compose( withSelect( select => ( { - themes: select('tumblr3/theme-garden-store').getThemes(), + themes: select( 'tumblr3/theme-garden-store' ).getThemes(), isOverlayOpen: select( 'tumblr3/theme-garden-store' ).getIsOverlayOpen(), isFetchingTheme: select( 'tumblr3/theme-garden-store' ).getIsFetchingTheme(), themeDetails: select( 'tumblr3/theme-garden-store' ).getThemeDetails(), @@ -79,8 +91,5 @@ export const ThemeGardenOverlay = compose( closeOverlay: () => { return dispatch( 'tumblr3/theme-garden-store' ).closeOverlay(); }, - fetchTheme: ( id ) => { - return dispatch( 'tumblr3/theme-garden-store' ).fetchTheme( id ); - }, } ) ) )( _ThemeGardenOverlay ); diff --git a/assets/js/src/components/theme-garden-store.js b/assets/js/src/components/theme-garden-store.js index a546ec7..1ab58c1 100644 --- a/assets/js/src/components/theme-garden-store.js +++ b/assets/js/src/components/theme-garden-store.js @@ -5,16 +5,19 @@ import { createReduxStore, register } from '@wordpress/data'; * Default state is loaded from an inline script declared in ThemeGarden.php. */ const DEFAULT_STATE = { + // The following properties are static and will not change. logoUrl: themeGardenData.logoUrl, // eslint-disable-line no-undef - themes: themeGardenData.themes, // eslint-disable-line no-undef categories: themeGardenData.categories, // eslint-disable-line no-undef + baseUrl: themeGardenData.baseUrl, // eslint-disable-line no-undef + + // The following properties will change during usage of the app. + themes: themeGardenData.themes, // eslint-disable-line no-undef selectedCategory: themeGardenData.selectedCategory, // eslint-disable-line no-undef search: themeGardenData.search, // eslint-disable-line no-undef - baseUrl: themeGardenData.baseUrl, // eslint-disable-line no-undef selectedThemeId: themeGardenData.selectedThemeId, // eslint-disable-line no-undef themeDetails: themeGardenData.themeDetails, // eslint-disable-line no-undef isFetchingThemes: false, - isOverlayOpen: !!themeGardenData.selectedThemeId, // eslint-disable-line no-undef + isOverlayOpen: !! themeGardenData.selectedThemeId, // eslint-disable-line no-undef isFetchingTheme: false, }; @@ -23,11 +26,22 @@ const reducer = ( state = DEFAULT_STATE, action ) => { case 'BEFORE_FETCH_THEMES': return { ...state, isFetchingThemes: true }; case 'BEFORE_FETCH_THEME': - return { ...state, isFetchingTheme: true, isOverlayOpen: true, }; + return { ...state, isFetchingTheme: true, isOverlayOpen: true }; case 'RECEIVE_THEMES': - return { ...state, themes: action.themes, isFetchingThemes: false }; + return { + ...state, + themes: action.themes, + isFetchingThemes: false, + selectedCategory: action.category, + search: action.search, + }; case 'RECEIVE_THEME': - return { ...state, isFetchingTheme: false, themeDetails: action.theme, selectedThemeId: action.id }; + return { + ...state, + isFetchingTheme: false, + themeDetails: action.theme, + selectedThemeId: action.id, + }; case 'CLOSE_OVERLAY': return { ...state, isOverlayOpen: false, isFetchingTheme: false, themeDetails: null }; default: @@ -38,20 +52,22 @@ const reducer = ( state = DEFAULT_STATE, action ) => { const actions = { closeOverlay() { return { - type: 'CLOSE_OVERLAY' + type: 'CLOSE_OVERLAY', }; }, receiveTheme( theme, id ) { return { type: 'RECEIVE_THEME', theme, - id + id, }; }, - receiveThemes( themes ) { + receiveThemes( themes, category, search ) { return { type: 'RECEIVE_THEMES', themes, + category, + search, }; }, beforeFetchTheme() { @@ -80,15 +96,24 @@ const actions = { } catch ( error ) { throw new Error( 'Failed to fetch theme' ); } - } + }, }; const selectors = { + getBaseUrl() { + return DEFAULT_STATE.baseUrl; + }, + getCategories() { + return DEFAULT_STATE.categories; + }, getLogoUrl() { return DEFAULT_STATE.logoUrl; }, - getDefaultState() { - return DEFAULT_STATE; + getSelectedCategory( state ) { + return state.selectedCategory; + }, + getSearch( state ) { + return state.search; }, getIsFetchingThemes( state ) { return state.isFetchingThemes; diff --git a/assets/js/src/theme-garden.js b/assets/js/src/theme-garden.js index 61a104b..d3fa6ab 100644 --- a/assets/js/src/theme-garden.js +++ b/assets/js/src/theme-garden.js @@ -1,11 +1,11 @@ -import { createRoot } from '@wordpress/element'; +import { createRoot, useEffect } from '@wordpress/element'; import { ThemeGardenFilterBar } from './components/theme-garden-filterbar'; import { ThemeGardenList } from './components/theme-garden-list'; import { __ } from '@wordpress/i18n'; -import { withSelect } from '@wordpress/data'; +import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import './components/theme-garden-store'; -import {ThemeGardenOverlay} from "./components/theme-garden-overlay"; +import { ThemeGardenOverlay } from './components/theme-garden-overlay'; /** * ThemeGarden Component @@ -14,10 +14,60 @@ import {ThemeGardenOverlay} from "./components/theme-garden-overlay"; * * CSS classNames reference built-in wp-admin styles, and styles declared in _theme_garden.scss. * - * @param {Object} props - * @param {string} props.logoUrl + * @param {Object} props + * @param {string} props.logoUrl + * @param {Function} props.beforeFetchThemes + * @param {Function} props.fetchThemes + * @param {Function} props.receiveThemes + * @param {Function} props.searchThemes */ -const ThemeGarden = ( { logoUrl } ) => { +const ThemeGarden = ( { + logoUrl, + beforeFetchThemes, + fetchThemes, + receiveThemes, + searchThemes, +} ) => { + /** + * Detect backwards and forwards browser navigation. + */ + useEffect( () => { + window.addEventListener( 'popstate', onBrowserNavigation ); + return () => { + window.removeEventListener( 'popstate', onBrowserNavigation ); + }; + }, [] ); + + const fetchThemesByCategory = async category => { + beforeFetchThemes(); + const response = await fetchThemes( category ); + receiveThemes( response, category, '' ); + }; + + const fetchThemesByQuery = async newSearch => { + beforeFetchThemes(); + const response = await searchThemes( newSearch ); + receiveThemes( response, '', newSearch ); + }; + + /** + * After backwards or forwards navigation, check URL search params for indicators that we have to re-fetch themes. + * + * @return {Promise} + */ + const onBrowserNavigation = async () => { + const urlParams = new URLSearchParams( window.location.search ); + const category = urlParams.get( 'category' ) || 'featured'; + const searchParam = urlParams.get( 'search' ) || ''; + console.info( 'detected browser navigation' ); + if ( searchParam !== '' ) { + console.info( 'fetching themes by search' ); + await fetchThemesByQuery( searchParam ); + } else if ( category !== '' ) { + console.info( 'fetching themes by category' ); + await fetchThemesByCategory( category ); + } + }; return (
@@ -25,7 +75,10 @@ const ThemeGarden = ( { logoUrl } ) => { { __( 'Tumblr Themes', 'tumblr3' ) } - +
@@ -35,7 +88,20 @@ const ThemeGarden = ( { logoUrl } ) => { export const ConnectedThemeGarden = compose( withSelect( select => ( { logoUrl: select( 'tumblr3/theme-garden-store' ).getLogoUrl(), - themes: select( 'tumblr3/theme-garden-store' ).getThemes(), + } ) ), + withDispatch( dispatch => ( { + beforeFetchThemes: () => { + return dispatch( 'tumblr3/theme-garden-store' ).beforeFetchThemes(); + }, + fetchThemes: category => { + return dispatch( 'tumblr3/theme-garden-store' ).fetchThemes( category ); + }, + searchThemes: query => { + return dispatch( 'tumblr3/theme-garden-store' ).searchThemes( query ); + }, + receiveThemes: ( themes, category, search ) => { + return dispatch( 'tumblr3/theme-garden-store' ).receiveThemes( themes, category, search ); + }, } ) ) )( ThemeGarden ); From 7a71dfaeea313093a91c0f59c97a331e53b4973c Mon Sep 17 00:00:00 2001 From: roccotrip Date: Wed, 4 Dec 2024 16:00:06 -0500 Subject: [PATCH 15/20] recalibrating data flow --- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- assets/js/src/components/theme-garden-list.js | 53 ++----------------- assets/js/src/theme-garden.js | 38 ++++++++++++- 4 files changed, 43 insertions(+), 52 deletions(-) diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index dac5d83..ad3b8f7 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b8b85a059ed18aaf1c1e'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '1f911498d33866a42f1f'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index 9b191b5..6087a54 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,m=window.wp.apiFetch;var l=e.n(m);const c={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},h={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,a)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:a}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getBaseUrl:()=>c.baseUrl,getCategories:()=>c.categories,getLogoUrl:()=>c.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>l()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=c,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:h,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:e,selectedCategory:s,categories:n,search:m,themes:l,fetchThemesByQuery:c,fetchThemesByCategory:h})=>{const[o,i]=(0,a.useState)(s),[d,u]=(0,a.useState)(m),[g,E]=(0,a.useState)(l),w=(0,a.useRef)();return(0,a.useEffect)((()=>{E(l)}),[l]),(0,a.useEffect)((()=>{i(s)}),[s]),(0,a.useEffect)((()=>{u(m)}),[m]),(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},g.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;i(a),await h(a),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:o===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:t})=>{const a=t.value;u(a),clearTimeout(w.current),w.current=setTimeout((async()=>{await c(a),window.history.pushState({},"",e+"&search="+a)}),500)}})))})),g=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({receiveTheme:(t,a)=>e("tumblr3/theme-garden-store").receiveTheme(t,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isFetchingThemes:s,receiveTheme:n,fetchTheme:m,beforeFetchTheme:l,closeOverlay:c})=>{const[h,o]=(0,a.useState)(e);(0,a.useEffect)((()=>{o(e)}),[e]),(0,a.useEffect)((()=>(window.addEventListener("popstate",i),()=>{window.removeEventListener("popstate",i)})),[]);const i=async()=>{const e=new URLSearchParams(window.location.search).get("theme")||"";if(""!==e){l();const t=await m(e);n(t,e)}else c()},d=async({currentTarget:e})=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),r=e.value;a.append("theme",r),t.search=a.toString(),l();const s=await m(r);n(s,r),window.history.pushState({},"",t.toString())};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===h.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:d,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),w=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:m,themeDetails:l})=>{const c=(0,a.useCallback)((()=>n||!l?(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:l.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},l.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:l.description}})))),[l,n]);return s?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),m()}},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),c())):null})),T=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,a,r)=>e("tumblr3/theme-garden-store").receiveThemes(t,a,r)}))))((({logoUrl:e,beforeFetchThemes:s,fetchThemes:n,receiveThemes:m,searchThemes:l})=>{(0,a.useEffect)((()=>(window.addEventListener("popstate",o),()=>{window.removeEventListener("popstate",o)})),[]);const c=async e=>{s();const t=await n(e);m(t,e,"")},h=async e=>{s();const t=await l(e);m(t,"",e)},o=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"";console.info("detected browser navigation"),""!==a?(console.info("fetching themes by search"),await h(a)):""!==t&&(console.info("fetching themes by category"),await c(t))};return(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,{fetchThemesByCategory:c,fetchThemesByQuery:h}),(0,t.createElement)(E,null),(0,t.createElement)(w,null))})),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(T,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,m=window.wp.apiFetch;var l=e.n(m);const h={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},c={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,a)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:a}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getBaseUrl:()=>h.baseUrl,getCategories:()=>h.categories,getLogoUrl:()=>h.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>l()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:c,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:e,selectedCategory:s,categories:n,search:m,themes:l,fetchThemesByQuery:h,fetchThemesByCategory:c})=>{const[o,i]=(0,a.useState)(s),[d,u]=(0,a.useState)(m),[g,E]=(0,a.useState)(l),T=(0,a.useRef)();return(0,a.useEffect)((()=>{E(l)}),[l]),(0,a.useEffect)((()=>{i(s)}),[s]),(0,a.useEffect)((()=>{u(m)}),[m]),(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},g.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;i(a),await c(a),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:o===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:t})=>{const a=t.value;u(a),clearTimeout(T.current),T.current=setTimeout((async()=>{await h(a),window.history.pushState({},"",e+"&search="+a)}),500)}})))})),g=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isFetchingThemes:s,fetchThemeById:n})=>{const[m,l]=(0,a.useState)(e);(0,a.useEffect)((()=>{l(e)}),[e]);const h=async({currentTarget:{value:e}})=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search);a.append("theme",e),t.search=a.toString(),await n(e),window.history.pushState({},"",t.toString())};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===m.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:h,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:m,themeDetails:l})=>{const h=(0,a.useCallback)((()=>n||!l?(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:l.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},l.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:l.description}})))),[l,n]);return s?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),m()}},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),h())):null})),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,a,r)=>e("tumblr3/theme-garden-store").receiveThemes(t,a,r),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),receiveTheme:(t,a)=>e("tumblr3/theme-garden-store").receiveTheme(t,a),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({logoUrl:e,beforeFetchThemes:s,fetchThemes:n,receiveThemes:m,searchThemes:l,beforeFetchTheme:h,fetchTheme:c,receiveTheme:o,closeOverlay:i})=>{(0,a.useEffect)((()=>(window.addEventListener("popstate",w),()=>{window.removeEventListener("popstate",w)})),[]);const d=async e=>{s();const t=await n(e);m(t,e,"")},g=async e=>{s();const t=await l(e);m(t,"",e)},w=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"",r=e.get("theme")||"";if(console.info("detected browser navigation"),""!==a?(console.info("fetching themes by search"),await g(a)):""!==t&&(console.info("fetching themes by category"),await d(t)),""!==r){h();const e=await c(r);o(e,r)}else i()};return(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,{fetchThemesByCategory:d,fetchThemesByQuery:g}),(0,t.createElement)(E,{fetchThemeById:async e=>{h();const t=await c(e);o(t,e)}}),(0,t.createElement)(T,null))})),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index 3e98f51..6de388b 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -13,18 +13,12 @@ import './theme-garden-store'; * @param {Object} props * @param {Array} props.themes * @param {boolean} props.isFetchingThemes - * @param {Function} props.receiveTheme - * @param {Function} props.fetchTheme - * @param {Function} props.beforeFetchTheme - * @param {Function} props.closeOverlay + * @param {Function} props.fetchThemeById */ const _ThemeGardenList = ( { themes, isFetchingThemes, - receiveTheme, - fetchTheme, - beforeFetchTheme, - closeOverlay, + fetchThemeById } ) => { const [ localThemes, setLocalThemes ] = useState( themes ); @@ -32,42 +26,12 @@ const _ThemeGardenList = ( { setLocalThemes( themes ); }, [ themes ] ); - /** - * Detect backwards and forwards browser navigation. - */ - useEffect( () => { - window.addEventListener( 'popstate', onBrowserNavigation ); - return () => { - window.removeEventListener( 'popstate', onBrowserNavigation ); - }; - }, [] ); - - /** - * After backwards or forwards navigation, check URL search params for indicators that we have to re-fetch themes. - * - * @return {Promise} - */ - const onBrowserNavigation = async () => { - const urlParams = new URLSearchParams( window.location.search ); - const theme = urlParams.get( 'theme' ) || ''; - if ( theme !== '' ) { - beforeFetchTheme(); - const response = await fetchTheme( theme ); - receiveTheme( response, theme ); - } else { - closeOverlay(); - } - }; - - const handleDetailsClick = async ( { currentTarget } ) => { + const handleDetailsClick = async ( { currentTarget: {value: themeId} } ) => { const currentUrl = new URL( window.location.href ); const params = new URLSearchParams( currentUrl.search ); - const themeId = currentTarget.value; params.append( 'theme', themeId ); currentUrl.search = params.toString(); - beforeFetchTheme(); - const response = await fetchTheme( themeId ); - receiveTheme( response, themeId ); + await fetchThemeById(themeId) window.history.pushState( {}, '', currentUrl.toString() ); }; @@ -127,15 +91,6 @@ export const ThemeGardenList = compose( isFetchingThemes: select( 'tumblr3/theme-garden-store' ).getIsFetchingThemes(), } ) ), withDispatch( dispatch => ( { - receiveTheme: ( theme, themeId ) => { - return dispatch( 'tumblr3/theme-garden-store' ).receiveTheme( theme, themeId ); - }, - beforeFetchTheme: () => { - return dispatch( 'tumblr3/theme-garden-store' ).beforeFetchTheme(); - }, - fetchTheme: id => { - return dispatch( 'tumblr3/theme-garden-store' ).fetchTheme( id ); - }, closeOverlay: () => { return dispatch( 'tumblr3/theme-garden-store' ).closeOverlay(); }, diff --git a/assets/js/src/theme-garden.js b/assets/js/src/theme-garden.js index d3fa6ab..86a0f72 100644 --- a/assets/js/src/theme-garden.js +++ b/assets/js/src/theme-garden.js @@ -20,6 +20,10 @@ import { ThemeGardenOverlay } from './components/theme-garden-overlay'; * @param {Function} props.fetchThemes * @param {Function} props.receiveThemes * @param {Function} props.searchThemes + * @param {Function} props.beforeFetchTheme + * @param {Function} props.fetchTheme + * @param {Function} props.receiveTheme + * @param {Function} props.closeOverlay */ const ThemeGarden = ( { logoUrl, @@ -27,6 +31,10 @@ const ThemeGarden = ( { fetchThemes, receiveThemes, searchThemes, + beforeFetchTheme, + fetchTheme, + receiveTheme, + closeOverlay } ) => { /** * Detect backwards and forwards browser navigation. @@ -50,6 +58,12 @@ const ThemeGarden = ( { receiveThemes( response, '', newSearch ); }; + const fetchThemeById = async themeId => { + beforeFetchTheme(); + const response = await fetchTheme(themeId); + receiveTheme( response, themeId ); + } + /** * After backwards or forwards navigation, check URL search params for indicators that we have to re-fetch themes. * @@ -59,6 +73,8 @@ const ThemeGarden = ( { const urlParams = new URLSearchParams( window.location.search ); const category = urlParams.get( 'category' ) || 'featured'; const searchParam = urlParams.get( 'search' ) || ''; + const theme = urlParams.get( 'theme' ) || ''; + console.info( 'detected browser navigation' ); if ( searchParam !== '' ) { console.info( 'fetching themes by search' ); @@ -67,6 +83,14 @@ const ThemeGarden = ( { console.info( 'fetching themes by category' ); await fetchThemesByCategory( category ); } + + if ( theme !== '' ) { + beforeFetchTheme(); + const response = await fetchTheme( theme ); + receiveTheme( response, theme ); + } else { + closeOverlay(); + } }; return ( @@ -79,7 +103,7 @@ const ThemeGarden = ( { fetchThemesByCategory={ fetchThemesByCategory } fetchThemesByQuery={ fetchThemesByQuery } /> - +
); @@ -102,6 +126,18 @@ export const ConnectedThemeGarden = compose( receiveThemes: ( themes, category, search ) => { return dispatch( 'tumblr3/theme-garden-store' ).receiveThemes( themes, category, search ); }, + beforeFetchTheme: () => { + return dispatch( 'tumblr3/theme-garden-store' ).beforeFetchTheme(); + }, + fetchTheme: id => { + return dispatch( 'tumblr3/theme-garden-store' ).fetchTheme( id ); + }, + receiveTheme: ( theme, themeId ) => { + return dispatch( 'tumblr3/theme-garden-store' ).receiveTheme( theme, themeId ); + }, + closeOverlay: () => { + return dispatch( 'tumblr3/theme-garden-store' ).closeOverlay(); + }, } ) ) )( ThemeGarden ); From 266f77a73c6df3454f7c9aa75a0cb4221879f7b5 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Wed, 4 Dec 2024 16:40:07 -0500 Subject: [PATCH 16/20] ui for back and forward --- assets/css/build/admin.css | 2 +- assets/css/build/themes.css | 2 +- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- .../js/src/components/theme-garden-overlay.js | 61 ++++++++++++++----- package-lock.json | 7 +++ package.json | 1 + 7 files changed, 59 insertions(+), 18 deletions(-) diff --git a/assets/css/build/admin.css b/assets/css/build/admin.css index f7b7492..f535d10 100644 --- a/assets/css/build/admin.css +++ b/assets/css/build/admin.css @@ -269,4 +269,4 @@ body.admin-color-sunrise { #tumblr-no-themes { display: block; } -/*# sourceMappingURL=admin.css.map */ \ No newline at end of file +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9hZG1pbi9fdGhlbWVfZ2FyZGVuLnNjc3MiLCIuLi9zcmMvYWRtaW4uc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2QkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0Esd0JBQUE7RUFDQSxrQkFBQTtFQUNBLHNCQUFBO0VBQ0EsaUJBQUE7RUFDQSxvQkFBQTtFQUNBLG9CQUFBO0VBQ0EsbUJBQUE7RUFDQSxvQkFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0EsZUFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLGtCQUFBO0FDNUJEOztBRCtCQTtFQUNDLHFCQUFBO0VBQ0EsdUJBQUE7RUFDQSxrQkFBQTtBQzVCRDs7QUQrQkE7RUFDQyxxQkFBQTtFQUNBLHVCQUFBO0VBQ0Esa0JBQUE7QUM1QkQ7O0FEK0JBO0VBQ0MscUJBQUE7RUFDQSx1QkFBQTtFQUNBLGtCQUFBO0FDNUJEOztBRCtCQTtFQUNDLHFCQUFBO0VBQ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SksXG5cdFx0XHR2YXIoLS10My15ZWxsb3cpLFxuXHRcdFx0dmFyKC0tdDMtZ3JlZW4pLFxuXHRcdFx0dmFyKC0tdDMtdmlvbGV0KSxcblx0XHRcdHZhcigtLXQzLXJlZCkgNTAlXG5cdCk7XG59XG5cbi50dW1ibHItdGhlbWUtZ2FyZGVuLWxpbms6aG92ZXIge1xuXHRhbmltYXRpb246IHBsYXkgMS41cyBsaW5lYXIgaW5maW5pdGU7XG59XG5cbiN0dW1ibHItbm8tdGhlbWVzIHtcblx0ZGlzcGxheTogYmxvY2s7XG59XG4iLCJAaW1wb3J0IFwiYWRtaW4vdGhlbWVfZ2FyZGVuXCI7XG4iXX0= */ \ No newline at end of file diff --git a/assets/css/build/themes.css b/assets/css/build/themes.css index 5f40f52..a9e34ec 100644 --- a/assets/css/build/themes.css +++ b/assets/css/build/themes.css @@ -16,4 +16,4 @@ right: 8px; border-radius: 99px; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy90aGVtZXMuc2NzcyUyM3Nhc3MiLCIuLi9zcmMvdGhlbWVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUM7RUFDQyxpQkFBQTtFQ0RELFlBQUE7QUFDRDtBRElDO0VDRkEsV0FBQTtFRElDLGtCQUFBO0VDRkQsd0RBQUE7RURJQyxzQkFBQTtFQUNBLFdBQUE7RUFDQSxZQUFBO0VBQ0EscUJBQUE7RUFDQSw0QkFBQTtFQUNBLDJCQUFBO0VBQ0EsUUFBQTtFQUNBLFVBQUE7RUFDQSxtQkFBQTtBQ0ZGIiwiZmlsZSI6InRoZW1lcy5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIudGhlbWUtYnJvd3NlciAudGhlbWVbZGF0YS1zbHVnPVwidHVtYmxyM1wiXSB7XG5cblx0LnRoZW1lLXNjcmVlbnNob3QgaW1nIHtcblx0XHRvYmplY3QtZml0OiBjb3Zlcj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hweDtcblx0XHRyaWdodDogOHB4O1xuXHRcdGJvcmRlci1yYWRpdXM6IDk5cHg7XG5cdH1cbn1cbiJdfQ== */ \ No newline at end of file +/*# sourceMappingURL=themes.css.map */ \ No newline at end of file diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index ad3b8f7..bc1aadc 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '1f911498d33866a42f1f'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b158660030d9e8299e0b'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index 6087a54..89aa3cd 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{"use strict";var e={n:t=>{var a=t&&t.__esModule?()=>t.default:()=>t;return e.d(a,{a}),a},d:(t,a)=>{for(var r in a)e.o(a,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:a[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,a=window.wp.element,r=window.wp.i18n,s=window.wp.data,n=window.wp.compose,m=window.wp.apiFetch;var l=e.n(m);const h={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},c={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,a)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:a}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getBaseUrl:()=>h.baseUrl,getCategories:()=>h.categories,getLogoUrl:()=>h.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>l()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>l()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:c,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:e,selectedCategory:s,categories:n,search:m,themes:l,fetchThemesByQuery:h,fetchThemesByCategory:c})=>{const[o,i]=(0,a.useState)(s),[d,u]=(0,a.useState)(m),[g,E]=(0,a.useState)(l),T=(0,a.useRef)();return(0,a.useEffect)((()=>{E(l)}),[l]),(0,a.useEffect)((()=>{i(s)}),[s]),(0,a.useEffect)((()=>{u(m)}),[m]),(0,t.createElement)("div",{className:"wp-filter"},(0,t.createElement)("div",{className:"filter-count"},(0,t.createElement)("span",{className:"count"},g.length)),(0,t.createElement)("label",{htmlFor:"t3-categories"},(0,r._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,t.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:t})=>{const a=t.value;i(a),await c(a),window.history.pushState({},"",e+"&category="+a)}},(0,t.createElement)("option",{value:"featured"},(0,r._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((e=>(0,t.createElement)("option",{key:e.text_key,value:e.text_key,selected:o===e.text_key},e.name)))),(0,t.createElement)("p",{className:"search-box"},(0,t.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,r._x)("Search Themes","label for a text input","tumblr3")),(0,t.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:t})=>{const a=t.value;u(a),clearTimeout(T.current),T.current=setTimeout((async()=>{await h(a),window.history.pushState({},"",e+"&search="+a)}),500)}})))})),g=()=>{const e=[(0,r._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,r._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],a=Math.floor(Math.random()*e.length);return(0,t.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},e[a])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isFetchingThemes:s,fetchThemeById:n})=>{const[m,l]=(0,a.useState)(e);(0,a.useEffect)((()=>{l(e)}),[e]);const h=async({currentTarget:{value:e}})=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search);a.append("theme",e),t.search=a.toString(),await n(e),window.history.pushState({},"",t.toString())};return s?(0,t.createElement)("div",{className:"loading-content"},(0,t.createElement)("span",{className:"spinner"})):0===m.length?(0,t.createElement)(g,null):(0,t.createElement)("div",{className:"tumblr-themes"},e.map((e=>(0,t.createElement)("article",{className:"tumblr-theme",key:e.title},(0,t.createElement)("header",{className:"tumblr-theme-header"},(0,t.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,t.createElement)("span",{className:"tumblr-theme-title"},e.title))),(0,t.createElement)("div",{className:"tumblr-theme-content"},(0,t.createElement)("button",{className:"tumblr-theme-details",onClick:h,value:e.id},(0,t.createElement)("label",null,(0,t.createElement)("span",{className:"tumblr-theme-detail-button"},(0,r._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,t.createElement)("img",{src:e.thumbnail,alt:""})),(0,t.createElement)("div",{className:"tumblr-theme-footer"},(0,t.createElement)("a",{className:"rainbow-button",href:e.activate_url},"Activate")))))))})),T=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:e,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:m,themeDetails:l})=>{const h=(0,a.useCallback)((()=>n||!l?(0,t.createElement)("div",{className:"loading-content wp-clearfix"},(0,t.createElement)("span",{className:"spinner"})):(0,t.createElement)("div",{className:"theme-about wp-clearfix"},(0,t.createElement)("div",{className:"theme-screenshots"},(0,t.createElement)("div",{className:"screenshot"},(0,t.createElement)("img",{src:l.screenshots[0],alt:""}))),(0,t.createElement)("div",{className:"theme-info"},(0,t.createElement)("h2",{className:"theme-name"},l.title),(0,t.createElement)("div",{dangerouslySetInnerHTML:{__html:l.description}})))),[l,n]);return s?(0,t.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,t.createElement)("div",{className:"theme-backdrop"}),(0,t.createElement)("div",{className:"theme-wrap wp-clearfix"},(0,t.createElement)("div",{className:"theme-header"},(0,t.createElement)("button",{className:"close dashicons dashicons-no",onClick:()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),m()}},(0,t.createElement)("span",{className:"screen-reader-text"},(0,r._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3")))),h())):null})),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,a,r)=>e("tumblr3/theme-garden-store").receiveThemes(t,a,r),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),receiveTheme:(t,a)=>e("tumblr3/theme-garden-store").receiveTheme(t,a),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({logoUrl:e,beforeFetchThemes:s,fetchThemes:n,receiveThemes:m,searchThemes:l,beforeFetchTheme:h,fetchTheme:c,receiveTheme:o,closeOverlay:i})=>{(0,a.useEffect)((()=>(window.addEventListener("popstate",w),()=>{window.removeEventListener("popstate",w)})),[]);const d=async e=>{s();const t=await n(e);m(t,e,"")},g=async e=>{s();const t=await l(e);m(t,"",e)},w=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",a=e.get("search")||"",r=e.get("theme")||"";if(console.info("detected browser navigation"),""!==a?(console.info("fetching themes by search"),await g(a)):""!==t&&(console.info("fetching themes by category"),await d(t)),""!==r){h();const e=await c(r);o(e,r)}else i()};return(0,t.createElement)("div",{className:"wrap"},(0,t.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,t.createElement)("img",{className:"tumblr-logo-icon",src:e,alt:""}),(0,t.createElement)("span",null,(0,r.__)("Tumblr Themes","tumblr3"))),(0,t.createElement)(u,{fetchThemesByCategory:d,fetchThemesByQuery:g}),(0,t.createElement)(E,{fetchThemeById:async e=>{h();const t=await c(e);o(t,e)}}),(0,t.createElement)(T,null))})),b=document.getElementById("tumblr-theme-garden");b?(0,a.createRoot)(b).render((0,t.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})(); \ No newline at end of file +(()=>{var e={942:(e,t)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function s(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.element,a=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var c=r.n(l);const m={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},o={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,r)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:r}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},h={getBaseUrl:()=>m.baseUrl,getCategories:()=>m.categories,getLogoUrl:()=>m.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>c()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=m,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:o,selectors:h,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:r,selectedCategory:s,categories:n,search:l,themes:c,fetchThemesByQuery:m,fetchThemesByCategory:o})=>{const[h,i]=(0,t.useState)(s),[d,u]=(0,t.useState)(l),[g,E]=(0,t.useState)(c),b=(0,t.useRef)();return(0,t.useEffect)((()=>{E(c)}),[c]),(0,t.useEffect)((()=>{i(s)}),[s]),(0,t.useEffect)((()=>{u(l)}),[l]),(0,e.createElement)("div",{className:"wp-filter"},(0,e.createElement)("div",{className:"filter-count"},(0,e.createElement)("span",{className:"count"},g.length)),(0,e.createElement)("label",{htmlFor:"t3-categories"},(0,a._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,e.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:e})=>{const t=e.value;i(t),await o(t),window.history.pushState({},"",r+"&category="+t)}},(0,e.createElement)("option",{value:"featured"},(0,a._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((t=>(0,e.createElement)("option",{key:t.text_key,value:t.text_key,selected:h===t.text_key},t.name)))),(0,e.createElement)("p",{className:"search-box"},(0,e.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,a._x)("Search Themes","label for a text input","tumblr3")),(0,e.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:e})=>{const t=e.value;u(t),clearTimeout(b.current),b.current=setTimeout((async()=>{await m(t),window.history.pushState({},"",r+"&search="+t)}),500)}})))})),g=()=>{const t=[(0,a._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],r=Math.floor(Math.random()*t.length);return(0,e.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},t[r])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isFetchingThemes:s,fetchThemeById:n})=>{const[l,c]=(0,t.useState)(r);(0,t.useEffect)((()=>{c(r)}),[r]);const m=async({currentTarget:{value:e}})=>{const t=new URL(window.location.href),r=new URLSearchParams(t.search);r.append("theme",e),t.search=r.toString(),await n(e),window.history.pushState({},"",t.toString())};return s?(0,e.createElement)("div",{className:"loading-content"},(0,e.createElement)("span",{className:"spinner"})):0===l.length?(0,e.createElement)(g,null):(0,e.createElement)("div",{className:"tumblr-themes"},r.map((t=>(0,e.createElement)("article",{className:"tumblr-theme",key:t.title},(0,e.createElement)("header",{className:"tumblr-theme-header"},(0,e.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,e.createElement)("span",{className:"tumblr-theme-title"},t.title))),(0,e.createElement)("div",{className:"tumblr-theme-content"},(0,e.createElement)("button",{className:"tumblr-theme-details",onClick:m,value:t.id},(0,e.createElement)("label",null,(0,e.createElement)("span",{className:"tumblr-theme-detail-button"},(0,a._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,e.createElement)("img",{src:t.thumbnail,alt:""})),(0,e.createElement)("div",{className:"tumblr-theme-footer"},(0,e.createElement)("a",{className:"rainbow-button",href:t.activate_url},"Activate")))))))}));var b=r(942),p=r.n(b);const T=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:l,themeDetails:c})=>{const m=()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),l()},o=(0,t.useCallback)((()=>n||!c?(0,e.createElement)("div",{className:"loading-content wp-clearfix"},(0,e.createElement)("span",{className:"spinner"})):(0,e.createElement)("div",{className:"theme-about wp-clearfix"},(0,e.createElement)("div",{className:"theme-screenshots"},(0,e.createElement)("div",{className:"screenshot"},(0,e.createElement)("img",{src:c.screenshots[0],alt:""}))),(0,e.createElement)("div",{className:"theme-info"},(0,e.createElement)("h2",{className:"theme-name"},c.title),(0,e.createElement)("div",{dangerouslySetInnerHTML:{__html:c.description}})))),[c,n]),h=(0,t.useCallback)((()=>{const t=r.findIndex((e=>e.id===c.id)),s=!t||0===t,n=t===r.length-1;return(0,e.createElement)("div",{className:"theme-header"},(0,e.createElement)("button",{className:p()("left","dashicons","dashicons-no",{disabled:s}),disabled:s},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show previous theme","label for a button that will navigate to previous theme","tumblr3"))),(0,e.createElement)("button",{className:p()("right","dashicons","dashicons-no",{disabled:n}),disabled:n},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show next theme","label for a button that will navigate to next theme","tumblr3"))),(0,e.createElement)("button",{className:"close dashicons dashicons-no",onClick:m},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3"))))}),[c,r]);return s&&c?(0,e.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,e.createElement)("div",{className:"theme-backdrop"}),(0,e.createElement)("div",{className:"theme-wrap wp-clearfix"},h(),o())):null})),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,r,a)=>e("tumblr3/theme-garden-store").receiveThemes(t,r,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),receiveTheme:(t,r)=>e("tumblr3/theme-garden-store").receiveTheme(t,r),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({logoUrl:r,beforeFetchThemes:s,fetchThemes:n,receiveThemes:l,searchThemes:c,beforeFetchTheme:m,fetchTheme:o,receiveTheme:h,closeOverlay:i})=>{(0,t.useEffect)((()=>(window.addEventListener("popstate",b),()=>{window.removeEventListener("popstate",b)})),[]);const d=async e=>{s();const t=await n(e);l(t,e,"")},g=async e=>{s();const t=await c(e);l(t,"",e)},b=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",r=e.get("search")||"",a=e.get("theme")||"";if(console.info("detected browser navigation"),""!==r?(console.info("fetching themes by search"),await g(r)):""!==t&&(console.info("fetching themes by category"),await d(t)),""!==a){m();const e=await o(a);h(e,a)}else i()};return(0,e.createElement)("div",{className:"wrap"},(0,e.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,e.createElement)("img",{className:"tumblr-logo-icon",src:r,alt:""}),(0,e.createElement)("span",null,(0,a.__)("Tumblr Themes","tumblr3"))),(0,e.createElement)(u,{fetchThemesByCategory:d,fetchThemesByQuery:g}),(0,e.createElement)(E,{fetchThemeById:async e=>{m();const t=await o(e);h(t,e)}}),(0,e.createElement)(T,null))})),f=document.getElementById("tumblr-theme-garden");f?(0,t.createRoot)(f).render((0,e.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})()})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js index 46968dc..46bd8bb 100644 --- a/assets/js/src/components/theme-garden-overlay.js +++ b/assets/js/src/components/theme-garden-overlay.js @@ -1,7 +1,8 @@ -import { useCallback } from '@wordpress/element'; +import { useCallback, useState } from '@wordpress/element'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { _x } from '@wordpress/i18n'; +import classNames from "classnames"; /** * Displays an overlay with details about a Tumblr theme. @@ -22,6 +23,7 @@ const _ThemeGardenOverlay = ( { closeOverlay, themeDetails, } ) => { + const handleCloseClick = () => { const currentUrl = new URL( window.location.href ); const params = new URLSearchParams( currentUrl.search ); @@ -55,7 +57,48 @@ const _ThemeGardenOverlay = ( { ); }, [ themeDetails, isFetchingTheme ] ); - if ( ! isOverlayOpen ) { + const renderThemeHeader = useCallback( () => { + const currentIndex = themes.findIndex((theme) => theme.id === themeDetails.id ); + const prevButtonDisabled = !currentIndex || currentIndex === 0; + const nextButtonDisabled = currentIndex === themes.length - 1; + + + return ( +
+ + + +
+ ); + }, [themeDetails, themes]); + + if (!isOverlayOpen || !themeDetails) { return null; } @@ -63,18 +106,8 @@ const _ThemeGardenOverlay = ( {
-
- -
- { renderThemeDetails() } + {renderThemeHeader()} + {renderThemeDetails()}
); diff --git a/package-lock.json b/package-lock.json index 5e16499..ddc0b19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "GPL-2.0-or-later", "dependencies": { "@gsap/react": "^2.1.1", + "classnames": "^2.5.1", "gsap": "^3.12.5", "use-debounce": "^10.0.4" }, @@ -5743,6 +5744,12 @@ "dev": true, "license": "MIT" }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "license": "MIT" + }, "node_modules/clean-webpack-plugin": { "version": "3.0.0", "dev": true, diff --git a/package.json b/package.json index 7e27756..746f14e 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ }, "dependencies": { "@gsap/react": "^2.1.1", + "classnames": "^2.5.1", "gsap": "^3.12.5", "use-debounce": "^10.0.4" } From 15ac382dd0661dfe9d0fb53e4bcb5bf078213151 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Wed, 4 Dec 2024 16:52:10 -0500 Subject: [PATCH 17/20] got that sweet, sweet theme navigation --- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- assets/js/src/components/theme-garden-list.js | 2 +- .../js/src/components/theme-garden-overlay.js | 26 ++++++++++++++++--- assets/js/src/theme-garden.js | 2 +- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index bc1aadc..bf9ea71 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => 'b158660030d9e8299e0b'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '3e584c9691d73221dbf1'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index 89aa3cd..b8e1803 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{var e={942:(e,t)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function s(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.element,a=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var c=r.n(l);const m={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},o={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,r)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:r}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},h={getBaseUrl:()=>m.baseUrl,getCategories:()=>m.categories,getLogoUrl:()=>m.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>c()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=m,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:o,selectors:h,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:r,selectedCategory:s,categories:n,search:l,themes:c,fetchThemesByQuery:m,fetchThemesByCategory:o})=>{const[h,i]=(0,t.useState)(s),[d,u]=(0,t.useState)(l),[g,E]=(0,t.useState)(c),b=(0,t.useRef)();return(0,t.useEffect)((()=>{E(c)}),[c]),(0,t.useEffect)((()=>{i(s)}),[s]),(0,t.useEffect)((()=>{u(l)}),[l]),(0,e.createElement)("div",{className:"wp-filter"},(0,e.createElement)("div",{className:"filter-count"},(0,e.createElement)("span",{className:"count"},g.length)),(0,e.createElement)("label",{htmlFor:"t3-categories"},(0,a._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,e.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:e})=>{const t=e.value;i(t),await o(t),window.history.pushState({},"",r+"&category="+t)}},(0,e.createElement)("option",{value:"featured"},(0,a._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((t=>(0,e.createElement)("option",{key:t.text_key,value:t.text_key,selected:h===t.text_key},t.name)))),(0,e.createElement)("p",{className:"search-box"},(0,e.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,a._x)("Search Themes","label for a text input","tumblr3")),(0,e.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:e})=>{const t=e.value;u(t),clearTimeout(b.current),b.current=setTimeout((async()=>{await m(t),window.history.pushState({},"",r+"&search="+t)}),500)}})))})),g=()=>{const t=[(0,a._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],r=Math.floor(Math.random()*t.length);return(0,e.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},t[r])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isFetchingThemes:s,fetchThemeById:n})=>{const[l,c]=(0,t.useState)(r);(0,t.useEffect)((()=>{c(r)}),[r]);const m=async({currentTarget:{value:e}})=>{const t=new URL(window.location.href),r=new URLSearchParams(t.search);r.append("theme",e),t.search=r.toString(),await n(e),window.history.pushState({},"",t.toString())};return s?(0,e.createElement)("div",{className:"loading-content"},(0,e.createElement)("span",{className:"spinner"})):0===l.length?(0,e.createElement)(g,null):(0,e.createElement)("div",{className:"tumblr-themes"},r.map((t=>(0,e.createElement)("article",{className:"tumblr-theme",key:t.title},(0,e.createElement)("header",{className:"tumblr-theme-header"},(0,e.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,e.createElement)("span",{className:"tumblr-theme-title"},t.title))),(0,e.createElement)("div",{className:"tumblr-theme-content"},(0,e.createElement)("button",{className:"tumblr-theme-details",onClick:m,value:t.id},(0,e.createElement)("label",null,(0,e.createElement)("span",{className:"tumblr-theme-detail-button"},(0,a._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,e.createElement)("img",{src:t.thumbnail,alt:""})),(0,e.createElement)("div",{className:"tumblr-theme-footer"},(0,e.createElement)("a",{className:"rainbow-button",href:t.activate_url},"Activate")))))))}));var b=r(942),p=r.n(b);const T=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:l,themeDetails:c})=>{const m=()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),l()},o=(0,t.useCallback)((()=>n||!c?(0,e.createElement)("div",{className:"loading-content wp-clearfix"},(0,e.createElement)("span",{className:"spinner"})):(0,e.createElement)("div",{className:"theme-about wp-clearfix"},(0,e.createElement)("div",{className:"theme-screenshots"},(0,e.createElement)("div",{className:"screenshot"},(0,e.createElement)("img",{src:c.screenshots[0],alt:""}))),(0,e.createElement)("div",{className:"theme-info"},(0,e.createElement)("h2",{className:"theme-name"},c.title),(0,e.createElement)("div",{dangerouslySetInnerHTML:{__html:c.description}})))),[c,n]),h=(0,t.useCallback)((()=>{const t=r.findIndex((e=>e.id===c.id)),s=!t||0===t,n=t===r.length-1;return(0,e.createElement)("div",{className:"theme-header"},(0,e.createElement)("button",{className:p()("left","dashicons","dashicons-no",{disabled:s}),disabled:s},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show previous theme","label for a button that will navigate to previous theme","tumblr3"))),(0,e.createElement)("button",{className:p()("right","dashicons","dashicons-no",{disabled:n}),disabled:n},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show next theme","label for a button that will navigate to next theme","tumblr3"))),(0,e.createElement)("button",{className:"close dashicons dashicons-no",onClick:m},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3"))))}),[c,r]);return s&&c?(0,e.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,e.createElement)("div",{className:"theme-backdrop"}),(0,e.createElement)("div",{className:"theme-wrap wp-clearfix"},h(),o())):null})),w=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,r,a)=>e("tumblr3/theme-garden-store").receiveThemes(t,r,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),receiveTheme:(t,r)=>e("tumblr3/theme-garden-store").receiveTheme(t,r),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({logoUrl:r,beforeFetchThemes:s,fetchThemes:n,receiveThemes:l,searchThemes:c,beforeFetchTheme:m,fetchTheme:o,receiveTheme:h,closeOverlay:i})=>{(0,t.useEffect)((()=>(window.addEventListener("popstate",b),()=>{window.removeEventListener("popstate",b)})),[]);const d=async e=>{s();const t=await n(e);l(t,e,"")},g=async e=>{s();const t=await c(e);l(t,"",e)},b=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",r=e.get("search")||"",a=e.get("theme")||"";if(console.info("detected browser navigation"),""!==r?(console.info("fetching themes by search"),await g(r)):""!==t&&(console.info("fetching themes by category"),await d(t)),""!==a){m();const e=await o(a);h(e,a)}else i()};return(0,e.createElement)("div",{className:"wrap"},(0,e.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,e.createElement)("img",{className:"tumblr-logo-icon",src:r,alt:""}),(0,e.createElement)("span",null,(0,a.__)("Tumblr Themes","tumblr3"))),(0,e.createElement)(u,{fetchThemesByCategory:d,fetchThemesByQuery:g}),(0,e.createElement)(E,{fetchThemeById:async e=>{m();const t=await o(e);h(t,e)}}),(0,e.createElement)(T,null))})),f=document.getElementById("tumblr-theme-garden");f?(0,t.createRoot)(f).render((0,e.createElement)(w,null)):console.error("Failed to find the root element for the settings panel.")})()})(); \ No newline at end of file +(()=>{var e={942:(e,t)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function s(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.element,a=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var c=r.n(l);const h={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},o={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,r)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:r}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},m={getBaseUrl:()=>h.baseUrl,getCategories:()=>h.categories,getLogoUrl:()=>h.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>c()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:o,selectors:m,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:r,selectedCategory:s,categories:n,search:l,themes:c,fetchThemesByQuery:h,fetchThemesByCategory:o})=>{const[m,i]=(0,t.useState)(s),[d,u]=(0,t.useState)(l),[g,E]=(0,t.useState)(c),p=(0,t.useRef)();return(0,t.useEffect)((()=>{E(c)}),[c]),(0,t.useEffect)((()=>{i(s)}),[s]),(0,t.useEffect)((()=>{u(l)}),[l]),(0,e.createElement)("div",{className:"wp-filter"},(0,e.createElement)("div",{className:"filter-count"},(0,e.createElement)("span",{className:"count"},g.length)),(0,e.createElement)("label",{htmlFor:"t3-categories"},(0,a._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,e.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:e})=>{const t=e.value;i(t),await o(t),window.history.pushState({},"",r+"&category="+t)}},(0,e.createElement)("option",{value:"featured"},(0,a._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((t=>(0,e.createElement)("option",{key:t.text_key,value:t.text_key,selected:m===t.text_key},t.name)))),(0,e.createElement)("p",{className:"search-box"},(0,e.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,a._x)("Search Themes","label for a text input","tumblr3")),(0,e.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:e})=>{const t=e.value;u(t),clearTimeout(p.current),p.current=setTimeout((async()=>{await h(t),window.history.pushState({},"",r+"&search="+t)}),500)}})))})),g=()=>{const t=[(0,a._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],r=Math.floor(Math.random()*t.length);return(0,e.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},t[r])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isFetchingThemes:s,fetchThemeById:n})=>{const[l,c]=(0,t.useState)(r);(0,t.useEffect)((()=>{c(r)}),[r]);const h=async({currentTarget:{value:e}})=>{const t=new URL(window.location.href),r=new URLSearchParams(t.search);r.append("theme",e),t.search=r.toString(),await n(e),window.history.pushState({},"",t.toString())};return s?(0,e.createElement)("div",{className:"loading-content"},(0,e.createElement)("span",{className:"spinner"})):0===l.length?(0,e.createElement)(g,null):(0,e.createElement)("div",{className:"tumblr-themes"},r.map((t=>(0,e.createElement)("article",{className:"tumblr-theme",key:t.title},(0,e.createElement)("header",{className:"tumblr-theme-header"},(0,e.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,e.createElement)("span",{className:"tumblr-theme-title"},t.title))),(0,e.createElement)("div",{className:"tumblr-theme-content"},(0,e.createElement)("button",{className:"tumblr-theme-details",onClick:h,value:t.id},(0,e.createElement)("label",null,(0,e.createElement)("span",{className:"tumblr-theme-detail-button"},(0,a._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,e.createElement)("img",{src:t.thumbnail,alt:""})),(0,e.createElement)("div",{className:"tumblr-theme-footer"},(0,e.createElement)("a",{className:"rainbow-button",href:t.activate_url},"Activate")))))))}));var p=r(942),b=r.n(p);const w=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:l,themeDetails:c,fetchThemeById:h})=>{const o=()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),l()},m=(0,t.useCallback)((()=>n||!c?(0,e.createElement)("div",{className:"loading-content wp-clearfix"},(0,e.createElement)("span",{className:"spinner"})):(0,e.createElement)("div",{className:"theme-about wp-clearfix"},(0,e.createElement)("div",{className:"theme-screenshots"},(0,e.createElement)("div",{className:"screenshot"},(0,e.createElement)("img",{src:c.screenshots[0],alt:""}))),(0,e.createElement)("div",{className:"theme-info"},(0,e.createElement)("h2",{className:"theme-name"},c.title),(0,e.createElement)("div",{dangerouslySetInnerHTML:{__html:c.description}})))),[c,n]),i=(0,t.useCallback)((async e=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),s=r[e].id;a.delete("theme"),a.append("theme",s),t.search=a.toString(),await h(s),window.history.pushState({},"",t.toString())}),[r]),d=(0,t.useCallback)((()=>{const t=r.findIndex((e=>e.id===c.id)),s=!t||0===t,n=t===r.length-1;return(0,e.createElement)("div",{className:"theme-header"},(0,e.createElement)("button",{className:b()("left","dashicons","dashicons-no",{disabled:s}),disabled:s,onClick:()=>i(t-1)},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show previous theme","label for a button that will navigate to previous theme","tumblr3"))),(0,e.createElement)("button",{className:b()("right","dashicons","dashicons-no",{disabled:n}),disabled:n,onClick:()=>i(t+1)},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show next theme","label for a button that will navigate to next theme","tumblr3"))),(0,e.createElement)("button",{className:"close dashicons dashicons-no",onClick:o},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3"))))}),[c,r,i]);return s&&c?(0,e.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,e.createElement)("div",{className:"theme-backdrop"}),(0,e.createElement)("div",{className:"theme-wrap wp-clearfix"},d(),m())):null})),T=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,r,a)=>e("tumblr3/theme-garden-store").receiveThemes(t,r,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),receiveTheme:(t,r)=>e("tumblr3/theme-garden-store").receiveTheme(t,r),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({logoUrl:r,beforeFetchThemes:s,fetchThemes:n,receiveThemes:l,searchThemes:c,beforeFetchTheme:h,fetchTheme:o,receiveTheme:m,closeOverlay:i})=>{(0,t.useEffect)((()=>(window.addEventListener("popstate",b),()=>{window.removeEventListener("popstate",b)})),[]);const d=async e=>{s();const t=await n(e);l(t,e,"")},g=async e=>{s();const t=await c(e);l(t,"",e)},p=async e=>{h();const t=await o(e);m(t,e)},b=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",r=e.get("search")||"",a=e.get("theme")||"";if(console.info("detected browser navigation"),""!==r?(console.info("fetching themes by search"),await g(r)):""!==t&&(console.info("fetching themes by category"),await d(t)),""!==a){h();const e=await o(a);m(e,a)}else i()};return(0,e.createElement)("div",{className:"wrap"},(0,e.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,e.createElement)("img",{className:"tumblr-logo-icon",src:r,alt:""}),(0,e.createElement)("span",null,(0,a.__)("Tumblr Themes","tumblr3"))),(0,e.createElement)(u,{fetchThemesByCategory:d,fetchThemesByQuery:g}),(0,e.createElement)(E,{fetchThemeById:p}),(0,e.createElement)(w,{fetchThemeById:p}))})),f=document.getElementById("tumblr-theme-garden");f?(0,t.createRoot)(f).render((0,e.createElement)(T,null)):console.error("Failed to find the root element for the settings panel.")})()})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index 6de388b..2023497 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -18,7 +18,7 @@ import './theme-garden-store'; const _ThemeGardenList = ( { themes, isFetchingThemes, - fetchThemeById + fetchThemeById } ) => { const [ localThemes, setLocalThemes ] = useState( themes ); diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js index 46bd8bb..4839b4c 100644 --- a/assets/js/src/components/theme-garden-overlay.js +++ b/assets/js/src/components/theme-garden-overlay.js @@ -15,6 +15,7 @@ import classNames from "classnames"; * @param {boolean} props.isFetchingTheme * @param {Function} props.closeOverlay * @param {Object} props.themeDetails + * @param {Function} props.fetchThemeById */ const _ThemeGardenOverlay = ( { themes, @@ -22,6 +23,7 @@ const _ThemeGardenOverlay = ( { isFetchingTheme, closeOverlay, themeDetails, + fetchThemeById, } ) => { const handleCloseClick = () => { @@ -57,17 +59,29 @@ const _ThemeGardenOverlay = ( { ); }, [ themeDetails, isFetchingTheme ] ); + const onClickNavigate = useCallback( async (nextIndex) => { + const currentUrl = new URL( window.location.href ); + const params = new URLSearchParams( currentUrl.search ); + const nextId = themes[nextIndex].id; + params.delete( 'theme' ); + params.append( 'theme', nextId); + currentUrl.search = params.toString(); + await fetchThemeById( nextId ); + window.history.pushState( {}, '', currentUrl.toString() ); + }, [themes] ) + const renderThemeHeader = useCallback( () => { const currentIndex = themes.findIndex((theme) => theme.id === themeDetails.id ); const prevButtonDisabled = !currentIndex || currentIndex === 0; const nextButtonDisabled = currentIndex === themes.length - 1; - return (
-
); - }, [themeDetails, themes]); + }, [themeDetails, themes, onClickNavigate]); if (!isOverlayOpen || !themeDetails) { return null; diff --git a/assets/js/src/theme-garden.js b/assets/js/src/theme-garden.js index 86a0f72..e2ed2f2 100644 --- a/assets/js/src/theme-garden.js +++ b/assets/js/src/theme-garden.js @@ -104,7 +104,7 @@ const ThemeGarden = ( { fetchThemesByQuery={ fetchThemesByQuery } /> - +
); }; From 51e802a6f535bf4a7b5ac04a5253155bacc73451 Mon Sep 17 00:00:00 2001 From: roccotrip Date: Wed, 4 Dec 2024 23:32:24 -0500 Subject: [PATCH 18/20] linting --- assets/css/build/admin.css | 2 +- assets/css/build/themes.css | 2 +- assets/js/build/theme-garden.asset.php | 2 +- assets/js/build/theme-garden.js | 2 +- assets/js/src/components/theme-garden-list.js | 76 +++++++-------- .../js/src/components/theme-garden-overlay.js | 88 +++++++++-------- assets/js/src/theme-garden.js | 97 +++++++++++-------- 7 files changed, 147 insertions(+), 122 deletions(-) diff --git a/assets/css/build/admin.css b/assets/css/build/admin.css index f535d10..f7b7492 100644 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JAaW1wb3J0IFwiYWRtaW4vdGhlbWVfZ2FyZGVuXCI7XG4iXX0= */ \ No newline at end of file +/*# sourceMappingURL=admin.css.map */ \ No newline at end of file diff --git a/assets/css/build/themes.css b/assets/css/build/themes.css index a9e34ec..5f40f52 100644 --- a/assets/css/build/themes.css +++ b/assets/css/build/themes.css @@ -16,4 +16,4 @@ right: 8px; border-radius: 99px; } -/*# sourceMappingURL=themes.css.map */ \ No newline at end of file +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy90aGVtZXMuc2NzcyUyM3Nhc3MiLCIuLi9zcmMvdGhlbWVzLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUM7RUFDQyxpQkFBQTtFQ0RELFlBQUE7QUFDRDtBRElDO0VDRkEsV0FBQTtFRElDLGtCQUFBO0VDRkQsd0RBQUE7RURJQyxzQkFBQTtFQUNBLFdBQUE7RUFDQSxZQUFBO0VBQ0EscUJBQUE7RUFDQSw0QkFBQTtFQUNBLDJCQUFBO0VBQ0EsUUFBQTtFQUNBLFVBQUE7RUFDQSxtQkFBQTtBQ0ZGIiwiZmlsZSI6InRoZW1lcy5jc3MiLCJzb3VyY2VzQ29udGVudCI6WyIudGhlbWUtYnJvd3NlciAudGhlbWVbZGF0YS1zbHVnPVwidHVtYmxyM1wiXSB7XG5cblx0LnRoZW1lLXNjcmVlbnNob3QgaW1nIHtcblx0XHRvYmplY3QtZml0OiBjb3Zlcjtcblx0XHRoZWlnaHQ6IDEwMCU7XG5cdH1cblxuXHQmOjphZnRlciB7XG5cdFx0Y29udGVudDogXCJcIjtcblx0XHRwb3NpdGlvbjogYWJzb2x1dGU7XG5cdFx0YmFja2dyb3VuZC1pbWFnZTogdXJsKC4uLy4uL2ltYWdlcy90dW1ibHJfbG9nb19pY29uLnBuZyk7XG5cdFx0YmFja2dyb3VuZC1jb2xvcjogI2ZmZjtcblx0XHR3aWR0aDogNDhweDtcblx0XHRoZWlnaHQ6IDQ4cHg7XG5cdFx0YmFja2dyb3VuZC1zaXplOiAzNnB4O1xuXHRcdGJhY2tncm91bmQtcmVwZWF0OiBuby1yZXBlYXQ7XG5cdFx0YmFja2dyb3VuZC1wb3NpdGlvbjogY2VudGVyO1xuXHRcdHRvcDogOHB4O1xuXHRcdHJpZ2h0OiA4cHg7XG5cdFx0Ym9yZGVyLXJhZGl1czogOTlweDtcblx0fVxufVxuIiwiLnRoZW1lLWJyb3dzZXIgLnRoZW1lW2RhdGEtc2x1Zz1cInR1bWJscjNcIl0ge1xuXG5cdC50aGVtZS1zY3JlZW5zaG90IGltZyB7XG5cdFx0b2JqZWN0LWZpdDogY292ZXI7XG5cdFx0aGVpZ2h0OiAxMDAlO1xuXHR9XG5cblx0Jjo6YWZ0ZXIge1xuXHRcdGNvbnRlbnQ6IFwiXCI7XG5cdFx0cG9zaXRpb246IGFic29sdXRlO1xuXHRcdGJhY2tncm91bmQtaW1hZ2U6IHVybCguLi8uLi9pbWFnZXMvdHVtYmxyX2xvZ29faWNvbi5wbmcpO1xuXHRcdGJhY2tncm91bmQtY29sb3I6ICNmZmY7XG5cdFx0d2lkdGg6IDQ4cHg7XG5cdFx0aGVpZ2h0OiA0OHB4O1xuXHRcdGJhY2tncm91bmQtc2l6ZTogMzZweDtcblx0XHRiYWNrZ3JvdW5kLXJlcGVhdDogbm8tcmVwZWF0O1xuXHRcdGJhY2tncm91bmQtcG9zaXRpb246IGNlbnRlcjtcblx0XHR0b3A6IDhweDtcblx0XHRyaWdodDogOHB4O1xuXHRcdGJvcmRlci1yYWRpdXM6IDk5cHg7XG5cdH1cbn1cbiJdfQ== */ \ No newline at end of file diff --git a/assets/js/build/theme-garden.asset.php b/assets/js/build/theme-garden.asset.php index bf9ea71..fe561d5 100644 --- a/assets/js/build/theme-garden.asset.php +++ b/assets/js/build/theme-garden.asset.php @@ -1 +1 @@ - array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '3e584c9691d73221dbf1'); + array('react', 'wp-api-fetch', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '9727829e65ee1958b005'); diff --git a/assets/js/build/theme-garden.js b/assets/js/build/theme-garden.js index b8e1803..afe21f9 100644 --- a/assets/js/build/theme-garden.js +++ b/assets/js/build/theme-garden.js @@ -1 +1 @@ -(()=>{var e={942:(e,t)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function s(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.element,a=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var c=r.n(l);const h={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},o={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,r)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:r}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},m={getBaseUrl:()=>h.baseUrl,getCategories:()=>h.categories,getLogoUrl:()=>h.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>c()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:o,selectors:m,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:r,selectedCategory:s,categories:n,search:l,themes:c,fetchThemesByQuery:h,fetchThemesByCategory:o})=>{const[m,i]=(0,t.useState)(s),[d,u]=(0,t.useState)(l),[g,E]=(0,t.useState)(c),p=(0,t.useRef)();return(0,t.useEffect)((()=>{E(c)}),[c]),(0,t.useEffect)((()=>{i(s)}),[s]),(0,t.useEffect)((()=>{u(l)}),[l]),(0,e.createElement)("div",{className:"wp-filter"},(0,e.createElement)("div",{className:"filter-count"},(0,e.createElement)("span",{className:"count"},g.length)),(0,e.createElement)("label",{htmlFor:"t3-categories"},(0,a._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,e.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:e})=>{const t=e.value;i(t),await o(t),window.history.pushState({},"",r+"&category="+t)}},(0,e.createElement)("option",{value:"featured"},(0,a._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((t=>(0,e.createElement)("option",{key:t.text_key,value:t.text_key,selected:m===t.text_key},t.name)))),(0,e.createElement)("p",{className:"search-box"},(0,e.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,a._x)("Search Themes","label for a text input","tumblr3")),(0,e.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:e})=>{const t=e.value;u(t),clearTimeout(p.current),p.current=setTimeout((async()=>{await h(t),window.history.pushState({},"",r+"&search="+t)}),500)}})))})),g=()=>{const t=[(0,a._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],r=Math.floor(Math.random()*t.length);return(0,e.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},t[r])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isFetchingThemes:s,fetchThemeById:n})=>{const[l,c]=(0,t.useState)(r);(0,t.useEffect)((()=>{c(r)}),[r]);const h=async({currentTarget:{value:e}})=>{const t=new URL(window.location.href),r=new URLSearchParams(t.search);r.append("theme",e),t.search=r.toString(),await n(e),window.history.pushState({},"",t.toString())};return s?(0,e.createElement)("div",{className:"loading-content"},(0,e.createElement)("span",{className:"spinner"})):0===l.length?(0,e.createElement)(g,null):(0,e.createElement)("div",{className:"tumblr-themes"},r.map((t=>(0,e.createElement)("article",{className:"tumblr-theme",key:t.title},(0,e.createElement)("header",{className:"tumblr-theme-header"},(0,e.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,e.createElement)("span",{className:"tumblr-theme-title"},t.title))),(0,e.createElement)("div",{className:"tumblr-theme-content"},(0,e.createElement)("button",{className:"tumblr-theme-details",onClick:h,value:t.id},(0,e.createElement)("label",null,(0,e.createElement)("span",{className:"tumblr-theme-detail-button"},(0,a._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,e.createElement)("img",{src:t.thumbnail,alt:""})),(0,e.createElement)("div",{className:"tumblr-theme-footer"},(0,e.createElement)("a",{className:"rainbow-button",href:t.activate_url},"Activate")))))))}));var p=r(942),b=r.n(p);const w=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:l,themeDetails:c,fetchThemeById:h})=>{const o=()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),l()},m=(0,t.useCallback)((()=>n||!c?(0,e.createElement)("div",{className:"loading-content wp-clearfix"},(0,e.createElement)("span",{className:"spinner"})):(0,e.createElement)("div",{className:"theme-about wp-clearfix"},(0,e.createElement)("div",{className:"theme-screenshots"},(0,e.createElement)("div",{className:"screenshot"},(0,e.createElement)("img",{src:c.screenshots[0],alt:""}))),(0,e.createElement)("div",{className:"theme-info"},(0,e.createElement)("h2",{className:"theme-name"},c.title),(0,e.createElement)("div",{dangerouslySetInnerHTML:{__html:c.description}})))),[c,n]),i=(0,t.useCallback)((async e=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),s=r[e].id;a.delete("theme"),a.append("theme",s),t.search=a.toString(),await h(s),window.history.pushState({},"",t.toString())}),[r]),d=(0,t.useCallback)((()=>{const t=r.findIndex((e=>e.id===c.id)),s=!t||0===t,n=t===r.length-1;return(0,e.createElement)("div",{className:"theme-header"},(0,e.createElement)("button",{className:b()("left","dashicons","dashicons-no",{disabled:s}),disabled:s,onClick:()=>i(t-1)},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show previous theme","label for a button that will navigate to previous theme","tumblr3"))),(0,e.createElement)("button",{className:b()("right","dashicons","dashicons-no",{disabled:n}),disabled:n,onClick:()=>i(t+1)},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show next theme","label for a button that will navigate to next theme","tumblr3"))),(0,e.createElement)("button",{className:"close dashicons dashicons-no",onClick:o},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3"))))}),[c,r,i]);return s&&c?(0,e.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,e.createElement)("div",{className:"theme-backdrop"}),(0,e.createElement)("div",{className:"theme-wrap wp-clearfix"},d(),m())):null})),T=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,r,a)=>e("tumblr3/theme-garden-store").receiveThemes(t,r,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),receiveTheme:(t,r)=>e("tumblr3/theme-garden-store").receiveTheme(t,r),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({logoUrl:r,beforeFetchThemes:s,fetchThemes:n,receiveThemes:l,searchThemes:c,beforeFetchTheme:h,fetchTheme:o,receiveTheme:m,closeOverlay:i})=>{(0,t.useEffect)((()=>(window.addEventListener("popstate",b),()=>{window.removeEventListener("popstate",b)})),[]);const d=async e=>{s();const t=await n(e);l(t,e,"")},g=async e=>{s();const t=await c(e);l(t,"",e)},p=async e=>{h();const t=await o(e);m(t,e)},b=async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",r=e.get("search")||"",a=e.get("theme")||"";if(console.info("detected browser navigation"),""!==r?(console.info("fetching themes by search"),await g(r)):""!==t&&(console.info("fetching themes by category"),await d(t)),""!==a){h();const e=await o(a);m(e,a)}else i()};return(0,e.createElement)("div",{className:"wrap"},(0,e.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,e.createElement)("img",{className:"tumblr-logo-icon",src:r,alt:""}),(0,e.createElement)("span",null,(0,a.__)("Tumblr Themes","tumblr3"))),(0,e.createElement)(u,{fetchThemesByCategory:d,fetchThemesByQuery:g}),(0,e.createElement)(E,{fetchThemeById:p}),(0,e.createElement)(w,{fetchThemeById:p}))})),f=document.getElementById("tumblr-theme-garden");f?(0,t.createRoot)(f).render((0,e.createElement)(T,null)):console.error("Failed to find the root element for the settings panel.")})()})(); \ No newline at end of file +(()=>{var e={942:(e,t)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function s(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.element,a=window.wp.i18n,s=window.wp.data,n=window.wp.compose,l=window.wp.apiFetch;var c=r.n(l);const h={logoUrl:themeGardenData.logoUrl,categories:themeGardenData.categories,baseUrl:themeGardenData.baseUrl,themes:themeGardenData.themes,selectedCategory:themeGardenData.selectedCategory,search:themeGardenData.search,selectedThemeId:themeGardenData.selectedThemeId,themeDetails:themeGardenData.themeDetails,isFetchingThemes:!1,isOverlayOpen:!!themeGardenData.selectedThemeId,isFetchingTheme:!1},m={closeOverlay:()=>({type:"CLOSE_OVERLAY"}),receiveTheme:(e,t)=>({type:"RECEIVE_THEME",theme:e,id:t}),receiveThemes:(e,t,r)=>({type:"RECEIVE_THEMES",themes:e,category:t,search:r}),beforeFetchTheme:()=>({type:"BEFORE_FETCH_THEME"}),beforeFetchThemes:()=>({type:"BEFORE_FETCH_THEMES"}),*fetchThemes(e){try{return i.FETCH_THEMES(e)}catch(e){throw new Error("Failed to fetch themes")}},*searchThemes(e){try{return i.SEARCH_THEMES(e)}catch(e){throw new Error("Failed to search themes")}},*fetchTheme(e){try{return i.FETCH_THEME(e)}catch(e){throw new Error("Failed to fetch theme")}}},o={getBaseUrl:()=>h.baseUrl,getCategories:()=>h.categories,getLogoUrl:()=>h.logoUrl,getSelectedCategory:e=>e.selectedCategory,getSearch:e=>e.search,getIsFetchingThemes:e=>e.isFetchingThemes,getIsFetchingTheme:e=>e.isFetchingTheme,getThemes:e=>e.themes,getIsOverlayOpen:e=>e.isOverlayOpen,getThemeDetails:e=>e.themeDetails},i={FETCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?category="+e,method:"GET"}).then((e=>e)).catch((e=>{throw e})),SEARCH_THEMES:e=>c()({path:"/tumblr3/v1/themes?search="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e})),FETCH_THEME:e=>c()({path:"/tumblr3/v1/theme?theme="+e,method:"GET"}).then((e=>e)).catch((e=>{throw console.error("API Error:",e),e}))},d=(0,s.createReduxStore)("tumblr3/theme-garden-store",{reducer:(e=h,t)=>{switch(t.type){case"BEFORE_FETCH_THEMES":return{...e,isFetchingThemes:!0};case"BEFORE_FETCH_THEME":return{...e,isFetchingTheme:!0,isOverlayOpen:!0};case"RECEIVE_THEMES":return{...e,themes:t.themes,isFetchingThemes:!1,selectedCategory:t.category,search:t.search};case"RECEIVE_THEME":return{...e,isFetchingTheme:!1,themeDetails:t.theme,selectedThemeId:t.id};case"CLOSE_OVERLAY":return{...e,isOverlayOpen:!1,isFetchingTheme:!1,themeDetails:null};default:return e}},actions:m,selectors:o,controls:i});(0,s.register)(d);const u=(0,n.compose)((0,s.withSelect)((e=>({baseUrl:e("tumblr3/theme-garden-store").getBaseUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),categories:e("tumblr3/theme-garden-store").getCategories(),search:e("tumblr3/theme-garden-store").getSearch(),themes:e("tumblr3/theme-garden-store").getThemes()}))))((({baseUrl:r,selectedCategory:s,categories:n,search:l,themes:c,fetchThemesByQuery:h,fetchThemesByCategory:m})=>{const[o,i]=(0,t.useState)(s),[d,u]=(0,t.useState)(l),[g,E]=(0,t.useState)(c),b=(0,t.useRef)();return(0,t.useEffect)((()=>{E(c)}),[c]),(0,t.useEffect)((()=>{i(s)}),[s]),(0,t.useEffect)((()=>{u(l)}),[l]),(0,e.createElement)("div",{className:"wp-filter"},(0,e.createElement)("div",{className:"filter-count"},(0,e.createElement)("span",{className:"count"},g.length)),(0,e.createElement)("label",{htmlFor:"t3-categories"},(0,a._x)("Categories","label for a dropdown list of theme categories","tumblr3")),(0,e.createElement)("select",{id:"t3-categories",name:"category",onChange:async({currentTarget:e})=>{const t=e.value;i(t),await m(t),window.history.pushState({},"",r+"&category="+t)}},(0,e.createElement)("option",{value:"featured"},(0,a._x)("Featured","The name of a category in a list of categories.","tumblr3")),n.map((t=>(0,e.createElement)("option",{key:t.text_key,value:t.text_key,selected:o===t.text_key},t.name)))),(0,e.createElement)("p",{className:"search-box"},(0,e.createElement)("label",{htmlFor:"wp-filter-search-input"},(0,a._x)("Search Themes","label for a text input","tumblr3")),(0,e.createElement)("input",{type:"search","aria-describedby":"live-search-desc",id:"wp-filter-search-input",className:"wp-filter-search",name:"search",value:d,onChange:async({currentTarget:e})=>{const t=e.value;u(t),clearTimeout(b.current),b.current=setTimeout((async()=>{await h(t),window.history.pushState({},"",r+"&search="+t)}),500)}})))})),g=()=>{const t=[(0,a._x)("Sadly, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Tragically, nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("We found nothing. Here it isn’t.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Couldn’t find that. Please, don’t be upset. Please.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Sincerely, we found nothing.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("Nothing to see here.","The message displayed when no themes were found.","tumblr3"),(0,a._x)("If you were looking for nothing, congrats, you found it.","The message displayed when no themes were found.","tumblr3")],r=Math.floor(Math.random()*t.length);return(0,e.createElement)("p",{className:"no-themes",id:"tumblr-no-themes"},t[r])},E=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isFetchingThemes:e("tumblr3/theme-garden-store").getIsFetchingThemes()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isFetchingThemes:s,fetchThemeById:n})=>{const[l,c]=(0,t.useState)(r);(0,t.useEffect)((()=>{c(r)}),[r]);const h=async({currentTarget:{value:e}})=>{const t=new URL(window.location.href),r=new URLSearchParams(t.search);r.append("theme",e),t.search=r.toString(),await n(e),window.history.pushState({},"",t.toString())};return s?(0,e.createElement)("div",{className:"loading-content"},(0,e.createElement)("span",{className:"spinner"})):0===l.length?(0,e.createElement)(g,null):(0,e.createElement)("div",{className:"tumblr-themes"},r.map((t=>{const r=`t3-theme-details-${t.id}`;return(0,e.createElement)("article",{className:"tumblr-theme",key:t.title},(0,e.createElement)("header",{className:"tumblr-theme-header"},(0,e.createElement)("div",{className:"tumblr-theme-title-wrapper"},(0,e.createElement)("span",{className:"tumblr-theme-title"},t.title))),(0,e.createElement)("div",{className:"tumblr-theme-content"},(0,e.createElement)("button",{className:"tumblr-theme-details",onClick:h,value:t.id,id:r},(0,e.createElement)("label",{htmlFor:r},(0,e.createElement)("span",{className:"tumblr-theme-detail-button"},(0,a._x)("Theme details","Text on a button that will show more information about a Tumblr theme","tumblr3"))),(0,e.createElement)("img",{src:t.thumbnail,alt:""})),(0,e.createElement)("div",{className:"tumblr-theme-footer"},(0,e.createElement)("a",{className:"rainbow-button",href:t.activate_url},"Activate"))))})))}));var b=r(942),p=r.n(b);const w=(0,n.compose)((0,s.withSelect)((e=>({themes:e("tumblr3/theme-garden-store").getThemes(),isOverlayOpen:e("tumblr3/theme-garden-store").getIsOverlayOpen(),isFetchingTheme:e("tumblr3/theme-garden-store").getIsFetchingTheme(),themeDetails:e("tumblr3/theme-garden-store").getThemeDetails()}))),(0,s.withDispatch)((e=>({closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({themes:r,isOverlayOpen:s,isFetchingTheme:n,closeOverlay:l,themeDetails:c,fetchThemeById:h})=>{const m=(0,t.useCallback)((()=>{const e=new URL(window.location.href),t=new URLSearchParams(e.search);t.delete("theme"),e.search=t.toString(),window.history.pushState({},"",e.toString()),l()}),[l]),o=(0,t.useCallback)((()=>n||!c?(0,e.createElement)("div",{className:"loading-content wp-clearfix"},(0,e.createElement)("span",{className:"spinner"})):(0,e.createElement)("div",{className:"theme-about wp-clearfix"},(0,e.createElement)("div",{className:"theme-screenshots"},(0,e.createElement)("div",{className:"screenshot"},(0,e.createElement)("img",{src:c.screenshots[0],alt:""}))),(0,e.createElement)("div",{className:"theme-info"},(0,e.createElement)("h2",{className:"theme-name"},c.title),(0,e.createElement)("div",{dangerouslySetInnerHTML:{__html:c.description}})))),[c,n]),i=(0,t.useCallback)((async e=>{const t=new URL(window.location.href),a=new URLSearchParams(t.search),s=r[e].id;a.delete("theme"),a.append("theme",s),t.search=a.toString(),await h(s),window.history.pushState({},"",t.toString())}),[r,h]),d=(0,t.useCallback)((()=>{const t=r.findIndex((e=>e.id===c.id)),s=-1===t||0===t,n=-1===t||t===r.length-1;return(0,e.createElement)("div",{className:"theme-header"},(0,e.createElement)("button",{className:p()("left","dashicons","dashicons-no",{disabled:s}),disabled:s,onClick:()=>i(t-1)},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show previous theme","label for a button that will navigate to previous theme","tumblr3"))),(0,e.createElement)("button",{className:p()("right","dashicons","dashicons-no",{disabled:n}),disabled:n,onClick:()=>i(t+1)},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Show next theme","label for a button that will navigate to next theme","tumblr3"))),(0,e.createElement)("button",{className:"close dashicons dashicons-no",onClick:m},(0,e.createElement)("span",{className:"screen-reader-text"},(0,a._x)("Close theme details overlay","label for a button that will close an overlay","tumblr3"))))}),[c,r,i,m]);return s&&c?(0,e.createElement)("div",{className:"theme-overlay",id:"tumblr-theme-overlay"},(0,e.createElement)("div",{className:"theme-backdrop"}),(0,e.createElement)("div",{className:"theme-wrap wp-clearfix"},d(),o())):null})),T=(0,n.compose)((0,s.withSelect)((e=>({logoUrl:e("tumblr3/theme-garden-store").getLogoUrl(),selectedCategory:e("tumblr3/theme-garden-store").getSelectedCategory(),search:e("tumblr3/theme-garden-store").getSearch()}))),(0,s.withDispatch)((e=>({beforeFetchThemes:()=>e("tumblr3/theme-garden-store").beforeFetchThemes(),fetchThemes:t=>e("tumblr3/theme-garden-store").fetchThemes(t),searchThemes:t=>e("tumblr3/theme-garden-store").searchThemes(t),receiveThemes:(t,r,a)=>e("tumblr3/theme-garden-store").receiveThemes(t,r,a),beforeFetchTheme:()=>e("tumblr3/theme-garden-store").beforeFetchTheme(),fetchTheme:t=>e("tumblr3/theme-garden-store").fetchTheme(t),receiveTheme:(t,r)=>e("tumblr3/theme-garden-store").receiveTheme(t,r),closeOverlay:()=>e("tumblr3/theme-garden-store").closeOverlay()}))))((({logoUrl:r,beforeFetchThemes:s,fetchThemes:n,receiveThemes:l,searchThemes:c,beforeFetchTheme:h,fetchTheme:m,receiveTheme:o,closeOverlay:i,search:d,selectedCategory:g})=>{const b=(0,t.useCallback)((async e=>{s();const t=await n(e);l(t,e,"")}),[s,l,n]),p=(0,t.useCallback)((async e=>{s();const t=await c(e);l(t,"",e)}),[s,l,c]),T=(0,t.useCallback)((async()=>{const e=new URLSearchParams(window.location.search),t=e.get("category")||"featured",r=e.get("search")||"",a=e.get("theme")||"";if(""!==r&&r!==d?await p(r):""!==t&&t!==g&&await b(t),""!==a){h();const e=await m(a);o(e,a)}else i()}),[g,d,h,i,m,b,p,o]);(0,t.useEffect)((()=>(window.addEventListener("popstate",T),()=>{window.removeEventListener("popstate",T)})),[T]);const y=(0,t.useCallback)((async e=>{h();const t=await m(e);o(t,e)}),[h,o,m]);return(0,e.createElement)("div",{className:"wrap"},(0,e.createElement)("h1",{className:"wp-heading-inline",id:"theme-garden-heading"},(0,e.createElement)("img",{className:"tumblr-logo-icon",src:r,alt:""}),(0,e.createElement)("span",null,(0,a.__)("Tumblr Themes","tumblr3"))),(0,e.createElement)(u,{fetchThemesByCategory:b,fetchThemesByQuery:p}),(0,e.createElement)(E,{fetchThemeById:y}),(0,e.createElement)(w,{fetchThemeById:y}))})),y=document.getElementById("tumblr-theme-garden");y?(0,t.createRoot)(y).render((0,e.createElement)(T,null)):console.error("Failed to find the root element for the settings panel.")})()})(); \ No newline at end of file diff --git a/assets/js/src/components/theme-garden-list.js b/assets/js/src/components/theme-garden-list.js index 2023497..d9aa799 100644 --- a/assets/js/src/components/theme-garden-list.js +++ b/assets/js/src/components/theme-garden-list.js @@ -15,23 +15,19 @@ import './theme-garden-store'; * @param {boolean} props.isFetchingThemes * @param {Function} props.fetchThemeById */ -const _ThemeGardenList = ( { - themes, - isFetchingThemes, - fetchThemeById -} ) => { +const _ThemeGardenList = ( { themes, isFetchingThemes, fetchThemeById } ) => { const [ localThemes, setLocalThemes ] = useState( themes ); useEffect( () => { setLocalThemes( themes ); }, [ themes ] ); - const handleDetailsClick = async ( { currentTarget: {value: themeId} } ) => { + const handleDetailsClick = async ( { currentTarget: { value: themeId } } ) => { const currentUrl = new URL( window.location.href ); const params = new URLSearchParams( currentUrl.search ); params.append( 'theme', themeId ); currentUrl.search = params.toString(); - await fetchThemeById(themeId) + await fetchThemeById( themeId ); window.history.pushState( {}, '', currentUrl.toString() ); }; @@ -49,38 +45,42 @@ const _ThemeGardenList = ( { return (
- { themes.map( theme => ( -
-
-
- { theme.title } + { themes.map( theme => { + const label = `t3-theme-details-${ theme.id }`; + return ( +
+
+
+ { theme.title } +
+
+
+ +
-
-
- - -
-
- ) ) } + + ); + } ) }
); }; diff --git a/assets/js/src/components/theme-garden-overlay.js b/assets/js/src/components/theme-garden-overlay.js index 4839b4c..78eb7fb 100644 --- a/assets/js/src/components/theme-garden-overlay.js +++ b/assets/js/src/components/theme-garden-overlay.js @@ -1,8 +1,8 @@ -import { useCallback, useState } from '@wordpress/element'; +import { useCallback } from '@wordpress/element'; import { withDispatch, withSelect } from '@wordpress/data'; import { compose } from '@wordpress/compose'; import { _x } from '@wordpress/i18n'; -import classNames from "classnames"; +import classNames from 'classnames'; /** * Displays an overlay with details about a Tumblr theme. @@ -23,17 +23,16 @@ const _ThemeGardenOverlay = ( { isFetchingTheme, closeOverlay, themeDetails, - fetchThemeById, + fetchThemeById, } ) => { - - const handleCloseClick = () => { + const handleCloseClick = useCallback( () => { const currentUrl = new URL( window.location.href ); const params = new URLSearchParams( currentUrl.search ); params.delete( 'theme' ); currentUrl.search = params.toString(); window.history.pushState( {}, '', currentUrl.toString() ); closeOverlay(); - }; + }, [ closeOverlay ] ); const renderThemeDetails = useCallback( () => { if ( isFetchingTheme || ! themeDetails ) { @@ -59,64 +58,71 @@ const _ThemeGardenOverlay = ( { ); }, [ themeDetails, isFetchingTheme ] ); - const onClickNavigate = useCallback( async (nextIndex) => { - const currentUrl = new URL( window.location.href ); - const params = new URLSearchParams( currentUrl.search ); - const nextId = themes[nextIndex].id; - params.delete( 'theme' ); - params.append( 'theme', nextId); - currentUrl.search = params.toString(); - await fetchThemeById( nextId ); - window.history.pushState( {}, '', currentUrl.toString() ); - }, [themes] ) + const onClickNavigate = useCallback( + async nextIndex => { + const currentUrl = new URL( window.location.href ); + const params = new URLSearchParams( currentUrl.search ); + const nextId = themes[ nextIndex ].id; + params.delete( 'theme' ); + params.append( 'theme', nextId ); + currentUrl.search = params.toString(); + await fetchThemeById( nextId ); + window.history.pushState( {}, '', currentUrl.toString() ); + }, + [ themes, fetchThemeById ] + ); const renderThemeHeader = useCallback( () => { - const currentIndex = themes.findIndex((theme) => theme.id === themeDetails.id ); - const prevButtonDisabled = !currentIndex || currentIndex === 0; - const nextButtonDisabled = currentIndex === themes.length - 1; + const currentIndex = themes.findIndex( theme => theme.id === themeDetails.id ); + const prevButtonDisabled = currentIndex === -1 || currentIndex === 0; + const nextButtonDisabled = currentIndex === -1 || currentIndex === themes.length - 1; return (
-
); - }, [themeDetails, themes, onClickNavigate]); + }, [ themeDetails, themes, onClickNavigate, handleCloseClick ] ); - if (!isOverlayOpen || !themeDetails) { + if ( ! isOverlayOpen || ! themeDetails ) { return null; } @@ -124,8 +130,8 @@ const _ThemeGardenOverlay = ( {
- {renderThemeHeader()} - {renderThemeDetails()} + { renderThemeHeader() } + { renderThemeDetails() }
); diff --git a/assets/js/src/theme-garden.js b/assets/js/src/theme-garden.js index e2ed2f2..8654fce 100644 --- a/assets/js/src/theme-garden.js +++ b/assets/js/src/theme-garden.js @@ -1,4 +1,4 @@ -import { createRoot, useEffect } from '@wordpress/element'; +import { createRoot, useEffect, useCallback } from '@wordpress/element'; import { ThemeGardenFilterBar } from './components/theme-garden-filterbar'; import { ThemeGardenList } from './components/theme-garden-list'; import { __ } from '@wordpress/i18n'; @@ -24,6 +24,8 @@ import { ThemeGardenOverlay } from './components/theme-garden-overlay'; * @param {Function} props.fetchTheme * @param {Function} props.receiveTheme * @param {Function} props.closeOverlay + * @param {string} props.selectedCategory + * @param {string} props.search */ const ThemeGarden = ( { logoUrl, @@ -31,56 +33,44 @@ const ThemeGarden = ( { fetchThemes, receiveThemes, searchThemes, - beforeFetchTheme, + beforeFetchTheme, fetchTheme, receiveTheme, - closeOverlay + closeOverlay, + search, + selectedCategory, } ) => { - /** - * Detect backwards and forwards browser navigation. - */ - useEffect( () => { - window.addEventListener( 'popstate', onBrowserNavigation ); - return () => { - window.removeEventListener( 'popstate', onBrowserNavigation ); - }; - }, [] ); - - const fetchThemesByCategory = async category => { - beforeFetchThemes(); - const response = await fetchThemes( category ); - receiveThemes( response, category, '' ); - }; - - const fetchThemesByQuery = async newSearch => { - beforeFetchThemes(); - const response = await searchThemes( newSearch ); - receiveThemes( response, '', newSearch ); - }; - - const fetchThemeById = async themeId => { - beforeFetchTheme(); - const response = await fetchTheme(themeId); - receiveTheme( response, themeId ); - } + const fetchThemesByCategory = useCallback( + async category => { + beforeFetchThemes(); + const response = await fetchThemes( category ); + receiveThemes( response, category, '' ); + }, + [ beforeFetchThemes, receiveThemes, fetchThemes ] + ); + const fetchThemesByQuery = useCallback( + async newSearch => { + beforeFetchThemes(); + const response = await searchThemes( newSearch ); + receiveThemes( response, '', newSearch ); + }, + [ beforeFetchThemes, receiveThemes, searchThemes ] + ); /** * After backwards or forwards navigation, check URL search params for indicators that we have to re-fetch themes. * * @return {Promise} */ - const onBrowserNavigation = async () => { + const onBrowserNavigation = useCallback( async () => { const urlParams = new URLSearchParams( window.location.search ); const category = urlParams.get( 'category' ) || 'featured'; const searchParam = urlParams.get( 'search' ) || ''; const theme = urlParams.get( 'theme' ) || ''; - console.info( 'detected browser navigation' ); - if ( searchParam !== '' ) { - console.info( 'fetching themes by search' ); + if ( searchParam !== '' && searchParam !== search ) { await fetchThemesByQuery( searchParam ); - } else if ( category !== '' ) { - console.info( 'fetching themes by category' ); + } else if ( category !== '' && category !== selectedCategory ) { await fetchThemesByCategory( category ); } @@ -91,7 +81,34 @@ const ThemeGarden = ( { } else { closeOverlay(); } - }; + }, [ + selectedCategory, + search, + beforeFetchTheme, + closeOverlay, + fetchTheme, + fetchThemesByCategory, + fetchThemesByQuery, + receiveTheme, + ] ); + /** + * Detect backwards and forwards browser navigation. + */ + useEffect( () => { + window.addEventListener( 'popstate', onBrowserNavigation ); + return () => { + window.removeEventListener( 'popstate', onBrowserNavigation ); + }; + }, [ onBrowserNavigation ] ); + + const fetchThemeById = useCallback( + async themeId => { + beforeFetchTheme(); + const response = await fetchTheme( themeId ); + receiveTheme( response, themeId ); + }, + [ beforeFetchTheme, receiveTheme, fetchTheme ] + ); return (
@@ -103,8 +120,8 @@ const ThemeGarden = ( { fetchThemesByCategory={ fetchThemesByCategory } fetchThemesByQuery={ fetchThemesByQuery } /> - - + +
); }; @@ -112,6 +129,8 @@ const ThemeGarden = ( { export const ConnectedThemeGarden = compose( withSelect( select => ( { logoUrl: select( 'tumblr3/theme-garden-store' ).getLogoUrl(), + selectedCategory: select( 'tumblr3/theme-garden-store' ).getSelectedCategory(), + search: select( 'tumblr3/theme-garden-store' ).getSearch(), } ) ), withDispatch( dispatch => ( { beforeFetchThemes: () => { From e2002619117f73aca83a635e48608c4400310ac2 Mon Sep 17 00:00:00 2001 From: TommusRhodus Date: Fri, 6 Dec 2024 13:53:07 +0000 Subject: [PATCH 19/20] Improves customizer editing and Jetpack Like button --- assets/css/build/index.css | 13 +- assets/css/build/index.css.map | 2 +- assets/css/src/frontend/_global.scss | 16 ++- assets/js/build/customizer-rtl.css | 1 + assets/js/build/customizer.asset.php | 1 + assets/js/build/customizer.css | 1 + assets/js/build/customizer.js | 1 + assets/js/src/customizer.js | 207 +++++++++++++++++++++++++++ assets/js/src/customizer.scss | 140 ++++++++++++++++++ includes/tag-functions.php | 22 ++- src/Customizer.php | 60 ++++++-- 11 files changed, 444 insertions(+), 20 deletions(-) create mode 100644 assets/js/build/customizer-rtl.css create mode 100644 assets/js/build/customizer.asset.php create mode 100644 assets/js/build/customizer.css create mode 100644 assets/js/build/customizer.js create mode 100644 assets/js/src/customizer.js create mode 100644 assets/js/src/customizer.scss diff --git a/assets/css/build/index.css b/assets/css/build/index.css index 841e011..ceeffe7 100644 --- a/assets/css/build/index.css +++ b/assets/css/build/index.css @@ -5,6 +5,17 @@ body > .iframe-container { body iframe[src*="https://www.tumblr.com/dashboard/iframe"] { display: none; } +body div.jetpack-likes-widget-wrapper.t3-likes { + min-height: 0px; + position: static; +} +body div.jetpack-likes-widget-wrapper.t3-likes .likes-widget-placeholder.post-likes-widget-placeholder { + display: none; +} +body div.jetpack-likes-widget-wrapper.t3-likes iframe { + width: 20px !important; + height: 20px !important; +} p.npf_quote { font-family: Georgia, Times, "Times New Roman", serif; @@ -297,4 +308,4 @@ body div.npf_row + div.npf_row { font-size: 0.875em; line-height: 1.5; } -/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5zY3NzJTIzc2FzcyIsIi4uL3NyYy9mcm9udGVuZC9fZ2xvYmFsLnNjc3MiLCIuLi9zcmMvaW5kZXguc2NzcyIsIi4uL3NyYy9mcm9udGVuZC9fdGV4dC5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL192YXJpYWJsZXMuc2NzcyIsIi4uL3NyYy9mcm9udGVuZC9fbGluay5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL192aWRlby5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL19pbWFnZS5zY3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lbXM6IHN0cmV0Y2g7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIG1hcmdpbi10b3A6IDA7XG4gICAgICAgIG92ZXJmbG93OiBoaWRkZW47XG5cbiAgICAgICAgZmlndXJlLnRtYmxyLWZ1bGwge1xuICAgICAgICAgICAgZmxleDogMTtcbiAgICAgICAgICAgIGp1c3RpZnktY29udGVudDogc3BhY2UtYmV0d2VlbjtcbiAgICAgICAgICAgIG1hcmdpbjogMDtcbiAgICAgICAgICAgIG92ZXJmbG93LXk6IGhpZGRlbjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZpZ3VyZS50bWJsci1mdWxsLFxuICAgICAgICAubnBmX2NvbCB7XG4gICAgICAgICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgICAgICAgZmxleC1kaXJlY3Rpb246IGNvbHVtbjtcbiAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMnB4O1xuICAgICAgICAgICAgcGFkZGluZy1yaWdodDogMnB4O1xuXG4gICAgICAgICAgICAmOmZpcnN0LWNoaWxkIHtcbiAgICAgICAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDA7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICY6bGFzdC1jaGlsZCB7XG4gICAgICAgICAgICAgICAgcGFkZGluZy1yaWdodDogMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGltZyB7XG4gICAgICAgICAgICBoZWlnaHQ6IGF1dG87XG4gICAgICAgIH1cblxuICAgICAgICAubnBmX2NvbCB7XG4gICAgICAgICAgICBmbGV4OiAxO1xuXG4gICAgICAgICAgICBmaWd1cmUge1xuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTtcbiAgICAgICAgICAgICAgICBtYXJnaW46IDA7XG4gICAgICAgICAgICAgICAgdGV4dC1hbGlnbjogbGVmdDtcblxuICAgICAgICAgICAgICAgIGltZyB7XG4gICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxMDAlO1xuICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IDEwMCU7XG4gICAgICAgICAgICAgICAgICAgIG9iamVjdC1maXQ6IGNvdmVyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHAudG1ibHItYXR0cmlidXRpb24ge1xuICAgICAgICAgICAgICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94O1xuICAgICAgICAgICAgICAgICAgICB3aWR0aDogMTAwJTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmaWd1cmVbZGF0YS1lbmFibGUtbGlnaHRib3g9XCIxXCJdIHtcbiAgICAgICAgY3Vyc29yOiBwb2ludGVyO1xuICAgIH1cblxuICAgIGEucG9zdF9tZWRpYV9waG90b19hbmNob3Ige1xuICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICAgIGZsZXg6IDE7XG4gICAgICAgIHRleHQtZGVjb3JhdGlvbjogbm9uZTtcbiAgICB9XG5cbiAgICBwICsgZGl2Lm5wZl9yb3csXG4gICAgZGl2Lm5wZl9yb3cgKyBwIHtcbiAgICAgICAgbWFyZ2luLXRvcDogMTVweDtcbiAgICB9XG5cbiAgICAvLyBBZGQgYSBtYXJnaW4gaWYgZm9sbG93aW5nL3ByZWNlZGluZyBhIHZpZGVvXG4gICAgLmNydC12aWRlbyArIGRpdi5ucGZfcm93LFxuICAgIGRpdi5ucGZfcm93ICsgLmNydC12aWRlbyB7XG4gICAgICAgIG1hcmdpbi10b3A6IDE1cHg7XG4gICAgfVxuXG4gICAgLy8gSG9yaXpvbnRhbCBtYXJnaW5zIGJldHdlZW4gcGhvdG9zZXQgcm93c1xuICAgIGRpdi5ucGZfcm93ICsgZmlndXJlLnRtYmxyLWZ1bGwsXG4gICAgZGl2Lm5wZl9yb3cgKyBkaXYubnBmX3JvdyB7XG4gICAgICAgIG1hcmdpbi10b3A6IDRweDtcbiAgICB9XG59XG4iLCIudG1ibHItZnVsbCA+IGF1ZGlvIHtcbiAgICB3aWR0aDogMTAwJTtcbn1cblxuLnRtYmxyLWZ1bGwgPiAuYXVkaW8tY2FwdGlvbiB7XG4gICAgZGlzcGxheTogZmxleDtcbiAgICBmbGV4LWRpcmVjdGlvbjogcm93O1xuXG4gICAgLmFsYnVtLWNvdmVyIHtcbiAgICAgICAgd2lkdGg6IDg1cHg7XG4gICAgICAgIGhlaWdodDogODVweDtcbiAgICB9XG5cbiAgICAuYXVkaW8tZGV0YWlscyB7XG4gICAgICAgIGRpc3BsYXk6IGZsZXg7XG4gICAgICAgIGZsZXg6IDEgMCBhdXRvO1xuICAgICAgICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICAgICAgICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbiAgICAgICAgYWxpZ24taXRlbXM6IGZsZXgtc3RhcnQ7XG4gICAgICAgIHBhZGRpbmc6IDAgMjBweDtcbiAgICB9XG5cbiAgICAudGl0bGUge1xuICAgICAgICBmb250LXdlaWdodDogYm9sZDtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDEuNTtcbiAgICB9XG5cbiAgICAuYXJ0aXN0LFxuICAgIC5hbGJ1bSB7XG4gICAgICAgIGZvbnQtc2l6ZTogMC44NzVlbTtcbiAgICAgICAgbGluZS1oZWlnaHQ6IDEuNTtcbiAgICB9XG59XG4iXX0= */ \ No newline at end of file +/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5zY3NzJTIzc2FzcyIsIi4uL3NyYy9mcm9udGVuZC9fZ2xvYmFsLnNjc3MiLCIuLi9zcmMvaW5kZXguc2NzcyIsIi4uL3NyYy9mcm9udGVuZC9fdGV4dC5zY3NzIiwiLi4vc3JjL2Zyb250ZW5kL192YXJpYWJsZXMuc2NzcyIsIi4uL3NyYy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cGFkZGluZy1sZWZ0OiAycHg7XG4gICAgICAgICAgICBwYWRkaW5nLXJpZ2h0OiAycHg7XG5cbiAgICAgICAgICAgICY6Zmlyc3QtY2hpbGQge1xuICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJjpsYXN0LWNoaWxkIHtcbiAgICAgICAgICAgICAgICBwYWRkaW5nLXJpZ2h0OiAwO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaW1nIHtcbiAgICAgICAgICAgIGhlaWdodDogYXV0bztcbiAgICAgICAgfVxuXG4gICAgICAgIC5ucGZfY29sIHtcbiAgICAgICAgICAgIGZsZXg6IDE7XG5cbiAgICAgICAgICAgIGZpZ3VyZSB7XG4gICAgICAgICAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICAgICAgICAgICAgIHdpZHRoOiAxMDAlO1xuICAgICAgICAgICAgICAgIG1hcmdpbjogMDtcbiAgICAgICAgICAgICAgICB0ZXh0LWFsaWduOiBsZWZ0O1xuXG4gICAgICAgICAgICAgICAgaW1nIHtcbiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IDEwMCU7XG4gICAgICAgICAgICAgICAgICAgIGhlaWdodDogMTAwJTtcbiAgICAgICAgICAgICAgICAgICAgb2JqZWN0LWZpdDogY292ZXI7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcC50bWJsci1hdHRyaWJ1dGlvbiB7XG4gICAgICAgICAgICAgICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7XG4gICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxMDAlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZpZ3VyZVtkYXRhLWVuYWJsZS1saWdodGJveD1cIjFcIl0ge1xuICAgICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgfVx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ogY2VudGVyO1xuICAgICAgICBhbGlnbi1pdGVtczogZmxleC1zdGFydDtcbiAgICAgICAgcGFkZGluZzogMCAyMHB4O1xuICAgIH1cblxuICAgIC50aXRsZSB7XG4gICAgICAgIGZvbnQtd2VpZ2h0OiBib2xkO1xuICAgICAgICBsaW5lLWhlaWdodDogMS41O1xuICAgIH1cblxuICAgIC5hcnRpc3QsXG4gICAgLmFsYnVtIHtcbiAgICAgICAgZm9udC1zaXplOiAwLjg3NWVtO1xuICAgICAgICBsaW5lLWhlaWdodDogMS41O1xuICAgIH1cbn1cbiJdfQ== */ \ No newline at end of file diff --git a/assets/css/build/index.css.map b/assets/css/build/index.css.map index f23650e..f23bc37 100644 --- a/assets/css/build/index.css.map +++ b/assets/css/build/index.css.map @@ -1 +1 @@ -{"version":3,"sources":["../src/index.scss%23sass","../src/frontend/_global.scss","../src/index.scss","../src/frontend/_text.scss","../src/frontend/_variables.scss","../src/frontend/_link.scss","../src/frontend/_video.scss","../src/frontend/_image.scss","../src/frontend/_audio.scss"],"names":[],"mappings":"AAAA,iGAAA;ACCC;ECCD,aAAA;AACA;ADEC;ECAD,aAAA;AACA;;ACDA;EACC,qDAAA;EACA,eAAA;ADID;;ACDA;EACC,6BAAA;EACA,eCoB4B;EDnB5B,kBCoB8B;AFhB/B;;ACDA;EACC,yCAAA;ADID;;ACDA;;EAEC,cCqDY;AFjDb;;ACDA;;EAEC,cCiDc;AF7Cf;;ACDA;;EAEC,cC6Cc;AFzCf;;ACDA;;EAEC,cCyCY;AFrCb;;ACDA;;EAEC,cCqCc;AFjCf;;ACDA;;EAEC,cCiCgB;AF7BjB;;ACDA;;EAEC,cC+Ba;AF3Bd;;ACDA;;EAEC,cCKwB;AFDzB;;ACDA;;EAEC,cCsBc;AFlBf;;AGvDA;EACC,mBAAA;EACA,uCAAA;EACA,kBAAA;EACA,aAAA;EACA,uBAAA;EACA,cAAA;EACA,gBAAA;AH0DD;AGxDC;EACC,cAAA;EACA,WAAA;EACA,qBAA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WAAA;AL+KpB;AKzKI;;;EACI,eAAA;AL6KR;AK1KI;;;EACI,eAAA;EACA,OAAA;EACA,qBAAA;AL8KR;AK3KI;;;;;;EAEI,gBAAA;ALiLR;AK7KI;;;;;;EAEI,gBAAA;ALmLR;AK/KI;;;;;;EAEI,eAAA;ALqLR;;AM5QA;EACI,WAAA;AN+QJ;;AM5QA;EACI,aAAA;EACA,mBAAA;AN+QJ;AM7QI;EACI,WAAA;EACA,YAAA;AN+QR;AM5QI;EACI,aAAA;EACA,cAAA;EACA,sBAAA;EACA,uBAAA;EACA,uBAAA;EACA,eAAA;AN8QR;AM3QI;EACI,iBAAA;EACA,gBAAA;AN6QR;AM1QI;;EAEI,kBAAA;EACA,gBAAA;AN4QR","file":"index.css","sourcesContent":["/* https://github.tumblr.net/Tumblr/tumblr/tree/master/client/standalone/blog-network-npf/styles*/\n@import \"frontend/variables\";\n@import \"frontend/global\";\n@import \"frontend/text\";\n@import \"frontend/link\";\n@import \"frontend/video\";\n@import \"frontend/image\";\n@import \"frontend/audio\";\n","body {\n\t> .iframe-container {\n\t\tdisplay: none;\n\t}\n\n\tiframe[src*=\"https://www.tumblr.com/dashboard/iframe\"] {\n\t\tdisplay: none;\n\t}\n}","// https://github.tumblr.net/Tumblr/tumblr/tree/master/client/standalone/blog-network-npf/styles\n@import \"frontend/variables\";\n@import \"frontend/global\";\n@import \"frontend/text\";\n@import \"frontend/link\";\n@import \"frontend/video\";\n@import \"frontend/image\";\n@import \"frontend/audio\";\n","// NPF text block styles - namely, to add NPF colors.\n\n// Disabled SelectorFormat to use underscored selector names\n// scss-lint:disable SelectorFormat\n\np.npf_quote {\n\tfont-family: Georgia, Times, \"Times New Roman\", serif;\n\tfont-size: 23px;\n}\n\np.npf_quirky {\n\tfont-family: Fairwater, serif;\n\tfont-size: $font-size-post-text-quirky;\n\tline-height: $line-height-post-text-quirky;\n}\n\np.npf_chat {\n\tfont-family: \"Source Code Pro\", monospace;\n}\n\np.npf_color_joey,\nspan.npf_color_joey {\n\tcolor: $color-joey;\n}\n\np.npf_color_monica,\nspan.npf_color_monica {\n\tcolor: $color-monica;\n}\n\np.npf_color_phoebe,\nspan.npf_color_phoebe {\n\tcolor: $color-phoebe;\n}\n\np.npf_color_ross,\nspan.npf_color_ross {\n\tcolor: $color-ross;\n}\n\np.npf_color_rachel,\nspan.npf_color_rachel {\n\tcolor: $color-rachel;\n}\n\np.npf_color_chandler,\nspan.npf_color_chandler {\n\tcolor: $color-chandler;\n}\n\np.npf_color_niles,\nspan.npf_color_niles {\n\tcolor: $color-niles;\n}\n\np.npf_color_frasier,\nspan.npf_color_frasier {\n\tcolor: $color-frasier;\n}\n\np.npf_color_mr_big,\nspan.npf_color_mr_big {\n\tcolor: $color-mr-big;\n}\n","@use \"sass:math\";\n\n$post-full-width: 540px;\n$post-full-radius: 3px;\n$post-full-v-padding: 15px;\n$post-full-h-padding: 20px;\n$post-full-note-item-h-padding: 14px;\n$color-post-members-only: #900020;\n\n$font-size-content: 14px;\n$line-height-content: math.round(1.5 * $font-size-content);\n\n// those match NPF heading size better\n$font-size-content-heading1: 26px;\n$line-height-content-heading1: math.round(1.3 * $font-size-content-heading1);\n$font-size-content-heading2: 20px;\n$line-height-content-heading2: math.round(1.3 * $font-size-content-heading2);\n\n$font-size-content-heading-medium: 30px;\n$line-height-content-heading-medium: math.round(1.3 * $font-size-content-heading-medium);\n$font-size-content-heading-large: 36px;\n$line-height-content-heading-large: math.round(1.3 * $font-size-content-heading-large);\n\n$font-size-pre: 11px;\n$line-height-pre: $font-size-pre;\n\n$font-size-icon: 24px;\n$line-height-icon: 24px;\n\n$font-size-base: $font-size-content;\n$line-height-base: 1.4;\n\n$font-size-post-text-quirky: 24px;\n$line-height-post-text-quirky: 1.3em;\n\n// These omit `serif` and `sans-serf` to make it\n// possible to splice in additional fallbacks\n$font-family-sans-face: \"Helvetica Neue\", \"HelveticaNeue\", helvetica, arial;\n$font-family-serif-face: georgia, times, \"Times New Roman\";\n$font-family-monospace-face: courier;\n\n// Standard faces\n$font-family-sans: $font-family-sans-face, sans-serif;\n$font-family-serif: georgia, times, \"Times New Roman\", serif;\n$font-family-monospace: $font-family-monospace-face, monospace;\n$font-family-korean: $font-family-sans-face, \"AppleGothic\", \"Malgun Gothic\", \"Dotum\", \"Gulim\", sans-serif;\n\n// Named faces\n$font-family-gibson: \"Gibson\", $font-family-sans;\n$font-family-walsheim: \"Walsheim\", \"Helvetica Neue\", \"HelveticaNeue\", helvetica, arial, sans-serif;\n$font-family-franklin-medium: \"Franklin Gothic Medium\", $font-family-sans;\n$font-family-franklin-medium-condensed: \"Franklin Gothic Medium Condensed\", $font-family-sans;\n$font-family-franklin-compressed: \"Franklin Gothic Compressed\", $font-family-sans;\n$font-family-source-code-pro: \"Source Code Pro\", $font-family-monospace;\n\n// Default \"app\" font family\n$font-family-base: $font-family-sans;\n\n$color-white: #fff;\n$color-black: #000;\n$color-tumblr-black: #444;\n$color-tumblr-blue: #36465d;\n$color-tumblr-dark-blue: #001935;\n\n$color-dank-smoke: #9da6af;\n$color-gloomy-cloud: #748089;\n// The below have Neue Color variants\n$color-likable-red: #d95e40;\n$color-cheezbort: #f2992e;\n$color-always-sunny: #f7dd38;\n$color-reblog-green: #56bc8a;\n$color-neat-blue: #529ecc;\n$color-purple-rain: #a77dc2;\n\n// These replace old accent colors\n$color-joey: #ff492f; // Red\n$color-monica: #ff8a00; // Orange\n$color-phoebe: #e8d73a; // Yellow\n$color-ross: #00cf35; // Green\n$color-rachel: #00b8ff; // Light Blue\n$color-chandler: #7c5cff; // Purple\n// These are new\n$color-frasier: $color-tumblr-dark-blue; // Dark Blue, new brand color\n$color-niles: #ff62ce; // Pink\n$color-mr-big: #000c1a; // Off-Black\n$color-explicit-red: #ff4930; // project x red\n\n\n$color-gray-100: $color-tumblr-black; // #444444\n\n$color-gray-60: prima-mix($color-tumblr-black, 0.6); // #8f8f8f\n$color-gray-40: prima-mix($color-tumblr-black, 0.4); // #b4b4b4\n$color-gray-25: prima-mix($color-tumblr-black, 0.25); // #d0d0d0\n$color-gray-13: prima-mix($color-tumblr-black, 0.13); // #e7e7e7\n$color-gray-7: prima-mix($color-tumblr-black, 0.07); // #f2f2f2\n\n\n$color-gray-60-transparent: unmatte-gray($color-gray-60); // rgba(0, 0, 0, 0.439216)\n$color-gray-40-transparent: unmatte-gray($color-gray-40); // rgba(0, 0, 0, 0.294118)\n$color-gray-25-transparent: unmatte-gray($color-gray-25); // rgba(0, 0, 0, 0.184314)\n$color-gray-13-transparent: unmatte-gray($color-gray-13); // rgba(0, 0, 0, 0.0941176)\n$color-gray-7-transparent: unmatte-gray($color-gray-7); // rgba(0, 0, 0, 0.0509804)\n\n\n$color-white-60-transparent: prima-mix($color-white, 0.6, transparent); // rgba(255, 255, 255, 0.6);\n$color-white-40-transparent: prima-mix($color-white, 0.4, transparent); // rgba(255, 255, 255, 0.4);\n$color-white-25-transparent: prima-mix($color-white, 0.25, transparent); // rgba(255, 255, 255, 0.25);\n$color-white-13-transparent: prima-mix($color-white, 0.13, transparent); // rgba(255, 255, 255, 0.13);\n$color-white-7-transparent: prima-mix($color-white, 0.07, transparent); // rgba(255, 255, 255, 0.07);\n\n\n@mixin brandBlue($prop) {\n\t#{$prop}: $color-tumblr-dark-blue;\n}\n\n@mixin brandBlueGray($prop, $percent) {\n\t#{$prop}: prima-mix($color-white, 1 - $percent, $color-tumblr-dark-blue);\n}\n\n@mixin transparentBrandBlue($prop, $opacity) {\n\t#{$prop}: rgba($color-tumblr-dark-blue, $opacity);\n}\n\n$accentColors: (\n\t\"red\": $color-joey,\n\t\"orange\": $color-monica,\n\t\"yellow\": $color-phoebe,\n\t\"green\": $color-ross,\n\t\"blue\": $color-rachel,\n\t\"purple\": $color-chandler,\n\t\"black\": $color-black,\n\n\t\"video\": $color-niles,\n);\n\n@function newAccentColor($color) {\n\n\t@if (not map_has_key($accentColors, $color)) {\n\n\t\t@error 'Unrecognized accent color \"#{$color}\" in accentColor mixin';\n\t}\n\n\t@return map-get($accentColors, $color);\n}\n\n@mixin accentColor($prop, $color) {\n\t#{$prop}: newaccentcolor($color);\n}\n\n@mixin updatedWhite($opacity: 1, $prop: color) {\n\t#{$prop}: rgba($color-white, $opacity);\n}\n\n@mixin updatedBlack($opacity: 1, $prop: color) {\n\t#{$prop}: rgba($color-black, $opacity);\n}\n","// NPF link block styles\n\n$title-line-height: 34px;\n$description-line-height: 24px;\n\n@mixin text-cutoff {\n\toverflow: hidden;\n\toverflow-wrap: anywhere;\n\ttext-overflow: ellipsis;\n}\n\ndiv.npf-link-block {\n\talign-items: center;\n\tborder: 1px solid $color-gray-25;\n\tborder-radius: 6px;\n\tdisplay: flex;\n\tjustify-content: center;\n\tmargin: 15px 0;\n\toverflow: hidden;\n\n\t> a {\n\t\tcolor: inherit;\n\t\twidth: 100%;\n\t\ttext-decoration: none;\n\t}\n\n\t.title {\n\t\tfont-size: 25px;\n\t\tline-height: $title-line-height;\n\t\tmax-height: $title-line-height * 4; // This needs to be equal to (line-height * 4) - We want to show a maximum of 4 lines here\n\n\t\t@include text-cutoff;\n\t}\n\n\t&.no-poster .title {\n\t\tpadding: 16px 12px 0;\n\t}\n\n\t.poster {\n\t\talign-items: center;\n\t\tbackground-position: center;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-size: cover;\n\t\tbackground-clip: content-box;\n\t\tborder-bottom: 1px solid $color-gray-25;\n\t\tdisplay: flex;\n\t\theight: 250px;\n\t\tjustify-content: center;\n\t\tposition: relative;\n\n\t\t&::before {\n\t\t\tbackground: $color-black;\n\t\t\tcontent: \"\";\n\t\t\tdisplay: block;\n\t\t\theight: 100%;\n\t\t\topacity: 0.4;\n\t\t\tposition: absolute;\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t.title {\n\t\t\tcolor: $color-white;\n\t\t\tfont-weight: 400;\n\t\t\tpadding: 16px 12px;\n\t\t\tposition: absolute;\n\t\t\ttext-align: center;\n\t\t}\n\t}\n\n\t.bottom {\n\t\tcolor: inherit;\n\t\tline-height: 24px;\n\t\tpadding: 8px 12px 16px;\n\n\t\t.description {\n\t\t\tcolor: inherit;\n\t\t\tfont-size: 16px;\n\t\t\tline-height: $description-line-height;\n\t\t\tmargin: 0;\n\t\t\tmax-height: $description-line-height * 2; // This needs to be equal to (line-height * 2) - We want to show a maximum of 2 lines here\n\n\t\t\t@include text-cutoff;\n\t\t}\n\n\t\t.site-name {\n\t\t\tcolor: inherit;\n\t\t\tfont-size: 12.5px;\n\t\t\tfont-weight: 400;\n\t\t\tline-height: 18px;\n\t\t\tmargin-top: 10px;\n\t\t\topacity: 0.65;\n\t\t\ttext-transform: uppercase;\n\t\t}\n\t}\n}\n","// NPF video block styles\nvideo,\naudio,\nimg,\n.wp-caption,\niframe {\n\tmax-width: 100%;\n}\n\n.tmblr-full > video {\n\theight: 100%;\n\twidth: 100%;\n}\n","// NPF image block styles - most importantly, to render NPF-created photosets.\n// stylelint-disable no-descending-specificity -- unnecessary.\n\n.post,\n.post-content,\nbody {\n // NPF photoset wrapper\n div.npf_row {\n align-items: stretch;\n display: flex;\n margin-top: 0;\n overflow: hidden;\n\n figure.tmblr-full {\n flex: 1;\n justify-content: space-between;\n margin: 0;\n overflow-y: hidden;\n }\n\n figure.tmblr-full,\n .npf_col {\n display: flex;\n flex-direction: column;\n padding-left: 2px;\n padding-right: 2px;\n\n &:first-child {\n padding-left: 0;\n }\n\n &:last-child {\n padding-right: 0;\n }\n }\n\n img {\n height: auto;\n }\n\n .npf_col {\n flex: 1;\n\n figure {\n position: relative;\n width: 100%;\n margin: 0;\n text-align: left;\n\n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n p.tmblr-attribution {\n box-sizing: border-box;\n width: 100%;\n }\n }\n }\n }\n\n figure[data-enable-lightbox=\"1\"] {\n cursor: pointer;\n }\n\n a.post_media_photo_anchor {\n cursor: pointer;\n flex: 1;\n text-decoration: none;\n }\n\n p + div.npf_row,\n div.npf_row + p {\n margin-top: 15px;\n }\n\n // Add a margin if following/preceding a video\n .crt-video + div.npf_row,\n div.npf_row + .crt-video {\n margin-top: 15px;\n }\n\n // Horizontal margins between photoset rows\n div.npf_row + figure.tmblr-full,\n div.npf_row + div.npf_row {\n margin-top: 4px;\n }\n}\n",".tmblr-full > audio {\n width: 100%;\n}\n\n.tmblr-full > .audio-caption {\n display: flex;\n flex-direction: row;\n\n .album-cover {\n width: 85px;\n height: 85px;\n }\n\n .audio-details {\n display: flex;\n flex: 1 0 auto;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n padding: 0 20px;\n }\n\n .title {\n font-weight: bold;\n line-height: 1.5;\n }\n\n .artist,\n .album {\n font-size: 0.875em;\n line-height: 1.5;\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/index.scss%23sass","../src/frontend/_global.scss","../src/index.scss","../src/frontend/_text.scss","../src/frontend/_variables.scss","../src/frontend/_link.scss","../src/frontend/_video.scss","../src/frontend/_image.scss","../src/frontend/_audio.scss"],"names":[],"mappings":"AAAA,iGAAA;ACCC;ECCD,aAAA;AACA;ADEC;ECAD,aAAA;AACA;ADGC;EACC,eAAA;EACA,sBAAA;ACDF;;ACLA;EACC,qDAAA;EACA,eAAA;ADQD;;ACLA;EACC,6BAAA;EACA,eCoB4B;EDnB5B,kBCoB8B;AFZ/B;;ACLA;EACC,yCAAA;ADQD;;ACLA;;EAEC,cCqDY;AF7Cb;;ACLA;;EAEC,cCiDc;AFzCf;;ACLA;;EAEC,cC6Cc;AFrCf;;ACLA;;EAEC,cCyCY;AFjCb;;ACLA;;EAEC,cCqCc;AF7Bf;;ACLA;;EAEC,cCiCgB;AFzBjB;;ACLA;;EAEC,cC+Ba;AFvBd;;ACLA;;EAEC,cCKwB;AFGzB;;ACLA;;EAEC,cCsBc;AFdf;;AG3DA;EACC,mBAAA;EACA,uCAAA;EACA,kBAAA;EACA,aAAA;EACA,uBAAA;EACA,cAAA;EACA,gBAAA;AH8DD;AG5DC;EACC,cAAA;EACA,WAAA;EACA,qBAAA;AH8DF;AG3DC;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;;;EACI,eAAA;ALiLR;AK9KI;;;EACI,eAAA;EACA,OAAA;EACA,qBAAA;ALkLR;AK/KI;;;;;;EAEI,gBAAA;ALqLR;AKjLI;;;;;;EAEI,gBAAA;ALuLR;AKnLI;;;;;;EAEI,eAAA;ALyLR;;AMhRA;EACI,WAAA;ANmRJ;;AMhRA;EACI,aAAA;EACA,mBAAA;ANmRJ;AMjRI;EACI,WAAA;EACA,YAAA;ANmRR;AMhRI;EACI,aAAA;EACA,cAAA;EACA,sBAAA;EACA,uBAAA;EACA,uBAAA;EACA,eAAA;ANkRR;AM/QI;EACI,iBAAA;EACA,gBAAA;ANiRR;AM9QI;;EAEI,kBAAA;EACA,gBAAA;ANgRR","file":"index.css","sourcesContent":["/* https://github.tumblr.net/Tumblr/tumblr/tree/master/client/standalone/blog-network-npf/styles*/\n@import \"frontend/variables\";\n@import \"frontend/global\";\n@import \"frontend/text\";\n@import \"frontend/link\";\n@import \"frontend/video\";\n@import \"frontend/image\";\n@import \"frontend/audio\";\n","body {\n\t> .iframe-container {\n\t\tdisplay: none;\n\t}\n\n\tiframe[src*=\"https://www.tumblr.com/dashboard/iframe\"] {\n\t\tdisplay: none;\n\t}\n\n\t.t3-likes {\n\t\tmin-height: 0px;\n\t\theight: 0px !important;\n\t}\n}","// https://github.tumblr.net/Tumblr/tumblr/tree/master/client/standalone/blog-network-npf/styles\n@import \"frontend/variables\";\n@import \"frontend/global\";\n@import \"frontend/text\";\n@import \"frontend/link\";\n@import \"frontend/video\";\n@import \"frontend/image\";\n@import \"frontend/audio\";\n","// NPF text block styles - namely, to add NPF colors.\n\n// Disabled SelectorFormat to use underscored selector names\n// scss-lint:disable SelectorFormat\n\np.npf_quote {\n\tfont-family: Georgia, Times, \"Times New Roman\", serif;\n\tfont-size: 23px;\n}\n\np.npf_quirky {\n\tfont-family: Fairwater, serif;\n\tfont-size: $font-size-post-text-quirky;\n\tline-height: $line-height-post-text-quirky;\n}\n\np.npf_chat {\n\tfont-family: \"Source Code Pro\", monospace;\n}\n\np.npf_color_joey,\nspan.npf_color_joey {\n\tcolor: $color-joey;\n}\n\np.npf_color_monica,\nspan.npf_color_monica {\n\tcolor: $color-monica;\n}\n\np.npf_color_phoebe,\nspan.npf_color_phoebe {\n\tcolor: $color-phoebe;\n}\n\np.npf_color_ross,\nspan.npf_color_ross {\n\tcolor: $color-ross;\n}\n\np.npf_color_rachel,\nspan.npf_color_rachel {\n\tcolor: $color-rachel;\n}\n\np.npf_color_chandler,\nspan.npf_color_chandler {\n\tcolor: $color-chandler;\n}\n\np.npf_color_niles,\nspan.npf_color_niles {\n\tcolor: $color-niles;\n}\n\np.npf_color_frasier,\nspan.npf_color_frasier {\n\tcolor: $color-frasier;\n}\n\np.npf_color_mr_big,\nspan.npf_color_mr_big {\n\tcolor: $color-mr-big;\n}\n","@use \"sass:math\";\n\n$post-full-width: 540px;\n$post-full-radius: 3px;\n$post-full-v-padding: 15px;\n$post-full-h-padding: 20px;\n$post-full-note-item-h-padding: 14px;\n$color-post-members-only: #900020;\n\n$font-size-content: 14px;\n$line-height-content: math.round(1.5 * $font-size-content);\n\n// those match NPF heading size better\n$font-size-content-heading1: 26px;\n$line-height-content-heading1: math.round(1.3 * $font-size-content-heading1);\n$font-size-content-heading2: 20px;\n$line-height-content-heading2: math.round(1.3 * $font-size-content-heading2);\n\n$font-size-content-heading-medium: 30px;\n$line-height-content-heading-medium: math.round(1.3 * $font-size-content-heading-medium);\n$font-size-content-heading-large: 36px;\n$line-height-content-heading-large: math.round(1.3 * $font-size-content-heading-large);\n\n$font-size-pre: 11px;\n$line-height-pre: $font-size-pre;\n\n$font-size-icon: 24px;\n$line-height-icon: 24px;\n\n$font-size-base: $font-size-content;\n$line-height-base: 1.4;\n\n$font-size-post-text-quirky: 24px;\n$line-height-post-text-quirky: 1.3em;\n\n// These omit `serif` and `sans-serf` to make it\n// possible to splice in additional fallbacks\n$font-family-sans-face: \"Helvetica Neue\", \"HelveticaNeue\", helvetica, arial;\n$font-family-serif-face: georgia, times, \"Times New Roman\";\n$font-family-monospace-face: courier;\n\n// Standard faces\n$font-family-sans: $font-family-sans-face, sans-serif;\n$font-family-serif: georgia, times, \"Times New Roman\", serif;\n$font-family-monospace: $font-family-monospace-face, monospace;\n$font-family-korean: $font-family-sans-face, \"AppleGothic\", \"Malgun Gothic\", \"Dotum\", \"Gulim\", sans-serif;\n\n// Named faces\n$font-family-gibson: \"Gibson\", $font-family-sans;\n$font-family-walsheim: \"Walsheim\", \"Helvetica Neue\", \"HelveticaNeue\", helvetica, arial, sans-serif;\n$font-family-franklin-medium: \"Franklin Gothic Medium\", $font-family-sans;\n$font-family-franklin-medium-condensed: \"Franklin Gothic Medium Condensed\", $font-family-sans;\n$font-family-franklin-compressed: \"Franklin Gothic Compressed\", $font-family-sans;\n$font-family-source-code-pro: \"Source Code Pro\", $font-family-monospace;\n\n// Default \"app\" font family\n$font-family-base: $font-family-sans;\n\n$color-white: #fff;\n$color-black: #000;\n$color-tumblr-black: #444;\n$color-tumblr-blue: #36465d;\n$color-tumblr-dark-blue: #001935;\n\n$color-dank-smoke: #9da6af;\n$color-gloomy-cloud: #748089;\n// The below have Neue Color variants\n$color-likable-red: #d95e40;\n$color-cheezbort: #f2992e;\n$color-always-sunny: #f7dd38;\n$color-reblog-green: #56bc8a;\n$color-neat-blue: #529ecc;\n$color-purple-rain: #a77dc2;\n\n// These replace old accent colors\n$color-joey: #ff492f; // Red\n$color-monica: #ff8a00; // Orange\n$color-phoebe: #e8d73a; // Yellow\n$color-ross: #00cf35; // Green\n$color-rachel: #00b8ff; // Light Blue\n$color-chandler: #7c5cff; // Purple\n// These are new\n$color-frasier: $color-tumblr-dark-blue; // Dark Blue, new brand color\n$color-niles: #ff62ce; // Pink\n$color-mr-big: #000c1a; // Off-Black\n$color-explicit-red: #ff4930; // project x red\n\n\n$color-gray-100: $color-tumblr-black; // #444444\n\n$color-gray-60: prima-mix($color-tumblr-black, 0.6); // #8f8f8f\n$color-gray-40: prima-mix($color-tumblr-black, 0.4); // #b4b4b4\n$color-gray-25: prima-mix($color-tumblr-black, 0.25); // #d0d0d0\n$color-gray-13: prima-mix($color-tumblr-black, 0.13); // #e7e7e7\n$color-gray-7: prima-mix($color-tumblr-black, 0.07); // #f2f2f2\n\n\n$color-gray-60-transparent: unmatte-gray($color-gray-60); // rgba(0, 0, 0, 0.439216)\n$color-gray-40-transparent: unmatte-gray($color-gray-40); // rgba(0, 0, 0, 0.294118)\n$color-gray-25-transparent: unmatte-gray($color-gray-25); // rgba(0, 0, 0, 0.184314)\n$color-gray-13-transparent: unmatte-gray($color-gray-13); // rgba(0, 0, 0, 0.0941176)\n$color-gray-7-transparent: unmatte-gray($color-gray-7); // rgba(0, 0, 0, 0.0509804)\n\n\n$color-white-60-transparent: prima-mix($color-white, 0.6, transparent); // rgba(255, 255, 255, 0.6);\n$color-white-40-transparent: prima-mix($color-white, 0.4, transparent); // rgba(255, 255, 255, 0.4);\n$color-white-25-transparent: prima-mix($color-white, 0.25, transparent); // rgba(255, 255, 255, 0.25);\n$color-white-13-transparent: prima-mix($color-white, 0.13, transparent); // rgba(255, 255, 255, 0.13);\n$color-white-7-transparent: prima-mix($color-white, 0.07, transparent); // rgba(255, 255, 255, 0.07);\n\n\n@mixin brandBlue($prop) {\n\t#{$prop}: $color-tumblr-dark-blue;\n}\n\n@mixin brandBlueGray($prop, $percent) {\n\t#{$prop}: prima-mix($color-white, 1 - $percent, $color-tumblr-dark-blue);\n}\n\n@mixin transparentBrandBlue($prop, $opacity) {\n\t#{$prop}: rgba($color-tumblr-dark-blue, $opacity);\n}\n\n$accentColors: (\n\t\"red\": $color-joey,\n\t\"orange\": $color-monica,\n\t\"yellow\": $color-phoebe,\n\t\"green\": $color-ross,\n\t\"blue\": $color-rachel,\n\t\"purple\": $color-chandler,\n\t\"black\": $color-black,\n\n\t\"video\": $color-niles,\n);\n\n@function newAccentColor($color) {\n\n\t@if (not map_has_key($accentColors, $color)) {\n\n\t\t@error 'Unrecognized accent color \"#{$color}\" in accentColor mixin';\n\t}\n\n\t@return map-get($accentColors, $color);\n}\n\n@mixin accentColor($prop, $color) {\n\t#{$prop}: newaccentcolor($color);\n}\n\n@mixin updatedWhite($opacity: 1, $prop: color) {\n\t#{$prop}: rgba($color-white, $opacity);\n}\n\n@mixin updatedBlack($opacity: 1, $prop: color) {\n\t#{$prop}: rgba($color-black, $opacity);\n}\n","// NPF link block styles\n\n$title-line-height: 34px;\n$description-line-height: 24px;\n\n@mixin text-cutoff {\n\toverflow: hidden;\n\toverflow-wrap: anywhere;\n\ttext-overflow: ellipsis;\n}\n\ndiv.npf-link-block {\n\talign-items: center;\n\tborder: 1px solid $color-gray-25;\n\tborder-radius: 6px;\n\tdisplay: flex;\n\tjustify-content: center;\n\tmargin: 15px 0;\n\toverflow: hidden;\n\n\t> a {\n\t\tcolor: inherit;\n\t\twidth: 100%;\n\t\ttext-decoration: none;\n\t}\n\n\t.title {\n\t\tfont-size: 25px;\n\t\tline-height: $title-line-height;\n\t\tmax-height: $title-line-height * 4; // This needs to be equal to (line-height * 4) - We want to show a maximum of 4 lines here\n\n\t\t@include text-cutoff;\n\t}\n\n\t&.no-poster .title {\n\t\tpadding: 16px 12px 0;\n\t}\n\n\t.poster {\n\t\talign-items: center;\n\t\tbackground-position: center;\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-size: cover;\n\t\tbackground-clip: content-box;\n\t\tborder-bottom: 1px solid $color-gray-25;\n\t\tdisplay: flex;\n\t\theight: 250px;\n\t\tjustify-content: center;\n\t\tposition: relative;\n\n\t\t&::before {\n\t\t\tbackground: $color-black;\n\t\t\tcontent: \"\";\n\t\t\tdisplay: block;\n\t\t\theight: 100%;\n\t\t\topacity: 0.4;\n\t\t\tposition: absolute;\n\t\t\twidth: 100%;\n\t\t}\n\n\t\t.title {\n\t\t\tcolor: $color-white;\n\t\t\tfont-weight: 400;\n\t\t\tpadding: 16px 12px;\n\t\t\tposition: absolute;\n\t\t\ttext-align: center;\n\t\t}\n\t}\n\n\t.bottom {\n\t\tcolor: inherit;\n\t\tline-height: 24px;\n\t\tpadding: 8px 12px 16px;\n\n\t\t.description {\n\t\t\tcolor: inherit;\n\t\t\tfont-size: 16px;\n\t\t\tline-height: $description-line-height;\n\t\t\tmargin: 0;\n\t\t\tmax-height: $description-line-height * 2; // This needs to be equal to (line-height * 2) - We want to show a maximum of 2 lines here\n\n\t\t\t@include text-cutoff;\n\t\t}\n\n\t\t.site-name {\n\t\t\tcolor: inherit;\n\t\t\tfont-size: 12.5px;\n\t\t\tfont-weight: 400;\n\t\t\tline-height: 18px;\n\t\t\tmargin-top: 10px;\n\t\t\topacity: 0.65;\n\t\t\ttext-transform: uppercase;\n\t\t}\n\t}\n}\n","// NPF video block styles\nvideo,\naudio,\nimg,\n.wp-caption,\niframe {\n\tmax-width: 100%;\n}\n\n.tmblr-full > video {\n\theight: 100%;\n\twidth: 100%;\n}\n","// NPF image block styles - most importantly, to render NPF-created photosets.\n// stylelint-disable no-descending-specificity -- unnecessary.\n\n.post,\n.post-content,\nbody {\n // NPF photoset wrapper\n div.npf_row {\n align-items: stretch;\n display: flex;\n margin-top: 0;\n overflow: hidden;\n\n figure.tmblr-full {\n flex: 1;\n justify-content: space-between;\n margin: 0;\n overflow-y: hidden;\n }\n\n figure.tmblr-full,\n .npf_col {\n display: flex;\n flex-direction: column;\n padding-left: 2px;\n padding-right: 2px;\n\n &:first-child {\n padding-left: 0;\n }\n\n &:last-child {\n padding-right: 0;\n }\n }\n\n img {\n height: auto;\n }\n\n .npf_col {\n flex: 1;\n\n figure {\n position: relative;\n width: 100%;\n margin: 0;\n text-align: left;\n\n img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n\n p.tmblr-attribution {\n box-sizing: border-box;\n width: 100%;\n }\n }\n }\n }\n\n figure[data-enable-lightbox=\"1\"] {\n cursor: pointer;\n }\n\n a.post_media_photo_anchor {\n cursor: pointer;\n flex: 1;\n text-decoration: none;\n }\n\n p + div.npf_row,\n div.npf_row + p {\n margin-top: 15px;\n }\n\n // Add a margin if following/preceding a video\n .crt-video + div.npf_row,\n div.npf_row + .crt-video {\n margin-top: 15px;\n }\n\n // Horizontal margins between photoset rows\n div.npf_row + figure.tmblr-full,\n div.npf_row + div.npf_row {\n margin-top: 4px;\n }\n}\n",".tmblr-full > audio {\n width: 100%;\n}\n\n.tmblr-full > .audio-caption {\n display: flex;\n flex-direction: row;\n\n .album-cover {\n width: 85px;\n height: 85px;\n }\n\n .audio-details {\n display: flex;\n flex: 1 0 auto;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n padding: 0 20px;\n }\n\n .title {\n font-weight: bold;\n line-height: 1.5;\n }\n\n .artist,\n .album {\n font-size: 0.875em;\n line-height: 1.5;\n }\n}\n"]} \ No newline at end of file diff --git a/assets/css/src/frontend/_global.scss b/assets/css/src/frontend/_global.scss index 02ce30e..3e284a3 100644 --- a/assets/css/src/frontend/_global.scss +++ b/assets/css/src/frontend/_global.scss @@ -1,9 +1,23 @@ body { - > .iframe-container { + >.iframe-container { display: none; } iframe[src*="https://www.tumblr.com/dashboard/iframe"] { display: none; } + + div.jetpack-likes-widget-wrapper.t3-likes { + min-height: 0px; + position: static; + + .likes-widget-placeholder.post-likes-widget-placeholder { + display: none; + } + + iframe { + width: 20px !important; + height: 20px !important; + } + } } \ No newline at end of file diff --git a/assets/js/build/customizer-rtl.css b/assets/js/build/customizer-rtl.css new file mode 100644 index 0000000..6a5e47f --- /dev/null +++ b/assets/js/build/customizer-rtl.css @@ -0,0 +1 @@ +.customize-control-code_editor .CodeMirror,.customize-control-code_editor textarea{height:100%}.customizer-resizer{display:none}.wp-full-overlay-sidebar{max-width:100%}.resizable .customizer-resizer{content:"";display:block;height:100%;width:4px;position:absolute;left:-4px;margin-top:-30px;cursor:pointer;cursor:col-resize;z-index:9999999;opacity:.8}.resizable .wp-full-overlay-sidebar{border-left-width:4px}.resizable .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-286px}.resizable.wp-core-ui .wp-full-overlay .collapse-sidebar{right:22px}.no-animation .wp-full-overlay,.no-animation .wp-full-overlay-sidebar,.no-animation .wp-full-overlay .collapse-sidebar,.no-animation .wp-full-overlay-main{transition:none}.fullwidth-customizer #customize-controls{width:100%}.fullwidth-customizer .wp-full-overlay.expanded{margin-right:0}.fullwidth-customizer .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{bottom:0}.fullwidth-customizer .customize-controls-preview-toggle{display:block;position:absolute;top:0;right:48px;line-height:45px;font-size:14px;padding:0 12px;margin:0;height:45px;background:#eee;border-left:1px solid #ddd;color:#444;cursor:pointer;transition:color .1s ease-in-out,background .1s ease-in-out}.fullwidth-customizer #customize-footer-actions,.fullwidth-customizer #customize-preview,.fullwidth-customizer .customize-controls-preview-toggle .controls,.fullwidth-customizer .preview-only .wp-full-overlay-sidebar-content,.fullwidth-customizer .preview-only .customize-controls-preview-toggle .preview{display:none}.fullwidth-customizer .customize-controls-preview-toggle .preview:before,.fullwidth-customizer .customize-controls-preview-toggle .controls:before{font:normal 20px/1 dashicons;content:"";position:relative;top:4px;margin-left:6px}.fullwidth-customizer .customize-controls-preview-toggle .controls:before{content:""}.fullwidth-customizer .preview-only #customize-controls{height:45px}.fullwidth-customizer .preview-only #customize-preview,.fullwidth-customizer .preview-only .customize-controls-preview-toggle .controls{display:block}.fullwidth-customizer #customize-preview{top:45px;bottom:0;height:auto}.fullwidth-customizer.wp-core-ui.wp-customizer .button{padding:6px 14px;line-height:normal;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}.fullwidth-customizer.wp-core-ui.wp-customizer #customize-header-actions .button-primary{margin-top:6px} diff --git a/assets/js/build/customizer.asset.php b/assets/js/build/customizer.asset.php new file mode 100644 index 0000000..5ca915e --- /dev/null +++ b/assets/js/build/customizer.asset.php @@ -0,0 +1 @@ + array(), 'version' => '50d298de0e00f7abc982'); diff --git a/assets/js/build/customizer.css b/assets/js/build/customizer.css new file mode 100644 index 0000000..edc2789 --- /dev/null +++ b/assets/js/build/customizer.css @@ -0,0 +1 @@ +.customize-control-code_editor .CodeMirror,.customize-control-code_editor textarea{height:100%}.customizer-resizer{display:none}.wp-full-overlay-sidebar{max-width:100%}.resizable .customizer-resizer{content:"";display:block;height:100%;width:4px;position:absolute;right:-4px;margin-top:-30px;cursor:pointer;cursor:col-resize;z-index:9999999;opacity:.8}.resizable .wp-full-overlay-sidebar{border-right-width:4px}.resizable .wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-286px}.resizable.wp-core-ui .wp-full-overlay .collapse-sidebar{left:22px}.no-animation .wp-full-overlay,.no-animation .wp-full-overlay-sidebar,.no-animation .wp-full-overlay .collapse-sidebar,.no-animation .wp-full-overlay-main{transition:none}.fullwidth-customizer #customize-controls{width:100%}.fullwidth-customizer .wp-full-overlay.expanded{margin-left:0}.fullwidth-customizer .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{bottom:0}.fullwidth-customizer .customize-controls-preview-toggle{display:block;position:absolute;top:0;left:48px;line-height:45px;font-size:14px;padding:0 12px;margin:0;height:45px;background:#eee;border-right:1px solid #ddd;color:#444;cursor:pointer;transition:color .1s ease-in-out,background .1s ease-in-out}.fullwidth-customizer #customize-footer-actions,.fullwidth-customizer #customize-preview,.fullwidth-customizer .customize-controls-preview-toggle .controls,.fullwidth-customizer .preview-only .wp-full-overlay-sidebar-content,.fullwidth-customizer .preview-only .customize-controls-preview-toggle .preview{display:none}.fullwidth-customizer .customize-controls-preview-toggle .preview:before,.fullwidth-customizer .customize-controls-preview-toggle .controls:before{font:normal 20px/1 dashicons;content:"";position:relative;top:4px;margin-right:6px}.fullwidth-customizer .customize-controls-preview-toggle .controls:before{content:""}.fullwidth-customizer .preview-only #customize-controls{height:45px}.fullwidth-customizer .preview-only #customize-preview,.fullwidth-customizer .preview-only .customize-controls-preview-toggle .controls{display:block}.fullwidth-customizer #customize-preview{top:45px;bottom:0;height:auto}.fullwidth-customizer.wp-core-ui.wp-customizer .button{padding:6px 14px;line-height:normal;font-size:14px;vertical-align:middle;height:auto;margin-bottom:4px}.fullwidth-customizer.wp-core-ui.wp-customizer #customize-header-actions .button-primary{margin-top:6px} diff --git a/assets/js/build/customizer.js b/assets/js/build/customizer.js new file mode 100644 index 0000000..6044dc5 --- /dev/null +++ b/assets/js/build/customizer.js @@ -0,0 +1 @@ +(()=>{"use strict";window.wp=window.wp||{},window.wp.customize=window.wp.customize||{},function(e,n,i,o){const t={};o.customize.resizer=t;let s=0,r=!1;t.cache=function(){t.$={},t.$.window=i(e),t.$.body=i(n.body),t.$.customizer=i(n.getElementById("customize-controls")),t.$.overlay=i(".wp-full-overlay.expanded"),t.$.collapser=i(".collapse-sidebar-label")},t.init=function(){t.cache(),t.$.customizer.append('
'),t.$.resizer=i(".customizer-resizer"),t.checkWidth(),t.events()},t.events=function(){t.initIframeMouseEvents(),t.$.resizer.on("mousedown",t.resizerEngage),t.$.collapser.on("click",t.snapToDefault),i(e).resize(_.debounce(t.checkWidth,50))},t.checkWidth=function(){if(t.$.window.width()<640)return r=!1,t.$.body.removeClass("resizable"),t.snapToDefault();r||(t.$.body.addClass("resizable"),r=!0)},t.resizerEngage=function(e){const o=t.$.window.width(),s=o-t.$.customizer.width();e.preventDefault(),s<100?(t.sizeCustomizer(o-320),t.fullWidth("no")):(t.$.customizer.addClass("no-animation"),i(n).on("mousemove",t.resizerMovement),i(n).on("mouseup",t.resizerDisengage))},t.resizerMovement=function(e){const n=s100?(t.snapToDefault(),t.resizerDisengage(),t.fullWidth("yes")):(t.fullWidth("no"),s>=320||s>=300&&n?t.sizeCustomizer(s):!n&&s>270&&s<320?t.snapToDefault():void(s<270&&(t.snapToDefault(),t.resizerDisengage(),t.$.collapser.trigger("click"))))},t.resizerDisengage=function(){i(n).off("mousemove",t.resizerMovement),i(n).off("mouseup",t.resizerDisengage),t.$.customizer.removeClass("no-animation")},t.fullWidth=function(e){const n="yes"===e?"addClass":"removeClass";t.$.body[n]("fullwidth-customizer")},t.snapToDefault=function(){t.sizeCustomizer()},t.sizeCustomizer=function(e){e=e||"",t.$.overlay.css({"margin-left":e}),t.$.resizer.css({"margin-left":e?e-5:e}),t.$.customizer.width(e)},t.initIframeMouseEvents=function(){setTimeout((function(){const e=t.$.overlay.find("iframe");e.length?(t.bubbleMouseEvent(e[0],"mousemove"),t.bubbleMouseEvent(e[0],"mouseup")):t.initIframeMouseEvents()}),500)},t.bubbleMouseEvent=function(i,o){const t="on"+o,s=i.contentWindow[t];i.contentWindow[t]=function(t){s&&s(t);const r=n.createEvent("MouseEvents"),u=i.getBoundingClientRect();r.initMouseEvent(o,!0,!1,e,t.detail,t.screenX,t.screenY,t.clientX+u.left,t.clientY+u.top,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,null),i.dispatchEvent(r)}},o.customize.bind("ready",t.init)}(window,document,jQuery,window.wp)})(); \ No newline at end of file diff --git a/assets/js/src/customizer.js b/assets/js/src/customizer.js new file mode 100644 index 0000000..c64e1e0 --- /dev/null +++ b/assets/js/src/customizer.js @@ -0,0 +1,207 @@ +/* global _ */ +/* global jQuery */ + +import './customizer.scss'; + +window.wp = window.wp || {}; +window.wp.customize = window.wp.customize || {}; + +( function ( window, document, $, wp ) { + 'use strict'; + + const app = {}; + wp.customize.resizer = app; + let mouseLeft = 0; + let expanded = false; + + app.cache = function () { + app.$ = {}; + app.$.window = $( window ); + app.$.body = $( document.body ); + app.$.customizer = $( document.getElementById( 'customize-controls' ) ); + app.$.overlay = $( '.wp-full-overlay.expanded' ); + app.$.collapser = $( '.collapse-sidebar-label' ); + }; + + app.init = function () { + app.cache(); + + app.$.customizer.append( '
' ); + app.$.resizer = $( '.customizer-resizer' ); + app.checkWidth(); + + app.events(); + }; + + app.events = function () { + // We need the iframe to bubble up mouse events + app.initIframeMouseEvents(); + + app.$.resizer.on( 'mousedown', app.resizerEngage ); + app.$.collapser.on( 'click', app.snapToDefault ); + $( window ).resize( _.debounce( app.checkWidth, 50 ) ); + }; + + app.checkWidth = function () { + const winWidth = app.$.window.width(); + + // the breakpoint where mobile view is triggered. + if ( winWidth < 640 ) { + expanded = false; + app.$.body.removeClass( 'resizable' ); + return app.snapToDefault(); + } + + if ( ! expanded ) { + app.$.body.addClass( 'resizable' ); + expanded = true; + } + }; + + app.resizerEngage = function ( evt ) { + const winWidth = app.$.window.width(); + const iframeWidth = winWidth - app.$.customizer.width(); + + evt.preventDefault(); + + if ( iframeWidth < 100 ) { + /* + Decrease customizer width below + threshold where it snaps to full-width + */ + app.sizeCustomizer( winWidth - 320 ); + app.fullWidth( 'no' ); + } else { + // Disable customizer sizing animation + app.$.customizer.addClass( 'no-animation' ); + + // add event listeners for the dragging duration + $( document ).on( 'mousemove', app.resizerMovement ); + $( document ).on( 'mouseup', app.resizerDisengage ); + } + }; + + app.resizerMovement = function ( evt ) { + // Check if the customizer is expanding (vs shrinking) + const expanding = mouseLeft < evt.pageX; + // Re-cache mouseLeft + mouseLeft = evt.pageX; + + const iframeWidth = app.$.window.width() - mouseLeft; + + // If iframe width is less than a workable width, snap full-screen + if ( iframeWidth < 300 && iframeWidth > 100 ) { + app.snapToDefault(); + app.resizerDisengage(); + + return app.fullWidth( 'yes' ); + } + + app.fullWidth( 'no' ); + + // If we're expanding larger than default, increae the width + if ( mouseLeft >= 320 || ( mouseLeft >= 300 && expanding ) ) { + return app.sizeCustomizer( mouseLeft ); + } + + // If we're condensing, and close to our default, snap to it + if ( ! expanding && mouseLeft > 270 && mouseLeft < 320 ) { + return app.snapToDefault(); + } + + // If we're condensing past our default, just trigger the collapse + if ( mouseLeft < 270 ) { + app.snapToDefault(); + app.resizerDisengage(); + app.$.collapser.trigger( 'click' ); + } + }; + + app.resizerDisengage = function () { + // remove temp. event listeners + $( document ).off( 'mousemove', app.resizerMovement ); + $( document ).off( 'mouseup', app.resizerDisengage ); + + // Re-enable customizer sizing animation + app.$.customizer.removeClass( 'no-animation' ); + }; + + app.fullWidth = function ( makeFull ) { + const method = 'yes' === makeFull ? 'addClass' : 'removeClass'; + app.$.body[ method ]( 'fullwidth-customizer' ); + }; + + app.snapToDefault = function () { + app.sizeCustomizer(); + }; + + app.sizeCustomizer = function ( size ) { + size = size || ''; + // Overlay margin needs to be nudged (give more space) + app.$.overlay.css( { 'margin-left': size } ); + // Move the resizer handle + app.$.resizer.css( { 'margin-left': size ? size - 5 : size } ); + // And of course, resize the customizer + app.$.customizer.width( size ); + }; + + app.initIframeMouseEvents = function () { + // Need to recursively check for existence of iframe + setTimeout( function () { + const $iframe = app.$.overlay.find( 'iframe' ); + + if ( $iframe.length ) { + // Setup iframe bubbling + app.bubbleMouseEvent( $iframe[ 0 ], 'mousemove' ); + app.bubbleMouseEvent( $iframe[ 0 ], 'mouseup' ); + } else { + app.initIframeMouseEvents(); + } + }, 500 ); + }; + + app.bubbleMouseEvent = function ( iframe, evtName ) { + const longName = 'on' + evtName; + // Save any previous handler + const existingMouseEvt = iframe.contentWindow[ longName ]; + + // Attach a new listener + iframe.contentWindow[ longName ] = function ( evt ) { + // Fire existing listener + if ( existingMouseEvt ) { + existingMouseEvt( evt ); + } + + // Create a new event for the this window + const newEvt = document.createEvent( 'MouseEvents' ); + + // We'll need this to offset the mouse appropriately + const boundingClientRect = iframe.getBoundingClientRect(); + + // Initialize the event, copying exiting event values + // for the most part + newEvt.initMouseEvent( + evtName, + true, // bubbles + false, // not cancelable + window, + evt.detail, + evt.screenX, + evt.screenY, + evt.clientX + boundingClientRect.left, + evt.clientY + boundingClientRect.top, + evt.ctrlKey, + evt.altKey, + evt.shiftKey, + evt.metaKey, + evt.button, + null // no related element + ); + + // Dispatch the event on the iframe element + iframe.dispatchEvent( newEvt ); + }; + }; + + wp.customize.bind( 'ready', app.init ); +} )( window, document, jQuery, window.wp ); diff --git a/assets/js/src/customizer.scss b/assets/js/src/customizer.scss new file mode 100644 index 0000000..2f7e38d --- /dev/null +++ b/assets/js/src/customizer.scss @@ -0,0 +1,140 @@ +.customize-control-code_editor .CodeMirror, +.customize-control-code_editor textarea { + height: 100%; +} + +.customizer-resizer { + display: none; +} + +.wp-full-overlay-sidebar { + max-width: 100%; +} + +.resizable { + .customizer-resizer { + content: ''; + display: block; + height: 100%; + width: 4px; + position: absolute; + right: -4px; + margin-top: -30px; + cursor: pointer; + cursor: col-resize; + z-index: 9999999; + opacity: 0.8; + } + + .wp-full-overlay-sidebar { + border-right-width: 4px; + } + + .wp-full-overlay.collapsed .wp-full-overlay-sidebar { + margin-left: -286px; + } + + &.wp-core-ui .wp-full-overlay .collapse-sidebar { + left: 22px; + } +} + +.no-animation { + + .wp-full-overlay, + .wp-full-overlay-sidebar, + .wp-full-overlay .collapse-sidebar, + .wp-full-overlay-main { + -webkit-transition: none; + transition: none; + } +} + +// Mimic @media screen and ( max-width: 640px ) styles when body has .fullwidth-customizer +.fullwidth-customizer { + #customize-controls { + width: 100%; + } + + .wp-full-overlay.expanded { + margin-left: 0; + } + + .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content { + bottom: 0; + } + + .customize-controls-preview-toggle { + display: block; + position: absolute; + top: 0; + left: 48px; + line-height: 45px; + font-size: 14px; + padding: 0 12px; + margin: 0; + height: 45px; + background: #eee; + border-right: 1px solid #ddd; + color: #444; + cursor: pointer; + -webkit-transition: color 0.1s ease-in-out, background 0.1s ease-in-out; + transition: color 0.1s ease-in-out, background 0.1s ease-in-out; + } + + #customize-footer-actions, + #customize-preview, + .customize-controls-preview-toggle .controls, + .preview-only .wp-full-overlay-sidebar-content, + .preview-only .customize-controls-preview-toggle .preview { + display: none; + } + + .customize-controls-preview-toggle { + + .preview:before, + .controls:before { + font: normal 20px/1 dashicons; + content: "\f177"; + position: relative; + top: 4px; + margin-right: 6px; + } + + .controls:before { + content: "\f540"; + } + } + + .preview-only { + #customize-controls { + height: 45px; + } + + #customize-preview, + .customize-controls-preview-toggle .controls { + display: block; + } + } + + #customize-preview { + top: 45px; + bottom: 0; + height: auto; + } + + &.wp-core-ui.wp-customizer { + .button { + padding: 6px 14px; + line-height: normal; + font-size: 14px; + vertical-align: middle; + height: auto; + margin-bottom: 4px; + } + + #customize-header-actions .button-primary { + margin-top: 6px; + } + } +} \ No newline at end of file diff --git a/includes/tag-functions.php b/includes/tag-functions.php index 392b744..0c2fc41 100644 --- a/includes/tag-functions.php +++ b/includes/tag-functions.php @@ -1878,27 +1878,35 @@ public function __construct( $id ) { $block ); - // Get the iFrame src from the rendered block. - $src = ''; $processor = new CupcakeLabs\T3\Processor( $block_output ); + // The standard block output won't work, we need to extract details from the block. while ( $processor->next_tag( array( 'tag_name' => 'div', 'class_name' => 'sharedaddy', ) ) ) { - $src = $processor->get_attribute( 'data-src' ); + $class = $processor->get_attribute( 'class' ); + $id = $processor->get_attribute( 'id' ); + $data_src = $processor->get_attribute( 'data-src' ); + $data_name = $processor->get_attribute( 'data-name' ); + $data_title = $processor->get_attribute( 'data-title' ); } - // If no iFrame src is found, return an empty string. - if ( '' === $src ) { + // The processor never found the block, return an empty string. + if ( ! isset( $class ) ) { return ''; } + // Here we reconstruct the like button with the extracted details. return sprintf( - '', - esc_url( $src ) + '', + $class, + $id, + $data_src, + $data_name, + $data_title ); } add_shortcode( 'tag_likebutton', 'tumblr3_tag_likebutton' ); diff --git a/src/Customizer.php b/src/Customizer.php index 0e2f315..f3e3b64 100644 --- a/src/Customizer.php +++ b/src/Customizer.php @@ -29,6 +29,7 @@ public function initialize( $is_tumblr3_active ): void { // Only run the rest of the actions if the Tumblr3 theme is active. if ( $is_tumblr3_active ) { + add_action( 'customize_controls_enqueue_scripts', array( $this, 'enqueue_customizer_scripts' ) ); add_action( 'customize_register', array( $this, 'global_options' ) ); add_action( 'customize_register', array( $this, 'theme_specific_options' ) ); add_filter( 'customize_panel_active', array( $this, 'customize_panel_active' ), 10, 2 ); @@ -36,6 +37,25 @@ public function initialize( $is_tumblr3_active ): void { } } + public function enqueue_customizer_scripts(): void { + $deps = tumblr3_get_asset_meta( TUMBLR3_PATH . 'assets/js/build/customizer.asset.php' ); + + wp_enqueue_script( + 'tumblr3-customizer', + TUMBLR3_URL . 'assets/js/build/customizer.js', + $deps['dependencies'], + $deps['version'], + true + ); + + wp_enqueue_style( + 'tumblr3-customizer', + TUMBLR3_URL . 'assets/js/build/customizer.css', + array(), + $deps['version'] + ); + } + /** * Add Tumblr theme HTML options. * @@ -48,8 +68,14 @@ public function tumblr_html_options( $wp_customize ): void { $wp_customize->add_section( 'tumblr3_html', array( - 'title' => __( 'Tumblr Theme HTML', 'tumblr3' ), - 'priority' => 30, + 'title' => __( 'Tumblr Theme HTML', 'tumblr3' ), + 'priority' => 30, + 'description' => sprintf( + '%s
%s', + __( 'Want to create a custom look for your blog? Read:', 'tumblr3' ), + __( 'Tumblr Theme Documentation', 'tumblr3' ) + ), + 'description_hidden' => true, ) ); @@ -68,15 +94,29 @@ public function tumblr_html_options( $wp_customize ): void { ) ); - $wp_customize->add_control( + /** + * @see https://github.com/WordPress/WordPress/blob/master/wp-includes/customize/class-wp-customize-code-editor-control.php + */ + $editor = new \WP_Customize_Code_Editor_Control( + $wp_customize, 'tumblr3_theme_html', array( - 'label' => __( 'HTML', 'tumblr3' ), + 'label' => '', 'section' => 'tumblr3_html', - 'type' => 'textarea', 'priority' => 10, ) ); + + $editor->code_type = 'text/html'; + $editor->editor_settings = array( + 'codemirror' => array( + 'indentUnit' => 2, + 'tabSize' => 2, + 'lint' => false, + ), + ); + + $wp_customize->add_control( $editor ); } /** @@ -317,7 +357,7 @@ public function theme_specific_options( $wp_customize ): void { $wp_customize->add_section( 'tumblr3_select', array( - 'title' => __( 'Theme Select Options', 'tumblr3' ), + 'title' => __( 'Tumblr Theme Select Options', 'tumblr3' ), 'priority' => 30, ) ); @@ -326,7 +366,7 @@ public function theme_specific_options( $wp_customize ): void { $wp_customize->add_section( 'tumblr3_text', array( - 'title' => __( 'Theme Text Options', 'tumblr3' ), + 'title' => __( 'Tumblr Theme Text Options', 'tumblr3' ), 'priority' => 30, ) ); @@ -335,7 +375,7 @@ public function theme_specific_options( $wp_customize ): void { $wp_customize->add_section( 'tumblr3_font', array( - 'title' => __( 'Theme Font Options', 'tumblr3' ), + 'title' => __( 'Tumblr Theme Font Options', 'tumblr3' ), 'priority' => 30, ) ); @@ -344,7 +384,7 @@ public function theme_specific_options( $wp_customize ): void { $wp_customize->add_section( 'tumblr3_boolean', array( - 'title' => __( 'Theme Boolean Options', 'tumblr3' ), + 'title' => __( 'Tumblr Theme Checkbox Options', 'tumblr3' ), 'priority' => 30, ) ); @@ -353,7 +393,7 @@ public function theme_specific_options( $wp_customize ): void { $wp_customize->add_section( 'tumblr3_image', array( - 'title' => __( 'Theme Image Options', 'tumblr3' ), + 'title' => __( 'Tumblr Theme Image Options', 'tumblr3' ), 'priority' => 30, ) ); From ecf9342abf96ecb7870268035dcd87164e718ffb Mon Sep 17 00:00:00 2001 From: TommusRhodus Date: Fri, 6 Dec 2024 14:45:15 +0000 Subject: [PATCH 20/20] Added a new missing block from Hatfield theme --- includes/tumblr-theme-language/blocks.php | 1 + includes/tumblr-theme-language/missing-blocks.php | 1 + 2 files changed, 2 insertions(+) diff --git a/includes/tumblr-theme-language/blocks.php b/includes/tumblr-theme-language/blocks.php index 984f23a..b4b2886 100644 --- a/includes/tumblr-theme-language/blocks.php +++ b/includes/tumblr-theme-language/blocks.php @@ -200,4 +200,5 @@ 'block:SubmitEnabled', 'block:Regular', // https://github.tumblr.net/Tumblr/tumblr/blob/5e69aae5fd71f2a151078abf11a4d146d3aa6bd7/app/controllers/tumblelog.php#L2988 'block:Conversation', + 'block:TaggedPage', ); diff --git a/includes/tumblr-theme-language/missing-blocks.php b/includes/tumblr-theme-language/missing-blocks.php index 10e3d71..32356b0 100644 --- a/includes/tumblr-theme-language/missing-blocks.php +++ b/includes/tumblr-theme-language/missing-blocks.php @@ -145,4 +145,5 @@ 'block_blogs', 'block_nofollowing', 'block_answer', + 'block_taggedpage', );