cosey 0.1.4 → 0.2.0

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.
Files changed (180) hide show
  1. package/README.md +61 -0
  2. package/components/close/style/index.js +2 -2
  3. package/components/col/col.vue.js +1 -1
  4. package/components/col/style/index.js +3 -3
  5. package/components/config-provider/config-provider.d.ts +2 -0
  6. package/components/config-provider/config-provider.vue.js +13 -3
  7. package/components/context-menu/context-menu.vue.js +4 -4
  8. package/components/context-menu/context-sub-menu.vue.js +2 -2
  9. package/components/context-menu/style/index.js +2 -2
  10. package/components/editor/components/color-picker/color-picker.vue.js +15 -11
  11. package/components/editor/components/color-picker/useHistoryColor.js +3 -3
  12. package/components/editor/components/resize/resize.js +9 -9
  13. package/components/editor/components/resize/resize.style.js +20 -20
  14. package/components/editor/components/resize/resize.vue.js +2 -2
  15. package/components/editor/components/table-toolbar/table-toolbar.style.js +2 -2
  16. package/components/editor/components/table-toolbar/table-toolbar.vue.js +2 -2
  17. package/components/editor/components/toolbar/formats/font.vue.js +5 -1
  18. package/components/editor/components/toolbar/formats/header.vue.js +6 -2
  19. package/components/editor/components/toolbar/formats/link.vue.js +17 -13
  20. package/components/editor/components/toolbar/formats/size.vue.js +5 -1
  21. package/components/editor/components/toolbar/formats/source.vue.d.ts +2 -0
  22. package/components/editor/components/toolbar/formats/source.vue.js +78 -0
  23. package/components/editor/components/toolbar/formats/table.style.js +2 -2
  24. package/components/editor/components/toolbar/formats/video.vue.js +9 -5
  25. package/components/editor/components/toolbar/toolbar.vue.js +5 -0
  26. package/components/editor/formats/font.js +2 -2
  27. package/components/editor/formats/indent.js +1 -1
  28. package/components/editor/formats/kbd.d.ts +7 -0
  29. package/components/editor/formats/kbd.js +13 -0
  30. package/components/editor/modules/image-uploader/formats/image-loading.style.js +2 -2
  31. package/components/editor/quill.js +8 -6
  32. package/components/editor/style/index.js +25 -16
  33. package/components/field/components/autocomplete/autocomplete.vue.js +5 -1
  34. package/components/field/components/cascader/cascader.vue.js +5 -1
  35. package/components/field/components/checkbox-group/checkbox-group.vue.js +1 -1
  36. package/components/field/components/checkbox-group/panel.vue.js +10 -5
  37. package/components/field/components/date/date.vue.js +5 -1
  38. package/components/field/components/date-range/date-range.vue.js +6 -2
  39. package/components/field/components/date-time/date-time.vue.js +5 -1
  40. package/components/field/components/date-time-range/date-time-range.vue.js +6 -2
  41. package/components/field/components/dates/dates.vue.js +5 -1
  42. package/components/field/components/input/input.vue.js +5 -1
  43. package/components/field/components/input-tag/input-tag.vue.js +5 -1
  44. package/components/field/components/mention/mention.vue.js +5 -1
  45. package/components/field/components/month/month.vue.js +5 -1
  46. package/components/field/components/month-range/month-range.vue.js +6 -2
  47. package/components/field/components/months/months.vue.js +5 -1
  48. package/components/field/components/password/password.vue.js +5 -1
  49. package/components/field/components/select/select.d.ts +2 -2
  50. package/components/field/components/select/select.js +3 -3
  51. package/components/field/components/select/select.vue.js +5 -1
  52. package/components/field/components/select-v2/select-v2.d.ts +6 -3
  53. package/components/field/components/select-v2/select-v2.js +9 -0
  54. package/components/field/components/select-v2/select-v2.vue.js +21 -3
  55. package/components/field/components/textarea/textarea.vue.js +5 -1
  56. package/components/field/components/time/time.vue.js +5 -1
  57. package/components/field/components/time-range/time-range.vue.js +6 -2
  58. package/components/field/components/time-select/time-select.vue.js +5 -1
  59. package/components/field/components/tree-select/tree-select.vue.js +5 -1
  60. package/components/field/components/week/week.vue.js +6 -2
  61. package/components/field/components/year/year.vue.js +5 -1
  62. package/components/field/components/year-range/year-range.vue.js +6 -2
  63. package/components/field/components/years/years.vue.js +5 -1
  64. package/components/form/form-item.d.ts +1 -1
  65. package/components/form/form.d.ts +2 -0
  66. package/components/form/form.js +2 -2
  67. package/components/form/form.vue.d.ts +5 -0
  68. package/components/form/form.vue.js +6 -2
  69. package/components/form/index.d.ts +10 -1
  70. package/components/form/useBubbleTemplate.js +13 -5
  71. package/components/form-dialog/form-dialog.js +2 -2
  72. package/components/form-dialog/index.d.ts +4 -1552
  73. package/components/form-list/form-list.js +1 -1
  74. package/components/form-list/form-list.vue.js +5 -1
  75. package/components/form-list/index.d.ts +1 -1
  76. package/components/form-query/form-query.d.ts +2 -0
  77. package/components/form-query/form-query.vue.d.ts +5 -0
  78. package/components/form-query/form-query.vue.js +13 -7
  79. package/components/form-query/index.d.ts +9 -0
  80. package/components/highlight/style/index.js +2 -2
  81. package/components/horizontal-tree/horizontal-tree.vue.js +11 -6
  82. package/components/image-card/image-card.d.ts +1 -8
  83. package/components/image-card/image-card.vue.d.ts +4 -18
  84. package/components/image-card/index.d.ts +8 -29
  85. package/components/long-text/style/index.js +2 -2
  86. package/components/mask/style/index.js +2 -2
  87. package/components/row/row.vue.js +1 -1
  88. package/components/scroll-view/scroll-view.vue.js +1 -1
  89. package/components/scroll-view/style/index.js +9 -9
  90. package/components/table/index.d.ts +73 -78
  91. package/components/table/table-column/renderer.d.ts +2 -1
  92. package/components/table/table-column/renderer.js +2 -2
  93. package/components/table/table-column/table-column.d.ts +15 -15
  94. package/components/table/table-column/table-column.vue.d.ts +9 -5
  95. package/components/table/table-column/table-column.vue.js +5 -1
  96. package/components/table/table-column-editor/table-column-editor.vue.js +22 -14
  97. package/components/table/table-export/table-export.vue.js +31 -26
  98. package/components/table/table-query/table-query.d.ts +2 -0
  99. package/components/table/table-query/table-query.vue.d.ts +5 -0
  100. package/components/table/table.d.ts +22 -25
  101. package/components/table/table.vue.d.ts +45 -51
  102. package/components/table/table.vue.js +13 -9
  103. package/components/table/useTable.d.ts +2 -1
  104. package/components/table/useTable.js +2 -2
  105. package/components/table-action/index.d.ts +48 -6
  106. package/components/table-action/item.d.ts +16 -2
  107. package/components/table-action/item.vue.d.ts +34 -6
  108. package/components/table-action/item.vue.js +15 -9
  109. package/components/table-action/table-action.vue.d.ts +16 -2
  110. package/components/toggle/toggle.vue.js +5 -1
  111. package/components/upload/style/index.js +2 -2
  112. package/components/upload/upload-item.vue.d.ts +2 -2
  113. package/components/upload/upload-item.vue.js +16 -9
  114. package/components/upload/upload.vue.js +7 -1
  115. package/config/index.d.ts +1 -2
  116. package/config/index.js +2 -2
  117. package/config/nprogress.style.js +5 -5
  118. package/config/root-config-provider.vue.js +5 -5
  119. package/constant.d.ts +2 -2
  120. package/constant.js +2 -2
  121. package/hooks/index.d.ts +1 -0
  122. package/hooks/index.js +2 -1
  123. package/hooks/useColorScheme.js +4 -4
  124. package/hooks/useDir.d.ts +2 -0
  125. package/hooks/useDir.js +20 -0
  126. package/hooks/useEcharts.d.ts +3 -2
  127. package/hooks/useEcharts.js +15 -3
  128. package/hooks/useLocale.d.ts +23 -371
  129. package/hooks/useLocale.js +26 -35
  130. package/hooks/useUpsert.d.ts +5 -3
  131. package/hooks/useUpsert.js +33 -25
  132. package/index.d.ts +1 -1
  133. package/index.js +4 -4
  134. package/layout/layout-auth/style/index.js +6 -6
  135. package/layout/layout-breadcrumb/layout-breadcrumb.vue.js +6 -2
  136. package/layout/layout-change-password/layout-change-password.vue.js +28 -22
  137. package/layout/layout-content/layout-content.vue.js +1 -1
  138. package/layout/layout-content/style/index.js +1 -1
  139. package/layout/layout-forbidden/layout-forbidden.vue.js +11 -6
  140. package/layout/layout-header/layout-header.vue.js +4 -4
  141. package/layout/layout-header/style/index.js +3 -3
  142. package/layout/layout-iframe/style/index.js +2 -2
  143. package/layout/layout-internal-server-error/layout-internal-server-error.vue.js +11 -6
  144. package/layout/layout-login/layout-login.vue.js +19 -14
  145. package/layout/layout-main/layout-main.vue.js +1 -1
  146. package/layout/layout-menu/layout-menu.vue.js +5 -1
  147. package/layout/layout-menu/style/index.js +1 -1
  148. package/layout/layout-not-found/layout-not-found.vue.js +11 -6
  149. package/layout/layout-search/layout-search.vue.js +22 -14
  150. package/layout/layout-sidebar/layout-sidebar.vue.js +8 -5
  151. package/layout/layout-sidebar/style/index.js +2 -2
  152. package/layout/layout-snug-aside/style/index.js +1 -1
  153. package/layout/layout-tabbar/layout-tabbar.vue.js +21 -13
  154. package/layout/layout-tabbar/style/index.js +1 -1
  155. package/layout/layout-top-snug-menu/layout-top-snug-menu.vue.js +24 -17
  156. package/layout/layout-user-menu/layout-user-menu.vue.js +10 -6
  157. package/locale/index.d.ts +10 -0
  158. package/locale/index.js +2 -0
  159. package/locale/lang/ar.d.ts +280 -0
  160. package/locale/lang/ar.js +129 -0
  161. package/locale/lang/en.d.ts +302 -0
  162. package/locale/lang/en.js +129 -0
  163. package/locale/lang/zh-cn.d.ts +301 -0
  164. package/locale/lang/zh-cn.js +129 -0
  165. package/package.json +10 -8
  166. package/request/useRequest.js +31 -23
  167. package/store/index.d.ts +1 -1
  168. package/store/index.js +6 -3
  169. package/store/layout.js +208 -190
  170. package/store/plugin.d.ts +9 -0
  171. package/store/plugin.js +22 -0
  172. package/store/user.d.ts +1 -1
  173. package/utils/css.d.ts +4 -0
  174. package/utils/css.js +5 -2
  175. package/utils/excel/bookFormats.js +5 -5
  176. package/utils/excel/xlsx.js +2 -2
  177. package/utils/index.js +1 -1
  178. package/utils/message-box.js +3 -1
  179. package/utils/tree.js +2 -2
  180. package/components/form-dialog/form-dialog.vue.d.ts +0 -675
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ <div align="center">
2
+ <p>
3
+ <img width="160" src="https://fastly.jsdelivr.net/npm/@gunny/files@latest/cosey-logo.svg" />
4
+ </p>
5
+
6
+ <p>一个基于 Vue3 + TypeScript + Vite 的后台管理框架</p>
7
+
8
+ <h1>Cosey Admin</h1>
9
+
10
+ [📖文档](https://docs.cosey.wzt.zone/) | [🧑🏻‍🏫演示](https://cosey.wzt.zone/)
11
+
12
+ </div>
13
+
14
+ ## 关于 Cosey Admin
15
+
16
+ Cosey 是一个基于 Vue3、Vite、TypeScript 的后台解决方案,专门为开发中大型项目提供开箱即用的基础框架,让您可以专心于业务逻辑的开发。
17
+
18
+ Cosey 封装了页面布局、路由菜单、接口请求、核心全局状态管理、菜单和按钮级别的权限管理、主题,并提供了大量的组件和工具,绝对让您从项目搭建到部署都做到省心省时省力。
19
+
20
+ 像有些后台框架需要从 github 下载项目源码,网络慢不说,升级时还容易造成代码冲突。使用 Cosey 就没有这种问题。
21
+
22
+ Cosey 以包的形式发布到 npm 上,包括创建项目时使用的 `create-cosey` 包和运行时使用的 `cosey` 包。你可以从各种注册表源下载 Cosey 包;更新迭代时,升级包即可,不会有代码冲突问题。
23
+
24
+ ## 基于 element-plus
25
+
26
+ element-plus 是 vue3 生态中最优雅的 UI 组件库之一,兼具企业级设计的严谨与开发者友好的灵活性,接口简单易用。
27
+
28
+ Cosey 基于 element-plus 并补充了众多组件,意在使开发者更加专注于业务逻辑的开发。
29
+
30
+ 同时对 element-plus 默认主题进行了修改,避免产生审美疲劳,通过简单的配置,你也可以定义自己的主题。
31
+
32
+ ## 质量与规范
33
+
34
+ 通过 `create-cosey` 初始化的项目,预设了 eslint、prettier 工具来确保代码质量。另外,stylelint、commitlint 等工具可视情况来安装。
35
+
36
+ ## 浏览器支持
37
+
38
+ <table>
39
+ <thead>
40
+ <tr>
41
+ <th>IE <img src="https://fastly.jsdelivr.net/npm/@gunny/files@latest/LogosInternetexplorer.svg" width="24" height="24" /></th>
42
+ <th>Edge <img src="https://fastly.jsdelivr.net/npm/@gunny/files@latest/LogosMicrosoftEdge.svg" width="24" height="24" /></th>
43
+ <th>Chrome <img src="https://fastly.jsdelivr.net/npm/@gunny/files@latest/LogosChrome.svg" width="24" height="24" /></th>
44
+ <th>Firefox <img src="https://fastly.jsdelivr.net/npm/@gunny/files@latest/LogosFirefox.svg" width="24" height="24" /></th>
45
+ <th>Safari <img src="https://fastly.jsdelivr.net/npm/@gunny/files@latest/LogosSafari.svg" width="24" height="24" /></th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <tr>
50
+ <td>不支持</td>
51
+ <td>≥ 85</td>
52
+ <td>≥ 85</td>
53
+ <td>≥ 79</td>
54
+ <td>≥ 14.1</td>
55
+ </tr>
56
+ </tbody>
57
+ </table>
58
+
59
+ ## 开源协议
60
+
61
+ 本项目基于 [MIT](https://zh.wikipedia.org/wiki/MIT%E8%A8%B1%E5%8F%AF%E8%AD%89) 协议,请自由地享受和参与开源。
@@ -5,8 +5,8 @@ const getCloseStyle = (token) => {
5
5
  return {
6
6
  [componentCls]: {
7
7
  position: "absolute",
8
- top: 40,
9
- right: 40,
8
+ insetBlockStart: 40,
9
+ insetInlineEnd: 40,
10
10
  zIndex: 10,
11
11
  boxSizing: "border-box",
12
12
  display: "flex",
@@ -106,7 +106,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
106
106
  const colStyle = computed(() => {
107
107
  const styles = {};
108
108
  if (rowContext.gutter) {
109
- styles.paddingLeft = styles.paddingRight = `${rowContext.gutter / 2}px`;
109
+ styles.paddingInlineStart = styles.paddingInlineEnd = `${rowContext.gutter / 2}px`;
110
110
  }
111
111
  return styles;
112
112
  });
@@ -17,15 +17,15 @@ const getColSizeStyle = (token, size) => {
17
17
  }
18
18
  },
19
19
  [`${prefixCls}-${sizeFrag}offset-${i}`]: {
20
- marginLeft: 1 / rowColumns * i * 100 + "%"
20
+ marginInlineStart: 1 / rowColumns * i * 100 + "%"
21
21
  },
22
22
  [`${prefixCls}-${sizeFrag}pull-${i}`]: {
23
23
  position: "relative",
24
- right: 1 / rowColumns * i * 100 + "%"
24
+ insetInlineEnd: 1 / rowColumns * i * 100 + "%"
25
25
  },
26
26
  [`${prefixCls}-${sizeFrag}push-${i}`]: {
27
27
  position: "relative",
28
- right: 1 / rowColumns * i * 100 + "%"
28
+ insetInlineEnd: 1 / rowColumns * i * 100 + "%"
29
29
  }
30
30
  };
31
31
  }).reduce((mergedCssbject, cssbject) => {
@@ -1,10 +1,12 @@
1
1
  import { type ComputedRef } from 'vue';
2
2
  import { type TableConfig } from '../table';
3
3
  import { type ThemeConfig } from '../theme';
4
+ import { type Language } from '../../locale';
4
5
  export interface ConfigProviderProps {
5
6
  prefixCls?: string;
6
7
  theme?: ThemeConfig;
7
8
  table?: TableConfig;
9
+ locale?: Language;
8
10
  }
9
11
  export interface ConfigProviderInnerProps {
10
12
  getPrefixCls: (suffixCls?: string, customizePrefixCls?: string) => string;
@@ -1,8 +1,10 @@
1
- import { defineComponent, computed, onUnmounted, onMounted, createElementBlock, openBlock, normalizeClass, unref, renderSlot } from 'vue';
1
+ import { defineComponent, computed, provide, watch, onUnmounted, onMounted, createElementBlock, openBlock, normalizeClass, unref, renderSlot } from 'vue';
2
2
  import useMergeTheme from './useMergeTheme.js';
3
3
  import { useConfig, useConfigProvide } from './config-provider.js';
4
4
  import { ThemeManager, useThemeProvide } from '../theme/theme-context.js';
5
- import stdin_default$1 from './override-element-plus.js';
5
+ import stdin_default$2 from './override-element-plus.js';
6
+ import stdin_default$1 from '../../locale/lang/en.js';
7
+ import { localeContextKey, outsideLocale } from '../../hooks/useLocale.js';
6
8
 
7
9
  var stdin_default = /* @__PURE__ */defineComponent({
8
10
  ...{
@@ -21,6 +23,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
21
23
  table: {
22
24
  type: Object,
23
25
  required: false
26
+ },
27
+ locale: {
28
+ type: Object,
29
+ required: false
24
30
  }
25
31
  },
26
32
  setup(__props) {
@@ -38,6 +44,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
38
44
  prefixCls: mergedPrefixCls
39
45
  };
40
46
  useConfigProvide(configProvider);
47
+ provide(localeContextKey, computed(() => props.locale));
48
+ watch(() => props.locale, () => {
49
+ outsideLocale.value = props.locale || stdin_default$1;
50
+ });
41
51
  const themeManager = new ThemeManager(mergedTheme);
42
52
  onUnmounted(() => {
43
53
  themeManager.destroy();
@@ -45,7 +55,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
45
55
  useThemeProvide(themeManager);
46
56
  const {
47
57
  hashId
48
- } = stdin_default$1(themeManager);
58
+ } = stdin_default$2(themeManager);
49
59
  onMounted(() => {
50
60
  if (!parentContext.theme) {
51
61
  document.documentElement.classList.add(hashId.value);
@@ -61,8 +61,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
61
61
  });
62
62
  const pointStyle = computed(() => {
63
63
  return {
64
- left: `${pointX.value}px`,
65
- top: `${pointY.value}px`,
64
+ insetInlineStart: `${pointX.value}px`,
65
+ insetBlockStart: `${pointY.value}px`,
66
66
  zIndex: zIndex.value
67
67
  };
68
68
  });
@@ -73,8 +73,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
73
73
  });
74
74
  const menuStyle = computed(() => {
75
75
  return {
76
- left: `${x.value}px`,
77
- top: `${y.value}px`,
76
+ insetInlineStart: `${x.value}px`,
77
+ insetBlockStart: `${y.value}px`,
78
78
  zIndex: zIndex.value
79
79
  };
80
80
  });
@@ -83,8 +83,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
83
83
  const zIndex = ref(0);
84
84
  const subStyle = computed(() => {
85
85
  return {
86
- top: `${y.value}px`,
87
- left: `${x.value}px`,
86
+ insetBlockStart: `${y.value}px`,
87
+ insetInlineStart: `${x.value}px`,
88
88
  zIndex: zIndex.value
89
89
  };
90
90
  });
@@ -49,8 +49,8 @@ const getCommonPanelStyle = (token) => {
49
49
  const { componentCls } = token;
50
50
  return {
51
51
  position: "fixed",
52
- left: 0,
53
- top: 0,
52
+ insetInlineStart: 0,
53
+ insetBlockStart: 0,
54
54
  paddingBlock: token.paddingXXS,
55
55
  border: `${token.lineWidth} ${token.lineType} ${token.colorBorderSecondary}`,
56
56
  borderRadius: token.borderRadius,
@@ -1,4 +1,4 @@
1
- import { defineComponent, computed, ref, createBlock, openBlock, unref, withCtx, renderSlot, createElementVNode, normalizeClass, createElementBlock, Fragment, renderList, normalizeStyle, createCommentVNode, createVNode } from 'vue';
1
+ import { defineComponent, computed, ref, createBlock, openBlock, unref, withCtx, renderSlot, createElementVNode, normalizeClass, toDisplayString, createElementBlock, Fragment, renderList, normalizeStyle, createCommentVNode, createVNode } from 'vue';
2
2
  import stdin_default$2 from '../picker/picker.vue.js';
3
3
  import stdin_default$1 from './color-picker.style.js';
4
4
  import { colorNames, colorPalettes } from './color-picker.js';
@@ -7,6 +7,7 @@ import { ElInput } from 'element-plus';
7
7
  import { TinyColor } from '@ctrl/tinycolor';
8
8
  import { useHistoryColor } from './useHistoryColor.js';
9
9
  import { useComponentConfig } from '../../../config-provider/config-provider.js';
10
+ import { useLocale } from '../../../../hooks/useLocale.js';
10
11
 
11
12
  const _hoisted_1 = ["onClick"];
12
13
  const _hoisted_2 = ["onClick"];
@@ -22,14 +23,17 @@ var stdin_default = /* @__PURE__ */defineComponent({
22
23
  setup(__props, {
23
24
  emit: __emit
24
25
  }) {
26
+ const props = __props;
27
+ const emit = __emit;
25
28
  const {
26
29
  prefixCls
27
30
  } = useComponentConfig("editor-color-picker");
28
31
  const {
29
32
  hashId
30
33
  } = stdin_default$1(prefixCls);
31
- const props = __props;
32
- const emit = __emit;
34
+ const {
35
+ t
36
+ } = useLocale();
33
37
  const innerVisible = computed({
34
38
  get() {
35
39
  return props.visible;
@@ -81,8 +85,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
81
85
  }, {
82
86
  content: withCtx(() => [createElementVNode("div", {
83
87
  class: normalizeClass(`${unref(prefixCls)}-title`)
84
- }, "\u9884\u8BBE", 2
85
- /* CLASS */), createElementVNode("div", {
88
+ }, toDisplayString(unref(t)("co.colorPicker.preset")), 3
89
+ /* TEXT, CLASS */), createElementVNode("div", {
86
90
  class: normalizeClass(`${unref(prefixCls)}-preset`)
87
91
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(colorPalettes), (row, i) => {
88
92
  return openBlock(), createElementBlock("div", {
@@ -108,8 +112,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
108
112
  /* KEYED_FRAGMENT */))], 2
109
113
  /* CLASS */), createElementVNode("div", {
110
114
  class: normalizeClass(`${unref(prefixCls)}-title`)
111
- }, "\u6700\u8FD1\u4F7F\u7528", 2
112
- /* CLASS */), createElementVNode("div", {
115
+ }, toDisplayString(unref(t)("co.colorPicker.recents")), 3
116
+ /* TEXT, CLASS */), createElementVNode("div", {
113
117
  class: normalizeClass(`${unref(prefixCls)}-row`)
114
118
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(mapHistoryColors.value, (color, i) => {
115
119
  return openBlock(), createElementBlock("div", {
@@ -130,8 +134,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
130
134
  /* KEYED_FRAGMENT */))], 2
131
135
  /* CLASS */), createElementVNode("div", {
132
136
  class: normalizeClass(`${unref(prefixCls)}-title`)
133
- }, "\u624B\u52A8\u8BBE\u7F6E", 2
134
- /* CLASS */), createElementVNode("div", {
137
+ }, toDisplayString(unref(t)("co.colorPicker.manual")), 3
138
+ /* TEXT, CLASS */), createElementVNode("div", {
135
139
  class: normalizeClass(`${unref(prefixCls)}-manual`)
136
140
  }, [isEyeDropperSupported.value ? (openBlock(), createElementBlock("button", {
137
141
  key: 0,
@@ -146,9 +150,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
146
150
  modelValue: inputColor.value,
147
151
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => inputColor.value = $event),
148
152
  size: "small",
149
- placeholder: "\u8BF7\u8F93\u5165",
153
+ placeholder: unref(t)("co.common.pleaseInput"),
150
154
  class: normalizeClass([`${unref(prefixCls)}-input`])
151
- }, null, 8, ["modelValue", "class"]), createElementVNode("button", {
155
+ }, null, 8, ["modelValue", "placeholder", "class"]), createElementVNode("button", {
152
156
  type: "button",
153
157
  class: normalizeClass([`${unref(prefixCls)}-color`, `${unref(prefixCls)}-btn`]),
154
158
  style: normalizeStyle({
@@ -1,12 +1,12 @@
1
1
  import { ref } from 'vue';
2
2
  import { usePersist } from '../../../../hooks/usePersist.js';
3
3
 
4
- const key = "historyColor";
4
+ const historyColorKey = "Cosey:historyColor";
5
5
  let historyColors = null;
6
6
  function useHistoryColor() {
7
7
  const persist = usePersist();
8
8
  if (!historyColors) {
9
- historyColors = ref(persist.get(key) || []);
9
+ historyColors = ref(persist.get(historyColorKey) || []);
10
10
  }
11
11
  const pushHistory = (color) => {
12
12
  const hist = historyColors.value;
@@ -14,7 +14,7 @@ function useHistoryColor() {
14
14
  hist.splice(hist.indexOf(color), 1);
15
15
  }
16
16
  hist.unshift(color);
17
- persist.set(key, historyColors.value);
17
+ persist.set(historyColorKey, historyColors.value);
18
18
  };
19
19
  return {
20
20
  historyColors,
@@ -14,7 +14,7 @@ const getAlign = (el) => {
14
14
  if (style.float === "right") {
15
15
  return "right";
16
16
  }
17
- if (style.marginLeft === "auto" && style.marginRight === "auto" && style.display === "block") {
17
+ if (style.marginInlineStart === "auto" && style.marginInlineEnd === "auto" && style.display === "block") {
18
18
  return "center";
19
19
  }
20
20
  return null;
@@ -53,32 +53,32 @@ const setAlignStyle = (el, align) => {
53
53
  style = {
54
54
  display: "",
55
55
  float: "",
56
- marginLeft: "",
57
- marginRight: ""
56
+ marginInlineStart: "",
57
+ marginInlineEnd: ""
58
58
  };
59
59
  break;
60
60
  case "left":
61
61
  style = {
62
62
  display: "",
63
63
  float: "left",
64
- marginLeft: "",
65
- marginRight: ""
64
+ marginInlineStart: "",
65
+ marginInlineEnd: ""
66
66
  };
67
67
  break;
68
68
  case "center":
69
69
  style = {
70
70
  display: "block",
71
71
  float: "",
72
- marginLeft: "auto",
73
- marginRight: "auto"
72
+ marginInlineStart: "auto",
73
+ marginInlineEnd: "auto"
74
74
  };
75
75
  break;
76
76
  case "right":
77
77
  style = {
78
78
  display: "",
79
79
  float: "right",
80
- marginLeft: "",
81
- marginRight: ""
80
+ marginInlineStart: "",
81
+ marginInlineEnd: ""
82
82
  };
83
83
  break;
84
84
  }
@@ -5,8 +5,8 @@ var stdin_default = getSimpleStyleHook("EditorResize", (token) => {
5
5
  return {
6
6
  [componentCls]: {
7
7
  position: "absolute",
8
- top: 0,
9
- left: 0,
8
+ insetBlockStart: 0,
9
+ insetInlineStart: 0,
10
10
  display: "none",
11
11
  outline: `3px solid ${token.colorPrimaryBorder}`,
12
12
  "&.is-show": {
@@ -19,33 +19,33 @@ var stdin_default = getSimpleStyleHook("EditorResize", (token) => {
19
19
  backgroundColor: token.colorPrimary,
20
20
  "&-nw": {
21
21
  cursor: "nw-resize",
22
- top: 0,
23
- left: 0,
22
+ insetBlockStart: 0,
23
+ insetInlineStart: 0,
24
24
  transform: "translate(-50%, -50%)"
25
25
  },
26
26
  "&-ne": {
27
27
  cursor: "ne-resize",
28
- top: 0,
29
- right: 0,
28
+ insetBlockStart: 0,
29
+ insetInlineEnd: 0,
30
30
  transform: "translate(50%, -50%)"
31
31
  },
32
32
  "&-sw": {
33
33
  cursor: "sw-resize",
34
- bottom: 0,
35
- left: 0,
34
+ insetBlockEnd: 0,
35
+ insetInlineStart: 0,
36
36
  transform: "translate(-50%, 50%)"
37
37
  },
38
38
  "&-se": {
39
39
  cursor: "se-resize",
40
- bottom: 0,
41
- right: 0,
40
+ insetBlockEnd: 0,
41
+ insetInlineEnd: 0,
42
42
  transform: "translate(50%, 50%)"
43
43
  }
44
44
  },
45
45
  [`${componentCls}-align`]: {
46
46
  position: "absolute",
47
- bottom: "100%",
48
- left: "50%",
47
+ insetBlockEnd: "100%",
48
+ insetInlineStart: "50%",
49
49
  display: "flex",
50
50
  columnGap: token.padding,
51
51
  paddingInline: token.paddingXS,
@@ -58,8 +58,8 @@ var stdin_default = getSimpleStyleHook("EditorResize", (token) => {
58
58
  },
59
59
  [`${componentCls}-size`]: {
60
60
  position: "absolute",
61
- right: token.sizeXXS,
62
- bottom: token.sizeXXS,
61
+ insetInlineEnd: token.sizeXXS,
62
+ insetBlockEnd: token.sizeXXS,
63
63
  paddingInline: token.paddingXXS,
64
64
  fontSize: token.fontSizeSM,
65
65
  lineHeight: token.lineHeight,
@@ -68,12 +68,12 @@ var stdin_default = getSimpleStyleHook("EditorResize", (token) => {
68
68
  borderRadius: token.borderRadiusXS,
69
69
  backgroundColor: token.colorBgElevated,
70
70
  "&.is-outside": {
71
- left: "100%",
72
- right: "auto",
73
- top: "100%",
74
- bottom: "auto",
75
- marginLeft: token.sizeXS,
76
- marginTop: token.sizeXS
71
+ insetInlineStart: "100%",
72
+ insetInlineEnd: "auto",
73
+ insetBlockStart: "100%",
74
+ insetBlockEnd: "auto",
75
+ marginInlineStart: token.sizeXS,
76
+ marginBlockStart: token.sizeXS
77
77
  }
78
78
  }
79
79
  }
@@ -40,8 +40,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
40
40
  const width = ~~rect.width;
41
41
  const height = ~~rect.height;
42
42
  overlayStyle.value = {
43
- left: ~~(rect.x - parentRect.x) + "px",
44
- top: ~~(rect.y - parentRect.y) + "px",
43
+ insetInlineStart: ~~(rect.x - parentRect.x) + "px",
44
+ insetBlockStart: ~~(rect.y - parentRect.y) + "px",
45
45
  width: width + "px",
46
46
  height: height + "px"
47
47
  };
@@ -5,8 +5,8 @@ var stdin_default = getSimpleStyleHook("EditorTableToolbar", (token) => {
5
5
  return {
6
6
  [componentCls]: {
7
7
  position: "absolute",
8
- top: 0,
9
- left: 0,
8
+ insetBlockStart: 0,
9
+ insetInlineStart: 0,
10
10
  display: "flex",
11
11
  columnGap: token.padding,
12
12
  paddingInline: token.paddingXS,
@@ -38,8 +38,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
38
38
  const floatingStyle = computed(() => {
39
39
  return {
40
40
  display: floating.value ? "flex" : "none",
41
- top: y.value + "px",
42
- left: x.value + "px"
41
+ insetBlockStart: y.value + "px",
42
+ insetInlineStart: x.value + "px"
43
43
  };
44
44
  });
45
45
  const {
@@ -3,10 +3,14 @@ import stdin_default$1 from '../../select.vue.js';
3
3
  import { Toolbar } from '../toolbar.js';
4
4
  import { toolbarContextKey } from '../toolbarContext.js';
5
5
  import { fonts } from '../../../formats/font.js';
6
+ import { useLocale } from '../../../../../hooks/useLocale.js';
6
7
 
7
8
  var stdin_default = /* @__PURE__ */defineComponent({
8
9
  __name: "font",
9
10
  setup(__props) {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  const {
11
15
  toolbar
12
16
  } = inject(toolbarContextKey);
@@ -21,7 +25,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
21
25
  };
22
26
  });
23
27
  return [{
24
- label: "\u9ED8\u8BA4\u5B57\u4F53",
28
+ label: t("co.editor.defaultFont"),
25
29
  value: false
26
30
  }, ...sizeList];
27
31
  });
@@ -3,10 +3,14 @@ import stdin_default$1 from '../../select.vue.js';
3
3
  import { useToken } from '../../../../theme/util/useToken.js';
4
4
  import { Toolbar } from '../toolbar.js';
5
5
  import { toolbarContextKey } from '../toolbarContext.js';
6
+ import { useLocale } from '../../../../../hooks/useLocale.js';
6
7
 
7
8
  var stdin_default = /* @__PURE__ */defineComponent({
8
9
  __name: "header",
9
10
  setup(__props) {
11
+ const {
12
+ t
13
+ } = useLocale();
10
14
  const {
11
15
  token
12
16
  } = useToken();
@@ -17,7 +21,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
17
21
  const list = computed(() => {
18
22
  const headingList = headings.map(heading => {
19
23
  return {
20
- label: `\u6807\u9898 ${heading}`,
24
+ label: `${t("co.editor.leading")} ${heading}`,
21
25
  value: heading,
22
26
  style: {
23
27
  fontSize: token.value[`fontSizeHeading${heading}`] + "px",
@@ -27,7 +31,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
27
31
  };
28
32
  });
29
33
  return [{
30
- label: "\u6B63\u6587",
34
+ label: t("co.editor.mainBody"),
31
35
  value: false,
32
36
  style: {
33
37
  lineHeight: token.value["lineHeight"],
@@ -8,10 +8,14 @@ import { Form as _Form, FormItem as _FormItem } from '../../../../form/index.js'
8
8
  import { ContextMenu as _ContextMenu, ContextMenuItem as _ContextMenuItem } from '../../../../context-menu/index.js';
9
9
  import Quill, { Range } from 'quill';
10
10
  import { Link } from '../../../formats/link.js';
11
+ import { useLocale } from '../../../../../hooks/useLocale.js';
11
12
 
12
13
  var stdin_default = /* @__PURE__ */defineComponent({
13
14
  __name: "link",
14
15
  setup(__props) {
16
+ const {
17
+ t
18
+ } = useLocale();
15
19
  const {
16
20
  quill,
17
21
  toolbar
@@ -43,7 +47,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
43
47
  const contextMenuRef = useTemplateRef("contextMenu");
44
48
  const visible = ref(false);
45
49
  const actionType = ref("insert");
46
- const title = computed(() => `${actionType.value === "update" ? "\u7F16\u8F91" : "\u63D2\u5165"}\u94FE\u63A5`);
50
+ const title = computed(() => `${actionType.value === "update" ? t("co.editor.edit") : t("co.editor.insert")}${t("co.editor.link")}`);
47
51
  const formModel = reactive({
48
52
  url: "",
49
53
  text: "",
@@ -51,10 +55,10 @@ var stdin_default = /* @__PURE__ */defineComponent({
51
55
  target: ""
52
56
  });
53
57
  const targetOptions = [{
54
- label: "\u5F53\u524D\u7A97\u53E3",
58
+ label: t("co.editor.currentWindow"),
55
59
  value: "_self"
56
60
  }, {
57
- label: "\u65B0\u7A97\u53E3",
61
+ label: t("co.editor.newWindow"),
58
62
  value: "_blank"
59
63
  }];
60
64
  const getSelectedInfo = () => {
@@ -159,24 +163,24 @@ var stdin_default = /* @__PURE__ */defineComponent({
159
163
  modelValue: formModel.text,
160
164
  "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => formModel.text = $event),
161
165
  prop: "text",
162
- label: "\u5C55\u793A\u7684\u6587\u672C",
166
+ label: unref(t)("co.editor.displayedText"),
163
167
  "field-type": "input"
164
- }, null, 8, ["modelValue"]), createVNode(unref(_FormItem), {
168
+ }, null, 8, ["modelValue", "label"]), createVNode(unref(_FormItem), {
165
169
  modelValue: formModel.title,
166
170
  "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => formModel.title = $event),
167
171
  prop: "title",
168
- label: "\u6807\u9898",
172
+ label: unref(t)("co.editor.leading"),
169
173
  "field-type": "input"
170
- }, null, 8, ["modelValue"]), createVNode(unref(_FormItem), {
174
+ }, null, 8, ["modelValue", "label"]), createVNode(unref(_FormItem), {
171
175
  modelValue: formModel.target,
172
176
  "onUpdate:modelValue": _cache[3] || (_cache[3] = $event => formModel.target = $event),
173
177
  prop: "target",
174
- label: "\u6253\u5F00\u94FE\u63A5\u5728",
178
+ label: unref(t)("co.editor.openLinkAt"),
175
179
  "field-type": "select",
176
180
  "field-props": {
177
181
  options: targetOptions
178
182
  }
179
- }, null, 8, ["modelValue", "field-props"])]),
183
+ }, null, 8, ["modelValue", "label", "field-props"])]),
180
184
  _: 1
181
185
  /* STABLE */
182
186
  }, 8, ["model"])]),
@@ -194,13 +198,13 @@ var stdin_default = /* @__PURE__ */defineComponent({
194
198
  key: 0
195
199
  }, [createVNode(unref(_ContextMenuItem), {
196
200
  icon: "co:unlink",
197
- title: "\u5220\u9664\u94FE\u63A5",
201
+ title: unref(t)("co.editor.removeLink"),
198
202
  command: "remove"
199
- }), createVNode(unref(_ContextMenuItem), {
203
+ }, null, 8, ["title"]), createVNode(unref(_ContextMenuItem), {
200
204
  icon: "co:launch",
201
- title: "\u6253\u5F00\u94FE\u63A5",
205
+ title: unref(t)("co.editor.openLink"),
202
206
  command: "open"
203
- })], 64
207
+ }, null, 8, ["title"])], 64
204
208
  /* STABLE_FRAGMENT */)) : createCommentVNode("v-if", true)]),
205
209
  _: 1
206
210
  /* STABLE */
@@ -2,10 +2,14 @@ import { defineComponent, inject, computed, ref, watch, createBlock, openBlock }
2
2
  import stdin_default$1 from '../../select.vue.js';
3
3
  import { Toolbar } from '../toolbar.js';
4
4
  import { toolbarContextKey } from '../toolbarContext.js';
5
+ import { useLocale } from '../../../../../hooks/useLocale.js';
5
6
 
6
7
  var stdin_default = /* @__PURE__ */defineComponent({
7
8
  __name: "size",
8
9
  setup(__props) {
10
+ const {
11
+ t
12
+ } = useLocale();
9
13
  const {
10
14
  toolbar
11
15
  } = inject(toolbarContextKey);
@@ -18,7 +22,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
18
22
  };
19
23
  });
20
24
  return [{
21
- label: "\u9ED8\u8BA4\u5B57\u53F7",
25
+ label: t("co.editor.defaultFontSize"),
22
26
  value: false
23
27
  }, ...sizeList];
24
28
  });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;