first commit

This commit is contained in:
2026-04-28 15:13:50 +02:00
commit a95acc355b
63745 changed files with 9487948 additions and 0 deletions

View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 711.45 226.77" style="enable-background:new 0 0 711.45 226.77;" xml:space="preserve">
<style type="text/css">
.st0{display:none;}
.st1{display:inline;opacity:0.1;}
.st2{fill:none;}
.st3{fill:#002333;}
</style>
<g id="tlo" class="st0">
<rect x="-8163.43" y="-2550.35" class="st1" width="16510" height="16490"/>
</g>
<g id="Warstwa_1">
<g>
<rect y="0" class="st2" width="711.45" height="226.77"/>
<g>
<g>
<path class="st3" d="M171.97,124.49c-6.12,0-11.1-4.98-11.1-11.1c0-6.12,4.98-11.1,11.1-11.1s11.1,4.98,11.1,11.1
C183.07,119.51,178.09,124.49,171.97,124.49z M171.97,105.59c-4.3,0-7.8,3.5-7.8,7.8c0,4.3,3.5,7.8,7.8,7.8
c4.3,0,7.8-3.5,7.8-7.8C179.77,109.09,176.27,105.59,171.97,105.59z"/>
</g>
<g>
<path class="st3" d="M105.83,122.6c-33.68,0-50.78-1.42-50.78-9.21c0-7.78,17.1-9.21,50.78-9.21c2.07,0,50.79,0.1,50.79,9.21
C156.61,122.49,107.9,122.6,105.83,122.6z M105.83,107.48c-14.21,0-47.48,0-47.48,5.91c0,5.91,33.27,5.91,47.48,5.91
c28.01,0,45.53-3.44,47.42-5.91C151.36,110.92,133.84,107.48,105.83,107.48z"/>
</g>
<g>
<path class="st3" d="M75.59,154.72c-1.51,0-2.72-0.35-3.61-1.05c-0.96-0.75-1.49-1.88-1.49-3.19c0-8.12,19.16-23.02,50.45-23.02
c20.56,0,32.06,5.3,41.5,10.73c0.03,0,0.05,0,0.08,0c32.18,0,62.6-12.06,62.6-24.81c0-12.75-30.42-24.81-62.6-24.81
c-0.02,0-0.05,0-0.08,0c-9.43,5.43-20.94,10.73-41.5,10.73c-31.3,0-50.45-14.91-50.45-23.02c0-1.31,0.53-2.44,1.49-3.19
c0.89-0.7,2.1-1.05,3.61-1.05c2.39,0,6.72,1.09,13.28,2.74c15.42,3.88,41.12,10.36,72.69,10.49c1.1-0.64,2.18-1.29,3.24-1.92
c8.11-4.84,15.76-9.42,27.96-9.42c19.67,0,35.67,17.7,35.67,39.45c0,21.75-16,39.45-35.67,39.45c-12.2,0-19.85-4.57-27.96-9.42
c-1.06-0.63-2.14-1.28-3.24-1.92c-31.56,0.13-57.27,6.6-72.69,10.49C82.32,153.63,77.99,154.72,75.59,154.72z M120.95,130.76
c-30.94,0-47.15,14.65-47.15,19.72c0,0.42,0.15,0.53,0.22,0.59c0.13,0.1,0.55,0.35,1.58,0.35c1.98,0,6.61-1.17,12.47-2.64
c14.61-3.68,38.35-9.66,67.62-10.49C147.47,134.18,137.11,130.76,120.95,130.76z M167.84,141.38
c7.49,4.45,14.27,8.15,24.92,8.15c14.72,0,27.17-11.03,31.09-26.07C214.16,133.65,190.63,140.45,167.84,141.38z M167.84,85.39
c22.8,0.93,46.33,7.73,56.01,17.92c-3.91-15.04-16.37-26.07-31.09-26.07C182.11,77.24,175.32,80.94,167.84,85.39z M75.59,75.35
c-1.02,0-1.44,0.24-1.58,0.35c-0.08,0.06-0.22,0.17-0.22,0.59c0,5.07,16.21,19.72,47.15,19.72c16.16,0,26.53-3.42,34.74-7.53
c-29.27-0.83-53.02-6.81-67.62-10.49C82.21,76.52,77.58,75.35,75.59,75.35z"/>
</g>
</g>
<g>
<g>
<path class="st3" d="M293.82,142.88c-5.63,0-10.73-1.27-15.17-3.76c-4.43-2.49-7.93-6.03-10.38-10.5
c-2.46-4.47-3.7-9.6-3.7-15.23c0-5.63,1.25-10.75,3.7-15.23c2.45-4.47,5.95-8.01,10.38-10.5c4.44-2.5,9.54-3.76,15.17-3.76
s10.71,1.27,15.1,3.76c4.39,2.49,7.86,6.02,10.32,10.5c2.46,4.48,3.7,9.6,3.7,15.23c0,5.7-1.25,10.85-3.7,15.29
c-2.45,4.43-5.91,7.95-10.26,10.44C304.63,141.61,299.52,142.88,293.82,142.88z M293.82,88.95c-5.56,0-9.99,2.17-13.17,6.44
c-3.17,4.26-4.78,10.32-4.78,18c0,7.69,1.61,13.76,4.78,18.06c3.18,4.31,7.61,6.5,13.17,6.5c5.56,0,9.97-2.19,13.12-6.5
c3.13-4.29,4.72-10.37,4.72-18.06c0-7.61-1.59-13.64-4.72-17.94C303.79,91.14,299.38,88.95,293.82,88.95z"/>
</g>
<g>
<path class="st3" d="M356.29,142.88c-5.54,0-10.44-1.3-14.56-3.88c-4.12-2.57-7.31-6.14-9.48-10.62
c-2.18-4.47-3.28-9.51-3.28-15c0-5.63,1.2-10.73,3.58-15.17c2.38-4.43,5.65-7.95,9.72-10.44c4.07-2.49,8.67-3.76,13.66-3.76
c3.72,0,7.35,0.74,10.8,2.21c3.44,1.46,6.25,3.53,8.34,6.13c2.09,2.6,3.14,5.55,3.14,8.78c0,1.32-0.35,2.43-1.04,3.31
c-0.69,0.88-1.67,1.31-2.98,1.31c-1.47,0-2.64-0.43-3.48-1.27c-0.86-0.86-1.58-2.09-2.12-3.66c-0.23-3.42-1.42-6.3-3.52-8.53
c-2.11-2.23-5.34-3.36-9.62-3.36c-2.83,0-5.49,0.86-7.91,2.55c-2.41,1.69-4.39,4.14-5.89,7.28c-1.48,3.13-2.24,6.83-2.24,11.01
c0,7.45,1.73,13.71,5.14,18.6c3.42,4.91,8.34,7.4,14.62,7.4c3.7,0,7.06-0.84,9.99-2.48c2.93-1.64,5.47-3.82,7.56-6.47
c0.54-0.84,1.09-1.25,1.67-1.25c0.73,0,1.21,0.26,1.46,0.8c0.26,0.56,0.32,1.19,0.17,1.87c-1.97,4.32-4.98,7.89-8.94,10.58
C367.13,141.51,362.15,142.88,356.29,142.88z"/>
</g>
<g>
<path class="st3" d="M405.94,142.76c-5.21,0-9.33-1.52-12.24-4.51c-2.92-2.99-4.4-7.76-4.4-14.17V92.61
c0-0.93-0.25-1.59-0.73-1.94c-0.48-0.34-1.14-0.51-1.97-0.51h-1.68c-0.67,0-1.18-0.21-1.55-0.66c-0.38-0.45-0.56-0.92-0.56-1.45
c0-0.92,0.43-2.04,1.29-3.32c0.88-1.32,2.29-3.19,4.2-5.57c2.22-2.77,4.13-4.97,5.69-6.53c1.52-1.52,2.83-2.29,3.9-2.29
c0.74,0,1.24,0.23,1.53,0.7c0.3,0.49,0.45,1.25,0.45,2.25v7.69c0,1.89,0.08,3.03,0.25,3.48c0.19,0.51,0.68,0.78,1.49,0.78h16.69
c0.75,0,1.28,0.13,1.57,0.38c0.28,0.24,0.42,0.79,0.42,1.61c0,0.91-0.29,1.63-0.85,2.15c-0.56,0.53-1.31,0.79-2.22,0.79h-14.77
c-1.95,0-2.94,0.87-2.94,2.58v29.67c0,4.34,0.92,7.65,2.74,9.84c1.83,2.19,4.4,3.31,7.64,3.31c1.94,0,3.99-0.59,6.09-1.76
c2.1-1.17,3.9-2.95,5.35-5.29c0.52-0.74,1.07-1.12,1.65-1.12c0.58,0,1,0.25,1.29,0.75c0.3,0.52,0.33,1.06,0.11,1.65
C421.07,138.39,414.87,142.76,405.94,142.76z"/>
</g>
<g>
<path class="st3" d="M453.76,142.88c-5.63,0-10.73-1.27-15.17-3.76c-4.43-2.49-7.93-6.03-10.38-10.5
c-2.46-4.47-3.7-9.6-3.7-15.23c0-5.63,1.25-10.75,3.7-15.23c2.46-4.47,5.95-8.01,10.38-10.5c4.43-2.5,9.54-3.76,15.17-3.76
c5.63,0,10.71,1.27,15.1,3.76c4.4,2.49,7.87,6.03,10.32,10.5c2.46,4.48,3.7,9.61,3.7,15.23c0,5.7-1.25,10.84-3.7,15.29
c-2.45,4.43-5.9,7.95-10.26,10.44C464.56,141.61,459.46,142.88,453.76,142.88z M453.76,88.95c-5.56,0-9.99,2.17-13.17,6.44
c-3.17,4.25-4.78,10.31-4.78,18c0,7.69,1.61,13.77,4.78,18.06c3.18,4.31,7.61,6.5,13.17,6.5c5.56,0,9.97-2.19,13.11-6.5
c3.13-4.29,4.72-10.37,4.72-18.06c0-7.61-1.59-13.64-4.72-17.94C463.72,91.14,459.31,88.95,453.76,88.95z"/>
</g>
<g>
<path class="st3" d="M491.59,142.03c-2.76,0-4.68-0.22-5.69-0.65c-0.98-0.41-1.45-1.01-1.45-1.82c0-1.12,0.63-1.85,1.91-2.23
c2.24-0.32,3.86-0.81,4.79-1.47c0.96-0.66,1.56-1.57,1.81-2.69c0.24-1.1,0.37-2.87,0.37-5.26V69.43c0-1.65-0.2-2.8-0.63-3.51
c-0.43-0.73-1.37-1.14-2.78-1.23c0,0-0.01,0-0.01,0c-0.81,0-1.58,0.04-2.3,0.12c-0.71,0.08-1.35,0.12-1.9,0.12
c-0.77,0-1.33-0.09-1.66-0.28c-0.3-0.16-0.45-0.54-0.45-1.11c0-0.67,0.27-1.19,0.83-1.6c0.59-0.43,1.44-0.85,2.54-1.24
c2.39-0.72,3.87-1.16,4.43-1.32c1.84-0.56,3.6-1.08,5.28-1.56c1.66-0.47,2.93-0.71,3.79-0.71c1.07,0,1.86,0.23,2.34,0.67
c0.48,0.44,0.72,1.25,0.72,2.39v67.74c0,2.41,0.12,4.16,0.37,5.2c0.25,1.08,0.88,1.97,1.88,2.63c0.97,0.65,2.61,1.19,4.87,1.59
c1.35,0.38,2.02,1.11,2.02,2.23c0,0.81-0.42,1.41-1.28,1.82c-0.89,0.43-2.74,0.64-5.51,0.64l-7.08-0.12L491.59,142.03z"/>
</g>
<g>
<path class="st3" d="M523.67,142.03c-2.68,0-4.56-0.22-5.57-0.65c-0.98-0.41-1.45-1.01-1.45-1.82c0-1.12,0.59-1.85,1.8-2.23
c2.23-0.32,3.88-0.81,4.85-1.46c0.99-0.66,1.61-1.55,1.82-2.64c0.2-1.05,0.3-2.83,0.3-5.32V96.81c0-1.73-0.19-2.91-0.56-3.63
c-0.39-0.74-1.31-1.11-2.73-1.11l-4.21,0.12c-0.84,0-1.44-0.09-1.77-0.28c-0.3-0.17-0.45-0.49-0.45-0.99
c0-0.67,0.27-1.19,0.83-1.6c0.59-0.43,1.44-0.85,2.54-1.24l4.91-1.44c4.29-1.43,7.18-2.15,8.6-2.15c1.15,0,1.98,0.23,2.46,0.67
c0.48,0.44,0.72,1.25,0.72,2.39v40.35c0,2.45,0.12,4.15,0.37,5.2c0.25,1.08,0.88,1.97,1.87,2.63c0.98,0.65,2.62,1.19,4.87,1.59
c1.35,0.38,2.01,1.11,2.01,2.23c0,0.82-0.42,1.41-1.28,1.82c-0.9,0.43-2.75,0.64-5.51,0.64l-7.2-0.12L523.67,142.03z
M528.48,74.42c-2.35,0-4.25-0.57-5.66-1.7c-1.39-1.12-2.1-2.59-2.1-4.37c0-1.77,0.7-3.2,2.09-4.24
c1.41-1.05,3.31-1.59,5.66-1.59c2.27,0,4.11,0.53,5.48,1.58c1.35,1.04,2.03,2.47,2.03,4.24c0,1.78-0.69,3.25-2.04,4.37
C532.59,73.85,530.75,74.42,528.48,74.42z"/>
</g>
<g>
<path class="st3" d="M592.77,142.63c-0.71,0-1.67-0.12-2.85-0.36c-0.4-0.08-1.55-0.22-3.44-0.42c-1.88-0.2-4.04-0.3-6.45-0.3
h-27.62c-2.07,0-3.07-0.65-3.07-1.98c0-0.84,0.43-1.89,1.29-3.14l33.86-43.95c0.27-0.44,0.4-0.79,0.4-1.07
c0-0.38-0.16-1.02-1.26-1.02h-20.42c-1.31,0-2.33,0.21-3.03,0.62c-0.73,0.43-1.36,1.36-1.94,2.85
c-0.56,1.44-1.25,3.87-2.05,7.23c-0.46,1.07-0.91,1.84-1.33,2.26c-0.4,0.4-1.03,0.61-1.86,0.61c-0.67,0-1.14-0.17-1.42-0.53
c-0.29-0.36-0.44-1.18-0.44-2.41c0-1.68,0.28-4.09,0.84-7.17c0.63-3.15,1.13-5.39,1.5-6.65c0.35-1.21,0.72-2.01,1.1-2.39
c0.36-0.36,0.97-0.55,1.8-0.55c0.63,0,1.95,0.16,4.06,0.48c2.07,0.32,5.07,0.48,8.92,0.48h27.26c0.83,0,1.48,0.21,1.92,0.61
c0.44,0.4,0.66,0.82,0.66,1.25c0,0.68-0.47,1.65-1.41,2.9l-33.75,44.32c-0.35,0.52-0.52,0.91-0.52,1.19
c0,0.46,0.26,1.02,1.5,1.02h20.78c1.65,0,2.82-0.25,3.58-0.75c0.76-0.51,1.39-1.54,1.93-3.15c0.53-1.58,1.28-4.39,2.22-8.36
c0.38-0.99,0.83-1.71,1.33-2.13c0.48-0.41,1.11-0.62,1.87-0.62c0.51,0,0.91,0.19,1.24,0.6c0.33,0.41,0.5,1.28,0.5,2.59
c0,1.9-0.32,4.48-0.96,7.65c-0.64,2.71-1.2,4.91-1.68,6.59c-0.58,2.04-1.05,2.82-1.33,3.11
C594.1,142.43,593.52,142.63,592.77,142.63z"/>
</g>
<g>
<path class="st3" d="M630.64,142.76c-5.62,0-10.54-1.36-14.62-4.05c-4.07-2.69-7.21-6.4-9.3-11.03
c-2.1-4.64-3.17-9.89-3.17-15.6c0-5.39,1.3-10.26,3.88-14.5c2.57-4.24,6.03-7.59,10.26-9.97c4.23-2.38,8.83-3.58,13.66-3.58
c4.43,0,8.38,0.94,11.74,2.8c3.36,1.86,6,4.34,7.86,7.38c1.86,3.04,2.8,6.3,2.8,9.7c0,3.54-0.71,6.09-2.11,7.56
c-1.4,1.48-3.86,2.23-7.32,2.23l-27.27,0.24c-0.9,0-1.97,0.41-1.97,2.34c0,2.9,0.71,5.89,2.11,8.9
c1.41,3.02,3.53,5.54,6.31,7.52c2.78,1.97,6.14,2.98,10.01,2.98c3.93,0,7.46-0.86,10.47-2.54c3.01-1.68,5.51-3.88,7.44-6.54
c0.23-0.31,0.49-0.58,0.75-0.81c0.25-0.21,0.5-0.32,0.78-0.32c0.73,0,1.23,0.3,1.52,0.92c0.3,0.64,0.34,1.25,0.12,1.84
c-1.97,4.18-5.05,7.69-9.12,10.42C641.41,141.37,636.42,142.76,630.64,142.76z M630.04,89.31c-3.95,0-7.49,1.53-10.51,4.56
c-3.02,3.02-4.87,7.23-5.52,12.53c-0.08,0.94,0.13,1.69,0.65,2.24c0.51,0.56,1.25,0.84,2.17,0.84l22.58-0.12
c1.91,0,3.15-0.31,3.79-0.95c0.64-0.64,0.95-1.96,0.95-4.03c0-4.19-1.27-7.78-3.76-10.68
C637.87,90.79,634.39,89.31,630.04,89.31z"/>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" fill="none"><path d="M40 21V26.11C40 26.76 40.6 27.21 41.23 27.08C41.85 26.95 42.53 26.97 43.24 27.2C44.59 27.64 45.64 28.79 45.92 30.18C46.43 32.75 44.48 35 42 35C41.71 35 41.44 34.97 41.17 34.91C40.57 34.77 40 35.27 40 35.89V41H45.11C45.76 41 46.21 41.6 46.08 42.24C45.95 42.86 45.97 43.54 46.2 44.24C46.63 45.59 47.79 46.65 49.18 46.92C51.75 47.43 54 45.48 54 43C54 42.71 53.97 42.44 53.91 42.17C53.77 41.57 54.27 41 54.89 41H60" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M60 41V35C60 25 56 21 46 21H40" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M60 41H54.89C54.24 41 53.79 41.6 53.92 42.24C54.05 42.86 54.03 43.54 53.8 44.24C53.37 45.59 52.21 46.65 50.82 46.92C48.25 47.43 46 45.48 46 43C46 42.71 46.03 42.44 46.09 42.17C46.23 41.57 45.73 41 45.11 41H40V46.11C40 46.76 39.4 47.21 38.76 47.08C38.14 46.95 37.46 46.97 36.76 47.2C35.41 47.63 34.35 48.79 34.08 50.18C33.57 52.75 35.52 55 38 55C38.29 55 38.56 54.97 38.83 54.91C39.43 54.77 40 55.27 40 55.89V61" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M60 45V47C60 57 56 61 46 61H44" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M40 61.0001V55.8901C40 55.2401 39.4 54.7901 38.76 54.9201C38.14 55.0501 37.46 55.0301 36.76 54.8001C35.41 54.3701 34.35 53.2101 34.08 51.8201C33.57 49.2501 35.52 47.0001 38 47.0001C38.29 47.0001 38.56 47.0301 38.83 47.0901C39.43 47.2301 40 46.7301 40 46.1101V41.0001H34.89C34.24 41.0001 33.79 40.4001 33.92 39.7601C34.05 39.1401 34.03 38.4601 33.8 37.7601C33.37 36.4101 32.21 35.3501 30.82 35.0801C28.25 34.5701 26 36.5201 26 39.0001C26 39.2901 26.03 39.5601 26.09 39.8301C26.23 40.4301 25.73 41.0001 25.11 41.0001H20" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M20 41V47C20 57 24 61 34 61H40" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M20 41H25.11C25.76 41 26.21 40.4 26.08 39.76C25.95 39.14 25.97 38.46 26.2 37.76C26.63 36.41 27.79 35.35 29.18 35.08C31.75 34.57 34 36.52 34 39C34 39.29 33.97 39.56 33.91 39.83C33.77 40.43 34.27 41 34.89 41H40V35.89C40 35.24 40.6 34.79 41.23 34.92C41.85 35.05 42.53 35.03 43.24 34.8C44.59 34.36 45.64 33.2 45.92 31.81C46.43 29.25 44.48 27 42 27C41.71 27 41.44 27.03 41.17 27.09C40.57 27.23 40 26.73 40 26.11V21" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M36 21H34C24 21 20 25 20 35V37" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M40 1.8C51.44 1.8 61.06 5.38 67.84 12.16C74.62 18.94 78.2 28.56 78.2 40C78.2 51.44 74.62 61.06 67.84 67.84C61.06 74.62 51.44 78.2 40 78.2C28.56 78.2 18.94 74.62 12.16 67.84C5.38 61.06 1.8 51.44 1.8 40C1.8 28.56 5.38 18.94 12.16 12.16C18.94 5.38 28.56 1.8 40 1.8ZM40 0C15.7 0 0 15.7 0 40C0 64.3 15.7 80 40 80C64.3 80 80 64.3 80 40C80 15.7 64.3 0 40 0Z" fill="#00E3C0"></path></svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,15 @@
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2339_45728)">
<path d="M21.125 27.625V39" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.5312 26.8125C24.44 26.8125 26.8125 24.4481 26.8125 21.5312C26.8125 18.6144 24.44 16.25 21.5312 16.25C18.6225 16.25 16.25 18.6144 16.25 21.5312C16.25 24.4481 18.6225 26.8125 21.5312 26.8125Z" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.125 48.75C23.8225 48.75 26 46.5676 26 43.875C26 41.1824 23.8225 39 21.125 39C18.4275 39 16.25 41.1824 16.25 43.875C16.25 46.5676 18.4275 48.75 21.125 48.75Z" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M43.875 48.75C46.5725 48.75 48.75 46.5676 48.75 43.875C48.75 41.1824 46.5725 39 43.875 39C41.1775 39 39 41.1824 39 43.875C39 46.5676 41.1775 48.75 43.875 48.75Z" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M21.3359 27.625C22.0672 30.4688 24.6681 32.5812 27.7385 32.565L33.3122 32.5488C37.5697 32.5325 41.1935 35.2625 42.526 39.065" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M32.5 1.4625C41.795 1.4625 49.6112 4.37125 55.12 9.88C60.6287 15.3888 63.5375 23.205 63.5375 32.5C63.5375 41.795 60.6287 49.6112 55.12 55.12C49.6112 60.6287 41.795 63.5375 32.5 63.5375C23.205 63.5375 15.3888 60.6287 9.88 55.12C4.37125 49.6112 1.4625 41.795 1.4625 32.5C1.4625 23.205 4.37125 15.3888 9.88 9.88C15.3888 4.37125 23.205 1.4625 32.5 1.4625ZM32.5 0C12.7563 0 0 12.7563 0 32.5C0 52.2437 12.7563 65 32.5 65C52.2437 65 65 52.2437 65 32.5C65 12.7563 52.2437 0 32.5 0Z" fill="#00E3C0"/>
</g>
<defs>
<clipPath id="clip0_2339_45728">
<rect width="65" height="65" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,16 @@
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2339_45695)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M49.5625 42.25C49.5625 43.4688 49.2212 44.6226 48.62 45.5976C48.2787 46.1826 47.84 46.7025 47.3363 47.125C46.1988 48.1487 44.7037 48.75 43.0625 48.75C41.08 48.75 39.3087 47.8562 38.1387 46.4587C38.1062 46.4099 38.0575 46.3775 38.025 46.3288C37.83 46.1013 37.6513 45.8576 37.505 45.5976C36.9038 44.6226 36.5625 43.4688 36.5625 42.25C36.5625 40.2025 37.505 38.3663 39 37.18C40.1212 36.2863 41.535 35.75 43.0625 35.75C44.6875 35.75 46.15 36.335 47.2875 37.3262C47.4825 37.4725 47.6612 37.6513 47.8237 37.83C48.8962 39 49.5625 40.5438 49.5625 42.25Z" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M45.4836 42.2168H40.6411" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M43.0625 39.8457V44.7044" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M17.3386 25.0898L31.6873 33.3936L45.9386 25.1386" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M31.6875 48.1156V33.377" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M47.3038 27.9012V37.0987C47.3038 37.18 47.3038 37.245 47.2876 37.3262C46.1501 36.335 44.6876 35.7498 43.0626 35.7498C41.5351 35.7498 40.1214 36.2861 39.0001 37.1798C37.5051 38.3661 36.5626 40.2023 36.5626 42.2498C36.5626 43.4686 36.9038 44.6224 37.505 45.5974C37.6513 45.8574 37.8301 46.1011 38.0251 46.3286L35.0514 47.9699C33.1989 49.0099 30.1764 49.0099 28.3239 47.9699L19.6463 43.1599C17.6801 42.0712 16.0713 39.3412 16.0713 37.0987V27.9012C16.0713 25.6587 17.6801 22.9287 19.6463 21.8399L28.3239 17.03C30.1764 15.99 33.1989 15.99 35.0514 17.03L43.7288 21.8399C45.6951 22.9287 47.3038 25.6587 47.3038 27.9012Z" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M32.5 1.4625C41.795 1.4625 49.6112 4.37125 55.12 9.88C60.6287 15.3888 63.5375 23.205 63.5375 32.5C63.5375 41.795 60.6287 49.6112 55.12 55.12C49.6112 60.6287 41.795 63.5375 32.5 63.5375C23.205 63.5375 15.3888 60.6287 9.88 55.12C4.37125 49.6112 1.4625 41.795 1.4625 32.5C1.4625 23.205 4.37125 15.3888 9.88 9.88C15.3888 4.37125 23.205 1.4625 32.5 1.4625ZM32.5 0C12.7563 0 0 12.7563 0 32.5C0 52.2437 12.7563 65 32.5 65C52.2437 65 65 52.2437 65 32.5C65 12.7563 52.2437 0 32.5 0Z" fill="#00E3C0"/>
</g>
<defs>
<clipPath id="clip0_2339_45695">
<rect width="65" height="65" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1,15 @@
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2339_45680)">
<path d="M45.5 32.175V25.2525C45.5 18.7037 43.9725 17.0625 37.83 17.0625H25.545C19.4025 17.0625 17.875 18.7037 17.875 25.2525V43.55C17.875 47.8725 20.2475 48.8963 23.1237 45.8088L23.14 45.7925C24.4725 44.3787 26.5038 44.4925 27.6575 46.0363L29.2988 48.23" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M25.1875 25.1875H38.1875" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M26.8125 31.6875H36.5625" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M41.7803 37.814L36.0279 43.5664C35.8004 43.7939 35.589 44.2165 35.5403 44.5252L35.2316 46.719C35.1179 47.5152 35.6703 48.0677 36.4666 47.954L38.6604 47.6452C38.9691 47.5965 39.4078 47.3852 39.6191 47.1577L45.3716 41.4052C46.3629 40.4139 46.8341 39.2602 45.3716 37.7977C43.9254 36.3515 42.7716 36.8227 41.7803 37.814Z" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M40.9485 38.6426C41.436 40.3976 42.801 41.7626 44.556 42.2501" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M32.5 1.4625C41.795 1.4625 49.6112 4.37125 55.12 9.88C60.6287 15.3888 63.5375 23.205 63.5375 32.5C63.5375 41.795 60.6287 49.6112 55.12 55.12C49.6112 60.6287 41.795 63.5375 32.5 63.5375C23.205 63.5375 15.3888 60.6287 9.88 55.12C4.37125 49.6112 1.4625 41.795 1.4625 32.5C1.4625 23.205 4.37125 15.3888 9.88 9.88C15.3888 4.37125 23.205 1.4625 32.5 1.4625ZM32.5 0C12.7563 0 0 12.7563 0 32.5C0 52.2437 12.7563 65 32.5 65C52.2437 65 65 52.2437 65 32.5C65 12.7563 52.2437 0 32.5 0Z" fill="#00E3C0"/>
</g>
<defs>
<clipPath id="clip0_2339_45680">
<rect width="65" height="65" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -0,0 +1,14 @@
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.3398 30.8799L38.9998 41.0999L56.5398 30.9399" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M39 59.22V41.0801" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M58.2202 41.66V34.3399C58.2202 31.5799 56.2403 28.2199 53.8203 26.8799L43.1401 20.96C40.8601 19.68 37.1401 19.68 34.8601 20.96L24.1802 26.8799C21.7602 28.2199 19.7803 31.5799 19.7803 34.3399V45.66C19.7803 48.42 21.7602 51.7799 24.1802 53.1199L34.8601 59.0398C36.0001 59.6798 37.5002 60 39.0002 60C40.5002 60 42.0001 59.6798 43.1401 59.0398" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M54.2222 63.7778H57.7778C62.2222 63.7778 64 62 64 57.5556V52.2222C64 47.7778 62.2222 46 57.7778 46H54.2222C49.7778 46 48 47.7778 48 52.2222V57.5556C48 62 49.7778 63.7778 54.2222 63.7778Z" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M60 50.9778V51.8667C60 52.5778 59.4222 53.2 58.6667 53.2H53.3333C52.6222 53.2 52 52.6222 52 51.8667V50.9778C52 50.2667 52.5778 49.6445 53.3333 49.6445H58.6667C59.4222 49.6445 60 50.2222 60 50.9778Z" stroke="#00E3C0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M59.4221 60.6667C59.913 60.6667 60.311 60.2687 60.311 59.7778C60.311 59.2869 59.913 58.8889 59.4221 58.8889C58.9312 58.8889 58.5332 59.2869 58.5332 59.7778C58.5332 60.2687 58.9312 60.6667 59.4221 60.6667Z" fill="#00E3C0"/>
<path d="M59.4221 57.5555C59.913 57.5555 60.311 57.1576 60.311 56.6667C60.311 56.1757 59.913 55.7778 59.4221 55.7778C58.9312 55.7778 58.5332 56.1757 58.5332 56.6667C58.5332 57.1576 58.9312 57.5555 59.4221 57.5555Z" fill="#00E3C0"/>
<path d="M56.0002 60.6667C56.4911 60.6667 56.8891 60.2687 56.8891 59.7778C56.8891 59.2869 56.4911 58.8889 56.0002 58.8889C55.5093 58.8889 55.1113 59.2869 55.1113 59.7778C55.1113 60.2687 55.5093 60.6667 56.0002 60.6667Z" fill="#00E3C0"/>
<path d="M56.0002 57.5555C56.4911 57.5555 56.8891 57.1576 56.8891 56.6667C56.8891 56.1757 56.4911 55.7778 56.0002 55.7778C55.5093 55.7778 55.1113 56.1757 55.1113 56.6667C55.1113 57.1576 55.5093 57.5555 56.0002 57.5555Z" fill="#00E3C0"/>
<path d="M52.5779 60.6667C53.0688 60.6667 53.4667 60.2687 53.4667 59.7778C53.4667 59.2869 53.0688 58.8889 52.5779 58.8889C52.0869 58.8889 51.689 59.2869 51.689 59.7778C51.689 60.2687 52.0869 60.6667 52.5779 60.6667Z" fill="#00E3C0"/>
<path d="M52.5779 57.5555C53.0688 57.5555 53.4667 57.1576 53.4667 56.6667C53.4667 56.1757 53.0688 55.7778 52.5779 55.7778C52.0869 55.7778 51.689 56.1757 51.689 56.6667C51.689 57.1576 52.0869 57.5555 52.5779 57.5555Z" fill="#00E3C0"/>
<path d="M40 1.8C51.44 1.8 61.06 5.38 67.84 12.16C74.62 18.94 78.2 28.56 78.2 40C78.2 51.44 74.62 61.06 67.84 67.84C61.06 74.62 51.44 78.2 40 78.2C28.56 78.2 18.94 74.62 12.16 67.84C5.38 61.06 1.8 51.44 1.8 40C1.8 28.56 5.38 18.94 12.16 12.16C18.94 5.38 28.56 1.8 40 1.8ZM40 0C15.7 0 0 15.7 0 40C0 64.3 15.7 80 40 80C64.3 80 80 64.3 80 40C80 15.7 64.3 0 40 0Z" fill="#00E3C0"/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,15 @@
<svg width="65" height="65" viewBox="0 0 65 65" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2339_45711)">
<path d="M28.6 29.25H26.65C25.025 29.25 24.375 28.6 24.375 26.975V25.025C24.375 23.4 25.025 22.75 26.65 22.75H28.6C30.225 22.75 30.875 23.4 30.875 25.025V26.975C30.875 28.6 30.225 29.25 28.6 29.25Z" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M48.75 29.25V37.375C48.75 45.5 45.5 48.75 37.375 48.75H27.625C19.5 48.75 16.25 45.5 16.25 37.375V27.625C16.25 19.5 19.5 16.25 27.625 16.25H35.75" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M48.75 29.25H42.25C37.375 29.25 35.75 27.625 35.75 22.75V16.25L48.75 29.25Z" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M24.375 35.75H40.625" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M40.625 40.625H24.375" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M32.5 1.4625C41.795 1.4625 49.6112 4.37125 55.12 9.88C60.6287 15.3888 63.5375 23.205 63.5375 32.5C63.5375 41.795 60.6287 49.6112 55.12 55.12C49.6112 60.6287 41.795 63.5375 32.5 63.5375C23.205 63.5375 15.3888 60.6287 9.88 55.12C4.37125 49.6112 1.4625 41.795 1.4625 32.5C1.4625 23.205 4.37125 15.3888 9.88 9.88C15.3888 4.37125 23.205 1.4625 32.5 1.4625ZM32.5 0C12.7563 0 0 12.7563 0 32.5C0 52.2437 12.7563 65 32.5 65C52.2437 65 65 52.2437 65 32.5C65 12.7563 52.2437 0 32.5 0Z" fill="#00E3C0"/>
</g>
<defs>
<clipPath id="clip0_2339_45711">
<rect width="65" height="65" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80" fill="none"><path d="M60.98 40C60.98 42.89 60.39 45.65 59.33 48.15C58.27 50.66 56.74 52.91 54.84 54.81C52.94 56.71 50.69 58.24 48.18 59.3C45.67 60.36 42.92 60.95 40.03 60.95C37.14 60.95 34.38 60.36 31.88 59.3C29.38 58.24 27.12 56.71 25.22 54.81C23.32 52.91 21.79 50.66 20.73 48.15" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M19.08 39.9998C19.08 37.1098 19.67 34.3498 20.73 31.8498C21.79 29.3398 23.32 27.0898 25.22 25.1898C27.12 23.2898 29.37 21.7598 31.88 20.6998C34.39 19.6398 37.14 19.0498 40.03 19.0498C42.92 19.0498 45.68 19.6398 48.18 20.6998C50.69 21.7598 52.94 23.2898 54.84 25.1898C56.74 27.0898 58.27 29.3398 59.33 31.8498" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M19.9901 48.1499V56.3499M19.9901 48.1499H27.5601H19.9901Z" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M60.07 31.8499V23.6499M60.07 31.8499H52.5H60.07Z" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M35.04 43.4898C35.04 45.4298 36.53 46.9898 38.37 46.9898H42.13C43.74 46.9898 45.04 45.6198 45.04 43.9498C45.04 42.1198 44.25 41.4798 43.06 41.0598L37.02 38.9598C35.83 38.5398 35.04 37.8998 35.04 36.0698C35.04 34.3898 36.35 33.0298 37.95 33.0298H41.71C43.56 33.0298 45.04 34.5898 45.04 36.5298" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M40.03 30V50" stroke="#00E3C0" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"></path><path d="M40 1.8C51.44 1.8 61.06 5.38 67.84 12.16C74.62 18.94 78.2 28.56 78.2 40C78.2 51.44 74.62 61.06 67.84 67.84C61.06 74.62 51.44 78.2 40 78.2C28.56 78.2 18.94 74.62 12.16 67.84C5.38 61.06 1.8 51.44 1.8 40C1.8 28.56 5.38 18.94 12.16 12.16C18.94 5.38 28.56 1.8 40 1.8ZM40 0C15.7 0 0 15.7 0 40C0 64.3 15.7 80 40 80C64.3 80 80 64.3 80 40C80 15.7 64.3 0 40 0Z" fill="#00E3C0"></path></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,60 @@
{
"name": "octolize\/wp-onboarding",
"description": "Onboarding",
"license": "MIT",
"keywords": [
"wordpress",
"onboarding"
],
"homepage": "https:\/\/gitlab.com\/wpdesk\/predators\/library\/wp-onboarding",
"authors": [
{
"name": "Grzegorz",
"email": "grzegorz@octolize.com"
}
],
"config": {
"platform": {
"php": "7.2"
}
},
"require": {
"ext-dom": "*",
"php": ">=7.2",
"psr\/log": "^1.1",
"wpdesk\/wp-forms": "^2||^3",
"wpdesk\/wp-builder": "^2.0.0"
},
"require-dev": {
"phpunit\/phpunit": "^7||^8||^9",
"wp-coding-standards\/wpcs": "^0.14.1",
"squizlabs\/php_codesniffer": "^3.0.2",
"mockery\/mockery": "*",
"10up\/wp_mock": "*",
"phpcompatibility\/php-compatibility": "^9.1"
},
"autoload": {
"psr-4": {
"VendorInPost\\Octolize\\Onboarding\\": "src\/Onboarding"
}
},
"autoload-dev": {
"classmap": [
"tests\/unit"
]
},
"extra": {
"text-domain": "wp-onboarding",
"translations-folder": "lang",
"po-files": {
"pl_PL": "pl_PL.po"
}
},
"scripts": {
"phpcs": "phpcs",
"phpunit-unit": "phpunit --configuration phpunit-unit.xml --coverage-text --colors=never",
"phpunit-unit-fast": "phpunit --configuration phpunit-unit.xml --no-coverage",
"phpunit-integration": "phpunit --configuration phpunit-integration.xml --coverage-text --colors=never",
"phpunit-integration-fast": "phpunit --configuration phpunit-integration.xml --no-coverage"
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace VendorInPost\Octolize\Onboarding\Field;
use VendorInPost\WPDesk\Forms\Field\BasicField;
/**
* Html field.
*/
class Html extends BasicField
{
const DEFAULT_PRIORITY = 10;
protected $meta = ['priority' => self::DEFAULT_PRIORITY, 'default_value' => '', 'label' => '', 'description' => '', 'description_tip' => '', 'data' => [], 'type' => 'html', 'class' => []];
public function __construct()
{
$this->set_name('html');
}
public function get_template_name(): string
{
return 'html';
}
public function get_type(): string
{
return $this->meta['type'];
}
}

View File

@@ -0,0 +1,126 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
use VendorInPost\WPDesk\PluginBuilder\Plugin\Hookable;
/**
* Can display onboarding.
*/
class Onboarding implements Hookable
{
const VERSION = 2;
const OCTOLIZE_WP_ONBOARDING_RENDERED_FILTER = 'octolize/wp-onboarding/rendered';
const OCTOLIZE_WP_ONBOARDING_ALLOWED = 'octolize/wp-onboarding/allowed';
/**
* @var OnboardingAjax
*/
private $tracker_ajax;
/**
* @var bool
*/
private $autostart = \true;
/**
* @var OnboardingShouldShowGetParametersStrategy
*/
private $onboarding_should_show_strategy;
/**
* @var OnboardingOption
*/
private $onboarding_option;
/**
* @var OnboardingStep[]
*/
private $steps = [];
/**
* @var bool
*/
private $already_rendered = \false;
/**
* @var string
*/
private $onboarding_id;
/**
* @param string $onboarding_id
* @param bool $autostart
* @param OnboardingShouldShowStrategy $onboarding_should_show_strategy
* @param OnboardingStep[] $steps
* @param OnboardingAjax $tracker_ajax
* @param OnboardingOption $onboarding_option
*/
public function __construct(string $onboarding_id, bool $autostart, OnboardingShouldShowStrategy $onboarding_should_show_strategy, array $steps, OnboardingAjax $tracker_ajax, OnboardingOption $onboarding_option)
{
$this->onboarding_id = $onboarding_id;
$this->autostart = $autostart;
$this->onboarding_should_show_strategy = $onboarding_should_show_strategy;
$this->steps = $steps;
$this->tracker_ajax = $tracker_ajax;
$this->onboarding_option = $onboarding_option;
}
public function hooks()
{
add_action('current_screen', [$this, 'init_onboarding']);
$this->tracker_ajax->hooks();
}
public function init_onboarding()
{
if ($this->onboarding_should_show_strategy->should_display()) {
add_action('admin_enqueue_scripts', [$this, 'enqueue_scripts_and_styles']);
add_action('admin_footer', [$this, 'render_onboarding']);
}
add_filter(self::OCTOLIZE_WP_ONBOARDING_RENDERED_FILTER, [$this, 'is_or_already_rendered']);
}
/**
* @param bool $already_rendered
*
* @return bool
*/
public function is_or_already_rendered(bool $already_rendered): bool
{
return $already_rendered || $this->already_rendered;
}
public function enqueue_scripts_and_styles()
{
$handle = 'octolize-onboarding-' . self::VERSION;
wp_register_style($handle, plugin_dir_url(__FILE__) . '../../assets/css/onboarding.css', [], self::VERSION);
wp_enqueue_style($handle);
wp_register_script($handle, plugin_dir_url(__FILE__) . '../../assets/js/onboarding.js', [], self::VERSION);
wp_enqueue_script($handle);
}
public function render_onboarding()
{
$current_screen = get_current_screen();
if (!$this->other_onboarding_already_rendered() && $this->is_onboarding_allowed()) {
$settings = ['open_auto' => $this->autostart, 'logo_img' => plugins_url('/', dirname(__FILE__)) . '/../../assets/images/Octolize_logo_RGB_navy.svg', 'page' => $current_screen->base, 'ajax' => ['url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce($this->tracker_ajax->prepare_nonce_action()), 'action' => ['event' => $this->tracker_ajax->prepare_action_event(), 'click' => $this->tracker_ajax->prepare_action_click(), 'auto_show_popup' => $this->tracker_ajax->prepare_action_auto_show_popup(), 'save_fields' => $this->tracker_ajax->prepare_action_save_fields()]], 'popups' => $this->steps, 'steps' => count($this->steps)];
include __DIR__ . '/views/html-onboarding-container.php';
$this->already_rendered = \true;
$this->update_option_render($current_screen->base);
}
}
private function update_option_render(string $page): void
{
if ($this->autostart) {
$this->onboarding_option->update_option(OnboardingOption::AUTO_SHOW_POPUP, 1);
$this->onboarding_option->update_option(OnboardingOption::VIEWS, (int) $this->onboarding_option->get_option_value(OnboardingOption::VIEWS, 0) + 1);
}
$this->onboarding_option->update_option(OnboardingOption::PAGE, sanitize_text_field($page));
$this->onboarding_option->update_option(OnboardingOption::EVENT_TIME, time());
$this->onboarding_option->update_option(OnboardingOption::EVENT, 'render');
}
/**
* @return bool
*/
private function other_onboarding_already_rendered(): bool
{
return apply_filters(self::OCTOLIZE_WP_ONBOARDING_RENDERED_FILTER, \false);
}
/**
* @return bool
*/
protected function is_onboarding_allowed(): bool
{
return apply_filters(self::OCTOLIZE_WP_ONBOARDING_ALLOWED, apply_filters(self::OCTOLIZE_WP_ONBOARDING_ALLOWED . '/' . $this->onboarding_id, \true));
}
}

View File

@@ -0,0 +1,131 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
use VendorInPost\WPDesk\PluginBuilder\Plugin\Hookable;
/**
* Can handle onboarding Ajax actions.
*/
class OnboardingAjax implements Hookable
{
const AJAX_ACTION_CLICK_PREFIX = 'octolize_onboarding_click_';
const AJAX_ACTION_EVENT_PREFIX = 'octolize_onboarding_event_';
const AJAX_ACTION_AUTO_SHOP_POPUP_PREFIX = 'octolize_onboarding_auto_show_popup_';
const AJAX_ACTION_SAVE_FIELDS_PREFIX = 'octolize_onboarding_save_fields_';
const NONCE_ACTION_PREFIX = 'octolize_onboarding_';
const OCTOLIZE_ONBOARDING_SAVE_FIELDS_ACTION = 'octolize/onboarding/save_fields/';
/**
* @var OnboardingOption
*/
protected $option;
/**
* OptionAjaxUpdater constructor.
*
* @param OnboardingOption $option .
*/
public function __construct(OnboardingOption $option)
{
$this->option = $option;
}
/**
* Hooks.
*/
public function hooks()
{
add_action('wp_ajax_' . $this->prepare_action_click(), [$this, 'handle_ajax_action_click']);
add_action('wp_ajax_' . $this->prepare_action_event(), [$this, 'handle_ajax_action_event']);
add_action('wp_ajax_' . $this->prepare_action_auto_show_popup(), [$this, 'handle_ajax_action_auto_show_popup']);
add_action('wp_ajax_' . $this->prepare_action_save_fields(), [$this, 'handle_ajax_action_save_fields']);
}
public function prepare_action_click(): string
{
return self::AJAX_ACTION_CLICK_PREFIX . $this->option->get_option_name_suffix();
}
public function prepare_action_event(): string
{
return self::AJAX_ACTION_EVENT_PREFIX . $this->option->get_option_name_suffix();
}
public function prepare_action_auto_show_popup(): string
{
return self::AJAX_ACTION_AUTO_SHOP_POPUP_PREFIX . $this->option->get_option_name_suffix();
}
public function prepare_action_save_fields(): string
{
return self::AJAX_ACTION_SAVE_FIELDS_PREFIX . $this->option->get_option_name_suffix();
}
/**
* Handle AJAX action OK.
*
* @internal
*/
public function handle_ajax_action_event()
{
check_ajax_referer($this->prepare_nonce_action());
$event = $this->filter_input(\INPUT_POST, 'event');
$step = $this->filter_input(\INPUT_POST, 'step');
if ($event) {
$this->option->update_option(OnboardingOption::EVENT, sanitize_text_field($event));
$this->option->update_option(OnboardingOption::STEP, sanitize_text_field($step));
$this->option->update_option(OnboardingOption::EVENT_TIME, time());
wp_send_json_success();
} else {
wp_send_json_error();
}
}
/**
* Handle AJAX action Click.
*
* @internal
*/
public function handle_ajax_action_click()
{
check_ajax_referer($this->prepare_nonce_action());
$clicks = (int) $this->option->get_option_value('clicks');
$step = $this->filter_input(\INPUT_POST, 'step');
$this->option->update_option('clicks', $clicks + 1);
$this->option->update_option(OnboardingOption::STEP, sanitize_text_field($step));
wp_send_json_success();
}
/**
* Handle AJAX action Click.
*
* @internal
*/
public function handle_ajax_action_auto_show_popup()
{
check_ajax_referer($this->prepare_nonce_action());
$page = $this->filter_input(\INPUT_POST, 'page');
$step = $this->filter_input(\INPUT_POST, 'step');
$this->option->update_option(OnboardingOption::PAGE, sanitize_text_field($page));
$this->option->update_option(OnboardingOption::STEP, sanitize_text_field($step));
$this->option->update_option(OnboardingOption::EVENT_TIME, time());
$this->option->update_option(OnboardingOption::EVENT, 'auto_show');
wp_send_json_success();
}
public function handle_ajax_action_save_fields()
{
check_ajax_referer($this->prepare_nonce_action());
$data = wp_unslash($_POST);
$this->option->update_option(OnboardingOption::SAVE_FIELDS, sanitize_text_field($data['popup_id']));
do_action(self::OCTOLIZE_ONBOARDING_SAVE_FIELDS_ACTION . $this->option->get_option_name_suffix(), $data);
wp_send_json_success();
}
/**
* @param int $type .
* @param string $var_name .
*
* @return mixed
* @codeCoverageIgnore
*/
protected function filter_input(int $type, string $var_name)
{
return filter_input($type, $var_name);
}
public function prepare_nonce_action(): string
{
return self::NONCE_ACTION_PREFIX . $this->option->get_option_name_suffix();
}
}

View File

@@ -0,0 +1,106 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
/**
* Onboarding button.
*/
class OnboardingButton implements \JsonSerializable
{
const BTN_SUCCESS = 'btn-success';
const BTN_SECONDARY = 'btn-secondary';
const BTN_LINK = 'btn-link';
const TYPE_STEP = 'step';
const TYPE_AJAX = 'ajax';
const TYPE_CLOSE = 'close';
/**
* @var string
*/
private $label = 'button';
/**
* @var string
*/
private $type = self::TYPE_STEP;
/**
* @var string
*/
private $popup = 'step_0';
/**
* @var string
*/
private $classes = self::BTN_SUCCESS;
/**
* @return string
*/
public function getLabel(): string
{
return $this->label;
}
/**
* @param string $label
* @return OnboardingButton
*/
public function set_label(string $label): OnboardingButton
{
$this->label = $label;
return $this;
}
/**
* @return string
*/
public function get_type(): string
{
return $this->type;
}
/**
* @param string $type
* @return OnboardingButton
*/
public function set_type(string $type): OnboardingButton
{
$this->type = $type;
return $this;
}
/**
* @return string
*/
public function get_popup(): string
{
return $this->popup;
}
/**
* @param string $popup
* @return OnboardingButton
*/
public function set_popup(string $popup): OnboardingButton
{
$this->popup = $popup;
return $this;
}
/**
* @return string
*/
public function get_classes(): string
{
return $this->classes;
}
/**
* @param string $classes
* @return OnboardingButton
*/
public function set_classes(string $classes): OnboardingButton
{
$this->classes = $classes;
return $this;
}
/**
* @return array
*/
public function jsonSerialize(): array
{
return ['label' => $this->getLabel(), 'type' => $this->get_type(), 'popup' => $this->get_popup(), 'classes' => $this->get_classes()];
}
}

View File

@@ -0,0 +1,47 @@
<?php
namespace VendorInPost\Octolize\Onboarding;
use VendorInPost\WPDesk\PluginBuilder\Plugin\Hookable;
/**
* Can append onboarding data to deactivation tracker.
*/
class OnboardingDeactivationData implements Hookable
{
const ADDITIONAL_DATA = 'additional_data';
/**
* @var string
*/
private $plugin_file;
/**
* @var OnboardingOption
*/
private $onboarding_option;
/**
* @param string $plugin_file
* @param OnboardingOption $onboarding_option
*/
public function __construct(string $plugin_file, OnboardingOption $onboarding_option)
{
$this->plugin_file = $plugin_file;
$this->onboarding_option = $onboarding_option;
}
public function hooks()
{
add_filter('wpdesk_tracker_deactivation_data', array($this, 'append_onboarding_option_to_data'));
}
/**
* @param array $data
* @return array
*/
public function append_onboarding_option_to_data($data)
{
if (is_array($data) && isset($data['plugin']) && $this->plugin_file === $data['plugin']) {
if (empty($data[self::ADDITIONAL_DATA])) {
$data[self::ADDITIONAL_DATA] = [];
}
$data[self::ADDITIONAL_DATA]['octolize_onboarding'] = $this->onboarding_option->get_raw_option_data();
}
return $data;
}
}

View File

@@ -0,0 +1,108 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
/**
* Can update option when onboarding is finish.
*/
class OnboardingOption
{
const OPTION_PREFIX = 'octolize_onboarding_';
const VIEWS = 'views';
const STEP = 'step';
const EVENT = 'event';
const PAGE = 'page';
const EVENT_TIME = 'event_time';
const AUTO_SHOW_POPUP = 'auto_show_popup';
const SAVE_FIELDS = 'save_fields';
/**
* @var string
*/
private $option_name_suffix;
/**
* @var string
*/
private $option_name_prefix = self::OPTION_PREFIX;
/**
* @param string $option_name_suffix
* @param string $option_name_prefix
*/
public function __construct(string $option_name_suffix, string $option_name_prefix = self::OPTION_PREFIX)
{
$this->option_name_suffix = $option_name_suffix;
$this->option_name_prefix = $option_name_prefix;
}
/**
* @return string
*/
public function get_option_name_suffix(): string
{
return $this->option_name_suffix;
}
/**
* Get option value.
*
* @param string $key .
* @param mixed $default .
*
* @return mixed
*/
public function get_option_value(string $key = '', $default = \false)
{
$options = $this->get_options();
if ($key) {
return $options[$key] ?? $default;
}
return $options;
}
/**
* Checks if option is set.
*
* @return bool Option status.
*/
public function is_option_set(): bool
{
return \false !== get_option($this->prepare_option_name(), \false);
}
/**
* @param string $option_key .
* @param mixed $option_value .
*
* @return bool
*/
public function update_option(string $option_key, $option_value): bool
{
$options = $this->get_options();
$options[$option_key] = $option_value;
return update_option($this->prepare_option_name(), $options);
}
public function get_raw_option_data(): array
{
return $this->get_options();
}
/**
* @return array
*/
private function get_options(): array
{
$options = get_option($this->prepare_option_name(), []);
if (!is_array($options)) {
$options = [];
}
return wp_parse_args($options, $this->get_default_option_values());
}
/**
* @return array
*/
private function get_default_option_values(): array
{
return [self::AUTO_SHOW_POPUP => 0, self::VIEWS => 0, self::STEP => 'step_0', self::EVENT => '', self::PAGE => '', self::EVENT_TIME => 0, self::SAVE_FIELDS => ''];
}
private function prepare_option_name(): string
{
return $this->option_name_prefix . $this->option_name_suffix;
}
}

View File

@@ -0,0 +1,17 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
/**
* Always display strategy.
*/
class OnboardingShouldShowAlwaysStrategy implements OnboardingShouldShowStrategy
{
public function should_display(): bool
{
return \true;
}
}

View File

@@ -0,0 +1,56 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
use VendorInPost\WPDesk\PluginBuilder\Plugin\Hookable;
/**
* When and if show Onboarding.
*/
class OnboardingShouldShowGetParametersStrategy implements OnboardingShouldShowStrategy
{
/**
* Whether to show onboarding on the page or not. Array of arrays with condition for _GET.
* Inner arrays mean AND, outer arrays mean OR conditions.
*
* ie. [ [ 'parameters' => [ .. and .. and ..] ] or [ 'parameters' => [ .. and .. and ..] or .. ] ]
*
* @var array
*/
private $conditions;
public function __construct(array $conditions)
{
$this->conditions = $conditions;
}
/**
* Should Onboarding be visible?
*
* @return bool
*/
public function should_display(): bool
{
return $this->should_display_from_get_parameters();
}
private function should_display_from_get_parameters(): bool
{
$current_screen = get_current_screen();
$page = $current_screen ? $current_screen->base : '';
foreach ($this->conditions as $or_conditions) {
if ($this->should_display_on_current_page($page === ($or_conditions['page'] ?? ''), $or_conditions['parameters'] ?? [])) {
return \true;
}
}
return \false;
}
private function should_display_on_current_page(bool $display, array $parameters): bool
{
foreach ($parameters as $parameter => $value) {
if (!isset($_GET[$parameter]) && !empty($value) || isset($_GET[$parameter]) && $_GET[$parameter] !== $value) {
$display = \false;
}
}
return $display;
}
}

View File

@@ -0,0 +1,17 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
/**
* Never display strategy.
*/
class OnboardingShouldShowNeverStrategy implements OnboardingShouldShowStrategy
{
public function should_display(): bool
{
return \false;
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
/**
* When to show Onboarding.
*/
interface OnboardingShouldShowStrategy
{
/**
* Should Onboarding be visible?
*
* @return bool
*/
public function should_display();
}

View File

@@ -0,0 +1,248 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
use VendorInPost\WPDesk\Forms\Field;
/**
* Onboarding step.
*/
class OnboardingStep implements \JsonSerializable
{
/**
* @var string
*/
private $id = 'step_0';
/**
* @var int
*/
private $step = 0;
/**
* @var bool
*/
private $logo = \false;
/**
* @var string
*/
private $title = '';
/**
* @var bool
*/
private $show = \false;
/**
* @var string
*/
private $image = '';
/**
* @var string
*/
private $heading = '';
/**
* @var string
*/
private $sub_heading = '';
/**
* @var Field[]
*/
private $content = [];
/**
* @var OnboardingButton[]
*/
private $buttons = [];
/**
* @param string $id
* @param int $step
* @param string $title
* @param Field[] $content
* @param OnboardingButton[] $buttons
*/
public function __construct(string $id, int $step, string $title, array $content, array $buttons)
{
$this->id = $id;
$this->step = $step;
$this->title = $title;
$this->content = $content;
$this->buttons = $buttons;
}
/**
* @return string
*/
public function get_id(): string
{
return $this->id;
}
/**
* @return int
*/
public function get_step(): int
{
return $this->step;
}
/**
* @return bool
*/
public function is_logo(): bool
{
return $this->logo;
}
/**
* @return string
*/
public function get_title(): string
{
return $this->title;
}
/**
* @return bool
*/
public function is_show(): bool
{
return $this->show;
}
/**
* @return string
*/
public function get_image(): string
{
return $this->image;
}
/**
* @return string
*/
public function get_heading(): string
{
return $this->heading;
}
/**
* @return string
*/
public function get_sub_heading(): string
{
return $this->sub_heading;
}
/**
* @return OnboardingButton[]
*/
public function get_buttons(): array
{
return $this->buttons;
}
/**
* @param string $id
* @return OnboardingStep
*/
public function set_id(string $id): OnboardingStep
{
$this->id = $id;
return $this;
}
/**
* @param int $step
* @return OnboardingStep
*/
public function set_step(int $step): OnboardingStep
{
$this->step = $step;
return $this;
}
/**
* @param bool $logo
* @return OnboardingStep
*/
public function set_logo(bool $logo): OnboardingStep
{
$this->logo = $logo;
return $this;
}
/**
* @param string $title
* @return OnboardingStep
*/
public function set_title(string $title): OnboardingStep
{
$this->title = $title;
return $this;
}
/**
* @param bool $show
* @return OnboardingStep
*/
public function set_show(bool $show): OnboardingStep
{
$this->show = $show;
return $this;
}
/**
* @param string $image
* @return OnboardingStep
*/
public function set_image(string $image): OnboardingStep
{
$this->image = $image;
return $this;
}
/**
* @param string $heading
* @return OnboardingStep
*/
public function set_heading(string $heading): OnboardingStep
{
$this->heading = $heading;
return $this;
}
/**
* @param string $sub_heading
* @return OnboardingStep
*/
public function set_sub_heading(string $sub_heading): OnboardingStep
{
$this->sub_heading = $sub_heading;
return $this;
}
/**
* @param OnboardingButton[] $buttons
* @return OnboardingStep
*/
public function set_buttons(array $buttons): OnboardingStep
{
$this->buttons = $buttons;
return $this;
}
/**
* @return Field[]
*/
public function get_content(): array
{
return $this->content;
}
/**
* @param Field[] $content
* @return OnboardingStep
*/
public function set_content(array $content): OnboardingStep
{
$this->content = $content;
return $this;
}
/**
* @return array
*/
public function jsonSerialize(): array
{
return ['id' => $this->get_id(), 'logo' => $this->is_logo(), 'title' => $this->get_title(), 'step' => $this->get_step(), 'show' => $this->is_show(), 'image' => $this->get_image(), 'heading' => $this->get_heading(), 'sub_heading' => $this->get_sub_heading(), 'content' => $this->serializeContent(), 'buttons' => $this->get_buttons()];
}
private function serializeContent(): array
{
$serialized = [];
foreach ($this->content as $field) {
$serialized_field = ['type' => $field->get_type(), 'name' => $field->get_name(), 'id' => $field->get_id(), 'class' => $field->get_classes(), 'value' => $field->get_default_value(), 'label' => $field->get_label(), 'autocomplete' => $field->is_attribute_set('autocomplete') ? $field->get_attribute('autocomplete', '') : ''];
if ($field instanceof Field\CheckboxField) {
$serialized_field['sublabel'] = $field->get_sublabel();
}
$serialized[] = $serialized_field;
}
return $serialized;
}
}

View File

@@ -0,0 +1,48 @@
<?php
/**
* @package Octolize\Onboarding
*/
namespace VendorInPost\Octolize\Onboarding;
use VendorInPost\WPDesk\PluginBuilder\Plugin\Hookable;
/**
* Can append onboarding data to tracker.
*/
class OnboardingTrackerData implements Hookable
{
const PRIORITY = 1000;
/**
* @var string
*/
private $append_data_to;
/**
* @var OnboardingOption
*/
private $onboarding_option;
/**
* @var string
*/
private $append_as;
/**
* @param string $append_data_to
*/
public function __construct(string $append_data_to, OnboardingOption $onboarding_option, $append_as = 'octolize_onboarding')
{
$this->append_data_to = $append_data_to;
$this->onboarding_option = $onboarding_option;
$this->append_as = $append_as;
}
public function hooks()
{
add_filter('wpdesk_tracker_data', [$this, 'append_data_to_tracker'], self::PRIORITY);
}
public function append_data_to_tracker($data)
{
if (empty($data[$this->append_data_to])) {
$data[$this->append_data_to] = [];
}
$data[$this->append_data_to][$this->append_as] = $this->onboarding_option->get_raw_option_data();
return $data;
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace VendorInPost\Octolize\Onboarding\PluginUpgrade\MessageFactory;
use VendorInPost\Octolize\Onboarding\PluginUpgrade\PluginUpgradeMessage;
class LiveRatesFsRulesTable
{
public function create_message(string $plugin_version, string $plugin_url)
{
return new PluginUpgradeMessage($plugin_version, trailingslashit($plugin_url) . 'vendor_prefixed/octolize/wp-onboarding/assets/images/icon-complex-solution.svg', __('We\'ve added integration with Flexible Shipping Table Rate', 'woocommerce-paczkomaty-inpost'), sprintf(
// Translators: %1$s - <br/><br/>, %2$s - <a href="https://octol.io/fs-tr-adv-live-rates-popup-free" target="_blank">, %3$s - </a>, %4$s - <a href="https://octol.io/fs-tr-adv-live-rates-popup-pro" target="_blank">, %5$s - </a>.
__('The new feature allows you to combine Live Rates and Table Rate, providing the ability to use automatically calculated Live Rates while also adjusting shipping costs using Table Rate with the free version of %1$sFlexible Shipping%2$s or %3$sFlexible Shipping PRO%4$s.%5$sThis way, you can now have greater control over the final delivery cost, precisely defining additional charges or discounts for each shipping method.', 'woocommerce-paczkomaty-inpost'),
'<a href="https://octol.io/fs-tr-adv-live-rates-popup-free" target="_blank">',
'</a>',
'<a href="https://octol.io/fs-tr-adv-live-rates-popup-pro" target="_blank">',
'</a>',
'<br/><br/>'
), '', '');
}
}

View File

@@ -0,0 +1,29 @@
<?php
namespace VendorInPost\Octolize\Onboarding\PluginUpgrade;
use VendorInPost\Octolize\Onboarding\OnboardingAjax;
use VendorInPost\Octolize\Onboarding\OnboardingOption;
/**
* Can handle plugin upgrade onboarding Ajax actions.
*/
class PluginUpgradeAjax extends OnboardingAjax
{
/**
* @var string
*/
private $plugin_version;
/**
* @param string $plugin_version
*/
public function __construct(OnboardingOption $onboarding_option, string $plugin_version)
{
parent::__construct($onboarding_option);
$this->plugin_version = $plugin_version;
}
public function handle_ajax_action_auto_show_popup()
{
$this->option->update_option('plugin_version', $this->plugin_version);
parent::handle_ajax_action_auto_show_popup();
}
}

View File

@@ -0,0 +1,93 @@
<?php
namespace VendorInPost\Octolize\Onboarding\PluginUpgrade;
/**
* Can provide upgrade data containing plugin upgrade message.
*/
class PluginUpgradeMessage
{
/**
* @var string
*/
private $plugin_version;
/**
* @var string
*/
private $image_url;
/**
* @var string
*/
private $title;
/**
* @var string
*/
private $message;
/**
* @var string
*/
private $link_text;
/**
* @var string
*/
private $link_url;
/**
* @param string $plugin_version
* @param string $image_url
* @param string $title
* @param string $message
* @param string $link_text
* @param string $link_url
*/
public function __construct(string $plugin_version, string $image_url, string $title, string $message, string $link_text, string $link_url)
{
$this->plugin_version = $plugin_version;
$this->image_url = $image_url;
$this->title = $title;
$this->message = $message;
$this->link_text = $link_text;
$this->link_url = $link_url;
}
/**
* @return string
*/
public function get_plugin_version(): string
{
return $this->plugin_version;
}
/**
* @return string
*/
public function get_image_url(): string
{
return $this->image_url;
}
/**
* @return string
*/
public function get_title(): string
{
return $this->title;
}
/**
* @return string
*/
public function get_message(): string
{
return $this->message;
}
/**
* @return string
*/
public function get_link_text(): string
{
return $this->link_text;
}
/**
* @return string
*/
public function get_link_url(): string
{
return $this->link_url;
}
}

View File

@@ -0,0 +1,159 @@
<?php
namespace VendorInPost\Octolize\Onboarding\PluginUpgrade;
use VendorInPost\Octolize\Onboarding\Field\Html;
use VendorInPost\Octolize\Onboarding\Onboarding;
use VendorInPost\Octolize\Onboarding\OnboardingButton;
use VendorInPost\Octolize\Onboarding\OnboardingOption;
use VendorInPost\Octolize\Onboarding\OnboardingShouldShowAlwaysStrategy;
use VendorInPost\Octolize\Onboarding\OnboardingShouldShowStrategy;
use VendorInPost\Octolize\Onboarding\OnboardingStep;
use VendorInPost\Octolize\Onboarding\OnboardingTrackerData;
use VendorInPost\WPDesk\Forms\Field;
/**
* Can create popup with plugin upgrade information.
*/
class PluginUpgradeOnboardingFactory
{
const PLUGIN_VERSION = 'plugin_version';
const MINIMAL_VERSION = '0.0.1';
/**
* @var string
*/
private $plugin_name;
/**
* @var PluginUpgradeMessage[]
*/
private $upgrade_messages = [];
/**
* @var string
*/
private $current_plugin_version;
/**
* @var string
*/
private $plugin_file;
/**
* @var string
*/
private $append_tracker_data_to;
/**
* @param string $plugin_name
* @param string $current_plugin_version
* @param string $plugin_file
* @param string $append_tracker_data_to
*/
public function __construct(string $plugin_name, string $current_plugin_version, string $plugin_file, string $append_tracker_data_to = '')
{
$this->plugin_name = $plugin_name;
$this->current_plugin_version = $current_plugin_version;
$this->plugin_file = $plugin_file;
$this->append_tracker_data_to = $append_tracker_data_to;
}
/**
* @param PluginUpgradeMessage $upgrade_message
* @return PluginUpgradeOnboardingFactory
*/
public function add_upgrade_message(PluginUpgradeMessage $upgrade_message): PluginUpgradeOnboardingFactory
{
$this->upgrade_messages[] = $upgrade_message;
return $this;
}
/**
* @return void
*/
public function create_onboarding(): void
{
$onboarding_id = 'upgrade_' . $this->plugin_file;
$onboarding_option = new OnboardingOption($onboarding_id);
$default_plugin_version = $this->plugin_activated_hour_before_or_early() ? self::MINIMAL_VERSION : $this->current_plugin_version;
$previous_version = $onboarding_option->get_option_value(self::PLUGIN_VERSION, $default_plugin_version);
$plugin_upgrade_watcher = new PluginUpgradeWatcher($this->plugin_file, $onboarding_option);
$plugin_upgrade_watcher->hooks();
$onboarding_ajax = new PluginUpgradeAjax($onboarding_option, $this->current_plugin_version);
$onboarding_ajax->hooks();
if ($this->has_onboarding_messages($previous_version, $this->current_plugin_version)) {
$onboarding_should_display_strategy = $this->prepare_display_strategy();
$onboarding = new Onboarding($onboarding_id, \true, $onboarding_should_display_strategy, $this->prepare_steps($previous_version, $this->current_plugin_version), $onboarding_ajax, $onboarding_option);
if (is_admin() && $onboarding_option->update_option(self::PLUGIN_VERSION, $this->current_plugin_version)) {
$onboarding->hooks();
}
} else if ($onboarding_option->get_option_value(self::PLUGIN_VERSION, self::MINIMAL_VERSION) !== $this->current_plugin_version) {
$onboarding_option->update_option(self::PLUGIN_VERSION, $this->current_plugin_version);
}
if ($this->append_tracker_data_to !== '') {
$tracker = new OnboardingTrackerData($this->append_tracker_data_to, $onboarding_option, 'update_onboarging');
$tracker->hooks();
}
}
private function plugin_activated_hour_before_or_early(): bool
{
$plugin_activation = get_option('plugin_activation_' . $this->plugin_file, current_time('mysql'));
return strtotime($plugin_activation) < current_time('timestamp') - 3600;
}
private function prepare_display_strategy(): OnboardingShouldShowStrategy
{
return new OnboardingShouldShowAlwaysStrategy();
}
/**
* @param string $previous_version
*
* @return OnboardingStep[]
*/
private function prepare_steps(string $previous_version, string $current_version): array
{
$onboarding_step = new OnboardingStep('step_1', 1, $this->plugin_name, $this->prepare_fields($previous_version, $current_version), $this->prepare_buttons());
$onboarding_step->set_show(\true)->set_heading(sprintf(__('Thank you for updating %1$s!', 'woocommerce-paczkomaty-inpost'), $this->plugin_name))->set_sub_heading(__('It is really important to keep the plugins up to date. We have implemented some improvements and new functionalities. Find out what has changed:', 'woocommerce-paczkomaty-inpost'));
return [$onboarding_step];
}
/**
* @param string $previous_version
*
* @return Field[]
*/
private function prepare_fields(string $previous_version, $current_version): array
{
$fields = [];
foreach ($this->upgrade_messages as $upgrade_message) {
if ($this->is_lower($previous_version, $upgrade_message->get_plugin_version()) && $this->is_grater_or_equal($current_version, $upgrade_message->get_plugin_version())) {
$fields[] = (new Html())->set_default_value(sprintf('<div class="upgrade_message"><img class="icon" src="%1$s" /><div class="content"><div class="title">%2$s</div><div class="message">%3$s</div><div><a target="_blank" href="%4$s">%5$s</a></div></div>', esc_url($upgrade_message->get_image_url()), $upgrade_message->get_title(), $upgrade_message->get_message(), esc_url($upgrade_message->get_link_url()), $upgrade_message->get_link_text()));
}
}
return $fields;
}
/**
* @return OnboardingButton[]
*/
private function prepare_buttons(): array
{
return [(new OnboardingButton())->set_label(__('I\'m not interested', 'woocommerce-paczkomaty-inpost'))->set_classes(OnboardingButton::BTN_LINK), (new OnboardingButton())->set_label(__('Thanks for letting me know', 'woocommerce-paczkomaty-inpost'))->set_type(OnboardingButton::TYPE_CLOSE)];
}
private function has_onboarding_messages($previous_version, $current_version): bool
{
foreach ($this->upgrade_messages as $upgrade_message) {
if ($this->is_lower($previous_version, $upgrade_message->get_plugin_version()) && $this->is_grater_or_equal($current_version, $upgrade_message->get_plugin_version())) {
return \true;
}
}
return \false;
}
/**
* @param string $previous_version
* @param string $current_version
* @return bool
*/
public function is_lower(string $previous_version, string $current_version)
{
return version_compare($previous_version, $current_version, '<');
}
/**
* @param string $previous_version
* @param string $current_version
* @return bool
*/
public function is_grater_or_equal(string $previous_version, string $current_version)
{
return version_compare($previous_version, $current_version, '>=');
}
}

View File

@@ -0,0 +1,51 @@
<?php
namespace VendorInPost\Octolize\Onboarding\PluginUpgrade;
use VendorInPost\Octolize\Onboarding\OnboardingOption;
use VendorInPost\WPDesk\PluginBuilder\Plugin\Hookable;
/**
* Can store plugin old version on upgrading process.
*/
class PluginUpgradeWatcher implements Hookable
{
/**
* @var string
*/
private $plugin_file_name;
/**
* @var OnboardingOption
*/
private $onboarding_option;
/**
* @param string $plugin_file_name
* @param OnboardingOption $onboarding_option
*/
public function __construct(string $plugin_file_name, OnboardingOption $onboarding_option)
{
$this->plugin_file_name = $plugin_file_name;
$this->onboarding_option = $onboarding_option;
}
public function hooks()
{
add_action('upgrader_process_complete', [$this, 'save_plugin_version_from_upgrader'], 10, 2);
}
/**
* @param \WP_Upgrader $upgrader
* @param array $options
* @return void
*/
public function save_plugin_version_from_upgrader($upgrader, $options)
{
if (!isset($options['plugins'])) {
return;
}
if ($options['action'] === 'update' && $options['type'] === 'plugin') {
foreach ($options['plugins'] as $plugin) {
if ($plugin === $this->plugin_file_name && isset($upgrader->skin->plugin_info['Version'])) {
$this->onboarding_option->update_option('plugin_version', $upgrader->skin->plugin_info['Version']);
}
}
}
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace VendorInPost;
/**
* Onboarding container.
*
* @package Octolize\Onboarding
*/
/**
* Params.
*
* @var $settings array .
*/
$container_class = 'onboarding-container-' . \VendorInPost\Octolize\Onboarding\Onboarding::VERSION;
?><div
class="<?php
echo \esc_attr($container_class);
?>"
onboarding_settings="<?php
echo \esc_attr(\json_encode($settings, \JSON_UNESCAPED_UNICODE | \JSON_HEX_QUOT));
?>"
></div>
<?php

View File

@@ -0,0 +1,21 @@
/* ---
Docs: https://www.npmjs.com/package/mati-mix/
--- */
const mix = require('mati-mix');
// OnBoarding
mix.js( [ 'assets-src/onboarding/js/index.jsx' ], 'assets/js/onboarding.js' );
mix.sass( 'assets-src/onboarding/scss/style.scss', 'assets/css/onboarding.css' );
mix.mix.babelConfig({
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
});
mix.mix.webpackConfig({
externals: {
"@wordpress/i18n": ["wp", "i18n"]
}
});