Add Quill editor for recipe description

This commit is contained in:
Christopher C. Wells 2021-03-07 13:39:44 -08:00
parent 700bc380a2
commit 22173bcdcb
46 changed files with 27681 additions and 18 deletions

57
package-lock.json generated
View File

@ -2408,6 +2408,12 @@
}
}
},
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=",
"dev": true
},
"coa": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/coa/-/coa-2.0.2.tgz",
@ -3843,6 +3849,12 @@
}
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
"dev": true
},
"extend-shallow": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
@ -3954,6 +3966,12 @@
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"dev": true
},
"fast-diff": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz",
"integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==",
"dev": true
},
"fast-glob": {
"version": "2.2.7",
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz",
@ -6361,6 +6379,12 @@
"no-case": "^2.2.0"
}
},
"parchment": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz",
"integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==",
"dev": true
},
"parse-asn1": {
"version": "5.1.6",
"resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz",
@ -7466,6 +7490,39 @@
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
"dev": true
},
"quill": {
"version": "1.3.7",
"resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz",
"integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==",
"dev": true,
"requires": {
"clone": "^2.1.1",
"deep-equal": "^1.0.1",
"eventemitter3": "^2.0.3",
"extend": "^3.0.2",
"parchment": "^1.1.4",
"quill-delta": "^3.6.2"
},
"dependencies": {
"eventemitter3": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
"integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo=",
"dev": true
}
}
},
"quill-delta": {
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz",
"integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==",
"dev": true,
"requires": {
"deep-equal": "^1.0.1",
"extend": "^3.0.2",
"fast-diff": "1.1.2"
}
},
"randombytes": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",

View File

@ -18,6 +18,7 @@
"laravel-mix": "^5.0.1",
"lodash": "^4.17.19",
"postcss-import": "^12.0.1",
"quill": "^1.3.7",
"resolve-url-loader": "^3.1.0",
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.1",
"vue-template-compiler": "^2.6.12"

1344
public/css/edit.css vendored Normal file

File diff suppressed because it is too large Load Diff

1344
public/css/recipes/edit.css vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"></line>
<line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"></line>
<line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"></line>
</svg>

After

Width:  |  Height:  |  Size: 223 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"></line>
<line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"></line>
<line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"></line>
</svg>

After

Width:  |  Height:  |  Size: 223 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"></line>
<line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"></line>
<line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"></line>
</svg>

After

Width:  |  Height:  |  Size: 222 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"></line>
<line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"></line>
<line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"></line>
</svg>

After

Width:  |  Height:  |  Size: 223 B

View File

@ -0,0 +1,52 @@
<svg viewbox="0 0 18 18">
<g class="ql-fill ql-color-label">
<polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon>
<rect height="1" width="1" x="4" y="4"></rect>
<polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon>
<rect height="1" width="1" x="2" y="6"></rect>
<rect height="1" width="1" x="3" y="5"></rect>
<rect height="1" width="1" x="4" y="7"></rect>
<polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon>
<rect height="1" width="1" x="2" y="12"></rect>
<rect height="1" width="1" x="2" y="9"></rect>
<rect height="1" width="1" x="2" y="15"></rect>
<polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon>
<rect height="1" width="1" x="3" y="8"></rect>
<path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"></path>
<path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"></path>
<path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"></path>
<rect height="1" width="1" x="12" y="2"></rect>
<rect height="1" width="1" x="11" y="3"></rect>
<path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"></path>
<rect height="1" width="1" x="2" y="3"></rect>
<rect height="1" width="1" x="6" y="2"></rect>
<rect height="1" width="1" x="3" y="2"></rect>
<rect height="1" width="1" x="5" y="3"></rect>
<rect height="1" width="1" x="9" y="2"></rect>
<rect height="1" width="1" x="15" y="14"></rect>
<polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon>
<rect height="1" width="1" x="13" y="7"></rect>
<rect height="1" width="1" x="15" y="5"></rect>
<rect height="1" width="1" x="14" y="6"></rect>
<rect height="1" width="1" x="15" y="8"></rect>
<rect height="1" width="1" x="14" y="9"></rect>
<path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"></path>
<rect height="1" width="1" x="14" y="3"></rect>
<polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon>
<rect height="1" width="1" x="15" y="2"></rect>
<rect height="1" width="1" x="12" y="5"></rect>
<rect height="1" width="1" x="13" y="4"></rect>
<polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon>
<rect height="1" width="1" x="9" y="14"></rect>
<rect height="1" width="1" x="8" y="15"></rect>
<path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"></path>
<rect height="1" width="1" x="5" y="15"></rect>
<path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"></path>
<rect height="1" width="1" x="11" y="15"></rect>
<path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"></path>
<rect height="1" width="1" x="14" y="15"></rect>
<rect height="1" width="1" x="15" y="11"></rect>
</g>
<polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"></polyline>
<line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"></line>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,6 @@
<svg viewbox="0 0 18 18">
<rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"></rect>
<rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"></rect>
<path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"></path>
<path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"></path>
</svg>

