Skip to content

Commit ed170be

Browse files
committed
feat: image-editor
1 parent 5df1c01 commit ed170be

File tree

7 files changed

+53
-26
lines changed

7 files changed

+53
-26
lines changed

CoCreate.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,21 @@ module.exports = {
620620
"module_id": "60e7444eb979b40017448ca8"
621621
}
622622
},
623+
{
624+
"entry": "./src/admin/image-editor/index.html",
625+
"collection": "files",
626+
"document_id": "61302d1a8ed7b00013653215",
627+
"key": "src",
628+
"data": {
629+
"name": "index.html",
630+
"domains": [
631+
"general.cocreate.app"
632+
],
633+
"path": "/admin/image-editor/index.html",
634+
"public": "true",
635+
"module_id": "61302bae8ed7b000136531d0"
636+
}
637+
},
623638
{
624639
"entry": "./src/admin/industries/datatable.html",
625640
"collection": "files",

src/admin/builder/components/left-panel.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,17 @@
136136
</span>
137137
</form>
138138
<!-- Assets -->
139-
<div class="display:flex flex-wrap:wrap justify-content:center width:100% text-align:center padding-bottom:20px" template_id="assets" fetch-collection="files" filter-name="content-type" filter-value="" order-by="position" order-type="asc">
139+
<div class="display:flex flex-wrap:wrap justify-content:center width:100% text-align:center padding-bottom:20px" template_id="assets" fetch-collection="files" filter-name="content-type" filter-value="image" order-by="position" order-type="asc">
140140
<!-- Asset Template -->
141141
<div template_id="assets" class="template card flex-grow:1 width:70px height:90px margin:5px padding:5px" hover="display:block!important" hover-target="#editblock{{data._id}}">
142142
<div id="editblock{{data._id}}" class="position:absolute top:8px right:8px font-size:11px display:none">
143-
<a target="modal" href="https://server.cocreate.app/CoCreate-plugins/CoCreate-tui-image-editor/demo/index.html" pass-collection="blocks" pass-document_id="{{data._id}}" pass_to="form-fields" modal-width="900px">
143+
<a target="modal" href="https://server.cocreate.app/CoCreate-plugins/CoCreate-tui-image-editor/demo/index.html" pass-collection="files" pass-document_id="{{data._id}}" pass_to="form-fields" modal-width="900px">
144144
<i class="fas fa-pencil-alt"></i>
145145
</a>
146146
</div>
147-
<div cloneable="true" cloneable-html='{{data.src}}' collection="files" document_id="{{data._id}}" name="thumbnail" class="padding-bottom:5px">
148-
<img width="100%" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAgQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc3MA/9sAhAAGBgYGBgYHCAgHCgoJCgoODQwMDQ4VDxAPEA8VIBQYFBQYFCAdIxwaHCMdMygkJCgzOzIvMjtIQEBIWlZadnafAQYGBgYGBgcICAcKCgkKCg4NDAwNDhUPEA8QDxUgFBgUFBgUIB0jHBocIx0zKCQkKDM7Mi8yO0hAQEhaVlp2dp//wgARCACCAIIDASIAAhEBAxEB/8QAHAAAAAcBAQAAAAAAAAAAAAAAAAECAwQFBgcI/9oACAEBAAAAAO+urWtajUFAECOsW4talKNQMERFGNSjUpRmZggkkmAZ5Wol66YAASTMAZDzBUPdr7i8AkE2pYLmXn+i2+s7bfEEgkkgiZ4RyCi13rm4MAhXPEki8qc2nX1v6onuKIqN5S0Yupl5bexNc8pwzp3FN8851bW+autc9sYCXDN13B4LANXubf1V51FceRKZUOB01EzHvdDnLHQdVgB11FlyPD1btcIVpf6LplMhExVnxeuztlKFUpzebqojNtWA5g3R3bqYSK/WdFqYi4L8nn9K/dQLyGjO7/qHPY6Y0qRzKu0z7VzKz+duvSvFSV//xAAaAQACAwEBAAAAAAAAAAAAAAAAAQIDBQQG/9oACAECEAAAAL0kAADSBoGIACDbBrFzum7dZHgyb40a2kLJqJxq9Co5q5o9fJ6GJzVcvHpU7Uf/xAAZAQEAAwEBAAAAAAAAAAAAAAAAAQMFAgT/2gAIAQMQAAAA4AAAldzXBMTf1RwOtb3VeXJ5T79ildkZ7vWvcSxE6c+qfJfhnpt9voz5y3//xAAjEAABBAICAwEBAQEAAAAAAAABAgMEBQYRABIQExQHIBUW/9oACAEBAAECAAAAAAPGvAGtfwEgAAAa1oDWta1ojgR0Cda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6ebDhreE8mFdRRNzvC+epbYS+UARx3BbzErWWsfUSs3yji4PJS6besw/UMbxQ9P2mI6g9J+K/b//2Q==">
149-
<p class="font-size:11px" collection="module_activities" document_id="{{data._id}}" name="name">Block</p>
147+
<div cloneable="true" cloneable-html='<img src=".{{data.path}}"></img>' collection="files" document_id="{{data._id}}" name="thumbnail" class="padding-bottom:5px">
148+
<img width="100%" src="{{data.path}}">
149+
<!--<p class="font-size:11px" collection="module_activities" document_id="{{data._id}}" name="name">Block</p>-->
150150
</div>
151151
</div>
152152
</div>

src/admin/builder/components/right-panel.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,9 @@
495495
<div class="card padding:10px_0px">
496496
<div class="display:flex height:50px">
497497
<div class="width:50% margin:0_5px">
498-
<input id="offsetx" class="floating-label z-index:0" placeholder="Offset X:" step="100" attribute="classstyle" attribute-property="offsetx" pass_id="builder" collection="" document_id="" active>
498+
<input id="offsetx" class="floating-label z-index:0" placeholder="Offset X:" step="100" attribut="classstyle" attribute-property="offsetx" pass_id="builder" collection="" document_id="" active>
499499
<div class="position:relative width:40px top:-32px right:8px float:right cursor:pointer">
500-
<cocreate-select id="property-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" pass_id="builder" collection="" document_id="" attribute="attribute-unit" attribute-target="border-width">
500+
<cocreate-select id="property-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" pass_id="builder" collection="" document_id="" attribut="attribute-unit" attribute-target="border-width">
501501

502502
<ul class="options overflow:auto padding:0px z-index:7" fetch-collection="modules" filter-value="5ff747727005da1c27274193" filter-name="_id" filter-operator="$eq" fetch-name="units" template_id="units23">
503503
<cc-option class="template margin:0px padding:3px border-radius:4px" template_id="units23" value="{{units[]}}"><span value="{{units[]}}">{{units[]}}</span></cc-option>
@@ -506,9 +506,9 @@
506506
</div>
507507
</div>
508508
<div class="width:50% margin:0_5px">
509-
<input id="offsetv" class="floating-label z-index:0" placeholder="Offset V:" step="100" attribute="classstyle" attribute-property="offsetv" pass_id="builder" collection="" document_id="" active>
509+
<input id="offsetv" class="floating-label z-index:0" placeholder="Offset V:" step="100" attribut="classstyle" attribute-property="offsetv" pass_id="builder" collection="" document_id="" active>
510510
<div class="position:relative width:40px top:-32px right:8px float:right cursor:pointer">
511-
<cocreate-select id="property-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" pass_id="builder" collection="" document_id="" attribute="attribute-unit" attribute-target="border-width">
511+
<cocreate-select id="property-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" pass_id="builder" collection="" document_id="" attribut="attribute-unit" attribute-target="border-width">
512512

513513
<ul class="options overflow:auto padding:0px z-index:7" fetch-collection="modules" filter-value="5ff747727005da1c27274193" filter-name="_id" filter-operator="$eq" fetch-name="units" template_id="units24">
514514
<cc-option class="template margin:0px padding:3px border-radius:4px" template_id="units24" value="{{units[]}}"><span value="{{units[]}}">{{units[]}}</span></cc-option>
@@ -519,9 +519,9 @@
519519
</div>
520520
<div class="display:flex height:50px">
521521
<div class="width:50% margin:0_5px">
522-
<input id="blur" class="floating-label z-index:0" placeholder="Blur:" step="100" attribute="classstyle" attribute-property="blur" attribute-unit="px" pass_id="builder" collection="" document_id="" active>
522+
<input id="blur" class="floating-label z-index:0" placeholder="Blur:" step="100" attribut="classstyle" attribute-property="blur" attribute-unit="px" pass_id="builder" collection="" document_id="" active>
523523
<div class="position:relative width:40px top:-32px right:8px float:right cursor:pointer">
524-
<cocreate-select id="property-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" pass_id="builder" collection="" document_id="" attribute="attribute-unit" attribute-target="border-width">
524+
<cocreate-select id="property-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" pass_id="builder" collection="" document_id="" attribut="attribute-unit" attribute-target="border-width">
525525

526526
<ul class="options overflow:auto padding:0px z-index:7" fetch-collection="modules" filter-value="5ff747727005da1c27274193" filter-name="_id" filter-operator="$eq" fetch-name="units" template_id="units25"25>
527527
<cc-option class="template margin:0px padding:3px border-radius:4px" template_id="units26" value="{{units[]}}"><span value="{{units[]}}">{{units[]}}</span></cc-option>
@@ -530,9 +530,9 @@
530530
</div>
531531
</div>
532532
<div class="width:50% margin:0_5px">
533-
<input id="spread" class="floating-label z-index:0" placeholder="Spread:" step="100" attribute="classstyle" attribute-property="spread" attribute-unit="px" pass_id="builder" collection="" document_id="" active>
533+
<input id="spread" class="floating-label z-index:0" placeholder="Spread:" step="100" attribut="classstyle" attribute-property="spread" attribute-unit="px" pass_id="builder" collection="" document_id="" active>
534534
<div class="position:relative width:40px top:-32px right:8px float:right cursor:pointer">
535-
<cocreate-select id="property-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" pass_id="builder" collection="" document_id="" attribute="attribute-unit" attribute-target="border-width">
535+
<cocreate-select id="property-unit" class="styleunit remove-none border:none padding:0 min-height:24px!important background:#eee" pass_id="builder" collection="" document_id="" attribut="attribute-unit" attribute-target="border-width">
536536

537537
<ul class="options overflow:auto padding:0px z-index:7" fetch-collection="modules" filter-value="5ff747727005da1c27274193" filter-name="_id" filter-operator="$eq" fetch-name="units" template_id="units27">
538538
<cc-option class="template margin:0px padding:3px border-radius:4px" template_id="units27" value="{{units[]}}"><span value="{{units[]}}">{{units[]}}</span></cc-option>
@@ -542,7 +542,7 @@
542542
</div>
543543
</div>
544544
<div class="margin:0_5px">
545-
<input id="fill-color" type="color" class="floating-label z-index:0" placeholder="fill-color:" attribute="classstyle" attribute-property="fill-color" pass_id="builder" collection="" document_id="" active>
545+
<input id="fill-color" type="color" class="floating-label z-index:0" placeholder="fill-color:" attribut="classstyle" attribute-property="fill-color" pass_id="builder" collection="" document_id="" active>
546546
</div>
547547
</div>
548548
</div>
@@ -567,7 +567,7 @@
567567
<cc-option value="norepeat"><span>no repeat</span></cc-option>
568568
</ul>
569569
</cocreate-select>
570-
<cocreate-select class="floating-label" id="background-position" placeholder="background-position" attribute="classstyle" pass_id="builder" collection="" document_id="" active>
570+
<cocreate-select class="floating-label" id="background-position" placeholder="background-position" attribute="classstyle" attribute-property="background-position" pass_id="builder" collection="" document_id="" active>
571571

572572
<ul class="options z-index:7 margin-top:5px">
573573
<cc-option value="background-position:none"><span>none</span></cc-option>
@@ -671,7 +671,7 @@
671671
</cocreate-select>
672672
</div>
673673
<div class="margin:0_5px">
674-
<input id="strenth" class="floating-label z-index:0" placeholder="strenth:" step="100" attribute="classstyle" attribute-property="strenth" pass_id="builder" collection="" document_id="" active>
674+
<input id="strenth" class="floating-label z-index:0" placeholder="strenth:" step="100" attribut="classstyle" attribute-property="strenth" pass_id="builder" collection="" document_id="" active>
675675
</div>
676676
</div>
677677
<div class="card margin:10px padding:10px_0px">
@@ -696,7 +696,7 @@
696696
</cocreate-select>
697697
</div>
698698
<div class="margin:0_5px">
699-
<input id="translate" class="floating-label z-index:0" placeholder="Value:" step="100" attribute="classstyle" attribute-property="translate" pass_id="builder" collection="" document_id="" active>
699+
<input id="translate" class="floating-label z-index:0" placeholder="translate:" step="100" attribut="classstyle" attribute-property="translate" pass_id="builder" collection="" document_id="" active>
700700
</div>
701701
</div>
702702
<div class="card margin:10px padding:10px_0px">
@@ -720,10 +720,10 @@
720720
</div>
721721
<div class="display:flex height:50px">
722722
<div class="width:50% margin:0_5px">
723-
<input id="duration" class="floating-label z-index:0" placeholder="duration:" step="100" attribute="classstyle" attribute-property="duration" pass_id="builder" collection="" document_id="" active>
723+
<input id="duration" class="floating-label z-index:0" placeholder="duration:" step="100" attribut="classstyle" attribute-property="duration" pass_id="builder" collection="" document_id="" active>
724724
</div>
725725
<div class="width:50% margin:0_5px">
726-
<cocreate-select class="floating-label" id="easing" placeholder="Easing:" attribute="classstyle" attribute-property="easing" pass_id="builder" collection="" document_id="" active>
726+
<cocreate-select class="floating-label" id="easing" placeholder="Easing:" attribut="classstyle" attribute-property="easing" pass_id="builder" collection="" document_id="" active>
727727

728728
<ul class="options z-index:7 margin-top:5px">
729729
<cc-option value="none"><span>none</span></cc-option>

0 commit comments

Comments
 (0)