@fileverse-dev/fortune-core 1.0.2-mod-43 → 1.0.2-mod-45

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.esm.js CHANGED
@@ -75128,8 +75128,6 @@ function sanitizeDuneUrl(input) {
75128
75128
  }
75129
75129
  return null;
75130
75130
  }
75131
- var sharedCtx;
75132
- var sharedGlobalCache;
75133
75131
  function saveIframe(ctx) {
75134
75132
  var index = getSheetIndex(ctx, ctx.currentSheetId);
75135
75133
  if (index == null) return;
@@ -75162,8 +75160,11 @@ function insertIframe(ctx, src) {
75162
75160
  width: 400,
75163
75161
  height: 300
75164
75162
  };
75165
- ctx.insertedIframes = (ctx.insertedIframes || []).concat(iframe);
75166
- saveIframe(ctx);
75163
+ var index = getSheetIndex(ctx, ctx.currentSheetId);
75164
+ if (index == null) return;
75165
+ var file = ctx.luckysheetfile[index];
75166
+ file.iframes = (file.iframes || []).concat(iframe);
75167
+ ctx.insertedIframes = file.iframes;
75167
75168
  } catch (err) {
75168
75169
  console.info(err);
75169
75170
  }
@@ -75247,14 +75248,6 @@ function onIframeMoveEnd(ctx, globalCache) {
75247
75248
  }
75248
75249
  }
75249
75250
  }
75250
- function onIframeMoveWrapped(e) {
75251
- onIframeMove(sharedCtx, sharedGlobalCache, e);
75252
- }
75253
- function onIframeMoveEndWrapped() {
75254
- onIframeMoveEnd(sharedCtx, sharedGlobalCache);
75255
- document.removeEventListener("mousemove", onIframeMoveWrapped);
75256
- document.removeEventListener("mouseup", onIframeMoveEndWrapped);
75257
- }
75258
75251
  function onIframeMoveStart(ctx, globalCache, e) {
75259
75252
  var position = getIframePosition();
75260
75253
  if (position) {
@@ -75270,10 +75263,6 @@ function onIframeMoveStart(ctx, globalCache, e) {
75270
75263
  top: top
75271
75264
  }
75272
75265
  });
75273
- sharedCtx = ctx;
75274
- sharedGlobalCache = globalCache;
75275
- document.addEventListener("mousemove", onIframeMoveWrapped);
75276
- document.addEventListener("mouseup", onIframeMoveEndWrapped);
75277
75266
  }
75278
75267
  }
75279
75268
  function onIframeResize(ctx, globalCache, e) {
@@ -75329,14 +75318,6 @@ function onIframeResize(ctx, globalCache, e) {
75329
75318
  content.style.height = "".concat(height, "px");
75330
75319
  return true;
75331
75320
  }
75332
- function onIframeResizeWrapped(e) {
75333
- onIframeResize(sharedCtx, sharedGlobalCache, e);
75334
- }
75335
- function onIframeResizeEndWrapped() {
75336
- onIframeResizeEnd(sharedCtx, sharedGlobalCache);
75337
- document.removeEventListener("mousemove", onIframeResizeWrapped);
75338
- document.removeEventListener("mouseup", onIframeResizeEndWrapped);
75339
- }
75340
75321
  function onIframeResizeStart(ctx, globalCache, e, resizingSide) {
75341
75322
  var position = getIframePosition();
75342
75323
  if (position) {
@@ -75348,10 +75329,6 @@ function onIframeResizeStart(ctx, globalCache, e, resizingSide) {
75348
75329
  resizingSide: resizingSide,
75349
75330
  iframeInitialPosition: position
75350
75331
  });
75351
- sharedCtx = ctx;
75352
- sharedGlobalCache = globalCache;
75353
- document.addEventListener("mousemove", onIframeResizeWrapped);
75354
- document.addEventListener("mouseup", onIframeResizeEndWrapped);
75355
75332
  }
75356
75333
  }
75357
75334
 
@@ -75681,6 +75658,11 @@ function opToPatch(ctx, ops) {
75681
75658
  path: ["insertedImgs"]
75682
75659
  }));
75683
75660
  }
75661
+ if (op.path[0] === "iframes" && op.id === ctx.currentSheetId) {
75662
+ additionalPatches.push(_objectSpread2(_objectSpread2({}, patch), {}, {
75663
+ path: ["insertedIframes"]
75664
+ }));
75665
+ }
75684
75666
  }
75685
75667
  return patch;
75686
75668
  });
@@ -77995,6 +77977,8 @@ function handleOverlayMouseUp(ctx, globalCache, settings, e, scrollbarX, scrollb
77995
77977
  var rect = container.getBoundingClientRect();
77996
77978
  onImageMoveEnd(ctx, globalCache);
77997
77979
  onImageResizeEnd(ctx, globalCache);
77980
+ onIframeMoveEnd(ctx, globalCache);
77981
+ onIframeResizeEnd(ctx, globalCache);
77998
77982
  onCommentBoxMoveEnd(ctx, globalCache);
77999
77983
  onCommentBoxResizeEnd(ctx, globalCache);
78000
77984
  onFormulaRangeDragEnd(ctx);
package/dist/index.js CHANGED
@@ -75138,8 +75138,6 @@ function sanitizeDuneUrl(input) {
75138
75138
  }
75139
75139
  return null;
75140
75140
  }
