@ixo/editor 5.36.1 → 5.37.0

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.
@@ -10900,6 +10900,30 @@ function replaceBlockInFragment(fragment, block) {
10900
10900
  }
10901
10901
  return false;
10902
10902
  }
10903
+ function swapBlocksInFragment(fragment, idA, idB) {
10904
+ const blockGroup = getExistingBlockGroup(fragment);
10905
+ if (!blockGroup) return false;
10906
+ let ia = -1;
10907
+ let ib = -1;
10908
+ for (let i = 0; i < blockGroup.length; i++) {
10909
+ const container = blockGroup.get(i);
10910
+ if (container instanceof Y4.XmlElement) {
10911
+ const id = container.getAttribute("id");
10912
+ if (id === idA) ia = i;
10913
+ else if (id === idB) ib = i;
10914
+ }
10915
+ }
10916
+ if (ia < 0 || ib < 0 || ia === ib) return false;
10917
+ const lo = Math.min(ia, ib);
10918
+ const hi = Math.max(ia, ib);
10919
+ const loClone = blockGroup.get(lo).clone();
10920
+ const hiClone = blockGroup.get(hi).clone();
10921
+ blockGroup.delete(hi, 1);
10922
+ blockGroup.insert(hi, [loClone]);
10923
+ blockGroup.delete(lo, 1);
10924
+ blockGroup.insert(lo, [hiClone]);
10925
+ return true;
10926
+ }
10903
10927
  function applyMergeResultToFragment(fragment, mergeResult) {
10904
10928
  const documentBlockGroup = getOrCreateDocumentBlockGroup(fragment);
10905
10929
  const blockByNodeId = /* @__PURE__ */ new Map();
@@ -12867,13 +12891,17 @@ export {
12867
12891
  createInvocationStore,
12868
12892
  createMemoryInvocationStore,
12869
12893
  writeRunRecordAndReconcile,
12894
+ compileBlockProps,
12895
+ COMPILED_BLOCK_TYPE,
12870
12896
  toEvaluatorOperator,
12871
12897
  buildBlockConditionsProp,
12872
12898
  compileBaseUcanFlow,
12899
+ createYMapFromNode,
12873
12900
  writeCompiledBlocksToFragment,
12874
12901
  removeAllFlowBlocks,
12875
12902
  removeBlockFromFragment,
12876
12903
  replaceBlockInFragment,
12904
+ swapBlocksInFragment,
12877
12905
  readBlocksFromFragment,
12878
12906
  readCompiledFlowFromYDoc,
12879
12907
  mergeCompiledFlows,
@@ -12914,4 +12942,4 @@ export {
12914
12942
  executeQueuedFlowAgentCoreCommands,
12915
12943
  FlowAgentService
12916
12944
  };
12917
- //# sourceMappingURL=chunk-MCFRBVCB.mjs.map
12945
+ //# sourceMappingURL=chunk-OOPKMGYW.mjs.map