ts-glitter 15.9.4 → 15.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lowcode/Entry.js +1 -1
- package/lowcode/Entry.ts +1 -1
- package/lowcode/backend-manager/bg-blog.js +41 -5
- package/lowcode/backend-manager/bg-blog.ts +96 -60
- package/lowcode/jspage/function-page/setting_editor.js +2 -2
- package/lowcode/jspage/function-page/setting_editor.ts +3 -2
- package/lowcode/view-model/saas-view-model.js +9 -4
- package/lowcode/view-model/saas-view-model.ts +9 -4
- package/package.json +1 -1
package/lowcode/Entry.js
CHANGED
|
@@ -79,7 +79,7 @@ export class Entry {
|
|
|
79
79
|
}
|
|
80
80
|
window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
|
|
81
81
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
82
|
-
glitter.share.editerVersion = 'V_15.9.
|
|
82
|
+
glitter.share.editerVersion = 'V_15.9.7';
|
|
83
83
|
glitter.share.start = new Date();
|
|
84
84
|
const vm = {
|
|
85
85
|
appConfig: [],
|
package/lowcode/Entry.ts
CHANGED
|
@@ -81,7 +81,7 @@ export class Entry {
|
|
|
81
81
|
|
|
82
82
|
(window as any).renderClock = (window as any).renderClock ?? clockF();
|
|
83
83
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
84
|
-
glitter.share.editerVersion = 'V_15.9.
|
|
84
|
+
glitter.share.editerVersion = 'V_15.9.7';
|
|
85
85
|
glitter.share.start = new Date();
|
|
86
86
|
const vm: {
|
|
87
87
|
appConfig: any;
|
|
@@ -681,6 +681,38 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
681
681
|
function refreshProductPage() {
|
|
682
682
|
gvc.notifyDataChange(id);
|
|
683
683
|
}
|
|
684
|
+
let origin = (JSON.stringify(vm.data));
|
|
685
|
+
setTimeout(() => {
|
|
686
|
+
origin = (JSON.stringify(vm.data));
|
|
687
|
+
}, 400);
|
|
688
|
+
function checkSwitchToUiEditor() {
|
|
689
|
+
function next() {
|
|
690
|
+
window.parent.glitter.setUrlParameter('page-id', vm.data.id);
|
|
691
|
+
window.parent.glitter.setUrlParameter('language', language);
|
|
692
|
+
window.parent.glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
|
|
693
|
+
}
|
|
694
|
+
if (origin !== JSON.stringify(vm.data)) {
|
|
695
|
+
const dialog = new ShareDialog(gvc.glitter);
|
|
696
|
+
dialog.checkYesOrNot({
|
|
697
|
+
text: '偵測到內容變更,是否保留更改?',
|
|
698
|
+
callback: (response) => {
|
|
699
|
+
if (response) {
|
|
700
|
+
saveData(gvc, cf, vm, cVm, false).then((res) => {
|
|
701
|
+
if (res) {
|
|
702
|
+
next();
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
else {
|
|
707
|
+
next();
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
next();
|
|
714
|
+
}
|
|
715
|
+
}
|
|
684
716
|
return {
|
|
685
717
|
bind: id,
|
|
686
718
|
view: () => {
|
|
@@ -731,9 +763,7 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
731
763
|
}))}
|
|
732
764
|
<div class="mx-1"></div>
|
|
733
765
|
${BgWidget.grayButton('前往設計', gvc.event(() => {
|
|
734
|
-
|
|
735
|
-
window.parent.glitter.setUrlParameter('language', language);
|
|
736
|
-
window.parent.glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
|
|
766
|
+
checkSwitchToUiEditor();
|
|
737
767
|
}))}
|
|
738
768
|
</div>
|
|
739
769
|
</div>
|
|
@@ -1598,16 +1628,18 @@ function detail(gvc, cf, vm, cVm, page_tab) {
|
|
|
1598
1628
|
});
|
|
1599
1629
|
}
|
|
1600
1630
|
function saveData(gvc, cf, vm, cVm, silence) {
|
|
1601
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1631
|
+
return new Promise((res_, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
1602
1632
|
if (!vm.data.content.tag) {
|
|
1603
1633
|
yield cf.widget.event('error', {
|
|
1604
1634
|
title: '請設定連結',
|
|
1605
1635
|
});
|
|
1636
|
+
res_(false);
|
|
1606
1637
|
}
|
|
1607
1638
|
else if (!vm.data.content.name) {
|
|
1608
1639
|
yield cf.widget.event('error', {
|
|
1609
1640
|
title: '請設定名稱',
|
|
1610
1641
|
});
|
|
1642
|
+
res_(false);
|
|
1611
1643
|
}
|
|
1612
1644
|
else {
|
|
1613
1645
|
if (!silence) {
|
|
@@ -1625,11 +1657,13 @@ function saveData(gvc, cf, vm, cVm, silence) {
|
|
|
1625
1657
|
yield cf.widget.event('success', {
|
|
1626
1658
|
title: '設定成功',
|
|
1627
1659
|
});
|
|
1660
|
+
res_(true);
|
|
1628
1661
|
}
|
|
1629
1662
|
else {
|
|
1630
1663
|
yield cf.widget.event('error', {
|
|
1631
1664
|
title: '此連結已被使用',
|
|
1632
1665
|
});
|
|
1666
|
+
res_(false);
|
|
1633
1667
|
}
|
|
1634
1668
|
}));
|
|
1635
1669
|
}
|
|
@@ -1651,16 +1685,18 @@ function saveData(gvc, cf, vm, cVm, silence) {
|
|
|
1651
1685
|
}
|
|
1652
1686
|
cVm.type = 'detail';
|
|
1653
1687
|
gvc.notifyDataChange(cVm.id);
|
|
1688
|
+
res_(true);
|
|
1654
1689
|
}
|
|
1655
1690
|
else {
|
|
1656
1691
|
yield cf.widget.event('error', {
|
|
1657
1692
|
title: '此連結已被使用',
|
|
1658
1693
|
});
|
|
1694
|
+
res_(false);
|
|
1659
1695
|
}
|
|
1660
1696
|
}));
|
|
1661
1697
|
}
|
|
1662
1698
|
}
|
|
1663
|
-
});
|
|
1699
|
+
}));
|
|
1664
1700
|
}
|
|
1665
1701
|
function setCollection(cf) {
|
|
1666
1702
|
const vm = {
|
|
@@ -746,6 +746,36 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
746
746
|
gvc.notifyDataChange(id)
|
|
747
747
|
}
|
|
748
748
|
|
|
749
|
+
let origin=(JSON.stringify(vm.data))
|
|
750
|
+
setTimeout(()=>{
|
|
751
|
+
origin=(JSON.stringify(vm.data))
|
|
752
|
+
},400)
|
|
753
|
+
function checkSwitchToUiEditor(){
|
|
754
|
+
function next(){
|
|
755
|
+
(window.parent as any).glitter.setUrlParameter('page-id', vm.data.id);
|
|
756
|
+
(window.parent as any).glitter.setUrlParameter('language', language);
|
|
757
|
+
(window.parent as any).glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
|
|
758
|
+
}
|
|
759
|
+
if(origin!==JSON.stringify(vm.data)){
|
|
760
|
+
const dialog=new ShareDialog(gvc.glitter)
|
|
761
|
+
dialog.checkYesOrNot({
|
|
762
|
+
text:'偵測到內容變更,是否保留更改?',
|
|
763
|
+
callback:(response)=>{
|
|
764
|
+
if(response){
|
|
765
|
+
saveData(gvc, cf, vm, cVm, false).then((res)=>{
|
|
766
|
+
if(res){
|
|
767
|
+
next()
|
|
768
|
+
}
|
|
769
|
+
});
|
|
770
|
+
}else{
|
|
771
|
+
next()
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
})
|
|
775
|
+
}else{
|
|
776
|
+
next()
|
|
777
|
+
}
|
|
778
|
+
}
|
|
749
779
|
return {
|
|
750
780
|
bind: id,
|
|
751
781
|
view: () => {
|
|
@@ -809,9 +839,7 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
809
839
|
${BgWidget.grayButton(
|
|
810
840
|
'前往設計',
|
|
811
841
|
gvc.event(() => {
|
|
812
|
-
(
|
|
813
|
-
(window.parent as any).glitter.setUrlParameter('language', language);
|
|
814
|
-
(window.parent as any).glitter.share.switch_to_web_builder(`${domainPrefix}/${vm.data.content.tag}`);
|
|
842
|
+
checkSwitchToUiEditor()
|
|
815
843
|
})
|
|
816
844
|
)}
|
|
817
845
|
</div>
|
|
@@ -1751,64 +1779,72 @@ function detail(gvc: GVC, cf: any, vm: any, cVm: any, page_tab: 'page' | 'hidden
|
|
|
1751
1779
|
});
|
|
1752
1780
|
}
|
|
1753
1781
|
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1782
|
+
function saveData(gvc: GVC, cf: any, vm: any, cVm: any, silence: boolean) {
|
|
1783
|
+
return new Promise(async (res_,reject)=>{
|
|
1784
|
+
if (!vm.data.content.tag) {
|
|
1785
|
+
await cf.widget.event('error', {
|
|
1786
|
+
title: '請設定連結',
|
|
1787
|
+
});
|
|
1788
|
+
res_(false)
|
|
1789
|
+
} else if (!vm.data.content.name) {
|
|
1790
|
+
await cf.widget.event('error', {
|
|
1791
|
+
title: '請設定名稱',
|
|
1792
|
+
});
|
|
1793
|
+
res_(false)
|
|
1794
|
+
} else {
|
|
1795
|
+
if (!silence) {
|
|
1796
|
+
await cf.widget.event('loading', {
|
|
1797
|
+
title: '儲存中...',
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1769
1800
|
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1801
|
+
if (vm.data.id) {
|
|
1802
|
+
Article.put(vm.data).then(async (res) => {
|
|
1803
|
+
await cf.widget.event('loading', {
|
|
1804
|
+
title: '儲存中...',
|
|
1805
|
+
visible: false,
|
|
1806
|
+
});
|
|
1807
|
+
if (res.result) {
|
|
1808
|
+
await cf.widget.event('success', {
|
|
1809
|
+
title: '設定成功',
|
|
1810
|
+
});
|
|
1811
|
+
res_(true)
|
|
1812
|
+
} else {
|
|
1813
|
+
await cf.widget.event('error', {
|
|
1814
|
+
title: '此連結已被使用',
|
|
1815
|
+
});
|
|
1816
|
+
res_(false)
|
|
1817
|
+
}
|
|
1818
|
+
});
|
|
1819
|
+
} else {
|
|
1820
|
+
await cf.widget.event('loading', {
|
|
1821
|
+
title: '儲存中...',
|
|
1822
|
+
});
|
|
1823
|
+
Article.post(vm.data.content, vm.data.status).then(async (res) => {
|
|
1824
|
+
await cf.widget.event('loading', {
|
|
1825
|
+
title: '儲存中...',
|
|
1826
|
+
visible: false,
|
|
1827
|
+
});
|
|
1828
|
+
if (res.result) {
|
|
1829
|
+
vm.data.id = res.response.result;
|
|
1830
|
+
if (!silence) {
|
|
1831
|
+
await cf.widget.event('success', {
|
|
1832
|
+
title: '新增成功',
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1835
|
+
cVm.type = 'detail';
|
|
1836
|
+
gvc.notifyDataChange(cVm.id);
|
|
1837
|
+
res_(true)
|
|
1838
|
+
} else {
|
|
1839
|
+
await cf.widget.event('error', {
|
|
1840
|
+
title: '此連結已被使用',
|
|
1841
|
+
});
|
|
1842
|
+
res_(false)
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
})
|
|
1812
1848
|
}
|
|
1813
1849
|
|
|
1814
1850
|
//分類選擇頁面
|
|
@@ -192,7 +192,7 @@ export class Setting_editor {
|
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
if (
|
|
195
|
+
if ((glitter.getUrlParameter('tab') === dd.page) && !initial) {
|
|
196
196
|
initial = true;
|
|
197
197
|
if (['page_layout', 'dev_mode'].indexOf(items[index].page) !== -1) {
|
|
198
198
|
Storage.select_item = `5`;
|
|
@@ -206,7 +206,7 @@ export class Setting_editor {
|
|
|
206
206
|
title: dd.title,
|
|
207
207
|
index: index,
|
|
208
208
|
info: dd,
|
|
209
|
-
toggle:
|
|
209
|
+
toggle: (glitter.getUrlParameter('tab') === dd.page),
|
|
210
210
|
});
|
|
211
211
|
});
|
|
212
212
|
function refreshContainer() {
|
|
@@ -871,7 +871,8 @@ export class Setting_editor {
|
|
|
871
871
|
});
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
|
|
874
|
+
|
|
875
|
+
if ((glitter.getUrlParameter('tab') === dd.page) && !initial) {
|
|
875
876
|
initial = true;
|
|
876
877
|
if (['page_layout', 'dev_mode'].indexOf(items[index].page) !== -1) {
|
|
877
878
|
Storage.select_item = `5`;
|
|
@@ -884,7 +885,7 @@ export class Setting_editor {
|
|
|
884
885
|
title: dd.title,
|
|
885
886
|
index: index,
|
|
886
887
|
info: dd,
|
|
887
|
-
toggle:
|
|
888
|
+
toggle: (glitter.getUrlParameter('tab') === dd.page),
|
|
888
889
|
});
|
|
889
890
|
});
|
|
890
891
|
|
|
@@ -892,10 +892,10 @@ export class SaasViewModel {
|
|
|
892
892
|
`);
|
|
893
893
|
gvc.glitter.addStyleLink(gvc.glitter.root_path + `/css/editor.css`);
|
|
894
894
|
const hr = html `
|
|
895
|
-
<div style="width: 600px;max-width: calc(100vw - 20px); overflow-y: auto;max-height: 100vh
|
|
896
|
-
class="bg-white shadow rounded-3">
|
|
895
|
+
<div style="${(document.body.clientWidth < 800) ? `width: 100%;` : `width: 600px;max-width: calc(100vw - 20px); overflow-y: auto;max-height: 100vh;`}"
|
|
896
|
+
class="bg-white shadow ${(document.body.clientWidth > 800) ? `rounded-3` : ``}">
|
|
897
897
|
<div class="w-100 d-flex align-items-center p-3 border-bottom">
|
|
898
|
-
<div class="fw-500 color39">建立您的商店</div>
|
|
898
|
+
<div class="fw-500 color39" style="padding-top: ${gvc.glitter.share.top_inset}px;">建立您的商店</div>
|
|
899
899
|
<div class="flex-fill"></div>
|
|
900
900
|
<i
|
|
901
901
|
class="fa-regular fa-circle-xmark fs-5 color39 ${register ? `d-none` : ``}"
|
|
@@ -960,7 +960,7 @@ ${['選擇初始模板', BgWidget.grayNote('請選擇初始模板,後續可在
|
|
|
960
960
|
</div>`;
|
|
961
961
|
},
|
|
962
962
|
divCreate: {
|
|
963
|
-
style: `max-height:calc(
|
|
963
|
+
style: `max-height:calc(${window.innerHeight - gvc.glitter.share.top_inset - gvc.glitter.share.bottom_inset}px - 115px);overflow-y:auto;`,
|
|
964
964
|
class: ``,
|
|
965
965
|
},
|
|
966
966
|
};
|
|
@@ -990,6 +990,11 @@ ${['選擇初始模板', BgWidget.grayNote('請選擇初始模板,後續可在
|
|
|
990
990
|
</div>
|
|
991
991
|
</div>`;
|
|
992
992
|
if (register) {
|
|
993
|
+
if (document.body.clientWidth < 800) {
|
|
994
|
+
return `<div class="position-fixed w-100 vh-100 bg-white" style="top:0px;left:0px;">
|
|
995
|
+
${hr}
|
|
996
|
+
</div>`;
|
|
997
|
+
}
|
|
993
998
|
return html `
|
|
994
999
|
<div
|
|
995
1000
|
class="position-fixed vw-100 vh-100 d-flex align-items-center justify-content-center bg-white"
|
|
@@ -931,10 +931,10 @@ export class SaasViewModel {
|
|
|
931
931
|
`);
|
|
932
932
|
gvc.glitter.addStyleLink(gvc.glitter.root_path + `/css/editor.css`);
|
|
933
933
|
const hr = html`
|
|
934
|
-
<div style="width: 600px;max-width: calc(100vw - 20px); overflow-y: auto;max-height: 100vh
|
|
935
|
-
class="bg-white shadow rounded-3">
|
|
934
|
+
<div style="${(document.body.clientWidth<800) ? `width: 100%;`:`width: 600px;max-width: calc(100vw - 20px); overflow-y: auto;max-height: 100vh;`}"
|
|
935
|
+
class="bg-white shadow ${(document.body.clientWidth>800) ? `rounded-3`:``}">
|
|
936
936
|
<div class="w-100 d-flex align-items-center p-3 border-bottom">
|
|
937
|
-
<div class="fw-500 color39">建立您的商店</div>
|
|
937
|
+
<div class="fw-500 color39" style="padding-top: ${gvc.glitter.share.top_inset}px;">建立您的商店</div>
|
|
938
938
|
<div class="flex-fill"></div>
|
|
939
939
|
<i
|
|
940
940
|
class="fa-regular fa-circle-xmark fs-5 color39 ${register ? `d-none` : ``}"
|
|
@@ -1000,7 +1000,7 @@ ${['選擇初始模板',BgWidget.grayNote('請選擇初始模板,後續可在
|
|
|
1000
1000
|
</div>`;
|
|
1001
1001
|
},
|
|
1002
1002
|
divCreate: {
|
|
1003
|
-
style: `max-height:calc(
|
|
1003
|
+
style: `max-height:calc(${window.innerHeight - gvc.glitter.share.top_inset - gvc.glitter.share.bottom_inset}px - 115px);overflow-y:auto;`,
|
|
1004
1004
|
class: ``,
|
|
1005
1005
|
},
|
|
1006
1006
|
};
|
|
@@ -1030,6 +1030,11 @@ ${['選擇初始模板',BgWidget.grayNote('請選擇初始模板,後續可在
|
|
|
1030
1030
|
</div>
|
|
1031
1031
|
</div>`;
|
|
1032
1032
|
if (register) {
|
|
1033
|
+
if(document.body.clientWidth<800){
|
|
1034
|
+
return `<div class="position-fixed w-100 vh-100 bg-white" style="top:0px;left:0px;">
|
|
1035
|
+
${hr}
|
|
1036
|
+
</div>`
|
|
1037
|
+
}
|
|
1033
1038
|
return html`
|
|
1034
1039
|
<div
|
|
1035
1040
|
class="position-fixed vw-100 vh-100 d-flex align-items-center justify-content-center bg-white"
|