@yudaocode/univer-docs-ui 1.6.205 → 1.6.207

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/lib/es/index.js CHANGED
@@ -136,6 +136,19 @@ function resolveDocsUIFeatures(raw) {
136
136
  controlComputedAndVisibleIf: raw?.controlComputedAndVisibleIf ?? true,
137
137
  controlVisualChrome: raw?.controlVisualChrome ?? true,
138
138
  controlValidator: raw?.controlValidator ?? true,
139
+ controlFormExtras: raw?.controlFormExtras ?? true,
140
+ tocInsert: raw?.tocInsert ?? true,
141
+ headingCollapse: raw?.headingCollapse ?? true,
142
+ headerFooterSdt: raw?.headerFooterSdt ?? true,
143
+ dynamicFields: raw?.dynamicFields ?? true,
144
+ textDirection: raw?.textDirection ?? true,
145
+ footnotes: raw?.footnotes ?? true,
146
+ docAreas: raw?.docAreas ?? true,
147
+ cascadeRules: raw?.cascadeRules ?? true,
148
+ extendedTableBorders: raw?.extendedTableBorders ?? true,
149
+ paragraphAdvancedLayout: raw?.paragraphAdvancedLayout ?? true,
150
+ legacyFormatIo: raw?.legacyFormatIo ?? true,
151
+ bookmarks: raw?.bookmarks ?? true,
139
152
  ...raw?.allowedSdtKinds ? { allowedSdtKinds: [...raw.allowedSdtKinds] } : {}
140
153
  };
141
154
  }
@@ -983,7 +996,7 @@ var DocInspectorPanel = () => {
983
996
  children: "+ \u7F16\u8F91\u9875\u811A"
984
997
  }
985
998
  ),
986
- headerFooterSegments.length > 0 && features.sdtControls && /* @__PURE__ */ jsx2(
999
+ headerFooterSegments.length > 0 && features.sdtControls && features.headerFooterSdt && /* @__PURE__ */ jsx2(
987
1000
  "button",
988
1001
  {
989
1002
  type: "button",
@@ -1012,7 +1025,7 @@ var DocInspectorPanel = () => {
1012
1025
  children: "\u8BA1\u7B97\u8868\u5185\u516C\u5F0F (SUM/CNMONEY)"
1013
1026
  }
1014
1027
  ),
1015
- /* @__PURE__ */ jsx2(
1028
+ features.dynamicFields && /* @__PURE__ */ jsx2(
1016
1029
  "button",
1017
1030
  {
1018
1031
  type: "button",
@@ -1038,30 +1051,32 @@ var DocInspectorPanel = () => {
1038
1051
  children: "\u4E00\u952E\u6392\u7248\u6E05\u7406"
1039
1052
  }
1040
1053
  ),
1041
- /* @__PURE__ */ jsx2(
1042
- "button",
1043
- {
1044
- type: "button",
1045
- className: "yudao-doc-mini-btn",
1046
- onClick: () => commandService.syncExecuteCommand(SetDocTextDirectionCommand.id, {
1047
- unitId: unit.getUnitId(),
1048
- direction: "ltr"
1049
- }),
1050
- children: "LTR"
1051
- }
1052
- ),
1053
- /* @__PURE__ */ jsx2(
1054
- "button",
1055
- {
1056
- type: "button",
1057
- className: "yudao-doc-mini-btn",
1058
- onClick: () => commandService.syncExecuteCommand(SetDocTextDirectionCommand.id, {
1059
- unitId: unit.getUnitId(),
1060
- direction: "rtl"
1061
- }),
1062
- children: "RTL"
1063
- }
1064
- )
1054
+ features.textDirection && /* @__PURE__ */ jsxs2(Fragment, { children: [
1055
+ /* @__PURE__ */ jsx2(
1056
+ "button",
1057
+ {
1058
+ type: "button",
1059
+ className: "yudao-doc-mini-btn",
1060
+ onClick: () => commandService.syncExecuteCommand(SetDocTextDirectionCommand.id, {
1061
+ unitId: unit.getUnitId(),
1062
+ direction: "ltr"
1063
+ }),
1064
+ children: "LTR"
1065
+ }
1066
+ ),
1067
+ /* @__PURE__ */ jsx2(
1068
+ "button",
1069
+ {
1070
+ type: "button",
1071
+ className: "yudao-doc-mini-btn",
1072
+ onClick: () => commandService.syncExecuteCommand(SetDocTextDirectionCommand.id, {
1073
+ unitId: unit.getUnitId(),
1074
+ direction: "rtl"
1075
+ }),
1076
+ children: "RTL"
1077
+ }
1078
+ )
1079
+ ] })
1065
1080
  ] })
1066
1081
  ] }),