After

Width:  |  Height:  |  Size: 334 B

View File

@ -0,0 +1,4 @@
<svg viewbox="0 0 18 18">
<path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"></path>
<path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 281 B

View File

@ -0,0 +1,7 @@
<svg class="" viewbox="0 0 18 18">
<line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"></line>
<line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"></line>
<line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"></line>
<line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"></line>
<rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"></rect>
</svg>

After

Width:  |  Height:  |  Size: 386 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline>
<polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline>
<line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"></line>
</svg>

After

Width:  |  Height:  |  Size: 243 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"></line>
<polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"></polyline>
<line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"></line>
</svg>

After

Width:  |  Height:  |  Size: 266 B

View File

@ -0,0 +1,7 @@
<svg viewbox="0 0 18 18">
<polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon>
<line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"></line>
<path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"></path>
<rect class="ql-fill" height="11" width="1" x="11" y="4"></rect>
<rect class="ql-fill" height="11" width="1" x="13" y="4"></rect>
</svg>

After

Width:  |  Height:  |  Size: 377 B

View File

@ -0,0 +1,7 @@
<svg viewbox="0 0 18 18">
<polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon>
<line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"></line>
<path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"></path>
<rect class="ql-fill" height="11" width="1" x="5" y="4"></rect>
<rect class="ql-fill" height="11" width="1" x="7" y="4"></rect>
</svg>

After

Width:  |  Height:  |  Size: 376 B

View File

@ -0,0 +1,4 @@
<svg viewbox="0 0 18 18">
<polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"></polygon>
<polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"></polygon>
</svg>

After

Width:  |  Height:  |  Size: 168 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<path class="ql-fill" d="M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z"/>
<path class="ql-fill" d="M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z"/>
<rect class="ql-fill" x="3" y="6" width="12" height="6" rx="1" ry="1"/>
</svg>

After

Width:  |  Height:  |  Size: 250 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<path class="ql-fill" d="M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z"/>
<path class="ql-fill" d="M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z"/>
<rect class="ql-fill" x="2" y="6" width="14" height="6" rx="1" ry="1"/>
</svg>

After

Width:  |  Height:  |  Size: 248 B

View File

@ -0,0 +1,7 @@
<svg viewbox="0 0 18 18">
<path class="ql-fill" d="M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z"/>
<path class="ql-fill" d="M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z"/>
<path class="ql-fill" d="M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z"/>
<path class="ql-fill" d="M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z"/>
<rect class="ql-fill" x="2" y="6" width="8" height="6" rx="1" ry="1"/>
</svg>

After

Width:  |  Height:  |  Size: 393 B

View File

@ -0,0 +1,7 @@
<svg viewbox="0 0 18 18">
<path class="ql-fill" d="M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z"/>
<path class="ql-fill" d="M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z"/>
<path class="ql-fill" d="M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z"/>
<path class="ql-fill" d="M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z"/>
<rect class="ql-fill" x="8" y="6" width="8" height="6" rx="1" ry="1" transform="translate(24 18) rotate(-180)"/>
</svg>

After

Width:  |  Height:  |  Size: 429 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"></path>
<rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"></rect>
<path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,3 @@
<svg viewBox="0 0 18 18">
<path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/>
</svg>

After

Width:  |  Height:  |  Size: 641 B

View File

@ -0,0 +1,3 @@
<svg viewBox="0 0 18 18">
<path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/>
</svg>

After

Width:  |  Height:  |  Size: 577 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<rect class="ql-stroke" height="10" width="12" x="3" y="4"></rect>
<circle class="ql-fill" cx="6" cy="7" r="1"></circle>
<polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline>
</svg>

After

Width:  |  Height:  |  Size: 254 B

View File

@ -0,0 +1,6 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"></line>
<line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"></line>
<line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"></line>
<polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline>
</svg>

