@makeswift/runtime 0.2.10 → 0.2.13
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/Form.cjs.js +5 -1
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +5 -1
- package/dist/Form.es.js.map +1 -1
- package/dist/index.cjs.js +20 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +21 -2
- package/dist/index.es.js.map +1 -1
- package/dist/react-builder-preview.es.js +1 -1
- package/dist/react-page.cjs.js +364 -0
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +363 -1
- package/dist/react-page.es.js.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
- package/dist/types/src/next/api-handler.d.ts +4 -1
- package/dist/types/src/next/api-handler.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/copy/backgrounds.d.ts +57 -0
- package/dist/types/src/prop-controllers/copy/backgrounds.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/border.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/border.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/element-id.d.ts +3 -0
- package/dist/types/src/prop-controllers/copy/element-id.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/grid.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/grid.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/image.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/image.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/images.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/images.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/link.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/link.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/navigation-links.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/navigation-links.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/responsive-color.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/responsive-color.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/rich-text.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/rich-text.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/shadows.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/shadows.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/table-form-fields.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/table-form-fields.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy/table.d.ts +4 -0
- package/dist/types/src/prop-controllers/copy/table.d.ts.map +1 -0
- package/dist/types/src/prop-controllers/copy.d.ts +5 -0
- package/dist/types/src/prop-controllers/copy.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/index.d.ts +1 -0
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +51 -0
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ import { combineReducers, createStore, applyMiddleware } from "redux";
|
|
|
21
21
|
import thunk from "redux-thunk";
|
|
22
22
|
import { Q as deepEqual } from "./index.es.js";
|
|
23
23
|
import { removeIn, setIn } from "immutable";
|
|
24
|
-
import {
|
|
24
|
+
import { t as getInitialState$1, u as reducer$2, v as getDocument$1, c as createDocument, w as reducer$3, x as reducer$5, y as reducer$6, z as reducer$7, A as reducer$8, B as getComponentsMeta$1, C as getComponentPropControllerDescriptors$1, D as getPropController, E as getPropControllersHandle, F as getElement, G as getElementPropControllerDescriptors, i as isElementReference, H as isPropControllersHandle } from "./react-page.es.js";
|
|
25
25
|
import { A as ActionTypes, l as changeElementBoxModels, n as changeDocumentElementSize, o as handleWheel, p as setIsInBuilder, q as registerBuilderComponent, t as unregisterBuilderComponent, v as unregisterMeasurable, w as registerMeasurable, x as unregisterPropControllers, y as registerPropControllers, z as registerPropControllersHandle, B as messageBuilderPropController } from "./actions.es.js";
|
|
26
26
|
import { r as reducer$4, a as getMeasurables$1, b as getBoxModels$1, m as measure, d as getBoxModel$1, i as isMeasurable } from "./box-models.es.js";
|
|
27
27
|
export { c as createBox, g as getBox, p as parse } from "./box-models.es.js";
|
package/dist/react-page.cjs.js
CHANGED
|
@@ -473,6 +473,329 @@ function getPageIds(descriptor, prop) {
|
|
|
473
473
|
return [];
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
+
function copy$d(value, context) {
|
|
477
|
+
if (value == null)
|
|
478
|
+
return value;
|
|
479
|
+
return value.map((override) => __spreadProps(__spreadValues({}, override), {
|
|
480
|
+
value: override.value.map((backgroundItem) => {
|
|
481
|
+
var _a, _b;
|
|
482
|
+
switch (backgroundItem.type) {
|
|
483
|
+
case "color":
|
|
484
|
+
return __spreadProps(__spreadValues({}, backgroundItem), {
|
|
485
|
+
payload: backgroundItem.payload === null ? null : __spreadProps(__spreadValues({}, backgroundItem.payload), {
|
|
486
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(backgroundItem.payload.swatchId)) != null ? _a : backgroundItem.payload.swatchId
|
|
487
|
+
})
|
|
488
|
+
});
|
|
489
|
+
case "gradient":
|
|
490
|
+
return __spreadProps(__spreadValues({}, backgroundItem), {
|
|
491
|
+
payload: __spreadProps(__spreadValues({}, backgroundItem.payload), {
|
|
492
|
+
stops: backgroundItem.payload.stops.map((stop) => {
|
|
493
|
+
var _a2;
|
|
494
|
+
return __spreadProps(__spreadValues({}, stop), {
|
|
495
|
+
color: stop.color == null ? null : __spreadProps(__spreadValues({}, stop.color), {
|
|
496
|
+
swatchId: (_a2 = context.replacementContext.swatchIds.get(stop.color.swatchId)) != null ? _a2 : stop.color.swatchId
|
|
497
|
+
})
|
|
498
|
+
});
|
|
499
|
+
})
|
|
500
|
+
})
|
|
501
|
+
});
|
|
502
|
+
case "image":
|
|
503
|
+
return __spreadProps(__spreadValues({}, backgroundItem), {
|
|
504
|
+
payload: __spreadProps(__spreadValues({}, backgroundItem.payload), {
|
|
505
|
+
imageId: (_b = context.replacementContext.fileIds.get(backgroundItem.payload.imageId)) != null ? _b : backgroundItem.payload.imageId
|
|
506
|
+
})
|
|
507
|
+
});
|
|
508
|
+
default:
|
|
509
|
+
return backgroundItem;
|
|
510
|
+
}
|
|
511
|
+
})
|
|
512
|
+
}));
|
|
513
|
+
}
|
|
514
|
+
function copy$c(value, context) {
|
|
515
|
+
return __spreadProps(__spreadValues({}, value), {
|
|
516
|
+
elements: value.elements.map((element) => context.copyElement(element))
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
function copy$b(value, context) {
|
|
520
|
+
var _a, _b;
|
|
521
|
+
if (value == null)
|
|
522
|
+
return value;
|
|
523
|
+
switch (value.type) {
|
|
524
|
+
case "OPEN_PAGE": {
|
|
525
|
+
const pageId = value.payload.pageId;
|
|
526
|
+
if (pageId == null)
|
|
527
|
+
return value;
|
|
528
|
+
return __spreadProps(__spreadValues({}, value), {
|
|
529
|
+
payload: __spreadProps(__spreadValues({}, value.payload), {
|
|
530
|
+
pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : pageId
|
|
531
|
+
})
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
case "SCROLL_TO_ELEMENT": {
|
|
535
|
+
const elementIdConfig = value.payload.elementIdConfig;
|
|
536
|
+
if (elementIdConfig == null)
|
|
537
|
+
return value;
|
|
538
|
+
return __spreadProps(__spreadValues({}, value), {
|
|
539
|
+
payload: __spreadProps(__spreadValues({}, value.payload), {
|
|
540
|
+
elementIdConfig: __spreadProps(__spreadValues({}, elementIdConfig), {
|
|
541
|
+
elementKey: (_b = context.replacementContext.elementKeys.get(elementIdConfig.elementKey)) != null ? _b : elementIdConfig.elementKey
|
|
542
|
+
})
|
|
543
|
+
})
|
|
544
|
+
});
|
|
545
|
+
}
|
|
546
|
+
default:
|
|
547
|
+
return value;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
function copy$a(value, context) {
|
|
551
|
+
if (value == null)
|
|
552
|
+
return value;
|
|
553
|
+
return value.map(copyNavigationLinksPanelItem);
|
|
554
|
+
function copyNavigationLinksPanelItem(item) {
|
|
555
|
+
switch (item.type) {
|
|
556
|
+
case "button":
|
|
557
|
+
case "dropdown": {
|
|
558
|
+
const { color: color2, link } = item.payload;
|
|
559
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
560
|
+
payload: __spreadProps(__spreadValues({}, item.payload), {
|
|
561
|
+
link: link != null ? copy$b(link, context) : void 0,
|
|
562
|
+
color: color2 != null ? color2.map((override) => {
|
|
563
|
+
var _a;
|
|
564
|
+
return __spreadProps(__spreadValues({}, override), {
|
|
565
|
+
value: __spreadProps(__spreadValues({}, override.value), {
|
|
566
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(override.value.swatchId)) != null ? _a : override.value.swatchId
|
|
567
|
+
})
|
|
568
|
+
});
|
|
569
|
+
}) : void 0
|
|
570
|
+
})
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
default:
|
|
574
|
+
return item;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
function copy$9(value, context) {
|
|
579
|
+
if (value == null)
|
|
580
|
+
return value;
|
|
581
|
+
return value.map((override) => __spreadProps(__spreadValues({}, override), { value: override.value.map(copyShadowItem) }));
|
|
582
|
+
function copyShadowItem(item) {
|
|
583
|
+
var _a;
|
|
584
|
+
const { color: color2 } = item.payload;
|
|
585
|
+
if (color2 == null)
|
|
586
|
+
return item;
|
|
587
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
588
|
+
payload: __spreadProps(__spreadValues({}, item.payload), {
|
|
589
|
+
color: __spreadProps(__spreadValues({}, color2), {
|
|
590
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(color2.swatchId)) != null ? _a : color2.swatchId
|
|
591
|
+
})
|
|
592
|
+
})
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
function copy$8(value, context) {
|
|
597
|
+
var _a;
|
|
598
|
+
if (value == null)
|
|
599
|
+
return value;
|
|
600
|
+
return (_a = context.replacementContext.fileIds.get(value)) != null ? _a : value;
|
|
601
|
+
}
|
|
602
|
+
function copy$7(value, context) {
|
|
603
|
+
if (value == null)
|
|
604
|
+
return value;
|
|
605
|
+
return value.map(copyImagesPanelItem);
|
|
606
|
+
function copyImagesPanelItem(imagesPanelItem) {
|
|
607
|
+
var _a;
|
|
608
|
+
const { file } = imagesPanelItem.props;
|
|
609
|
+
if (file == null)
|
|
610
|
+
return imagesPanelItem;
|
|
611
|
+
return __spreadProps(__spreadValues({}, imagesPanelItem), {
|
|
612
|
+
props: __spreadProps(__spreadValues({}, imagesPanelItem.props), {
|
|
613
|
+
file: (_a = context.replacementContext.fileIds.get(file)) != null ? _a : file
|
|
614
|
+
})
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
function copy$6(value, context) {
|
|
619
|
+
if (value == null)
|
|
620
|
+
return value;
|
|
621
|
+
return value.map((override) => __spreadProps(__spreadValues({}, override), { value: copyColorValue(override.value) }));
|
|
622
|
+
function copyColorValue(colorValue) {
|
|
623
|
+
var _a;
|
|
624
|
+
return __spreadProps(__spreadValues({}, colorValue), {
|
|
625
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(colorValue.swatchId)) != null ? _a : colorValue.swatchId
|
|
626
|
+
});
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function copy$5(value, context) {
|
|
630
|
+
if (value == null)
|
|
631
|
+
return value;
|
|
632
|
+
return __spreadProps(__spreadValues({}, value), { fields: value.fields.map(copyFormFieldsPanelItem) });
|
|
633
|
+
function copyFormFieldsPanelItem(item) {
|
|
634
|
+
var _a;
|
|
635
|
+
return __spreadProps(__spreadValues({}, item), {
|
|
636
|
+
tableColumnId: (_a = context.replacementContext.tableColumnIds.get(item.tableColumnId)) != null ? _a : item.tableColumnId
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
function copy$4(value, context) {
|
|
641
|
+
var _a;
|
|
642
|
+
if (value == null)
|
|
643
|
+
return value;
|
|
644
|
+
return (_a = context.replacementContext.tableIds.get(value)) != null ? _a : value;
|
|
645
|
+
}
|
|
646
|
+
function copy$3(value, context) {
|
|
647
|
+
if (value == null)
|
|
648
|
+
return value;
|
|
649
|
+
return value.map((override) => __spreadProps(__spreadValues({}, override), { value: copyBorderValue(override.value) }));
|
|
650
|
+
function copyBorderValue({ borderTop, borderRight, borderBottom, borderLeft }) {
|
|
651
|
+
return {
|
|
652
|
+
borderTop: borderTop && copyBorderSide(borderTop),
|
|
653
|
+
borderRight: borderRight && copyBorderSide(borderRight),
|
|
654
|
+
borderBottom: borderBottom && copyBorderSide(borderBottom),
|
|
655
|
+
borderLeft: borderLeft && copyBorderSide(borderLeft)
|
|
656
|
+
};
|
|
657
|
+
}
|
|
658
|
+
function copyBorderSide(borderSide) {
|
|
659
|
+
var _a;
|
|
660
|
+
const { color: color2 } = borderSide;
|
|
661
|
+
if (color2 == null)
|
|
662
|
+
return borderSide;
|
|
663
|
+
return __spreadProps(__spreadValues({}, borderSide), {
|
|
664
|
+
color: __spreadProps(__spreadValues({}, color2), {
|
|
665
|
+
swatchId: (_a = context.replacementContext.swatchIds.get(color2.swatchId)) != null ? _a : color2.swatchId
|
|
666
|
+
})
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
function copy$2(value, context) {
|
|
671
|
+
if (value == null)
|
|
672
|
+
return value;
|
|
673
|
+
return __spreadProps(__spreadValues({}, value), { document: value.document ? copyNode(value.document) : value.document });
|
|
674
|
+
function copyNode(node) {
|
|
675
|
+
var _a;
|
|
676
|
+
switch (node.object) {
|
|
677
|
+
case "document":
|
|
678
|
+
case "block":
|
|
679
|
+
case "inline":
|
|
680
|
+
return copyInline(node);
|
|
681
|
+
case "text":
|
|
682
|
+
return __spreadProps(__spreadValues({}, node), { marks: (_a = node.marks) == null ? void 0 : _a.map(copyMark) });
|
|
683
|
+
default:
|
|
684
|
+
return node;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
function copyInline(inline) {
|
|
688
|
+
var _a, _b;
|
|
689
|
+
switch (inline.type) {
|
|
690
|
+
case "link":
|
|
691
|
+
return __spreadProps(__spreadValues({}, inline), {
|
|
692
|
+
nodes: (_a = inline.nodes) == null ? void 0 : _a.map(copyNode),
|
|
693
|
+
data: inline.data ? copyLinkData(inline.data) : inline.data
|
|
694
|
+
});
|
|
695
|
+
default:
|
|
696
|
+
return __spreadProps(__spreadValues({}, inline), { nodes: (_b = inline.nodes) == null ? void 0 : _b.map(copyNode) });
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function copyLinkData(data) {
|
|
700
|
+
var _a, _b;
|
|
701
|
+
switch (data.type) {
|
|
702
|
+
case "OPEN_PAGE": {
|
|
703
|
+
const pageId = data.payload.pageId;
|
|
704
|
+
if (pageId == null)
|
|
705
|
+
return data;
|
|
706
|
+
return __spreadProps(__spreadValues({}, data), {
|
|
707
|
+
payload: __spreadProps(__spreadValues({}, data.payload), {
|
|
708
|
+
pageId: (_a = context.replacementContext.pageIds.get(pageId)) != null ? _a : data.payload.pageId
|
|
709
|
+
})
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
case "SCROLL_TO_ELEMENT": {
|
|
713
|
+
const elementIdConfig = data.payload.elementIdConfig;
|
|
714
|
+
if (elementIdConfig == null)
|
|
715
|
+
return data;
|
|
716
|
+
return __spreadProps(__spreadValues({}, data), {
|
|
717
|
+
payload: __spreadProps(__spreadValues({}, data.payload), {
|
|
718
|
+
elementIdConfig: __spreadProps(__spreadValues({}, elementIdConfig), {
|
|
719
|
+
elementKey: (_b = context.replacementContext.elementKeys.get(elementIdConfig.elementKey)) != null ? _b : elementIdConfig.elementKey
|
|
720
|
+
})
|
|
721
|
+
})
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
default:
|
|
725
|
+
return data;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
function copyMark(mark) {
|
|
729
|
+
var _a, _b, _c, _d;
|
|
730
|
+
switch (mark.type) {
|
|
731
|
+
case "typography": {
|
|
732
|
+
const typographyId = (_a = mark.data) == null ? void 0 : _a.value.id;
|
|
733
|
+
return __spreadProps(__spreadValues({}, mark), {
|
|
734
|
+
data: __spreadProps(__spreadValues({}, mark.data), {
|
|
735
|
+
value: __spreadProps(__spreadValues({}, (_b = mark.data) == null ? void 0 : _b.value), {
|
|
736
|
+
id: (_c = context.replacementContext.typographyIds.get(typographyId)) != null ? _c : typographyId,
|
|
737
|
+
style: (_d = mark.data) == null ? void 0 : _d.value.style.map((override) => {
|
|
738
|
+
var _a2, _b2, _c2;
|
|
739
|
+
return __spreadProps(__spreadValues({}, override), {
|
|
740
|
+
value: __spreadProps(__spreadValues({}, override.value), {
|
|
741
|
+
color: override.value.color == null ? override.value.color : __spreadProps(__spreadValues({}, override.value.color), {
|
|
742
|
+
swatchId: (_c2 = context.replacementContext.swatchIds.get((_a2 = override.value.color) == null ? void 0 : _a2.swatchId)) != null ? _c2 : (_b2 = override.value.color) == null ? void 0 : _b2.swatchId
|
|
743
|
+
})
|
|
744
|
+
})
|
|
745
|
+
});
|
|
746
|
+
})
|
|
747
|
+
})
|
|
748
|
+
})
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
default:
|
|
752
|
+
return mark;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
function copy$1(value, context) {
|
|
757
|
+
if (value == null)
|
|
758
|
+
return value;
|
|
759
|
+
if (context.replacementContext.elementHtmlIds.has(value))
|
|
760
|
+
return void 0;
|
|
761
|
+
context.replacementContext.elementHtmlIds.add(value);
|
|
762
|
+
return value;
|
|
763
|
+
}
|
|
764
|
+
function copy(descriptor, value, context) {
|
|
765
|
+
switch (descriptor.type) {
|
|
766
|
+
case "Backgrounds":
|
|
767
|
+
return copy$d(value, context);
|
|
768
|
+
case "Grid":
|
|
769
|
+
return copy$c(value, context);
|
|
770
|
+
case "NavigationLinks":
|
|
771
|
+
return copy$a(value, context);
|
|
772
|
+
case "Link":
|
|
773
|
+
return copy$b(value, context);
|
|
774
|
+
case "Shadows":
|
|
775
|
+
return copy$9(value, context);
|
|
776
|
+
case "Image":
|
|
777
|
+
return copy$8(value, context);
|
|
778
|
+
case "Images":
|
|
779
|
+
return copy$7(value, context);
|
|
780
|
+
case "ResponsiveColor":
|
|
781
|
+
return copy$6(value, context);
|
|
782
|
+
case "TableFormFields":
|
|
783
|
+
return copy$5(value, context);
|
|
784
|
+
case "Table":
|
|
785
|
+
return copy$4(value, context);
|
|
786
|
+
case "Border":
|
|
787
|
+
return copy$3(value, context);
|
|
788
|
+
case "RichText":
|
|
789
|
+
return copy$2(value, context);
|
|
790
|
+
case "ElementID":
|
|
791
|
+
return copy$1(value, context);
|
|
792
|
+
default:
|
|
793
|
+
return value;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
function copyElementReference(value, context) {
|
|
797
|
+
return context.replacementContext.globalElementIds.get(value) || value;
|
|
798
|
+
}
|
|
476
799
|
const reducer = redux.combineReducers({
|
|
477
800
|
documents: reducer$6,
|
|
478
801
|
reactComponents: reducer$5,
|
|
@@ -558,6 +881,45 @@ function getElementId(state, documentKey, elementKey) {
|
|
|
558
881
|
}, null);
|
|
559
882
|
return elementId;
|
|
560
883
|
}
|
|
884
|
+
function createReplacementContext(jsonReplacementContext) {
|
|
885
|
+
const rc = {
|
|
886
|
+
elementHtmlIds: new Set(jsonReplacementContext.elementHtmlIds),
|
|
887
|
+
elementKeys: new Map(jsonReplacementContext.elementKeys && Object.entries(jsonReplacementContext.elementKeys)),
|
|
888
|
+
swatchIds: new Map(jsonReplacementContext.swatchIds && Object.entries(jsonReplacementContext.swatchIds)),
|
|
889
|
+
fileIds: new Map(jsonReplacementContext.fileIds && Object.entries(jsonReplacementContext.fileIds)),
|
|
890
|
+
typographyIds: new Map(jsonReplacementContext.typographyIds && Object.entries(jsonReplacementContext.typographyIds)),
|
|
891
|
+
tableIds: new Map(jsonReplacementContext.tableIds && Object.entries(jsonReplacementContext.tableIds)),
|
|
892
|
+
tableColumnIds: new Map(jsonReplacementContext.tableColumnIds && Object.entries(jsonReplacementContext.tableColumnIds)),
|
|
893
|
+
pageIds: new Map(jsonReplacementContext.pageIds && Object.entries(jsonReplacementContext.pageIds)),
|
|
894
|
+
globalElementIds: new Map(jsonReplacementContext.globalElementIds && Object.entries(jsonReplacementContext.globalElementIds)),
|
|
895
|
+
globalElementData: new Map(jsonReplacementContext.globalElementData && Object.entries(jsonReplacementContext.globalElementData))
|
|
896
|
+
};
|
|
897
|
+
return rc;
|
|
898
|
+
}
|
|
899
|
+
function copyElementTree(state, elementTree, replacementContext) {
|
|
900
|
+
function copyElementTreeNode(state2, replacementContext2) {
|
|
901
|
+
return function(node) {
|
|
902
|
+
const context = {
|
|
903
|
+
replacementContext: replacementContext2,
|
|
904
|
+
copyElement: copyElementTreeNode(state2, replacementContext2)
|
|
905
|
+
};
|
|
906
|
+
if ("props" in node) {
|
|
907
|
+
for (const propKey of Object.keys(node.props)) {
|
|
908
|
+
const descriptors = getComponentPropControllerDescriptors(state2, node.type);
|
|
909
|
+
if (descriptors == null)
|
|
910
|
+
continue;
|
|
911
|
+
const descriptor = descriptors[propKey];
|
|
912
|
+
node.props[propKey] = copy(descriptor, node.props[propKey], context);
|
|
913
|
+
}
|
|
914
|
+
} else if (node.type === "reference") {
|
|
915
|
+
return __spreadProps(__spreadValues({}, node), { value: copyElementReference(node.value, context) });
|
|
916
|
+
}
|
|
917
|
+
return node;
|
|
918
|
+
};
|
|
919
|
+
}
|
|
920
|
+
const copy$12 = JSON.parse(JSON.stringify(elementTree));
|
|
921
|
+
return copyElementTreeNode(state, replacementContext)(copy$12);
|
|
922
|
+
}
|
|
561
923
|
function getIsInBuilder(state) {
|
|
562
924
|
return state.isInBuilder;
|
|
563
925
|
}
|
|
@@ -568,8 +930,10 @@ function configureStore({
|
|
|
568
930
|
return redux.createStore(reducer, __spreadProps(__spreadValues({}, preloadedState), { documents: getInitialState$5({ rootElements }) }), redux.applyMiddleware(thunk__default["default"]));
|
|
569
931
|
}
|
|
570
932
|
exports.configureStore = configureStore;
|
|
933
|
+
exports.copyElementTree = copyElementTree;
|
|
571
934
|
exports.createDocument = createDocument;
|
|
572
935
|
exports.createDocumentReference = createDocumentReference;
|
|
936
|
+
exports.createReplacementContext = createReplacementContext;
|
|
573
937
|
exports.getComponentPropControllerDescriptors = getComponentPropControllerDescriptors;
|
|
574
938
|
exports.getComponentPropControllerDescriptors$1 = getComponentPropControllerDescriptors$1;
|
|
575
939
|
exports.getComponentsMeta = getComponentsMeta;
|