1067
1082
  /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
@@ -1140,7 +1155,7 @@ var DocInspectorPanel = () => {
1140
1155
  ] })
1141
1156
  ] }),
1142
1157
  features.coSigningRoles && renderRoleSwitcherCard(),
1143
- /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1158
+ features.footnotes && /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1144
1159
  /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section-title", children: [
1145
1160
  /* @__PURE__ */ jsxs2("span", { children: [
1146
1161
  "\u811A\u6CE8\u4E0E\u5C3E\u6CE8\u7BA1\u7406 (",
@@ -1284,7 +1299,7 @@ var DocInspectorPanel = () => {
1284
1299
  nt.id
1285
1300
  ))
1286
1301
  ] }),
1287
- /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1302
+ features.docAreas && /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1288
1303
  /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section-title", children: [
1289
1304
  /* @__PURE__ */ jsxs2("span", { children: [
1290
1305
  "\u547D\u540D\u5B50\u533A\u57DF (Area / Zone) (",
@@ -1420,7 +1435,7 @@ var DocInspectorPanel = () => {
1420
1435
  area.id
1421
1436
  )) })
1422
1437
  ] }),
1423
- /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1438
+ features.cascadeRules && /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1424
1439
  /* @__PURE__ */ jsx2("div", { className: "yudao-doc-section-title", children: /* @__PURE__ */ jsxs2("span", { children: [
1425
1440
  "\u63A7\u4EF6\u7EA7\u8054\u89C4\u5219\u5F15\u64CE (Cascade) (",
1426
1441
  cascadeRules.length,
@@ -1733,77 +1748,79 @@ var DocInspectorPanel = () => {
1733
1748
  children: (tables[Math.min(sortTableIdx, tables.length - 1)]?.headerRowCount ?? 0) > 0 ? "\u5DF2\u5F00\u542F\u8DE8\u9875\u8868\u5934" : "\u8BBE\u4E3A\u8DE8\u9875\u91CD\u590D\u8868\u5934"
1734
1749
  }
1735
1750
  ),
1736
- /* @__PURE__ */ jsx2(
1737
- "button",
1738
- {
1739
- type: "button",
1740
- className: "yudao-doc-mini-btn",
1741
- onClick: () => commandService.syncExecuteCommand(SetDocTableBorderPresetCommand.id, {
1742
- unitId: unit.getUnitId(),
1743
- tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1744
- preset: "all"
1745
- }),
1746
- children: "\u5168\u6846\u7EBF"
1747
- }
1748
- ),
1749
- /* @__PURE__ */ jsx2(
1750
- "button",
1751
- {
1752
- type: "button",
1753
- className: "yudao-doc-mini-btn",
1754
- onClick: () => commandService.syncExecuteCommand(SetDocTableBorderPresetCommand.id, {
1755
- unitId: unit.getUnitId(),
1756
- tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1757
- preset: "external"
1758
- }),
1759
- children: "\u5916\u6846\u7EBF"
1760
- }
1761
- ),
1762
- /* @__PURE__ */ jsx2(
1763
- "button",
1764
- {
1765
- type: "button",
1766
- className: "yudao-doc-mini-btn",
1767
- onClick: () => commandService.syncExecuteCommand(SetDocTableBorderPresetCommand.id, {
1768
- unitId: unit.getUnitId(),
1769
- tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1770
- preset: "empty"
1771
- }),
1772
- children: "\u65E0\u6846\u7EBF"
1773
- }
1774
- ),
1775
- /* @__PURE__ */ jsx2(
1776
- "button",
1777
- {
1778
- type: "button",
1779
- className: "yudao-doc-mini-btn",
1780
- onClick: () => commandService.syncExecuteCommand(SetDocTableCellPropertiesCommand.id, {
1781
- unitId: unit.getUnitId(),
1782
- tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1783
- rowIndex: 0,
1784
- colIndex: 0,
1785
- properties: { slashType: "forward" }
1786
- }),
1787
- children: "\u9996\u683C\u659C\u7EBF"
1788
- }
1789
- ),
1790
- /* @__PURE__ */ jsx2(
1791
- "button",
1792
- {
1793
- type: "button",
1794
- className: "yudao-doc-mini-btn",
1795
- onClick: () => commandService.syncExecuteCommand(AutoFitDocTableCommand.id, {
1796
- unitId: unit.getUnitId(),
1797
- tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1798
- mode: "window"
1799
- }),
1800
- children: "\u81EA\u9002\u5E94\u9875\u5BBD"
1801
- }
1802
- )
1751
+ features.extendedTableBorders && /* @__PURE__ */ jsxs2(Fragment, { children: [
1752
+ /* @__PURE__ */ jsx2(
1753
+ "button",
1754
+ {
1755
+ type: "button",
1756
+ className: "yudao-doc-mini-btn",
1757
+ onClick: () => commandService.syncExecuteCommand(SetDocTableBorderPresetCommand.id, {
1758
+ unitId: unit.getUnitId(),
1759
+ tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1760
+ preset: "all"
1761
+ }),
1762
+ children: "\u5168\u6846\u7EBF"
1763
+ }
1764
+ ),
1765
+ /* @__PURE__ */ jsx2(
1766
+ "button",
1767
+ {
1768
+ type: "button",
1769
+ className: "yudao-doc-mini-btn",
1770
+ onClick: () => commandService.syncExecuteCommand(SetDocTableBorderPresetCommand.id, {
1771
+ unitId: unit.getUnitId(),
1772
+ tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1773
+ preset: "external"
1774
+ }),
1775
+ children: "\u5916\u6846\u7EBF"
1776
+ }
1777
+ ),
1778
+ /* @__PURE__ */ jsx2(
1779
+ "button",
1780
+ {
1781
+ type: "button",
1782
+ className: "yudao-doc-mini-btn",
1783
+ onClick: () => commandService.syncExecuteCommand(SetDocTableBorderPresetCommand.id, {
1784
+ unitId: unit.getUnitId(),
1785
+ tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1786
+ preset: "empty"
1787
+ }),
1788
+ children: "\u65E0\u6846\u7EBF"
1789
+ }
1790
+ ),
1791
+ /* @__PURE__ */ jsx2(
1792
+ "button",
1793
+ {
1794
+ type: "button",
1795
+ className: "yudao-doc-mini-btn",
1796
+ onClick: () => commandService.syncExecuteCommand(SetDocTableCellPropertiesCommand.id, {
1797
+ unitId: unit.getUnitId(),
1798
+ tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1799
+ rowIndex: 0,
1800
+ colIndex: 0,
1801
+ properties: { slashType: "forward" }
1802
+ }),
1803
+ children: "\u9996\u683C\u659C\u7EBF"
1804
+ }
1805
+ ),
1806
+ /* @__PURE__ */ jsx2(
1807
+ "button",
1808
+ {
1809
+ type: "button",
1810
+ className: "yudao-doc-mini-btn",
1811
+ onClick: () => commandService.syncExecuteCommand(AutoFitDocTableCommand.id, {
1812
+ unitId: unit.getUnitId(),
1813
+ tableIndexOrId: Math.min(sortTableIdx, tables.length - 1),
1814
+ mode: "window"
1815
+ }),
1816
+ children: "\u81EA\u9002\u5E94\u9875\u5BBD"
1817
+ }
1818
+ )
1819
+ ] })
1803
1820
  ] })
1804
1821
  ] })
