@windoc/react 0.3.18 → 0.3.19

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.
package/dist/index.d.mts CHANGED
@@ -168,6 +168,12 @@ type EditorInstance = {
168
168
  pageModeChange: ((payload: string) => void) | null;
169
169
  contentChange: (() => void) | null;
170
170
  saved: ((payload: object) => void) | null;
171
+ optionsChange: ((payload: {
172
+ scale: number;
173
+ paperDirection: string;
174
+ width: number;
175
+ height: number;
176
+ }) => void) | null;
171
177
  };
172
178
  register: {
173
179
  contextMenuList: (items: object[]) => void;
package/dist/index.d.ts CHANGED
@@ -168,6 +168,12 @@ type EditorInstance = {
168
168
  pageModeChange: ((payload: string) => void) | null;
169
169
  contentChange: (() => void) | null;
170
170
  saved: ((payload: object) => void) | null;
171
+ optionsChange: ((payload: {
172
+ scale: number;
173
+ paperDirection: string;
174
+ width: number;
175
+ height: number;
176
+ }) => void) | null;
171
177
  };
172
178
  register: {
173
179
  contextMenuList: (items: object[]) => void;
package/dist/index.js CHANGED
@@ -2545,6 +2545,12 @@ function EditorInner({
2545
2545
  instance.listener.pageScaleChange = (payload) => {
2546
2546
  setPageScale(Math.floor(payload * 10 * 10));
2547
2547
  };
2548
+ instance.listener.optionsChange = (payload) => {
2549
+ setPageScale(Math.round(payload.scale * 100));
2550
+ setPaperDirection(payload.paperDirection);
2551
+ setPaperWidth(payload.width);
2552
+ setPaperHeight(payload.height);
2553
+ };
2548
2554
  instance.listener.contentChange = async () => {
2549
2555
  const count2 = await instance?.command.getWordCount();
2550
2556
  setWordCount(count2 || 0);