Quellcode durchsuchen

update: crop page popup支持自定义UI

wzl vor 1 Monat
Ursprung
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.getToolItems.annotation,
     ...store.getToolItems.form,
-    ...store.getPopupItems('textPopup')
+    ...store.getPopupItems('textPopup'),
+    ...store.getPopupItems('cropPagePopup')
   ];
 
   if (Array.isArray(dataElements)) {

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

@@ -6,7 +6,8 @@ export default (store) => (dataElements) => {
     ...store.getActiveRightHeaderItems,
     ...store.getToolItems.annotation,
     ...store.getToolItems.form,
-    ...store.getPopupItems('textPopup')
+    ...store.getPopupItems('textPopup'),
+    ...store.getPopupItems('cropPagePopup')
   ];
 
   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 getTool from './getTool';
 import getActiveTool from './getActiveTool';
+import cropPagePopup from './cropPagePopup';
 
 export default () => {
   const { locale } = i18n.global
@@ -61,6 +62,7 @@ export default () => {
     getActiveTool: getActiveTool(useDocument),
     getToolColor: getToolColor(useDocument),
     getTool: getTool(useDocument),
+    cropPagePopup: cropPagePopup(viewerStore),
   }
   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' }
     ],
     cropPagePopup: [
-      { type: 'cropPage', dataElement: 'cropPageButton' },
+      { type: 'cropPage', dataElement: 'cropDownloadButton' },
       { type: 'close', dataElement: 'exitCroppingButton' }
     ],
     contentEditorPopup: [