1805
1822
  ] }),
1806
- /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1823
+ features.paragraphAdvancedLayout && /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1807
1824
  /* @__PURE__ */ jsx2("div", { className: "yudao-doc-section-title", children: /* @__PURE__ */ jsx2("span", { children: "\u6BB5\u843D\u5206\u9875\u63A7\u5236\u4E0E\u5236\u8868\u4F4D\u524D\u5BFC\u7B26" }) }),
1808
1825
  /* @__PURE__ */ jsxs2("div", { style: { display: "flex", gap: 6, alignItems: "center" }, children: [
1809
1826
  /* @__PURE__ */ jsx2("span", { style: { fontSize: 11, color: "#4e5565" }, children: "\u76EE\u6807\u6BB5\u843D\uFF1A" }),
@@ -1900,7 +1917,7 @@ var DocInspectorPanel = () => {
1900
1917
  )
1901
1918
  ] })
1902
1919
  ] }),
1903
- /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1920
+ features.legacyFormatIo && /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
1904
1921
  /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section-title", children: [
1905
1922
  /* @__PURE__ */ jsx2("span", { children: "\u90AE\u4EF6\u5408\u5E76\u4E0E\u591A\u683C\u5F0F\u517C\u5BB9 (.doc/.rtf/.odt)" }),
