2 İşlemeler fe36e14881 ... 687e95bfeb

Yazar SHA1 Mesaj Tarih
  liutian 687e95bfeb add: tool 新增获取属性 1 ay önce
  liutian fe36e14881 add: tool 新增获取属性 1 ay önce

+ 13 - 0
packages/webview/src/apis/getActiveTool.js

@@ -0,0 +1,13 @@
+/**
+ * Get the active tool of WebViewer UI.
+ * @method UI.getActiveTool
+ * @example
+WebViewer(...)
+  .then(function(instance) {
+    instance.UI.getActiveTool(); // Get the getActiveTool
+  });
+ */
+
+  export default (store) => () => {
+    return store.getActiveTool
+  }

+ 2 - 0
packages/webview/src/apis/index.js

@@ -20,6 +20,7 @@ import setCustomFonts from './setCustomFonts';
 import setAnnotator from './setAnnotator';
 import getToolColor from './getToolColor';
 import getTool from './getTool';
+import getActiveTool from './getActiveTool';
 
 export default () => {
   const { locale } = i18n.global
@@ -57,6 +58,7 @@ export default () => {
     setActiveElementTab: setActiveElementTab(useViewer),
     setCustomFonts: setCustomFonts(useViewer),
     setAnnotator: setAnnotator(useDocument),
+    getActiveTool: getActiveTool(useDocument),
     getToolColor: getToolColor(useDocument),
     getTool: getTool(useDocument),
   }