go-view-worker 0.0.1

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 (198) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +221 -0
  3. package/dist/chunks/403-382550a8.js +42 -0
  4. package/dist/chunks/404-3d357d75.js +42 -0
  5. package/dist/chunks/500-96d14fb0.js +43 -0
  6. package/dist/chunks/StylesSetting-952ff564.js +338 -0
  7. package/dist/chunks/chartEditStore-a725b558.js +4975 -0
  8. package/dist/chunks/designStore-fe92c2ba.js +6268 -0
  9. package/dist/chunks/index-00b6339d.js +588 -0
  10. package/dist/chunks/index-0472b3a5.js +173 -0
  11. package/dist/chunks/index-097ae4b0.js +436 -0
  12. package/dist/chunks/index-09e62bb4.js +284 -0
  13. package/dist/chunks/index-1cb69ab6.js +136 -0
  14. package/dist/chunks/index-32d13283.js +26 -0
  15. package/dist/chunks/index-3fd591ea.js +81 -0
  16. package/dist/chunks/index-51458edb.js +143 -0
  17. package/dist/chunks/index-54f304ef.js +89 -0
  18. package/dist/chunks/index-62a7855c.js +51 -0
  19. package/dist/chunks/index-82d00e13.js +300 -0
  20. package/dist/chunks/index-9502bd7e.js +155 -0
  21. package/dist/chunks/index-95c5f0a0.js +1664 -0
  22. package/dist/chunks/index-a410a1d3.js +250 -0
  23. package/dist/chunks/index-da8ddb02.js +13 -0
  24. package/dist/chunks/index-de0a1234.js +482 -0
  25. package/dist/chunks/index-e31a7881.js +32 -0
  26. package/dist/chunks/index-f266153a.js +1985 -0
  27. package/dist/chunks/index-f97e5ffc.js +13 -0
  28. package/dist/chunks/index-fdf7dc1e.js +88 -0
  29. package/dist/chunks/index-fec9f9f8.js +368 -0
  30. package/dist/chunks/index.vue_vue_type_script_setup_true_lang-c6159a17.js +3357 -0
  31. package/dist/chunks/lodash-c80b695e.js +3680 -0
  32. package/dist/chunks/router-106a6abc.js +57 -0
  33. package/dist/chunks/useKeyboard.hook-da88451a.js +341 -0
  34. package/dist/chunks/useSyncUpdate.hook-5517a8ad.js +40 -0
  35. package/dist/chunks/useTargetData.hook-28a7e43b.js +12 -0
  36. package/dist/chunks/wrapper-4c15ca94.js +28 -0
  37. package/dist/favicon.ico +0 -0
  38. package/dist/go-view-worker.js +23 -0
  39. package/dist/init.js +688 -0
  40. package/dist/style.css +7 -0
  41. package/dist/types/packages/index.d.ts +12 -0
  42. package/dist/types/packages/init.d.ts +6 -0
  43. package/dist/types/packages/utils/resize.d.ts +1 -0
  44. package/dist/types/src/components/GoAppProvider/index.d.ts +3 -0
  45. package/dist/types/src/components/GoIconify/index.d.ts +3 -0
  46. package/dist/types/src/components/GoLoading/index.d.ts +5 -0
  47. package/dist/types/src/components/GoReload/index.d.ts +3 -0
  48. package/dist/types/src/components/GoSkeleton/index.d.ts +3 -0
  49. package/dist/types/src/components/GoSystemInfo/index.d.ts +3 -0
  50. package/dist/types/src/components/GoSystemSet/index.d.ts +3 -0
  51. package/dist/types/src/components/GoThemeSelect/index.d.ts +3 -0
  52. package/dist/types/src/components/GoUserInfo/index.d.ts +3 -0
  53. package/dist/types/src/components/Pages/ChartGlobImage/index.d.ts +3 -0
  54. package/dist/types/src/components/Pages/ChartItemSetting/index.d.ts +11 -0
  55. package/dist/types/src/components/Pages/Flipper/index.d.ts +4 -0
  56. package/dist/types/src/components/Pages/ThemeColorSelect/index.d.ts +3 -0
  57. package/dist/types/src/components/Pages/VChartItemSetting/index.d.ts +8 -0
  58. package/dist/types/src/components/Plugins/DialogContent/index.d.ts +3 -0
  59. package/dist/types/src/components/Plugins/LoadingContent/index.d.ts +3 -0
  60. package/dist/types/src/components/Plugins/MessageContent/index.d.ts +3 -0
  61. package/dist/types/src/components/Tips/MacOsControlBtn/index.d.ts +3 -0
  62. package/dist/types/src/directives/index.d.ts +2 -0
  63. package/dist/types/src/enums/editPageEnum.d.ts +55 -0
  64. package/dist/types/src/enums/eventEnum.d.ts +32 -0
  65. package/dist/types/src/enums/fileTypeEnum.d.ts +7 -0
  66. package/dist/types/src/enums/httpEnum.d.ts +96 -0
  67. package/dist/types/src/enums/pageEnum.d.ts +34 -0
  68. package/dist/types/src/enums/pluginEnum.d.ts +6 -0
  69. package/dist/types/src/enums/storageEnum.d.ts +10 -0
  70. package/dist/types/src/enums/styleEnum.d.ts +14 -0
  71. package/dist/types/src/hooks/index.d.ts +6 -0
  72. package/dist/types/src/hooks/useCanvasInitOptions.hook.d.ts +8 -0
  73. package/dist/types/src/hooks/useChartDataPondFetch.hook.d.ts +8 -0
  74. package/dist/types/src/hooks/useChartInteract.hook.d.ts +9 -0
  75. package/dist/types/src/hooks/useLang.hook.d.ts +126 -0
  76. package/dist/types/src/hooks/useLifeHandler.hook.d.ts +10 -0
  77. package/dist/types/src/hooks/usePreviewScale.hook.d.ts +32 -0
  78. package/dist/types/src/hooks/useTheme.hook.d.ts +7 -0
  79. package/dist/types/src/layout/components/LayoutFooter/index.d.ts +3 -0
  80. package/dist/types/src/layout/components/LayoutHeader/index.d.ts +3 -0
  81. package/dist/types/src/layout/components/LayoutHeaderPro/index.d.ts +3 -0
  82. package/dist/types/src/layout/components/LayoutMain/index.d.ts +3 -0
  83. package/dist/types/src/layout/components/LayoutTransitionMain/index.d.ts +3 -0
  84. package/dist/types/src/main.d.ts +1 -0
  85. package/dist/types/src/packages/chartConfiguration/echarts/axis.d.ts +24 -0
  86. package/dist/types/src/packages/chartConfiguration/echarts/index.d.ts +4 -0
  87. package/dist/types/src/packages/chartConfiguration/echarts/label.d.ts +10 -0
  88. package/dist/types/src/packages/chartConfiguration/echarts/legend.d.ts +18 -0
  89. package/dist/types/src/packages/chartConfiguration/echarts/line.d.ts +8 -0
  90. package/dist/types/src/packages/chartConfiguration/vcharts/index.d.ts +3 -0
  91. package/dist/types/src/packages/chartConfiguration/vcharts/label.d.ts +14 -0
  92. package/dist/types/src/packages/chartConfiguration/vcharts/legends.d.ts +27 -0
  93. package/dist/types/src/packages/chartConfiguration/vcharts/style.d.ts +18 -0
  94. package/dist/types/src/packages/components/Charts/Bars/BarCommon/config.d.ts +63 -0
  95. package/dist/types/src/packages/components/Charts/Bars/BarCommon/index.d.ts +3 -0
  96. package/dist/types/src/packages/components/Charts/Bars/index.d.ts +2 -0
  97. package/dist/types/src/packages/components/Charts/index.d.ts +8 -0
  98. package/dist/types/src/packages/components/Photos/Private/index.d.ts +17 -0
  99. package/dist/types/src/packages/components/Photos/Share/index.d.ts +14 -0
  100. package/dist/types/src/packages/components/Photos/index.d.ts +9 -0
  101. package/dist/types/src/packages/index.d.ts +214 -0
  102. package/dist/types/src/packages/public/index.d.ts +2 -0
  103. package/dist/types/src/packages/public/publicConfig.d.ts +81 -0
  104. package/dist/types/src/packages/public/vChart.d.ts +14 -0
  105. package/dist/types/src/plugins/customComponents.d.ts +7 -0
  106. package/dist/types/src/plugins/directives.d.ts +7 -0
  107. package/dist/types/src/plugins/icon.d.ts +111 -0
  108. package/dist/types/src/plugins/index.d.ts +5 -0
  109. package/dist/types/src/plugins/initFunction.d.ts +4 -0
  110. package/dist/types/src/plugins/naive.d.ts +3 -0
  111. package/dist/types/src/router/base.d.ts +7 -0
  112. package/dist/types/src/router/constant.d.ts +5 -0
  113. package/dist/types/src/router/index.d.ts +6 -0
  114. package/dist/types/src/router/modules/chart.route.d.ts +4 -0
  115. package/dist/types/src/router/modules/index.d.ts +5 -0
  116. package/dist/types/src/router/modules/preview.route.d.ts +4 -0
  117. package/dist/types/src/router/router-guards.d.ts +3 -0
  118. package/dist/types/src/router/types.d.ts +26 -0
  119. package/dist/types/src/settings/animations/index.d.ts +7 -0
  120. package/dist/types/src/settings/chartThemes/index.d.ts +195 -0
  121. package/dist/types/src/settings/designSetting.d.ts +33 -0
  122. package/dist/types/src/settings/pathConst.d.ts +3 -0
  123. package/dist/types/src/settings/systemSetting.d.ts +11 -0
  124. package/dist/types/src/settings/vchartThemes/index.d.ts +139 -0
  125. package/dist/types/src/store/index.d.ts +5 -0
  126. package/dist/types/src/store/modules/chartEditStore/chartEditStore.d.ts +215 -0
  127. package/dist/types/src/store/modules/chartHistoryStore/chartHistoryDefine.d.ts +20 -0
  128. package/dist/types/src/store/modules/chartHistoryStore/chartHistoryStore.d.ts +79 -0
  129. package/dist/types/src/store/modules/chartLayoutStore/chartLayoutStore.d.ts +36 -0
  130. package/dist/types/src/store/modules/designStore/designStore.d.ts +20 -0
  131. package/dist/types/src/store/modules/globalConfigStore/globalConfigStore.d.ts +183 -0
  132. package/dist/types/src/store/modules/langStore/langStore.d.ts +6 -0
  133. package/dist/types/src/store/modules/packagesStore/packagesStore.d.ts +10 -0
  134. package/dist/types/src/store/modules/settingStore/settingStore.d.ts +31 -0
  135. package/dist/types/src/utils/components.d.ts +13 -0
  136. package/dist/types/src/utils/file.d.ts +19 -0
  137. package/dist/types/src/utils/index.d.ts +8 -0
  138. package/dist/types/src/utils/plugin.d.ts +30 -0
  139. package/dist/types/src/utils/router.d.ts +77 -0
  140. package/dist/types/src/utils/storage.d.ts +35 -0
  141. package/dist/types/src/utils/style.d.ts +154 -0
  142. package/dist/types/src/utils/type.d.ts +8 -0
  143. package/dist/types/src/utils/utils.d.ts +128 -0
  144. package/dist/types/src/views/chart/ContentBox/index.d.ts +3 -0
  145. package/dist/types/src/views/chart/ContentCharts/components/ChartsItemBox/index.d.ts +3 -0
  146. package/dist/types/src/views/chart/ContentCharts/components/ChartsOptionContent/index.d.ts +3 -0
  147. package/dist/types/src/views/chart/ContentCharts/components/ChartsSearch/index.d.ts +3 -0
  148. package/dist/types/src/views/chart/ContentCharts/hooks/useAside.hook.d.ts +11 -0
  149. package/dist/types/src/views/chart/ContentCharts/hooks/useLayout.hook.d.ts +10 -0
  150. package/dist/types/src/views/chart/ContentCharts/index.d.ts +3 -0
  151. package/dist/types/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRender/index.d.ts +3 -0
  152. package/dist/types/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/barOptions.d.ts +2 -0
  153. package/dist/types/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/index.d.ts +3 -0
  154. package/dist/types/src/views/chart/ContentConfigurations/components/CanvasPage/components/CreateColorRenderChart/lineOptions.d.ts +2 -0
  155. package/dist/types/src/views/chart/ContentConfigurations/components/CanvasPage/index.d.ts +3 -0
  156. package/dist/types/src/views/chart/ContentConfigurations/components/hooks/useTargetData.hook.d.ts +57 -0
  157. package/dist/types/src/views/chart/ContentConfigurations/index.d.ts +3 -0
  158. package/dist/types/src/views/chart/ContentEdit/components/EditAlignLine/index.d.ts +3 -0
  159. package/dist/types/src/views/chart/ContentEdit/components/EditBottom/index.d.ts +3 -0
  160. package/dist/types/src/views/chart/ContentEdit/components/EditGroup/index.d.ts +3 -0
  161. package/dist/types/src/views/chart/ContentEdit/components/EditHistory/index.d.ts +3 -0
  162. package/dist/types/src/views/chart/ContentEdit/components/EditRange/index.d.ts +3 -0
  163. package/dist/types/src/views/chart/ContentEdit/components/EditRule/index.d.ts +3 -0
  164. package/dist/types/src/views/chart/ContentEdit/components/EditSelect/index.d.ts +3 -0
  165. package/dist/types/src/views/chart/ContentEdit/components/EditShapeBox/index.d.ts +3 -0
  166. package/dist/types/src/views/chart/ContentEdit/components/EditShortcutKey/index.d.ts +3 -0
  167. package/dist/types/src/views/chart/ContentEdit/components/EditTools/hooks/useFile.hooks.d.ts +9 -0
  168. package/dist/types/src/views/chart/ContentEdit/components/EditTools/hooks/useSyncUpdate.hook.d.ts +3 -0
  169. package/dist/types/src/views/chart/ContentEdit/components/EditTools/index.d.ts +3 -0
  170. package/dist/types/src/views/chart/ContentEdit/components/EditTools/utils/index.d.ts +1 -0
  171. package/dist/types/src/views/chart/ContentEdit/components/EditWatermark/index.d.ts +3 -0
  172. package/dist/types/src/views/chart/ContentEdit/hooks/useDrag.hook.d.ts +13 -0
  173. package/dist/types/src/views/chart/ContentEdit/hooks/useLayout.hook.d.ts +1 -0
  174. package/dist/types/src/views/chart/ContentEdit/hooks/useStyle.hook.d.ts +17 -0
  175. package/dist/types/src/views/chart/ContentEdit/index.d.ts +3 -0
  176. package/dist/types/src/views/chart/ContentHeader/headerLeftBtn/index.d.ts +3 -0
  177. package/dist/types/src/views/chart/ContentHeader/headerRightBtn/index.d.ts +3 -0
  178. package/dist/types/src/views/chart/ContentHeader/headerTitle/index.d.ts +3 -0
  179. package/dist/types/src/views/chart/ContentLayers/components/LayersGroupListItem/index.d.ts +3 -0
  180. package/dist/types/src/views/chart/ContentLayers/components/LayersListItem/index.d.ts +3 -0
  181. package/dist/types/src/views/chart/ContentLayers/components/LayersStatus/index.d.ts +3 -0
  182. package/dist/types/src/views/chart/ContentLayers/enums.d.ts +0 -0
  183. package/dist/types/src/views/chart/ContentLayers/index.d.ts +3 -0
  184. package/dist/types/src/views/chart/ContentLoad/index.d.ts +3 -0
  185. package/dist/types/src/views/chart/hooks/useContextMenu.hook.d.ts +12 -0
  186. package/dist/types/src/views/chart/hooks/useKeyboard.hook.d.ts +38 -0
  187. package/dist/types/src/views/chart/hooks/useSync.hook.d.ts +5 -0
  188. package/dist/types/src/views/preview/components/PreviewRenderGroup/index.d.ts +3 -0
  189. package/dist/types/src/views/preview/components/PreviewRenderList/index.d.ts +3 -0
  190. package/dist/types/src/views/preview/hooks/useComInstall.hook.d.ts +5 -0
  191. package/dist/types/src/views/preview/hooks/useScale.hook.d.ts +17 -0
  192. package/dist/types/src/views/preview/hooks/useStore.hook.d.ts +3 -0
  193. package/dist/types/src/views/preview/utils/drag.d.ts +1 -0
  194. package/dist/types/src/views/preview/utils/index.d.ts +4 -0
  195. package/dist/types/src/views/preview/utils/keyboard.d.ts +1 -0
  196. package/dist/types/src/views/preview/utils/storage.d.ts +6 -0
  197. package/dist/types/src/views/preview/utils/style.d.ts +26 -0
  198. package/package.json +99 -0