75141
- var sharedCtx;
75142
- var sharedGlobalCache;
75143
75141
  function saveIframe(ctx) {
75144
75142
  var index = getSheetIndex(ctx, ctx.currentSheetId);
75145
75143
  if (index == null) return;
@@ -75172,8 +75170,11 @@ function insertIframe(ctx, src) {
75172
75170
  width: 400,
75173
75171
  height: 300
75174
75172
  };
75175
- ctx.insertedIframes = (ctx.insertedIframes || []).concat(iframe);
75176
- saveIframe(ctx);
75173
+ var index = getSheetIndex(ctx, ctx.currentSheetId);
75174
+ if (index == null) return;
75175
+ var file = ctx.luckysheetfile[index];
75176
+ file.iframes = (file.iframes || []).concat(iframe);
75177
+ ctx.insertedIframes = file.iframes;
75177
75178
  } catch (err) {
75178
75179
  console.info(err);
75179
75180
  }
@@ -75257,14 +75258,6 @@ function onIframeMoveEnd(ctx, globalCache) {
75257
75258
  }
75258
75259
  }
75259
75260
  }
75260
- function onIframeMoveWrapped(e) {
75261
- onIframeMove(sharedCtx, sharedGlobalCache, e);
75262
- }
75263
- function onIframeMoveEndWrapped() {
75264
- onIframeMoveEnd(sharedCtx, sharedGlobalCache);
75265
- document.removeEventListener("mousemove", onIframeMoveWrapped);
75266
- document.removeEventListener("mouseup", onIframeMoveEndWrapped);
75267
- }
75268
75261
  function onIframeMoveStart(ctx, globalCache, e) {
75269
75262
  var position = getIframePosition();
75270
75263
  if (position) {
@@ -75280,10 +75273,6 @@ function onIframeMoveStart(ctx, globalCache, e) {
75280
75273
  top: top
75281
75274
  }
75282
75275
  });
75283
- sharedCtx = ctx;
75284
- sharedGlobalCache = globalCache;
75285
- document.addEventListener("mousemove", onIframeMoveWrapped);
75286
- document.addEventListener("mouseup", onIframeMoveEndWrapped);
75287
75276
  }
75288
75277
  }
75289
75278
  function onIframeResize(ctx, globalCache, e) {
@@ -75339,14 +75328,6 @@ function onIframeResize(ctx, globalCache, e) {
75339
75328
  content.style.height = "".concat(height, "px");
75340
75329
  return true;
75341
75330
  }
75342
- function onIframeResizeWrapped(e) {
75343
- onIframeResize(sharedCtx, sharedGlobalCache, e);
75344
- }
75345
- function onIframeResizeEndWrapped() {
75346
- onIframeResizeEnd(sharedCtx, sharedGlobalCache);
75347
- document.removeEventListener("mousemove", onIframeResizeWrapped);
75348
- document.removeEventListener("mouseup", onIframeResizeEndWrapped);
75349
- }
75350
75331
  function onIframeResizeStart(ctx, globalCache, e, resizingSide) {
75351
75332
  var position = getIframePosition();
75352
75333
  if (position) {
@@ -75358,10 +75339,6 @@ function onIframeResizeStart(ctx, globalCache, e, resizingSide) {
75358
75339
  resizingSide: resizingSide,
75359
75340
  iframeInitialPosition: position
75360
75341
  });
75361
- sharedCtx = ctx;
75362
- sharedGlobalCache = globalCache;
75363
- document.addEventListener("mousemove", onIframeResizeWrapped);
75364
- document.addEventListener("mouseup", onIframeResizeEndWrapped);
75365
75342
  }
75366
75343
  }
75367
75344
 
@@ -75691,6 +75668,11 @@ function opToPatch(ctx, ops) {
75691
75668
  path: ["insertedImgs"]
75692
75669
  }));
75693
75670
  }
75671
+ if (op.path[0] === "iframes" && op.id === ctx.currentSheetId) {
75672
+ additionalPatches.push(_objectSpread2(_objectSpread2({}, patch), {}, {
75673
+ path: ["insertedIframes"]
75674
+ }));
75675
+ }
75694
75676
  }
75695
75677
  return patch;
75696
75678
  });
@@ -78005,6 +77987,8 @@ function handleOverlayMouseUp(ctx, globalCache, settings, e, scrollbarX, scrollb
78005
77987
  var rect = container.getBoundingClientRect();
78006
77988
  onImageMoveEnd(ctx, globalCache);
78007
77989
  onImageResizeEnd(ctx, globalCache);
77990
+ onIframeMoveEnd(ctx, globalCache);
77991
+ onIframeResizeEnd(ctx, globalCache);
78008
77992
  onCommentBoxMoveEnd(ctx, globalCache);
78009
77993
  onCommentBoxResizeEnd(ctx, globalCache);
78010
77994
  onFormulaRangeDragEnd(ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.0.2-mod-43",
3
+ "version": "1.0.2-mod-45",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",