Ver código fonte

update: crop page popup支持自定义UI

wzl 1 mês atrás
pai
commit
71ec0c1aac

+ 14 - 0
packages/webview/src/apis/cropPagePopup.js

@@ -0,0 +1,14 @@
+/**
+ * An instance of Popup that can be used to edit items in the crop page popup component
+ * @name UI.cropPagePopup
+ * @implements {UI.Popup}
+ * @type {UI.Popup}
+ * @example
+WebViewer(...)
+  .then(function (instance) {
+    instance.UI.cropPagePopup.someAPI();
+  });
+ */
+import createPopupAPI from '../api_helpers/createPopupAPI';
+
+export default (store) => createPopupAPI(store, 'cropPagePopup');

+ 2 - 1
packages/webview/src/apis/disableElements.js

@@ -6,7 +6,8 @@ export default (store) => (dataElements) => {
     ...store.getActiveRightHeaderItems,
     ...store.getActiveRightHeaderItems,
     ...store.getToolItems.annotation,
     ...store.getToolItems.annotation,
     ...store.getToolItems.form,
     ...store.getToolItems.form,
-    ...store.getPopupItems('textPopup')
+    ...store.getPopupItems('textPopup'),
+    ...store.getPopupItems('cropPagePopup')
   ];
   ];
 
 
   if (Array.isArray(dataElements)) {
   if (Array.isArray(dataElements)) {

+ 2 - 1
packages/webview/src/apis/enableElements.js

@@ -6,7 +6,8 @@ export default (store) => (dataElements) => {
     ...store.getActiveRightHeaderItems,
     ...store.getActiveRightHeaderItems,
     ...store.getToolItems.annotation,
     ...store.getToolItems.annotation,
     ...store.getToolItems.form,
     ...store.getToolItems.form,
-    ...store.getPopupItems('textPopup')
+    ...store.getPopupItems('textPopup'),
+    ...store.getPopupItems('cropPagePopup')
   ];
   ];
 
 
   if (Array.isArray(dataElements)) {
   if (Array.isArray(dataElements)) {

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

@@ -21,6 +21,7 @@ import setAnnotator from './setAnnotator';
 import getToolColor from './getToolColor';
 import getToolColor from './getToolColor';
 import getTool from './getTool';
 import getTool from './getTool';
 import getActiveTool from './getActiveTool';
 import getActiveTool from './getActiveTool';
+import cropPagePopup from './cropPagePopup';
 
 
 export default () => {
 export default () => {
   const { locale } = i18n.global
   const { locale } = i18n.global
@@ -61,6 +62,7 @@ export default () => {
     getActiveTool: getActiveTool(useDocument),
     getActiveTool: getActiveTool(useDocument),
     getToolColor: getToolColor(useDocument),
     getToolColor: getToolColor(useDocument),
     getTool: getTool(useDocument),
     getTool: getTool(useDocument),
+    cropPagePopup: cropPagePopup(viewerStore),
   }
   }
   const documentViewer = core.getDocumentViewer(1);
   const documentViewer = core.getDocumentViewer(1);
 
 

+ 1 - 1
packages/webview/src/stores/modules/viewer.js

@@ -431,7 +431,7 @@ export const useViewerStore = defineStore({
       { type: 'squiggly', dataElement: 'squigglyButton' }
       { type: 'squiggly', dataElement: 'squigglyButton' }
     ],
     ],
     cropPagePopup: [
     cropPagePopup: [
-      { type: 'cropPage', dataElement: 'cropPageButton' },
+      { type: 'cropPage', dataElement: 'cropDownloadButton' },
       { type: 'close', dataElement: 'exitCroppingButton' }
       { type: 'close', dataElement: 'exitCroppingButton' }
     ],
     ],
     contentEditorPopup: [
     contentEditorPopup: [