package/dist/init.js ADDED
@@ -0,0 +1,688 @@
1
+ import { create as Z, NA as j, NP as $, NH1 as J, NH2 as _, NH3 as ee, NH4 as te, NH5 as oe, NCode as re, NCountdown as ae, NText as le, NTime as ne, NEllipsis as se, NMessageProvider as ie, NDialogProvider as ce, NConfigProvider as ue, NGradientText as de, NInput as Ne, NButton as me, NButtonGroup as he, NForm as pe, NFormItem as ve, NCheckboxGroup as fe, NCheckbox as ge, NIcon as we, NImage as be, NLayout as Ae, NLayoutHeader as Ce, NLayoutContent as ye, NLayoutFooter as Se, NLayoutSider as ke, NMenu as Re, NBreadcrumb as Be, NBreadcrumbItem as Le, NDropdown as Xe, NSpace as xe, NTooltip as Ee, NAvatar as Ie, NTabs as Ye, NTab as Te, NTabPane as De, NCard as Ue, NRow as Oe, NCol as Pe, NDrawer as Ge, NDrawerContent as Fe, NDivider as Qe, NSwitch as He, NBadge as Me, NAlert as Ve, NElement as Ke, NTag as ze, NNotificationProvider as qe, NNumberAnimation as We, NProgress as Ze, NDatePicker as je, NGrid as $e, NGi as Je, NGridItem as _e, NList as et, NListItem as tt, NThing as ot, NDataTable as rt, NPopover as at, NPagination as lt, NSlider as nt, NSelect as st, NRadioGroup as it, NRadio as ct, NSteps as ut, NStep as dt, NInputGroup as Nt, NInputGroupLabel as mt, NResult as ht, NDescriptions as pt, NDescriptionsItem as vt, NTable as ft, NInputNumber as gt, NLoadingBarProvider as wt, NModal as bt, NUpload as At, NUploadFileList as Ct, NUploadTrigger as yt, NUploadDragger as St, NTree as kt, NSpin as Rt, NTimeline as Bt, NTimelineItem as Lt, NTimePicker as Xt, NBackTop as xt, NSkeleton as Et, NStatistic as It, NCarousel as Yt, NScrollbar as Tt, NPopselect as Dt, NCollapse as Ut, NCollapseItem as Ot, NColorPicker as Pt, NWatermark as Gt, NEmpty as Ft, NCollapseTransition as Qt } from "naive-ui";
2
+ import { defineComponent as E, resolveComponent as Y, withDirectives as g, openBlock as b, createElementBlock as k, createElementVNode as h, createVNode as p, mergeProps as S, vShow as w, ref as R, onMounted as K, computed as f, reactive as Ht, watch as D, normalizeStyle as x, toDisplayString as z, normalizeClass as Mt, Fragment as Vt, renderList as Kt, createBlock as zt } from "vue";
3
+ import { y as qt, z as Wt, A as Zt, B as jt } from "./chunks/designStore-fe92c2ba.js";
4
+ import "vue-router";
5
+ import "pinia";
6
+ function $t(e) {
7
+ const t = Z({
8
+ components: [
9
+ j,
10
+ $,
11
+ J,
12
+ _,
13
+ ee,
14
+ te,
15
+ oe,
16
+ re,
17
+ ae,
18
+ le,
19
+ ne,
20
+ se,
21
+ ie,
22
+ ce,
23
+ ue,
24
+ de,
25
+ Ne,
26
+ me,
27
+ he,
28
+ pe,
29
+ ve,
30
+ fe,
31
+ ge,
32
+ we,
33
+ be,
34
+ Ae,
35
+ Ce,
36
+ ye,
37
+ Se,
38
+ ke,
39
+ Re,
40
+ Be,
41
+ Le,
42
+ Xe,
43
+ xe,
44
+ Ee,
45
+ Ie,
46
+ Ye,
47
+ Te,
48
+ De,
49
+ Ue,
50
+ Oe,
51
+ Pe,
52
+ Ge,
53
+ Fe,
54
+ Qe,
55
+ He,
56
+ Me,
57
+ Ve,
58
+ Ke,
59
+ ze,
60
+ qe,
61
+ We,
62
+ Ze,
63
+ je,
64
+ $e,
65
+ Je,
66
+ _e,
67
+ et,
68
+ tt,
69
+ ot,
70
+ rt,
71
+ at,
72
+ lt,
73
+ nt,
74
+ st,
75
+ it,
76
+ ct,
77
+ ut,
78
+ dt,
79
+ Nt,
80
+ mt,
81
+ ht,
82
+ pt,
83
+ vt,
84
+ ft,
85
+ gt,
86
+ wt,
87
+ bt,
88
+ At,
89
+ Ct,
90
+ yt,
91
+ St,
92
+ kt,
93
+ Rt,
94
+ Bt,
95
+ Lt,
96
+ Xt,
97
+ xt,
98
+ Et,
99
+ It,
100
+ Yt,
101
+ Tt,
102
+ Dt,
103
+ Ut,
104
+ Ot,
105
+ Pt,
106
+ Gt,
107
+ Ft,
108
+ Qt
109
+ ]
110
+ });
111
+ e.use(t);
112
+ }
113
+ function Jt(e) {
114
+ e.use(qt, {
115
+ error: Wt()
116
+ });
117
+ }
118
+ const _t = { class: "go-skeleton" }, eo = /* @__PURE__ */ E({
119
+ __name: "index",
120
+ props: {
121
+ repeat: {
122
+ type: Number,
123
+ default: 1
124
+ },
125
+ load: {
126
+ type: Boolean,
127
+ default: !0
128
+ }
129
+ },
130
+ setup(e) {
131
+ return (t, l) => {
132
+ const n = Y("n-skeleton");
133
+ return g((b(), k("div", _t, [
134
+ g(h("div", null, [
135
+ p(n, S({ class: "item" }, t.$attrs), null, 16)
136
+ ], 512), [
137
+ [w, e.repeat == 1]
138
+ ]),
139
+ g(h("div", null, [
140
+ p(n, S({ class: "item" }, t.$attrs), null, 16),
141
+ p(n, S({ class: "item" }, t.$attrs, { style: { width: "60%" } }), null, 16)
142
+ ], 512), [
143
+ [w, e.repeat == 2]
144
+ ]),
145
+ g(h("div", null, [
146
+ p(n, S({ class: "item" }, t.$attrs, {
147
+ repeat: e.repeat - 2
148
+ }), null, 16, ["repeat"]),
149
+ p(n, S({ class: "item" }, t.$attrs, { style: { width: "60%" } }), null, 16),
150
+ p(n, S({ class: "item" }, t.$attrs, { style: { width: "50%" } }), null, 16)
151
+ ], 512), [
152
+ [w, e.repeat > 2]
153
+ ])
154
+ ], 512)), [
155
+ [w, e.load]
156
+ ]);
157
+ };
158
+ }
159
+ }), to = /* @__PURE__ */ Zt(eo, [["__scopeId", "data-v-20d57171"]]);
160
+ /*!vue3-sketch-ruler v1.3.152024年2月Mon Feb 19 2024 15:43:31 GMT+0800 (中国标准时间)制作*/
161
+ const oo = E({
162
+ name: "LineRuler",
163
+ props: {
164
+ scale: Number,
165
+ thick: Number,
166
+ palette: Object,
167
+ index: Number,
168
+ start: Number,
169
+ vertical: Boolean,
170
+ value: Number,
171
+ isShowReferLine: Boolean
172
+ },
173
+ emits: ["onMouseDown", "onRelease", "onRemove"],
174
+ setup(e, { emit: t }) {
175
+ const l = R(0), n = R(!0);
176
+ K(() => {
177
+ l.value = e.value;
178
+ });
179
+ const i = (r) => {
180
+ n.value = r >= 0;
181
+ }, c = f(() => {
182
+ const r = (l.value - e.start) * e.scale;
183
+ i(r);
184
+ const o = r + "px";
185
+ return e.vertical ? { top: o } : { left: o };
186
+ }), a = f(() => {
187
+ var r;
188
+ const o = `1px solid ${(r = e.palette) == null ? void 0 : r.lineColor}`, u = e.vertical ? { borderTop: o } : { borderLeft: o };
189
+ return {
190
+ cursor: e.isShowReferLine ? e.vertical ? "ns-resize" : "ew-resize" : "none",
191
+ ...u
192
+ };
193
+ }), s = f(() => e.vertical ? { left: e.thick + "px" } : { top: e.thick + "px" });
194
+ return {
195
+ startValue: l,
196
+ showLine: n,
197
+ offset: c,
198
+ borderCursor: a,
199
+ actionStyle: s,
200
+ handleDown: (r) => {
201
+ const o = e.vertical ? r.clientY : r.clientX, u = l.value;
202
+ t("onMouseDown");
203
+ const N = (A) => {
204
+ const B = e.vertical ? A.clientY : A.clientX, L = Math.round(u + (B - o) / e.scale);
205
+ l.value = L;
206
+ }, d = () => {
207
+ t("onRelease", l.value, e.index), document.removeEventListener("mousemove", N), document.removeEventListener("mouseup", d);
208
+ };
209
+ document.addEventListener("mousemove", N), document.addEventListener("mouseup", d);
210
+ },
211
+ handleRemove: () => {
212
+ t("onRemove", e.index);
213
+ }
214
+ };
215
+ }
216
+ }), T = (e, t) => {
217
+ const l = e.__vccOpts || e;
218
+ for (const [n, i] of t)
219
+ l[n] = i;
220
+ return l;
221
+ }, ro = { class: "value" };
222
+ function ao(e, t, l, n, i, c) {
223
+ return g((b(), k("div", {
224
+ class: "line",
225
+ style: x([e.offset, e.borderCursor]),
226
+ onMousedown: t[1] || (t[1] = (...a) => e.handleDown && e.handleDown(...a))
227
+ }, [
228
+ h("div", {
229
+ class: "action",
230
+ style: x(e.actionStyle)
231
+ }, [
232
+ h("span", {
233
+ class: "del",
234
+ onClick: t[0] || (t[0] = (...a) => e.handleRemove && e.handleRemove(...a))
235
+ }, "×"),
236
+ h("span", ro, z(e.startValue), 1)
237
+ ], 4)
238
+ ], 36)), [
239
+ [w, e.showLine]
240
+ ]);
241
+ }
242
+ const lo = /* @__PURE__ */ T(oo, [["render", ao], ["__scopeId", "data-v-053590ce"]]), no = (e) => e <= 0.25 ? 40 : e <= 0.5 ? 20 : e <= 1 ? 10 : e <= 2 ? 5 : e <= 4 ? 2 : 1, V = 0.83, so = (e, t, l, n, i, c) => {
243
+ const { scale: a, width: s, height: r, ratio: o, palette: u } = i, { bgColor: N, fontColor: d, shadowColor: A, longfgColor: B, shortfgColor: L } = u, U = c ? i.startNumX : i.startNumY, O = c ? i.endNumX : i.endNumY;
244
+ if (e.scale(o, o), e.clearRect(0, 0, s, r), e.fillStyle = N, e.fillRect(0, 0, s, r), n) {
245
+ const v = (l - t) * a, X = n * a;
246
+ e.fillStyle = A, c ? e.fillRect(v, 0, X, r * 3 / 8) : e.fillRect(0, v, s * 3 / 8, X);
247
+ }
248
+ const C = no(a), P = C * a, y = C * 10, G = y * a, F = Math.floor(t / C) * C, Q = Math.floor(t / y) * y, q = (F - t) / C * P, W = (Q - t) / y * G, H = t + Math.ceil((c ? s : r) / a);
249
+ e.beginPath(), e.fillStyle = d, e.strokeStyle = B;
250
+ for (let v = Q, X = 0; v < H; v += y, X++) {
251
+ if (v >= U && v <= O) {
252
+ const m = W + X * G + 0.5;
253
+ c ? e.moveTo(m, 0) : e.moveTo(0, m), e.save(), c ? e.translate(m, r * 0.4) : e.translate(s * 0.4, m), c || e.rotate(-Math.PI / 2), e.scale(V / o, V / o), e.fillText(v.toString(), 4 * o, 7 * o), e.restore(), c ? e.lineTo(m, r * 9 / 16) : e.lineTo(s * 9 / 16, m);
254
+ }
255
+ e.stroke(), e.closePath(), e.beginPath(), e.strokeStyle = L;
256
+ for (let m = F, M = 0; m < H; m += C, M++)
257
+ if (m >= U && m <= O) {
258
+ const I = q + M * P + 0.5;
259
+ c ? e.moveTo(I, 0) : e.moveTo(0, I), m % y !== 0 && (c ? e.lineTo(I, r * 1 / 4) : e.lineTo(s * 1 / 4, I));
260
+ }
261
+ e.stroke(), e.closePath(), e.setTransform(1, 0, 0, 1, 0, 0);
262
+ }
263
+ }, io = E({
264
+ name: "CanvasRuler",
265
+ props: {
266
+ showIndicator: Boolean,
267
+ valueNum: Number,
268
+ scale: Number,
269
+ ratio: Number,
270
+ palette: Object,
271
+ vertical: Boolean,
272
+ start: Number,
273
+ width: Number,
274
+ height: Number,
275
+ selectStart: Number,
276
+ selectLength: Number,
277
+ startNumX: Number,
278
+ endNumX: Number,
279
+ startNumY: Number,
280
+ endNumY: Number
281
+ },
282
+ emits: ["onAddLine", "update:showIndicator", "update:valueNum"],
283
+ setup(e, { emit: t }) {
284
+ const l = Ht({
285
+ canvasContext: null
286
+ });
287
+ let n = 1;
288
+ const i = R(null);
289
+ K(() => {
290
+ n = e.ratio || window.devicePixelRatio || 1, c(), a(n), s(n);
291
+ });
292
+ const c = () => {
293
+ l.canvasContext = i.value && i.value.getContext("2d");
294
+ }, a = (r) => {
295
+ if (i.value) {
296
+ i.value.width = e.width * r, i.value.height = e.height * r;
297
+ const o = l.canvasContext;
298
+ o && (o.font = `${12 * r}px -apple-system,
299
+ "Helvetica Neue", ".SFNSText-Regular",
300
+ "SF UI Text", Arial, "PingFang SC", "Hiragino Sans GB",
301
+ "Microsoft YaHei", "WenQuanYi Zen Hei", sans-serif`, o.lineWidth = 1, o.textBaseline = "middle");
302
+ }
303
+ }, s = (r) => {
304
+ const o = {
305
+ scale: e.scale,
306
+ width: e.width,
307
+ height: e.height,
308
+ palette: e.palette,
309
+ startNumX: e.startNumX,
310
+ endNumX: e.endNumX,
311
+ startNumY: e.startNumY,
312
+ endNumY: e.endNumY,
313
+ ratio: r
314
+ };
315
+ l.canvasContext && so(
316
+ l.canvasContext,
317
+ e.start,
318
+ e.selectStart,
319
+ e.selectLength,
320
+ o,
321
+ !e.vertical
322
+ );
323
+ };
324
+ return D(
325
+ () => e.start,
326
+ () => s(n)
327
+ ), D([() => e.width, () => e.height], () => {
328
+ a(n), s(n);
329
+ }), {
330
+ handle: (r, o) => {
331
+ const u = (A, B, L) => Math.round(B + A / L), N = e.vertical ? r.offsetY : r.offsetX, d = u(N, e.start, e.scale);
332
+ switch (o) {
333
+ case "click":
334
+ t("onAddLine", d);
335
+ break;
336
+ case "enter":
337
+ t("update:valueNum", d), t("update:showIndicator", !0);
338
+ break;
339
+ default:
340
+ t("update:valueNum", d);
341
+ break;
342
+ }
343
+ },
344
+ canvas: i
345
+ };
346
+ }
347
+ });
348
+ function co(e, t, l, n, i, c) {
349
+ return b(), k("canvas", {
350
+ ref: "canvas",
351
+ class: "ruler",
352
+ onClick: t[0] || (t[0] = (a) => e.handle(a, "click")),
353
+ onMouseenter: t[1] || (t[1] = (a) => e.handle(a, "enter")),
354
+ onMousemove: t[2] || (t[2] = (a) => e.handle(a, "move")),
355
+ onMouseleave: t[3] || (t[3] = (a) => e.$emit("update:showIndicator", !1))
356
+ }, null, 544);
357
+ }
358
+ const uo = /* @__PURE__ */ T(io, [["render", co]]), No = {
359
+ scale: Number,
360
+ ratio: Number,
361
+ thick: Number,
362
+ startNumX: Number,
363
+ endNumX: Number,
364
+ startNumY: Number,
365
+ endNumY: Number,
366
+ palette: Object,
367
+ vertical: {
368
+ type: Boolean,
369
+ default: !0
370
+ },
371
+ width: {
372
+ type: Number,
373
+ default: 200
374
+ },
375
+ height: {
376
+ type: Number,
377
+ default: 200
378
+ },
379
+ start: {
380
+ type: Number,
381
+ default: 0
382
+ },
383
+ lines: {
384
+ type: Array,
385
+ default: () => []
386
+ },
387
+ selectStart: {
388
+ type: Number
389
+ },
390
+ selectLength: {
391
+ type: Number
392
+ },
393
+ isShowReferLine: {
394
+ type: Boolean
395
+ }
396
+ }, mo = E({
397
+ name: "RulerWrapper",
398
+ components: {
399
+ CanvasRuler: uo,
400
+ RulerLine: lo
401
+ },
402
+ props: No,
403
+ setup(e) {
404
+ const t = R(!1), l = R(0), n = f(() => e.vertical ? "v-container" : "h-container"), i = f(() => {
405
+ const o = {
406
+ width: `calc(100% - ${e.thick}px)`,
407
+ height: `${e.thick + 1}px`,
408
+ left: `${e.thick}px`
409
+ }, u = {
410
+ width: `${e.thick && e.thick + 1}px`,
411
+ height: `calc(100% - ${e.thick}px)`,
412
+ top: `${e.thick}px`
413
+ };
414
+ return e.vertical ? u : o;
415
+ }), c = f(() => {
416
+ var o;
417
+ const u = (l.value - e.start) * e.scale;
418
+ let N = "top", d = "borderLeft";
419
+ return N = e.vertical ? "top" : "left", d = e.vertical ? "borderBottom" : "borderLeft", {
420
+ [N]: u + "px",
421
+ [d]: `1px solid ${(o = e.palette) == null ? void 0 : o.lineColor}`
422
+ };
423
+ }), a = (o) => {
424
+ e.lines.push(o);
425
+ }, s = (o, u) => {
426
+ const N = o - e.start, d = (e.vertical ? e.height : e.width) / e.scale;
427
+ N < 0 || N > d ? r(u) : e.lines[u] = o;
428
+ }, r = (o) => {
429
+ e.lines.splice(o, 1);
430
+ };
431
+ return {
432
+ showIndicator: t,
433
+ valueNum: l,
434
+ rwClassName: n,
435
+ rwStyle: i,
436
+ indicatorStyle: c,
437
+ handleNewLine: a,
438
+ handleLineRelease: s,
439
+ handleLineRemove: r
440
+ };
441
+ }
442
+ }), ho = { class: "lines" }, po = { class: "value" };
443
+ function vo(e, t, l, n, i, c) {
444
+ const a = Y("CanvasRuler"), s = Y("RulerLine");
445
+ return b(), k("div", {
446
+ class: Mt(e.rwClassName),
447
+ style: x(e.rwStyle)
448
+ }, [
449
+ p(a, {
450
+ vertical: e.vertical,
451
+ scale: e.scale,
452
+ width: e.width,
453
+ height: e.height,
454
+ start: e.start,
455
+ ratio: e.ratio,
456
+ startNumX: e.startNumX,
457
+ endNumX: e.endNumX,
458
+ startNumY: e.startNumY,
459
+ endNumY: e.endNumY,
460
+ "select-start": e.selectStart,
461
+ "select-length": e.selectLength,
462
+ palette: e.palette,
463
+ valueNum: e.valueNum,
464
+ "onUpdate:valueNum": t[0] || (t[0] = (r) => e.valueNum = r),
465
+ showIndicator: e.showIndicator,
466
+ "onUpdate:showIndicator": t[1] || (t[1] = (r) => e.showIndicator = r),
467
+ onOnAddLine: e.handleNewLine
468
+ }, null, 8, ["vertical", "scale", "width", "height", "start", "ratio", "startNumX", "endNumX", "startNumY", "endNumY", "select-start", "select-length", "palette", "valueNum", "showIndicator", "onOnAddLine"]),
469
+ g(h("div", ho, [
470
+ (b(!0), k(Vt, null, Kt(e.lines, (r, o) => (b(), zt(s, {
471
+ key: r + o,
472
+ index: o,
473
+ value: r >> 0,
474
+ scale: e.scale,
475
+ start: e.start,
476
+ thick: e.thick,
477
+ palette: e.palette,
478
+ vertical: e.vertical,
479
+ "is-show-refer-line": e.isShowReferLine,
480
+ onOnRemove: e.handleLineRemove,
481
+ onOnRelease: e.handleLineRelease
482
+ }, null, 8, ["index", "value", "scale", "start", "thick", "palette", "vertical", "is-show-refer-line", "onOnRemove", "onOnRelease"]))), 128))
483
+ ], 512), [
484
+ [w, e.isShowReferLine]
485
+ ]),
486
+ g(h("div", {
487
+ class: "indicator",
488
+ style: x(e.indicatorStyle)
489
+ }, [
490
+ h("div", po, z(e.valueNum), 1)
491
+ ], 4), [
492
+ [w, e.showIndicator]
493
+ ])
494
+ ], 6);
495
+ }
496
+ const fo = /* @__PURE__ */ T(mo, [["render", vo], ["__scopeId", "data-v-9da5477e"]]), go = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAopJREFUOE/FlE9IVEEcx7+/N9ouds1Mu0QUSFZYdIgoUqQoKPBQHsKozpXE7jbTO/U8xLJvn6usBHWQ6hBFXupSkQeVbh0KJEPp0sH+eLGTsKs77xcj78m0ax0E8cHjzZv5zef3/c33xxA24KENYGJzoEEQbNNaN4Zh2OQ4znwYhr9c1/39vwrXVDo0NNS0tLR0GYB5D64BmAMwzMyvlFKz1es10Hw+f4mZ7wHYBeA9gNdENFepVOaEEM3M3OI4Thczn41gt6WUgQ3+C+r7/h0AWQD3mXnYqPA8L9nQ0HCemduIaFpKOWoAhUJhT6VSuQXgOjP3K6W8GLwKzeVyp4jonR0QBEErM48w8zFLyayUsjX+z+VyHhHdZebTSqkxM78CHRgYOKS1/ghgVErZY214RkQ7ADyRUj72ff8qgCtmXUrZGcf5vv8CwEUhxOF0Ov1pBRpla5dSdseBhUJhpznH6tIsZb1KqacW+BGArUaUXX63UuplHJTNZjuEEONSyhozfd/n6mQ1RkXZL2itz7mu+80EDA4ONi8vL/8AcM2UbikyR2BU9cSmmTU70YqKIAj2hWFo2uenlHK/BRg3Y2aeNO5GyU8S0ZbFxcUuz/NKEXAGQKPjOCcymcyX1dIi8DSAiWQyeaavr68cbSgCuBknYubnQoj+TCYzUywWE6VS6S2ADsdx2gxw1X3L7SNENMbMnwE8qK+vf5NKpRaMaeVyeW8ikfiaSqW+R7BuZr5BRMe11p2u607U9Gk8kc/ntzPzQwCmExYATDLzVBiGE0KIowAOADDf3QA+aK2VDaxRajto3K+rq+tl5nYAzQBamHmeiOYBTGmtR6ph/1Rqg9c73pz7dD1qN0TpHyNQRCUDJXrAAAAAAElFTkSuQmCC", wo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAAAXNSR0IArs4c6QAAAjtJREFUOE/NlD9oFEEUxn9v9ghC0hpRUogIAUmniGAT/5Q2FrETPSNRJILg7RwimI0ox85eQFCEBGIUO1PYpFM0jSConQoBEZGgGPsgl+w+2eM2bC57SopAFqYZ3v7m+977ZoQt+GQLmGxPaBiGgYiMWWvXBHZUGoZhH3BERPYC+4F+4Keq/urt7b1RLpf/ZEBVHa9Wq0HWyg3QKIoGVPU8cA7wgK/pUtXPQJ8xZk+pVBpuNBqXUoUiEvi+P56fzTpo6+SbwHNg1lo7WzTITGEKXFlZeeB53tVCpa3CK8AFa+1cBgvD8LKIXAQOJkkyICJDeYVBEJS6u7s/qeoLa+1o+l9TqXNuBLhmjDlbqVQ+5ICjInIfOBPH8W9jzGCR5YmJiRNxHM+papgqzqDvgSlr7VTernPuO3An3c9bBt74vv+yrdaKyLDv+/1Sq9UGPc97nY9EVuycU2AQOA7cAm4Dr4D5TvVxHB9rKo2iaEFVp621Ln96FEUngaOqGmSxabVqsh3a2h+x1h5qQjNrae/yE4+iaCwDJkky73neTuBZe129Xk+H+BS4l7ZqLVIZ2BhzuFKpvMsDVXXWGPMxFdAedOfcKeCRqj7MYrUhpz09PfXl5eXrectFWXXODQHpOq2qd/95o/JXr6ura3J1dXU6SZIfwKKIHAD2tVYMPBGRx77vN10UXtO85fTkmZmZHUtLSzUR2QXsBhaAL6r6DXhbrVYXi1yss59GqOgub/bN3Z7v6X/tb9Zmp/q/kN8s+lJb8oEAAAAASUVORK5CYII=", bo = {
497
+ eyeIcon: {
498
+ type: String
499
+ },
500
+ closeEyeIcon: {
501
+ type: String
502
+ },
503
+ scale: {
504
+ type: Number,
505
+ default: 1
506
+ },
507
+ ratio: {
508
+ type: Number
509
+ // default: window.devicePixelRatio || 1
510
+ },
511
+ thick: {
512
+ type: Number,
513
+ default: 16
514
+ },
515
+ palette: Object,
516
+ startX: {
517
+ type: Number
518
+ },
519
+ startY: {
520
+ type: Number,
521
+ default: 0
522
+ },
523
+ width: {
524
+ type: Number,
525
+ default: 200
526
+ },
527
+ height: {
528
+ type: Number,
529
+ default: 200
530
+ },
531
+ shadow: {
532
+ type: Object,
533
+ default: () => ({
534
+ x: 0,
535
+ y: 0,
536
+ width: 0,
537
+ height: 0
538
+ })
539
+ },
540
+ lines: {
541
+ type: Object,
542
+ default: () => ({
543
+ h: [],
544
+ v: []
545
+ })
546
+ },
547
+ isShowReferLine: {
548
+ type: Boolean,
549
+ default: !0
550
+ },
551
+ startNumX: {
552
+ type: Number,
553
+ default: -1 / 0
554
+ },
555
+ endNumX: {
556
+ type: Number,
557
+ default: 1 / 0
558
+ },
559
+ startNumY: {
560
+ type: Number,
561
+ default: -1 / 0
562
+ },
563
+ endNumY: {
564
+ type: Number,
565
+ default: 1 / 0
566
+ }
567
+ }, Ao = E({
568
+ name: "SketchRule",
569
+ components: {
570
+ RulerWrapper: fo
571
+ },
572
+ props: bo,
573
+ emits: ["onCornerClick"],
574
+ setup(e, { emit: t }) {
575
+ let l = R(!0);
576
+ l.value = e.isShowReferLine;
577
+ const n = f(() => {
578
+ function a(s, r) {
579
+ return Object.keys(s).forEach((o) => {
580
+ o && s.hasOwnProperty(o) && (typeof r[o] == "object" ? s[o] = a(s[o], r[o]) : r.hasOwnProperty(o) && (s[o] = r[o]));
581
+ }), s;
582
+ }
583
+ return a(
584
+ {
585
+ bgColor: "rgba(225,225,225, 0)",
586
+ // ruler bg color
587
+ longfgColor: "#BABBBC",
588
+ // ruler longer mark color
589
+ shortfgColor: "#C8CDD0",
590
+ // ruler shorter mark color
591
+ fontColor: "#7D8694",
592
+ // ruler font color
593
+ shadowColor: "#E8E8E8",
594
+ // ruler shadow color
595
+ lineColor: "#EB5648",
596
+ borderColor: "#DADADC",
597
+ cornerActiveColor: "rgb(235, 86, 72, 0.6)",
598
+ menu: {
599
+ bgColor: "#fff",
600
+ dividerColor: "#DBDBDB",
601
+ listItem: {
602
+ textColor: "#415058",
603
+ hoverTextColor: "#298DF8",
604
+ disabledTextColor: "rgba(65, 80, 88, 0.4)",
605
+ bgColor: "#fff",
606
+ hoverBgColor: "#F2F2F2"
607
+ }
608
+ }
609
+ },
610
+ e.palette || {}
611
+ );
612
+ }), i = f(() => ({
613
+ backgroundImage: l.value ? `url(${e.eyeIcon || go})` : `url(${e.closeEyeIcon || wo})`,
614
+ width: e.thick + "px",
615
+ height: e.thick + "px",
616
+ borderRight: `1px solid ${n.value.borderColor}`,
617
+ borderBottom: `1px solid ${n.value.borderColor}`
618
+ })), c = (a) => {
619
+ l.value = !l.value, t("onCornerClick", l.value);
620
+ };
621
+ return D([() => e.isShowReferLine], () => {
622
+ l.value = e.isShowReferLine;
623
+ }), {
624
+ showReferLine: l,
625
+ paletteCpu: n,
626
+ cornerStyle: i,
627
+ onCornerClick: c
628
+ };
629
+ }
630
+ }), Co = {
631
+ id: "mb-ruler",
632
+ class: "style-ruler mb-ruler"
633
+ };
634
+ function yo(e, t, l, n, i, c) {
635
+ const a = Y("RulerWrapper");
636
+ return b(), k("div", Co, [
637
+ p(a, {
638
+ vertical: !1,
639
+ width: e.width,
640
+ height: e.thick,
641
+ "is-show-refer-line": e.showReferLine,
642
+ thick: e.thick,
643
+ ratio: e.ratio,
644
+ start: e.startX,
645
+ lines: e.lines.h,
646
+ "select-start": e.shadow.x,
647
+ "select-length": e.shadow.width,
648
+ scale: e.scale,
649
+ palette: e.paletteCpu,
650
+ startNumX: e.startNumX,
651
+ endNumX: e.endNumX
652
+ }, null, 8, ["width", "height", "is-show-refer-line", "thick", "ratio", "start", "lines", "select-start", "select-length", "scale", "palette", "startNumX", "endNumX"]),
653
+ p(a, {
654
+ vertical: !0,
655
+ width: e.thick,
656
+ height: e.height,
657
+ "is-show-refer-line": e.showReferLine,
658
+ thick: e.thick,
659
+ ratio: e.ratio,
660
+ start: e.startY,
661
+ lines: e.lines.v,
662
+ "select-start": e.shadow.y,
663
+ "select-length": e.shadow.height,
664
+ scale: e.scale,
665
+ palette: e.paletteCpu,
666
+ startNumY: e.startNumY,
667
+ endNumY: e.endNumY
668
+ }, null, 8, ["width", "height", "is-show-refer-line", "thick", "ratio", "start", "lines", "select-start", "select-length", "scale", "palette", "startNumY", "endNumY"]),
669
+ h("a", {
670
+ class: "corner",
671
+ style: x(e.cornerStyle),
672
+ onClick: t[0] || (t[0] = (...s) => e.onCornerClick && e.onCornerClick(...s))
673
+ }, null, 4)
674
+ ]);
675
+ }
676
+ const So = /* @__PURE__ */ T(Ao, [["render", yo]]);
677
+ function ko(e) {
678
+ e.component("GoSkeleton", to), e.component("GoLoading", jt), e.component("SketchRule", So);
679
+ }
680
+ function Eo(e) {
681
+ $t(e), ko(e), Jt(e), window.$vue = e;
682
+ }
683
+ export {
684
+ Eo as initGoViewWorker,
685
+ ko as setupCustomComponents,
686
+ Jt as setupDirectives,
687
+ $t as setupNaive
688
+ };