After

Width:  |  Height:  |  Size: 299 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"></line>
<line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"></line>
<line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"></line>
</svg>

After

Width:  |  Height:  |  Size: 224 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"></line>
<path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"></path>
<path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 431 B

View File

@ -0,0 +1,8 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"></line>
<line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"></line>
<line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"></line>
<line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"></line>
<line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"></line>
<line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"></line>
</svg>

After

Width:  |  Height:  |  Size: 411 B

View File

@ -0,0 +1,8 @@
<svg class="" viewbox="0 0 18 18">
<line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"></line>
<polyline class="ql-stroke" points="3 4 4 5 6 3"></polyline>
<line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"></line>
<polyline class="ql-stroke" points="3 14 4 15 6 13"></polyline>
<line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"></line>
<polyline class="ql-stroke" points="3 9 4 10 6 8"></polyline>
</svg>

After

Width:  |  Height:  |  Size: 425 B

View File

@ -0,0 +1,9 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"></line>
<line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"></line>
<line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"></line>
<line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"></line>
<path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"></path>
<path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"></path>
<path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"></path>
</svg>

After

Width:  |  Height:  |  Size: 764 B

View File

@ -0,0 +1,6 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"></line>
<line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"></line>
<line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"></line>
<polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"></polyline>
</svg>

After

Width:  |  Height:  |  Size: 291 B

View File

@ -0,0 +1,5 @@
<svg viewbox="0 0 18 18">
<line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"></line>
<path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"></path>
<path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"></path>
</svg>

After

Width:  |  Height:  |  Size: 543 B

View File

@ -0,0 +1,4 @@
<svg viewbox="0 0 18 18">
<path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/>
<path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/>
</svg>

After

Width:  |  Height:  |  Size: 686 B

View File

@ -0,0 +1,4 @@
<svg viewbox="0 0 18 18">
<path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/>
<path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/>
</svg>

After

Width:  |  Height:  |  Size: 567 B

View File

@ -0,0 +1,4 @@
<svg viewbox="0 0 18 18">
<path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"></path>
<rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"></rect>
</svg>

After

Width:  |  Height:  |  Size: 210 B

View File

@ -0,0 +1,14 @@
<svg viewbox="0 0 18 18">
<rect class="ql-stroke" height="12" width="12" x="3" y="3"></rect>
<rect class="ql-fill" height="12" width="1" x="5" y="3"></rect>
<rect class="ql-fill" height="12" width="1" x="12" y="3"></rect>
<rect class="ql-fill" height="2" width="8" x="5" y="8"></rect>
<rect class="ql-fill" height="1" width="3" x="3" y="5"></rect>
<rect class="ql-fill" height="1" width="3" x="3" y="7"></rect>
<rect class="ql-fill" height="1" width="3" x="3" y="10"></rect>
<rect class="ql-fill" height="1" width="3" x="3" y="12"></rect>
<rect class="ql-fill" height="1" width="3" x="12" y="5"></rect>
<rect class="ql-fill" height="1" width="3" x="12" y="7"></rect>
<rect class="ql-fill" height="1" width="3" x="12" y="10"></rect>
<rect class="ql-fill" height="1" width="3" x="12" y="12"></rect>
</svg>

After

Width:  |  Height:  |  Size: 827 B

20
public/js/app.js vendored
View File

@ -23722,6 +23722,17 @@ module.exports = function(module) {
/***/ }),
/***/ "./resources/css/recipes/edit.css":
/*!****************************************!*\
!*** ./resources/css/recipes/edit.css ***!
\****************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ }),
/***/ "./resources/js/app.js":
/*!*****************************!*\
!*** ./resources/js/app.js ***!
@ -23770,14 +23781,15 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
/***/ }),
/***/ 0:
/*!***********************************************************!*\
!*** multi ./resources/js/app.js ./resources/css/app.css ***!
\***********************************************************/
/*!********************************************************************************************!*\
!*** multi ./resources/js/app.js ./resources/css/app.css ./resources/css/recipes/edit.css ***!
\********************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(/*! /Users/wellc/PhpstormProjects/pfnj/resources/js/app.js */"./resources/js/app.js");
module.exports = __webpack_require__(/*! /Users/wellc/PhpstormProjects/pfnj/resources/css/app.css */"./resources/css/app.css");
__webpack_require__(/*! /Users/wellc/PhpstormProjects/pfnj/resources/css/app.css */"./resources/css/app.css");
module.exports = __webpack_require__(/*! /Users/wellc/PhpstormProjects/pfnj/resources/css/recipes/edit.css */"./resources/css/recipes/edit.css");
/***/ })