1906
1923
  wave2IoTip && /* @__PURE__ */ jsx2("span", { style: { fontSize: 10.5, color: "#2c53f1", fontWeight: 500 }, children: wave2IoTip })
@@ -2054,7 +2071,7 @@ var DocInspectorPanel = () => {
2054
2071
  fml.id
2055
2072
  ))
2056
2073
  ] }),
2057
- /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
2074
+ features.bookmarks && /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-section", children: [
2058
2075
  /* @__PURE__ */ jsx2("div", { className: "yudao-doc-section-title", children: /* @__PURE__ */ jsxs2("span", { children: [
2059
2076
  "\u6587\u6863\u4E66\u7B7E\u7BA1\u7406 (",
2060
2077
  bookmarks.length,
@@ -2795,7 +2812,7 @@ var DocInspectorPanel = () => {
2795
2812
  }
2796
2813
  )
2797
2814
  ] }),
2798
- /* @__PURE__ */ jsxs2("label", { className: "yudao-doc-field-row", children: [
2815
+ features.cascadeRules && /* @__PURE__ */ jsxs2("label", { className: "yudao-doc-field-row", children: [
2799
2816
  /* @__PURE__ */ jsx2("span", { children: "\u8054\u52A8\u6982\u5FF5\u7EC4\u6807\u8BC6 (conceptId)" }),
2800
2817
  /* @__PURE__ */ jsx2(
2801
2818
  "input",
@@ -2807,7 +2824,7 @@ var DocInspectorPanel = () => {
2807
2824
  }
2808
2825
  )
2809
2826
  ] }),
2810
- /* @__PURE__ */ jsxs2("label", { className: "yudao-doc-field-row", children: [
2827
+ features.controlFormExtras && /* @__PURE__ */ jsxs2("label", { className: "yudao-doc-field-row", children: [
2811
2828
  /* @__PURE__ */ jsx2("span", { children: "\u586B\u5199\u8F85\u52A9\u63D0\u793A (hint)" }),
2812
2829
  /* @__PURE__ */ jsx2(
2813
2830
  "input",
@@ -3045,27 +3062,29 @@ var DocInspectorPanel = () => {
3045
3062
  ),
3046
3063
  /* @__PURE__ */ jsx2("span", { children: "\u8BBE\u4E3A\u8868\u5355\u5FC5\u586B\u9879\uFF08\u672A\u586B\u65F6\u6821\u9A8C\u62E6\u622A\uFF09" })
3047
3064
  ] }),
3048
- /* @__PURE__ */ jsxs2("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
3049
- /* @__PURE__ */ jsx2(
3050
- "input",
3051
- {
3052
- type: "checkbox",
3053
- checked: Boolean(activeCtrl.pasteDisabled),
3054
- onChange: (e) => updateProps({ pasteDisabled: e.target.checked })
3055
- }
3056
- ),
3057
- /* @__PURE__ */ jsx2("span", { children: "\u7981\u6B62\u7C98\u8D34\u8F93\u5165 (pasteDisabled)" })
3058
- ] }),
3059
- (activeCtrl.kind === "number" || activeCtrl.kind === "text") && /* @__PURE__ */ jsxs2("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
3060
- /* @__PURE__ */ jsx2(
3061
- "input",
3062
- {
3063
- type: "checkbox",
3064
- checked: Boolean(activeCtrl.calculatorEnabled),
3065
- onChange: (e) => updateProps({ calculatorEnabled: e.target.checked })
3066
- }
3067
- ),
3068
- /* @__PURE__ */ jsx2("span", { children: "\u5F39\u7A97\u542F\u7528\u5185\u8054\u56DB\u5219\u8BA1\u7B97\u5668 (Calculator)" })
3065
+ features.controlFormExtras && /* @__PURE__ */ jsxs2(Fragment, { children: [
3066
+ /* @__PURE__ */ jsxs2("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
3067
+ /* @__PURE__ */ jsx2(
3068
+ "input",
3069
+ {
3070
+ type: "checkbox",
3071
+ checked: Boolean(activeCtrl.pasteDisabled),
3072
+ onChange: (e) => updateProps({ pasteDisabled: e.target.checked })
3073
+ }
3074
+ ),
3075
+ /* @__PURE__ */ jsx2("span", { children: "\u7981\u6B62\u7C98\u8D34\u8F93\u5165 (pasteDisabled)" })
3076
+ ] }),
3077
+ (activeCtrl.kind === "number" || activeCtrl.kind === "text") && /* @__PURE__ */ jsxs2("label", { style: { display: "flex", alignItems: "center", gap: 6, cursor: "pointer" }, children: [
3078
+ /* @__PURE__ */ jsx2(
3079
+ "input",
3080
+ {
3081
+ type: "checkbox",
3082
+ checked: Boolean(activeCtrl.calculatorEnabled),
3083
+ onChange: (e) => updateProps({ calculatorEnabled: e.target.checked })
3084
+ }
3085
+ ),
3086
+ /* @__PURE__ */ jsx2("span", { children: "\u5F39\u7A97\u542F\u7528\u5185\u8054\u56DB\u5219\u8BA1\u7B97\u5668 (Calculator)" })
3087
+ ] })
3069
3088
  ] })
3070
3089
  ] }),
3071
3090
  features.controlValidator && activeCtrl.kind !== "checkbox" && /* @__PURE__ */ jsxs2(Fragment, { children: [
@@ -3141,19 +3160,19 @@ var DocInspectorPanel = () => {
3141
3160
  }
3142
3161
  )
3143
3162
  ] })
3144
- ] }),
3145
- /* @__PURE__ */ jsxs2("label", { className: "yudao-doc-field-row", children: [
3146
- /* @__PURE__ */ jsx2("span", { children: "\u7A7A\u503C\u5360\u4F4D\u63D0\u793A\u8BED" }),
3147
- /* @__PURE__ */ jsx2(
3148
- "input",
3149
- {
3150
- type: "text",
3151
- value: activeCtrl.placeholder || "",
3152
- onChange: (e) => updateProps({ placeholder: e.target.value })
3153
- }
3154
- )
3155
3163
  ] })
