ts-glitter 13.7.4 → 13.7.5

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 CHANGED
@@ -59,7 +59,7 @@ export class Entry {
59
59
  }
60
60
  window.renderClock = (_a = window.renderClock) !== null && _a !== void 0 ? _a : clockF();
61
61
  console.log(`Entry-time:`, window.renderClock.stop());
62
- glitter.share.editerVersion = "V_13.7.4";
62
+ glitter.share.editerVersion = "V_13.7.5";
63
63
  glitter.share.start = (new Date());
64
64
  const vm = {
65
65
  appConfig: [],
package/lowcode/Entry.ts CHANGED
@@ -60,7 +60,7 @@ export class Entry {
60
60
  }
61
61
  (window as any).renderClock = (window as any).renderClock ?? clockF();
62
62
  console.log(`Entry-time:`, (window as any).renderClock.stop());
63
- glitter.share.editerVersion = "V_13.7.4";
63
+ glitter.share.editerVersion = "V_13.7.5";
64
64
  glitter.share.start = (new Date());
65
65
  const vm: {
66
66
  appConfig: any;
@@ -1696,18 +1696,13 @@ ${obj.gvc.bindView({
1696
1696
  key: 'onmouseover',
1697
1697
  value: gvc.event((e, event) => {
1698
1698
  if (window.parent.document.body.clientWidth < 800) {
1699
- if (window.parent.glitter.share.editorViewModel.selectItem.id === cf.widget.id) {
1700
- window.parent.glitter.openDrawer();
1701
- }
1702
- else {
1703
- HtmlGenerate.selectWidget({
1704
- gvc: gvc,
1705
- widget: widget,
1706
- widgetComponentID: cf.widget.id,
1707
- event: event,
1708
- glitter: window.parent.glitter,
1709
- });
1710
- }
1699
+ HtmlGenerate.selectWidget({
1700
+ gvc: gvc,
1701
+ widget: widget,
1702
+ widgetComponentID: cf.widget.id,
1703
+ event: event,
1704
+ glitter: window.parent.glitter,
1705
+ });
1711
1706
  }
1712
1707
  ;
1713
1708
  $(e).children('.editorChild').children('.copy-btn').show();
@@ -2182,17 +2182,13 @@ ${e.line}
2182
2182
  key: 'onmouseover',
2183
2183
  value: gvc.event((e, event) => {
2184
2184
  if((window.parent as any).document.body.clientWidth<800){
2185
- if((window.parent as any).glitter.share.editorViewModel.selectItem.id === cf.widget.id){
2186
- (window.parent as any).glitter.openDrawer()
2187
- }else{
2188
- HtmlGenerate.selectWidget({
2189
- gvc: gvc,
2190
- widget: widget,
2191
- widgetComponentID: cf.widget.id,
2192
- event: event,
2193
- glitter: (window.parent as any).glitter,
2194
- });
2195
- }
2185
+ HtmlGenerate.selectWidget({
2186
+ gvc: gvc,
2187
+ widget: widget,
2188
+ widgetComponentID: cf.widget.id,
2189
+ event: event,
2190
+ glitter: (window.parent as any).glitter,
2191
+ });
2196
2192
  };
2197
2193
  ($(e).children('.editorChild').children('.copy-btn') as any).show();
2198
2194
  ($(e).children('.editorChild').children('.plus_bt') as any).show();
@@ -1096,6 +1096,7 @@ export class Main_editor {
1096
1096
  style="${(parseInt(gvc.glitter.share.top_inset, 10)) ? `padding-top:${parseInt(gvc.glitter.share.top_inset, 10) + 10}px;` : ``}"
1097
1097
  id="editerCenter">
1098
1098
  ${(document.body.clientWidth < 800) ? gvc.bindView(() => {
1099
+ let last_selected = '';
1099
1100
  return {
1100
1101
  bind: `item-editor-select`,
1101
1102
  view: () => {
@@ -1182,6 +1183,16 @@ export class Main_editor {
1182
1183
  }
1183
1184
  });
1184
1185
  }
1186
+ if (gvc.glitter.share.editorViewModel.selectItem.id === last_selected) {
1187
+ setTimeout(() => {
1188
+ gvc.glitter.openDrawer();
1189
+ }, 50);
1190
+ }
1191
+ else {
1192
+ setTimeout(() => {
1193
+ last_selected = gvc.glitter.share.editorViewModel.selectItem.id;
1194
+ }, 50);
1195
+ }
1185
1196
  return html `
1186
1197
  <div class="border-bottom d-flex align-items-center px-2 shadow"
1187
1198
  style="height:40px;gap:7px;background: linear-gradient(143deg, #FFB400 -22.7%, #FF6C02 114.57%);color:white;">
@@ -1172,6 +1172,7 @@ export class Main_editor {
1172
1172
  style="${(parseInt(gvc.glitter.share.top_inset, 10)) ? `padding-top:${parseInt(gvc.glitter.share.top_inset, 10) + 10}px;` : ``}"
1173
1173
  id="editerCenter">
1174
1174
  ${(document.body.clientWidth < 800) ? gvc.bindView(() => {
1175
+ let last_selected='';
1175
1176
  return {
1176
1177
  bind: `item-editor-select`,
1177
1178
  view: () => {
@@ -1256,7 +1257,15 @@ export class Main_editor {
1256
1257
  dialog.errorMessage({text: '請選擇要複製的元件,並按下複製元件。'})
1257
1258
  }
1258
1259
  }
1259
-
1260
+ if(gvc.glitter.share.editorViewModel.selectItem.id===last_selected){
1261
+ setTimeout(()=>{
1262
+ gvc.glitter.openDrawer()
1263
+ },50)
1264
+ }else{
1265
+ setTimeout(()=>{
1266
+ last_selected=gvc.glitter.share.editorViewModel.selectItem.id
1267
+ },50)
1268
+ }
1260
1269
  return html`
1261
1270
  <div class="border-bottom d-flex align-items-center px-2 shadow"
1262
1271
  style="height:40px;gap:7px;background: linear-gradient(143deg, #FFB400 -22.7%, #FF6C02 114.57%);color:white;">
@@ -1096,6 +1096,7 @@ font-weight: 700;" onclick="${gvc.event(() => {
1096
1096
  toggle: false
1097
1097
  };
1098
1098
  setting_option[index].vm_c = vm_c;
1099
+ const _f_wd = widget;
1099
1100
  return {
1100
1101
  bind: vm_c.id,
1101
1102
  view: () => {
@@ -1122,6 +1123,26 @@ font-weight: 700;" onclick="${gvc.event(() => {
1122
1123
  ${vm_c.toggle ? ` <i class="fa-solid fa-chevron-down"></i>` : ` <i class="fa-solid fa-chevron-right"></i>`}
1123
1124
 
1124
1125
  </div>`];
1126
+ const refer_result = (() => {
1127
+ switch (dd.key) {
1128
+ case 'style':
1129
+ case 'color':
1130
+ return true;
1131
+ case 'background':
1132
+ return (oWidget[`${type}_editable`].filter((d1) => {
1133
+ return d1 === '_container_background';
1134
+ }).length);
1135
+ case 'fonts':
1136
+ return (oWidget[`${type}_editable`].filter((d1) => {
1137
+ return d1 === '_container_fonts';
1138
+ }).length);
1139
+ case 'margin':
1140
+ case 'develop':
1141
+ return (oWidget[`${type}_editable`].filter((d1) => {
1142
+ return d1 === '_container_margin';
1143
+ }).length);
1144
+ }
1145
+ })();
1125
1146
  if (vm_c.toggle) {
1126
1147
  switch (dd.key) {
1127
1148
  case 'style':
@@ -1142,58 +1163,67 @@ font-weight: 700;" onclick="${gvc.event(() => {
1142
1163
  })}</div>`);
1143
1164
  break;
1144
1165
  case 'fonts':
1145
- array_string.push(`<div class="px-3 pb-2 ">${EditorElem.select({
1146
- title: '',
1147
- gvc: gvc,
1148
- def: (() => {
1149
- if (!glitter.share.editorViewModel.appConfig.font_theme[parseInt(widget.container_fonts, 10)]) {
1150
- widget.container_fonts = `0`;
1151
- }
1152
- return widget.container_fonts;
1153
- })(),
1154
- callback: (text) => {
1155
- widget.container_fonts = text;
1156
- refresh(widget, type);
1157
- },
1158
- array: glitter.share.editorViewModel.appConfig.font_theme.map((dd, index) => {
1159
- return {
1160
- title: dd.title,
1161
- value: `${index}`
1162
- };
1163
- }),
1164
- })}
1166
+ (() => {
1167
+ const widget = refer_result ? _f_wd : oWidget;
1168
+ array_string.push(`<div class="px-3 pb-2 ">${EditorElem.select({
1169
+ title: '',
1170
+ gvc: gvc,
1171
+ def: (() => {
1172
+ if (!glitter.share.editorViewModel.appConfig.font_theme[parseInt(widget.container_fonts, 10)]) {
1173
+ widget.container_fonts = `0`;
1174
+ }
1175
+ return widget.container_fonts;
1176
+ })(),
1177
+ callback: (text) => {
1178
+ widget.container_fonts = text;
1179
+ refresh(widget, type);
1180
+ },
1181
+ array: glitter.share.editorViewModel.appConfig.font_theme.map((dd, index) => {
1182
+ return {
1183
+ title: dd.title,
1184
+ value: `${index}`
1185
+ };
1186
+ }),
1187
+ })}
1165
1188
  <div class="bt_border_editor mt-2"
1166
1189
  onclick="${gvc.event((e, event) => {
1167
- gvc.glitter.getModule(`${gvc.glitter.root_path}/setting/fonts-config.js`, (FontsConfig) => {
1168
- NormalPageEditor.closeEvent = () => {
1169
- gvc.notifyDataChange(vm_c.id);
1170
- refresh(widget, type);
1171
- };
1172
- NormalPageEditor.toggle({
1173
- visible: true,
1174
- view: FontsConfig.fontsSettingView(gvc, glitter.share.editorViewModel.appConfig, true),
1175
- title: '管理全站字型'
1190
+ gvc.glitter.getModule(`${gvc.glitter.root_path}/setting/fonts-config.js`, (FontsConfig) => {
1191
+ NormalPageEditor.closeEvent = () => {
1192
+ gvc.notifyDataChange(vm_c.id);
1193
+ refresh(widget, type);
1194
+ };
1195
+ NormalPageEditor.toggle({
1196
+ visible: true,
1197
+ view: FontsConfig.fontsSettingView(gvc, glitter.share.editorViewModel.appConfig, true),
1198
+ title: '管理全站字型'
1199
+ });
1176
1200
  });
1177
- });
1178
- })}">
1201
+ })}">
1179
1202
  管理全站字型
1180
1203
  </div>
1181
1204
  </div>`);
1205
+ })();
1182
1206
  break;
1183
1207
  case 'margin':
1184
- array_string.push(`<div class="px-3 pb-2">${CustomStyle.editorMargin(gvc, widget, () => {
1185
- refresh(widget, type);
1186
- })}</div>`);
1208
+ (() => {
1209
+ array_string.push(`<div class="px-3 pb-2">${CustomStyle.editorMargin(gvc, refer_result ? widget : oWidget, () => {
1210
+ refresh(widget, type);
1211
+ })}</div>`);
1212
+ })();
1187
1213
  break;
1188
1214
  case 'background':
1189
- array_string.push(`<div class="px-3 pb-2">${CustomStyle.editorBackground(gvc, widget, () => {
1190
- refresh(widget, type);
1191
- })}</div>`);
1215
+ (() => {
1216
+ array_string.push(`<div class="px-3 pb-2">${CustomStyle.editorBackground(gvc, refer_result ? widget : oWidget, () => {
1217
+ refresh(widget, type);
1218
+ })}</div>`);
1219
+ })();
1192
1220
  break;
1193
1221
  case 'develop':
1194
- array_string.push(`<div class="px-3">${CustomStyle.editor(gvc, widget, () => {
1195
- refresh(widget, type);
1196
- })}</div>`);
1222
+ (() => {
1223
+ array_string.push(`<div class="px-3">${CustomStyle.editor(gvc, refer_result ? widget : oWidget, () => {
1224
+ refresh(widget, type);
1225
+ })}</div>`);
1226
+ })();
1197
1227
  break;
1198
1228
  }
1199
1229
  }
@@ -1123,6 +1123,7 @@ font-weight: 700;" onclick="${gvc.event(() => {
1123
1123
  toggle: false
1124
1124
  };
1125
1125
  (setting_option[index] as any).vm_c = vm_c;
1126
+ const _f_wd=widget
1126
1127
  return {
1127
1128
  bind: vm_c.id,
1128
1129
  view: () => {
@@ -1149,6 +1150,26 @@ font-weight: 700;" onclick="${gvc.event(() => {
1149
1150
  ${vm_c.toggle ? ` <i class="fa-solid fa-chevron-down"></i>` : ` <i class="fa-solid fa-chevron-right"></i>`}
1150
1151
 
1151
1152
  </div>`]
1153
+ const refer_result= (() => {
1154
+ switch (dd.key) {
1155
+ case 'style':
1156
+ case 'color':
1157
+ return true
1158
+ case 'background':
1159
+ return (oWidget[`${type}_editable`].filter((d1: any) => {
1160
+ return d1 === '_container_background'
1161
+ }).length)
1162
+ case 'fonts':
1163
+ return (oWidget[`${type}_editable`].filter((d1: any) => {
1164
+ return d1 === '_container_fonts'
1165
+ }).length)
1166
+ case 'margin':
1167
+ case 'develop':
1168
+ return (oWidget[`${type}_editable`].filter((d1: any) => {
1169
+ return d1 === '_container_margin'
1170
+ }).length)
1171
+ }
1172
+ })()
1152
1173
  if (vm_c.toggle) {
1153
1174
  switch (dd.key) {
1154
1175
  case 'style':
@@ -1169,61 +1190,74 @@ font-weight: 700;" onclick="${gvc.event(() => {
1169
1190
  })}</div>`)
1170
1191
  break
1171
1192
  case 'fonts':
1172
- array_string.push(`<div class="px-3 pb-2 ">${
1173
- EditorElem.select({
1174
- title: '',
1175
- gvc: gvc,
1176
- def: (() => {
1177
- if (!glitter.share.editorViewModel.appConfig.font_theme[parseInt(widget.container_fonts, 10)]) {
1178
- widget.container_fonts = `0`
1179
- }
1180
- return widget.container_fonts
1181
- })(),
1182
- callback: (text: any) => {
1183
- widget.container_fonts = text
1184
- refresh(widget, type)
1185
- },
1186
- array: glitter.share.editorViewModel.appConfig.font_theme.map((dd: any, index: number) => {
1187
- return {
1188
- title: dd.title,
1189
- value: `${index}`
1190
- }
1191
- }),
1192
- })
1193
- }
1193
+ (()=>{
1194
+ const widget=refer_result ? _f_wd:oWidget
1195
+ array_string.push(`<div class="px-3 pb-2 ">${
1196
+ EditorElem.select({
1197
+ title: '',
1198
+ gvc: gvc,
1199
+ def: (() => {
1200
+ if (!glitter.share.editorViewModel.appConfig.font_theme[parseInt(widget.container_fonts, 10)]) {
1201
+ widget.container_fonts = `0`
1202
+ }
1203
+ return widget.container_fonts
1204
+ })(),
1205
+ callback: (text: any) => {
1206
+ widget.container_fonts = text
1207
+ refresh(widget, type)
1208
+ },
1209
+ array: glitter.share.editorViewModel.appConfig.font_theme.map((dd: any, index: number) => {
1210
+ return {
1211
+ title: dd.title,
1212
+ value: `${index}`
1213
+ }
1214
+ }),
1215
+ })
1216
+ }
1194
1217
  <div class="bt_border_editor mt-2"
1195
1218
  onclick="${gvc.event((e, event) => {
1196
- gvc.glitter.getModule(`${gvc.glitter.root_path}/setting/fonts-config.js`, (FontsConfig) => {
1197
- NormalPageEditor.closeEvent = () => {
1198
- gvc.notifyDataChange(vm_c.id)
1199
- refresh(widget, type)
1200
- }
1201
- NormalPageEditor.toggle({
1202
- visible: true,
1203
- view: FontsConfig.fontsSettingView(gvc, glitter.share.editorViewModel.appConfig, true),
1204
- title: '管理全站字型'
1219
+ gvc.glitter.getModule(`${gvc.glitter.root_path}/setting/fonts-config.js`, (FontsConfig) => {
1220
+ NormalPageEditor.closeEvent = () => {
1221
+ gvc.notifyDataChange(vm_c.id)
1222
+ refresh(widget, type)
1223
+ }
1224
+ NormalPageEditor.toggle({
1225
+ visible: true,
1226
+ view: FontsConfig.fontsSettingView(gvc, glitter.share.editorViewModel.appConfig, true),
1227
+ title: '管理全站字型'
1228
+ })
1205
1229
  })
1206
- })
1207
1230
 
1208
- })}">
1231
+ })}">
1209
1232
  管理全站字型
1210
1233
  </div>
1211
1234
  </div>`)
1235
+ })()
1236
+
1212
1237
  break
1213
1238
  case 'margin':
1214
- array_string.push(`<div class="px-3 pb-2">${CustomStyle.editorMargin(gvc, widget, () => {
1215
- refresh(widget, type)
1216
- })}</div>`)
1239
+ (()=>{
1240
+ array_string.push(`<div class="px-3 pb-2">${CustomStyle.editorMargin(gvc, refer_result ? widget:oWidget, () => {
1241
+ refresh(widget, type)
1242
+ })}</div>`)
1243
+ })()
1244
+
1217
1245
  break
1218
1246
  case 'background':
1219
- array_string.push(`<div class="px-3 pb-2">${CustomStyle.editorBackground(gvc, widget, () => {
1220
- refresh(widget, type)
1221
- })}</div>`)
1247
+ (()=>{
1248
+ array_string.push(`<div class="px-3 pb-2">${CustomStyle.editorBackground(gvc, refer_result ? widget:oWidget, () => {
1249
+ refresh(widget, type)
1250
+ })}</div>`)
1251
+ })()
1252
+
1222
1253
  break
1223
1254
  case 'develop':
1224
- array_string.push(`<div class="px-3">${CustomStyle.editor(gvc, widget, () => {
1225
- refresh(widget, type)
1226
- })}</div>`)
1255
+ (()=>{
1256
+ array_string.push(`<div class="px-3">${CustomStyle.editor(gvc, refer_result ? widget:oWidget, () => {
1257
+ refresh(widget, type)
1258
+ })}</div>`)
1259
+ })()
1260
+
1227
1261
  break
1228
1262
  }
1229
1263
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ts-glitter",
3
- "version": "13.7.4",
3
+ "version": "13.7.5",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {