@lemonppt/renderer 1.0.2 → 1.0.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.
@@ -480,6 +480,12 @@
480
480
  const appearance = goal.appearance || 'dark';
481
481
  document.documentElement.setAttribute('data-theme', scheme);
482
482
  document.documentElement.setAttribute('data-appearance', appearance);
483
+ } else if (t === 'theme11') {
484
+ // theme11 视觉由每页 mood class 驱动,根属性仅作占位避免落入 else 被误删
485
+ const scheme = goal.colorScheme || 'theme11';
486
+ const appearance = goal.appearance || 'light';
487
+ document.documentElement.setAttribute('data-theme', scheme);
488
+ document.documentElement.setAttribute('data-appearance', appearance);
483
489
  } else {
484
490
  const scheme = goal.colorScheme || (t === 'theme02' ? 'scheme-a' : 'light');
485
491
  document.documentElement.setAttribute('data-theme', scheme);
@@ -503,6 +509,8 @@
503
509
  }
504
510
  } else if (t === 'theme03') {
505
511
  active = appearanceValue === (goal.appearance || 'dark');
512
+ } else if (t === 'theme11') {
513
+ active = appearanceValue === (goal.appearance || 'light');
506
514
  } else {
507
515
  active = appearanceValue === (goal.colorScheme || (t === 'theme02' ? 'scheme-a' : 'light'));
508
516
  }
@@ -529,6 +537,13 @@
529
537
  goal.appearance = newMode;
530
538
  autoSave();
531
539
  document.documentElement.setAttribute('data-appearance', newMode);
540
+ } else if (t === 'theme11') {
541
+ // theme11 由每页 mood class 驱动,顶部外观按钮仅同步根属性与 goal.appearance
542
+ if (newMode === goal.appearance) return;
543
+ recordHistory();
544
+ goal.appearance = newMode;
545
+ autoSave();
546
+ document.documentElement.setAttribute('data-appearance', newMode);
532
547
  } else {
533
548
  if (newMode === goal.colorScheme) return;
534
549
  recordHistory();
@@ -2838,7 +2853,7 @@
2838
2853
  if (field.type === 'boolean') return false;
2839
2854
  if (field.type === 'number') return 100;
2840
2855
  if (field.type === 'textarea') return '示例内容';
2841
- return '示例项';
2856
+ return '示例文字';
2842
2857
  }
2843
2858
  const item = {};
2844
2859
  itemSchema.forEach((field) => {
@@ -2860,7 +2875,7 @@
2860
2875
  } else if (field.type === 'image') {
2861
2876
  item[field.key] = '';
2862
2877
  } else if (field.type === 'text') {
2863
- item[field.key] = '';
2878
+ item[field.key] = '示例文字';
2864
2879
  } else if (field.type === 'select') {
2865
2880
  const firstOption = Array.isArray(field.options) && field.options.length > 0 ? field.options[0] : undefined;
2866
2881
  item[field.key] = firstOption && typeof firstOption === 'object' ? firstOption.value : '';
@@ -2960,15 +2975,9 @@
2960
2975
  }
2961
2976
  });
2962
2977
 
2963
- // 显示当前条目的可编辑字段(简单文字字段仍在画布上编辑,此处跳过)
2978
+ // 显示当前条目的可编辑字段(数组项始终展示,避免新增空白条目无法编辑)
2964
2979
  const isPrimitiveItem = field.itemSchema && field.itemSchema.length === 1 && field.itemSchema[0].key === 'item';
2965
- const allSubFieldsAreCanvasEditable = skipCanvasEditable && (() => {
2966
- if (!field.itemSchema) return true;
2967
- if (isPrimitiveItem) {
2968
- return ['text', 'textarea', 'image'].includes(field.itemSchema[0].type);
2969
- }
2970
- return field.itemSchema.every((subField) => ['text', 'textarea', 'image'].includes(subField.type));
2971
- })();
2980
+ const allSubFieldsAreCanvasEditable = false;
2972
2981
 
2973
2982
  if (!allSubFieldsAreCanvasEditable) {
2974
2983
  const list = createEl('div', 'lp-property-array', section);