24613
public/js/recipes/edit.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
{
"/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css",
"/css/recipes/edit.css": "/css/recipes/edit.css",
"/js/recipes/edit.js": "/js/recipes/edit.js"
}

2
resources/css/recipes/edit.css vendored Normal file
View File

@ -0,0 +1,2 @@
@import 'quill/dist/quill.core.css';
@import 'quill/dist/quill.snow.css';

26
resources/js/quill.js vendored Normal file
View File

@ -0,0 +1,26 @@
import Quill from 'quill/core';
import Toolbar from 'quill/modules/toolbar';
import Snow from 'quill/themes/snow';
import Blockquote from 'quill/formats/blockquote';
import Bold from 'quill/formats/bold';
import Italic from 'quill/formats/italic';
import Link from 'quill/formats/link';
import List from 'quill/formats/list';
import Header from 'quill/formats/header';
Quill.register({
'modules/toolbar': Toolbar,
'themes/snow': Snow,
'formats/blockquote': Blockquote,
'formats/bold': Bold,
'formats/italic': Italic,
'formats/link': Link,
'formats/list': List,
'formats/header': Header
});
export default Quill;

View File

@ -1 +1,4 @@
require('../quill');
window.Draggable = require('@shopify/draggable');
window.Quill = require('quill');

View File

@ -18,11 +18,10 @@
<!-- Styles -->
<link rel="stylesheet" href="{{ asset('css/app.css') }}">
@stack('styles')
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}" defer></script>
@isset($styles) {{ $styles }} @endisset
</head>
<body class="font-sans antialiased min-h-screen bg-gray-100">
@include('layouts.navigation')

View File

@ -67,6 +67,17 @@
</div>
</div>
<div class="flex flex-col space-y-4 mt-4">
<!-- Description -->
<div>
<x-inputs.label for="description" value="Description" />
<x-inputs.input name="description"
type="hidden"
:value="old('description', $recipe->description)" />
<div class="quill-editor"></div>
</div>
<!-- Source -->
<div class="flex-auto">
<x-inputs.label for="source" value="Source" />
@ -77,15 +88,6 @@
:value="old('source', $recipe->source)" />
</div>
<!-- Description -->
<div>
<x-inputs.label for="description" value="Description" />
<x-inputs.textarea name="description"
class="block mt-1 w-full"
:value="old('description', $recipe->description)" />
</div>
<!-- Tags -->
<x-tagger :defaultTags="$recipe_tags"/>
</div>
@ -127,16 +129,32 @@
</div>
<div x-data class="flex items-center justify-end mt-4">
<x-inputs.button x-on:click="removeTemplates();" class="ml-3">
<x-inputs.button x-on:click="prepareForm();" class="ml-3">
{{ ($recipe->exists ? 'Save' : 'Add') }}
</x-inputs.button>
</div>
</form>
@once
@push('styles')
<link rel="stylesheet" href="{{ asset('css/recipes/edit.css') }}">
@endpush
@endonce
@once
@push('scripts')
<script src="{{ asset('js/recipes/edit.js') }}"></script>
<script type="text/javascript">
const description = new Quill('.quill-editor', {
modules: {
toolbar: true
},
theme: 'snow'
});
try {
description.setContents(JSON.parse(document.querySelector('input[name="description"]').value));
} catch (e) {}
new Draggable.Sortable(document.querySelector('.ingredients'), {
draggable: '.ingredient',
handle: '.draggable-handle',
@ -171,10 +189,14 @@
}
/**
* Removes any hidden templates before form submit.
* Prepare form values for submit.
*/
let removeTemplates = () => {
let prepareForm = () => {
// Remove any hidden templates before form submit.
document.querySelectorAll(':scope .entry-template').forEach(e => e.remove());
// Add description value to hidden field.
document.querySelector('input[name="description"]').value = JSON.stringify(description.getContents());
}
</script>
@endpush

4
webpack.mix.js vendored
View File

@ -18,4 +18,8 @@ mix
require('postcss-import'),
require('tailwindcss'),
require('autoprefixer'),
])
.postCss('resources/css/recipes/edit.css', 'public/css/recipes', [
require('postcss-import'),
require('autoprefixer'),
]);