소스 검색

feat: 修改打包路径

bill 3 달 전
부모
커밋
7cc8f97bf4

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 352 - 359
pnpm-lock.yaml


+ 3 - 3
src/core/components/line/use-draw.ts

@@ -38,7 +38,7 @@ export const useDraw = () => {
   const customSnapInfos = useCustomSnapInfos();
 
   // 可能历史空间会撤销 重做更改到正在绘制的组件
-  const currentCursor = ref("/icons/m_add.png");
+  const currentCursor = ref("./icons/m_add.png");
   const cursor = useCursor();
   let cursorPop: ReturnType<typeof cursor.push> | null = null;
   let stopWatch: (() => void) | null = null;
@@ -125,7 +125,7 @@ export const useDraw = () => {
 
   const getAddMessage = (cur: Pos) => {
     let consumed = messages.value;
-    currentCursor.value = "/icons/m_add.png";
+    currentCursor.value = "./icons/m_add.png";
     let pen: null | ReturnType<typeof penUpdatePoints> = null;
     return {
       pen,
@@ -138,7 +138,7 @@ export const useDraw = () => {
   const setMessage = (cur: Pos) => {
     const { pen, ...msg } = getAddMessage(cur);
     if ((currentIsDel = pen?.oper === "del")) {
-      currentCursor.value = "/icons/m_reduce.png";
+      currentCursor.value = "./icons/m_reduce.png";
       beforeHandler.clear();
     }
     return msg;

+ 2 - 2
src/core/components/share/edit-line.vue

@@ -57,7 +57,7 @@ const [isHover] = useShapeIsHover(line);
 const cursor = useCursor();
 watch(isHover, (hover, _, onCleanup) => {
   if (hover) {
-    onCleanup(cursor.push("/icons/m_move.png"));
+    onCleanup(cursor.push("./icons/m_move.png"));
   }
 });
 const points = computed(() => {
@@ -124,7 +124,7 @@ const [isPointHover] = useShapeIsHover(point);
 let addCursorPop: () => void;
 watch(isPointHover, (hover, _, onCleanup) => {
   if (hover) {
-    let pop: (() => void) | null = cursor.push("/icons/m_add.png");
+    let pop: (() => void) | null = cursor.push("./icons/m_add.png");
     addCursorPop = () => {
       pop && pop();
       pop = null;

+ 2 - 2
src/core/components/share/edit-point.vue

@@ -103,7 +103,7 @@ if (!props.notDelete) {
     isHover,
     (hover, _, onCleanup) => {
       if (hover) {
-        onCleanup(cursor.push("/icons/m_move.png"));
+        onCleanup(cursor.push("./icons/m_move.png"));
       }
     },
     { immediate: true }
@@ -117,7 +117,7 @@ watch(offset, (offset, oldOffsert) => {
     init = { ...position.value };
     startHandler();
     emit("dragstart");
-    cursor.push("/icons/m_move.png");
+    cursor.push("./icons/m_move.png");
     dragIng.value = true;
   }
   if (offset) {

+ 1 - 1
src/core/helper/layers.vue

@@ -38,7 +38,7 @@ const data = ref({
   height: 20,
   rotation: 0,
   fill: "#000000",
-  url: "/icons/grouping.svg",
+  url: "./icons/grouping.svg",
 });
 const shape = ref<DC<Group>>();
 const [style] = useAnimationMouseStyle({

+ 1 - 1
src/core/hook/use-alignment.ts

@@ -119,7 +119,7 @@ export const useJoinShapes = (
     const $stage = stage.value!.getNode();
     const dom = $stage.container();
     const points = drawLines(ref<(Pos | null)[]>(attribs.map(() => null)));
-    const cleanup = mergeFuns(cursor.push("/icons/m_draw.png"), mode.push(Mode.readonly)) 
+    const cleanup = mergeFuns(cursor.push("./icons/m_draw.png"), mode.push(Mode.readonly)) 
 
     for (let i = 0; i < attribs.length; i++) {
       const attrib = attribs[i];

+ 5 - 5
src/core/hook/use-draw.ts

@@ -357,7 +357,7 @@ export const useInteractiveDrawAreas = <T extends ShapeType>(type: T) => {
     useIA: useInteractiveAreas,
     refSelf: type === "arrow",
     enter() {
-      cursorPop = cursor.push("/icons/m_draw.png");
+      cursorPop = cursor.push("./icons/m_draw.png");
     },
     quit() {
       cursorPop && cursorPop();
@@ -372,7 +372,7 @@ export const useInteractiveDrawDots = <T extends ShapeType>(type: T) => {
     type,
     useIA: useInteractiveDots,
     enter() {
-      cursorPop = cursor.push("/icons/m_add.png");
+      cursorPop = cursor.push("./icons/m_add.png");
     },
     quit() {
       cursorPop && cursorPop();
@@ -457,7 +457,7 @@ export const useInteractiveDrawPen = <T extends ShapeType>(type: T) => {
   });
 
   // 可能历史空间会撤销 重做更改到正在绘制的组件
-  const currentCursor = ref("/icons/m_add.png");
+  const currentCursor = ref("./icons/m_add.png");
   const cursor = useCursor();
   let cursorPop: ReturnType<typeof cursor.push> | null = null;
   let stopWatch: (() => void) | null = null;
@@ -513,7 +513,7 @@ export const useInteractiveDrawPen = <T extends ShapeType>(type: T) => {
 
   const getAddMessage = (cur: Pos) => {
     let consumed = messages.value;
-    currentCursor.value = "/icons/m_add.png";
+    currentCursor.value = "./icons/m_add.png";
     let pen: null | ReturnType<typeof penUpdatePoints> = null;
     if (!operMode.value.freeDraw) {
       // pen = penUpdatePoints(messages.value, cur, type !== "polygon");
@@ -531,7 +531,7 @@ export const useInteractiveDrawPen = <T extends ShapeType>(type: T) => {
   const setMessage = (cur: Pos) => {
     const { pen, ...msg } = getAddMessage(cur);
     if ((currentIsDel = pen?.oper === "del")) {
-      currentCursor.value = "/icons/m_reduce.png";
+      currentCursor.value = "./icons/m_reduce.png";
       beforeHandler.clear();
     }
     return msg;

+ 1 - 1
src/core/hook/use-expose.ts

@@ -168,7 +168,7 @@ export const useAutoService = () => {
     if (operMode.value.freeView) {
       style = "pointer";
     } else if (mode.include(Mode.update)) {
-      style = "/icons/m_move.png";
+      style = "./icons/m_move.png";
     } else if (status.hovers.length) {
       style = "pointer";
     } else {

+ 1 - 1
src/core/hook/use-selection.ts

@@ -187,7 +187,7 @@ export const useSelectionShowIcons = installGlobalVar(() => {
   const iconProps = {
     width: 20,
     height: 20,
-    url: "/icons/state_s.svg",
+    url: "./icons/state_s.svg",
     fill: themeColor,
     stroke: "#fff",
     listening: false,

+ 1 - 1
src/core/hook/use-transformer.ts

@@ -95,7 +95,7 @@ export const useTransformer = installGlobalVar(() => {
 
   const cleanups: (() => void)[] = [];
   const viewer = useViewer();
-  getSvgContent("/icons/m_rotate.svg").then((svgContent) => {
+  getSvgContent("./icons/m_rotate.svg").then((svgContent) => {
     const svg = parseSvgContent(svgContent);
     const group = new Group({listening: false});
     const rotateRect = transformer.findOne<Rect>(".rotater")!;

+ 1 - 1
src/example/fuse/views/overview/slide-icons.vue

@@ -14,7 +14,7 @@
         <div class="icon-items">
           <div
             v-for="item in typeChildren.children"
-            @click="drawIcon(`/icons/${item.icon}.svg`, item.name)"
+            @click="drawIcon(`./icons/${item.icon}.svg`, item.name)"
           >
             <Icon :name="item.icon" size="32px" />
             <span>{{ item.name }}</span>

+ 1 - 1
src/example/fuse/views/tabulation/index.vue

@@ -52,7 +52,7 @@ const init = async (draw: Draw) => {
       compass: {
         rotation: 0,
         ...(config.compass || {}),
-        url: "/icons/compass.svg",
+        url: "./icons/compass.svg",
       },
     },
   });

+ 1 - 1
src/example/platform/platform-resource.ts

@@ -240,7 +240,7 @@ export const taggingGets = {
             if (!name) return;
             tags.push({
               position: pos,
-              url: `/icons/${icon ? icon : 'circle'}.svg`,
+              url: `./icons/${icon ? icon : 'circle'}.svg`,
               name,
               pixel: true,
               size,

+ 11 - 11
src/utils/shared.ts

@@ -234,32 +234,32 @@ export const asyncTimeout = (time: number) => {
 export const getResizeCorsur = (level = true, r = 0) => {
   r = rangMod(r, 360);
 
-  // 上下  "/icons/m_zoom_v.png"
+  // 上下  "./icons/m_zoom_v.png"
   if (level) {
     if ((r > 0 && r < 20) || (r > 160 && r <= 200)) {
-      return "/icons/m_zoom_h.png";
+      return "./icons/m_zoom_h.png";
     }
     if ((r >= 20 && r <= 70) || (r >= 200 && r <= 250)) {
-      return "/icons/m_zoom.png";
+      return "./icons/m_zoom.png";
     } else if ((r > 70 && r < 110) || (r > 250 && r < 290)) {
-      return "/icons/m_zoom_v.png";
+      return "./icons/m_zoom_v.png";
     } else if ((r >= 110 && r <= 160) || (r >= 290 && r <= 340)) {
-      return "/icons/m_zoom_r.png";
+      return "./icons/m_zoom_r.png";
     } else {
-      return "/icons/m_zoom_h.png";
+      return "./icons/m_zoom_h.png";
     }
   } else {
     if ((r > 0 && r < 20) || (r > 160 && r <= 200)) {
-      return "/icons/m_zoom_v.png";
+      return "./icons/m_zoom_v.png";
     }
     if ((r >= 20 && r <= 70) || (r >= 200 && r <= 250)) {
-      return "/icons/m_zoom_r.png";
+      return "./icons/m_zoom_r.png";
     } else if ((r > 70 && r < 110) || (r > 250 && r < 290)) {
-      return "/icons/m_zoom_h.png";
+      return "./icons/m_zoom_h.png";
     } else if ((r >= 110 && r <= 160) || (r >= 290 && r <= 340)) {
-      return "/icons/m_zoom.png";
+      return "./icons/m_zoom.png";
     } else {
-      return "/icons/m_zoom_v.png";
+      return "./icons/m_zoom_v.png";
     }
   }
 };

+ 1 - 0
vite.config.ts

@@ -27,6 +27,7 @@ export default ({ mode }: any) => {
   console.log(proxy)
 
   return defineConfig({
+    base: './',
     resolve: {
       alias: {
         "@/": `${path.resolve(__dirname, "src")}/`,