3156
3164
  ] }),
3165
+ activeCtrl.kind !== "checkbox" && /* @__PURE__ */ jsxs2("label", { className: "yudao-doc-field-row", children: [
3166
+ /* @__PURE__ */ jsx2("span", { children: "\u7A7A\u503C\u5360\u4F4D\u63D0\u793A\u8BED" }),
3167
+ /* @__PURE__ */ jsx2(
3168
+ "input",
3169
+ {
3170
+ type: "text",
3171
+ value: activeCtrl.placeholder || "",
3172
+ onChange: (e) => updateProps({ placeholder: e.target.value })
3173
+ }
3174
+ )
3175
+ ] }),
3157
3176
  features.coSigningRoles && /* @__PURE__ */ jsxs2("div", { className: "yudao-doc-field-row", children: [
3158
3177
  /* @__PURE__ */ jsx2("span", { children: "\u53EF\u586B\u5199\u89D2\u8272 (editableRoles \xB7 \u591A\u65B9\u534F\u540C\u7B7E\u7F72\u6743\u9650)" }),
3159
3178
  /* @__PURE__ */ jsx2("div", { style: { display: "flex", gap: 5, flexWrap: "wrap", marginTop: 2 }, children: [
@@ -3899,7 +3918,7 @@ var DocLeftSidebar = () => {
3899
3918
  }
3900
3919
  ),
3901
3920
  tab === "toc" ? /* @__PURE__ */ jsxs3("div", { className: "yudao-doc-left-body", children: [
3902
- /* @__PURE__ */ jsxs3("div", { style: { display: "flex", gap: 6 }, children: [
3921
+ features.tocInsert && /* @__PURE__ */ jsxs3("div", { style: { display: "flex", gap: 6 }, children: [
3903
3922
  /* @__PURE__ */ jsx3(
3904
3923
  "button",
3905
3924
  {
@@ -4004,7 +4023,7 @@ var DocLeftSidebar = () => {
4004
4023
  children: pageBadgeText
4005
4024
  }
4006
4025
  ),
4007
- paraIdx >= 0 && /* @__PURE__ */ jsx3(
4026
+ features.headingCollapse && paraIdx >= 0 && /* @__PURE__ */ jsx3(
4008
4027
  "button",
4009
4028
  {
4010
4029
  type: "button",