mxcad-app 1.0.69 → 1.0.71

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.
Binary file
Binary file
Binary file
package/dist/index.cjs.gz CHANGED
Binary file
package/dist/index.d.ts CHANGED
@@ -22,6 +22,9 @@ import { ShallowRef } from 'vue';
22
22
  import { Store } from 'pinia';
23
23
  import { StoreDefinition } from 'pinia';
24
24
  import { ThemeInstance } from 'vuetify';
25
+ import { VoerkaI18nScope } from '@voerkai18n/runtime';
26
+ import { VueTransformResultType } from '@voerkai18n/vue';
27
+ import { VueTranslateComponentType } from '@voerkai18n/vue';
25
28
 
26
29
  declare interface AppConfig {
27
30
  uiConfig?: string;
@@ -124,6 +127,8 @@ declare type LineType = typeof defaultLineType & {
124
127
  };
125
128
 
126
129
  declare class MxCADApp extends MxCADEvents {
130
+ /** i18nScope 国际化模块 */
131
+ get i18nScope(): VoerkaI18nScope<VueTranslateComponentType, VueTransformResultType>;
127
132
  setStaticAssetPath(url: string): void;
128
133
  getStaticAssetPath(): string;
129
134
  initConfig(config: AppConfig): void;
@@ -2633,28 +2638,17 @@ declare module '@howdyjs/to-drag' {
2633
2638
  }
2634
2639
 
2635
2640
 
2636
- declare module "@tiptap/core" {
2637
- interface Commands<ReturnType> {
2638
- selectedText: {
2639
- setSelectedText: (from: number, to: number) => ReturnType;
2640
- unsetSelectedText: (from: number, to: number) => ReturnType;
2641
- };
2642
- }
2643
- }
2644
-
2645
-
2646
2641
  declare module '@tiptap/core' {
2647
2642
  interface Commands<ReturnType> {
2648
- Strike: {
2643
+ TextDecoration: {
2649
2644
  /**
2650
2645
  * Set the font size attribute
2651
2646
  */
2652
- setStrike: () => ReturnType;
2647
+ setTextDecoration: (textDecoration: string) => ReturnType;
2653
2648
  /**
2654
2649
  * Unset the font size attribute
2655
2650
  */
2656
- unsetStrike: () => ReturnType;
2657
- toggleStrike: () => ReturnType;
2651
+ unsetTextDecoration: () => ReturnType;
2658
2652
  };
2659
2653
  }
2660
2654
  }
@@ -2662,10 +2656,16 @@ declare module '@tiptap/core' {
2662
2656
 
2663
2657
  declare module '@tiptap/core' {
2664
2658
  interface Commands<ReturnType> {
2665
- Underline: {
2666
- setUnderline: () => ReturnType;
2667
- unsetUnderline: () => ReturnType;
2668
- toggleUnderline: () => ReturnType;
2659
+ Overline: {
2660
+ /**
2661
+ * Set the font size attribute
2662
+ */
2663
+ setOverline: () => ReturnType;
2664
+ /**
2665
+ * Unset the font size attribute
2666
+ */
2667
+ unsetOverline: () => ReturnType;
2668
+ toggleOverline: () => ReturnType;
2669
2669
  };
2670
2670
  }
2671
2671
  }
@@ -2673,15 +2673,26 @@ declare module '@tiptap/core' {
2673
2673
 
2674
2674
  declare module '@tiptap/core' {
2675
2675
  interface Commands<ReturnType> {
2676
- fontSize: {
2676
+ Strike: {
2677
2677
  /**
2678
2678
  * Set the font size attribute
2679
2679
  */
2680
- setFontSize: (size: string) => ReturnType;
2680
+ setStrike: () => ReturnType;
2681
2681
  /**
2682
2682
  * Unset the font size attribute
2683
2683
  */
2684
- unsetFontSize: () => ReturnType;
2684
+ unsetStrike: () => ReturnType;
2685
+ toggleStrike: () => ReturnType;
2686
+ };
2687
+ }
2688
+ }
2689
+
2690
+
2691
+ declare module "@tiptap/core" {
2692
+ interface Commands<ReturnType> {
2693
+ selectedText: {
2694
+ setSelectedText: (from: number, to: number) => ReturnType;
2695
+ unsetSelectedText: (from: number, to: number) => ReturnType;
2685
2696
  };
2686
2697
  }
2687
2698
  }
@@ -2689,15 +2700,10 @@ declare module '@tiptap/core' {
2689
2700
 
2690
2701
  declare module '@tiptap/core' {
2691
2702
  interface Commands<ReturnType> {
2692
- TextDecoration: {
2693
- /**
2694
- * Set the font size attribute
2695
- */
2696
- setTextDecoration: (textDecoration: string) => ReturnType;
2697
- /**
2698
- * Unset the font size attribute
2699
- */
2700
- unsetTextDecoration: () => ReturnType;
2703
+ Underline: {
2704
+ setUnderline: () => ReturnType;
2705
+ unsetUnderline: () => ReturnType;
2706
+ toggleUnderline: () => ReturnType;
2701
2707
  };
2702
2708
  }
2703
2709
  }
@@ -2705,16 +2711,15 @@ declare module '@tiptap/core' {
2705
2711
 
2706
2712
  declare module '@tiptap/core' {
2707
2713
  interface Commands<ReturnType> {
2708
- Overline: {
2714
+ fontSize: {
2709
2715
  /**
2710
2716
  * Set the font size attribute
2711
2717
  */
2712
- setOverline: () => ReturnType;
2718
+ setFontSize: (size: string) => ReturnType;
2713
2719
  /**
2714
2720
  * Unset the font size attribute
2715
2721
  */
2716
- unsetOverline: () => ReturnType;
2717
- toggleOverline: () => ReturnType;
2722
+ unsetFontSize: () => ReturnType;
2718
2723
  };
2719
2724
  }
2720
2725
  }
Binary file
package/dist/mxcad.d.ts CHANGED
@@ -12995,18 +12995,44 @@ declare module "mxcad" {
12995
12995
  * @param call 回调函数
12996
12996
  * @example
12997
12997
  * ```ts
12998
- import { MxCpp, McObject } from "mxcad"
12999
- const mxcad: McObject = MxCpp.getCurrentMxCAD()
13000
- mxcad.loadImage(imagUrl, (image) => {
13001
- if (!image) {
13002
- console.log("loadImage failed");
13003
- return;
13004
- }
13005
- let width = mxcad.mxdraw.viewCoordLong2Cad(100);
13006
- let height = (image.height / image.width) * width;
13007
- idImage = mxcad.drawImage((pt as any).x, (pt as any).y, width, height, 0, imagUrl,true);
13008
- mxcad.updateDisplay();
13009
- });
12998
+ import { MxCpp } from "mxcad";
12999
+ function selectLocalFile() {
13000
+ return new Promise((resolve) => {
13001
+ const input = document.createElement("input");
13002
+ input.type = "file";
13003
+ input.accept = "image/*";
13004
+ input.onchange = (e) => resolve(e.target.files[0]);
13005
+ input.click();
13006
+ });
13007
+ }
13008
+ function fileToBase64(file) {
13009
+ return new Promise((resolve, reject) => {
13010
+ const reader = new FileReader();
13011
+ reader.onload = () => resolve(reader.result);
13012
+ reader.onerror = reject;
13013
+ reader.readAsDataURL(file);
13014
+ });
13015
+ }
13016
+
13017
+ const file = await selectLocalFile();
13018
+ if (!file) return;
13019
+ const imagData = await fileToBase64(file);
13020
+ let mxcad = MxCpp.getCurrentMxCAD();
13021
+
13022
+ mxcad.loadImageBase64(imagData, "test.jpg", (image) => {
13023
+ if (!image) {
13024
+ console.log("loadImage failed");
13025
+ return;
13026
+ }
13027
+ let width = mxcad.mxdraw.viewCoordLong2Cad(100);
13028
+ let height = (image.height / image.width) * width;
13029
+
13030
+ let viewAngle = 0.0;
13031
+ let id = mxcad.drawImage(100, 100, width, height, viewAngle, "test.jpg", true, image.width, image.height,"",imagData);
13032
+
13033
+
13034
+ mxcad.updateDisplay();
13035
+ })
13010
13036
  * ```
13011
13037
  */
13012
13038
  loadImageBase64(sImageBase64: string, imageFileName: string, call: (image: any) => void): void;
@@ -13019,7 +13045,7 @@ declare module "mxcad" {
13019
13045
  * @param dAng 图片角度,单位是度
13020
13046
  * @param imageUrl 图片路径
13021
13047
  */
13022
- drawImage(dPosX: number, dPosY: number, dWidth: number, dHeight: number, dAng: number, imageName: string, isConvertBase64?: boolean, dwgImageSizeWidth?: number, dwgImageSizeHeight?: number, imageUrl?: string): McObjectId;
13048
+ drawImage(dPosX: number, dPosY: number, dWidth: number, dHeight: number, dAng: number, imageName: string, isConvertBase64?: boolean, dwgImageSizeWidth?: number, dwgImageSizeHeight?: number, imageUrl?: string, sImageBase64?: string): McObjectId;
13023
13049
  /**
13024
13050
  * 添加一个图片定义到cad数据库中 。
13025
13051
  * @param imageUrl 图片路径
@@ -13039,7 +13065,7 @@ declare module "mxcad" {
13039
13065
  });
13040
13066
  * ```
13041
13067
  */
13042
- addImageDefine(imageUrl: string, sName?: string, isConvertBase64?: boolean, sourceFileName?: string): McObjectId;
13068
+ addImageDefine(imageUrl: string, sName?: string, isConvertBase64?: boolean, sourceFileName?: string, sBase64Data?: string): McObjectId;
13043
13069
  /**
13044
13070
  * 显示线重
13045
13071
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mxcad-app",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",