@measured/puck 0.18.0-canary.4b589f6 → 0.18.0-canary.63b8b9a
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +94 -41
- package/dist/index.mjs +95 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -3663,8 +3663,9 @@ var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3663
3663
|
var getClassName17 = get_class_name_factory_default("DropZone", styles_module_default12);
|
3664
3664
|
var getRandomColor = () => `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
3665
3665
|
var RENDER_DEBUG = false;
|
3666
|
+
var DropZoneEditPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropZoneEdit, __spreadValues({}, props));
|
3666
3667
|
var DropZoneEdit = (0, import_react29.forwardRef)(
|
3667
|
-
function
|
3668
|
+
function DropZoneEditInternal({
|
3668
3669
|
zone,
|
3669
3670
|
allow,
|
3670
3671
|
disallow,
|
@@ -3825,7 +3826,7 @@ var DropZoneEdit = (0, import_react29.forwardRef)(
|
|
3825
3826
|
var _a, _b, _c, _d, _e;
|
3826
3827
|
const componentId = item.props.id;
|
3827
3828
|
const puckProps = {
|
3828
|
-
renderDropZone:
|
3829
|
+
renderDropZone: DropZoneEditPure,
|
3829
3830
|
isEditing: true,
|
3830
3831
|
dragRef: null
|
3831
3832
|
};
|
@@ -3888,8 +3889,9 @@ var DropZoneEdit = (0, import_react29.forwardRef)(
|
|
3888
3889
|
);
|
3889
3890
|
}
|
3890
3891
|
);
|
3892
|
+
var DropZoneRenderPure = (props) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DropZoneRender, __spreadValues({}, props));
|
3891
3893
|
var DropZoneRender = (0, import_react29.forwardRef)(
|
3892
|
-
function
|
3894
|
+
function DropZoneRenderInternal({ className, style, zone }, ref) {
|
3893
3895
|
const ctx = (0, import_react29.useContext)(dropZoneContext);
|
3894
3896
|
const { data, areaId = "root", config } = ctx || {};
|
3895
3897
|
let zoneCompound = rootDroppableId;
|
@@ -3927,7 +3929,9 @@ var DropZoneRender = (0, import_react29.forwardRef)(
|
|
3927
3929
|
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
3928
3930
|
Component.render,
|
3929
3931
|
__spreadProps(__spreadValues({}, item.props), {
|
3930
|
-
puck: {
|
3932
|
+
puck: {
|
3933
|
+
renderDropZone: DropZoneRenderPure
|
3934
|
+
}
|
3931
3935
|
})
|
3932
3936
|
)
|
3933
3937
|
},
|
@@ -4002,6 +4006,48 @@ var getFrame = () => {
|
|
4002
4006
|
return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
|
4003
4007
|
};
|
4004
4008
|
|
4009
|
+
// lib/global-position.ts
|
4010
|
+
init_react_import();
|
4011
|
+
var GlobalPosition = class {
|
4012
|
+
constructor(target, original) {
|
4013
|
+
this.scaleFactor = 1;
|
4014
|
+
this.frameEl = null;
|
4015
|
+
this.frameRect = null;
|
4016
|
+
var _a;
|
4017
|
+
this.target = target;
|
4018
|
+
this.original = original;
|
4019
|
+
this.frameEl = document.querySelector("iframe");
|
4020
|
+
if (this.frameEl) {
|
4021
|
+
this.frameRect = this.frameEl.getBoundingClientRect();
|
4022
|
+
this.scaleFactor = this.frameRect.width / (((_a = this.frameEl.contentWindow) == null ? void 0 : _a.innerWidth) || 1);
|
4023
|
+
}
|
4024
|
+
}
|
4025
|
+
get x() {
|
4026
|
+
return this.original.x;
|
4027
|
+
}
|
4028
|
+
get y() {
|
4029
|
+
return this.original.y;
|
4030
|
+
}
|
4031
|
+
get global() {
|
4032
|
+
if (document !== this.target.ownerDocument && this.frameRect) {
|
4033
|
+
return {
|
4034
|
+
x: this.x * this.scaleFactor + this.frameRect.left,
|
4035
|
+
y: this.y * this.scaleFactor + this.frameRect.top
|
4036
|
+
};
|
4037
|
+
}
|
4038
|
+
return this.original;
|
4039
|
+
}
|
4040
|
+
get frame() {
|
4041
|
+
if (document === this.target.ownerDocument && this.frameRect) {
|
4042
|
+
return {
|
4043
|
+
x: (this.x - this.frameRect.left) / this.scaleFactor,
|
4044
|
+
y: (this.y - this.frameRect.top) / this.scaleFactor
|
4045
|
+
};
|
4046
|
+
}
|
4047
|
+
return this.original;
|
4048
|
+
}
|
4049
|
+
};
|
4050
|
+
|
4005
4051
|
// lib/dnd/NestedDroppablePlugin.ts
|
4006
4052
|
var depthSort = (candidates) => {
|
4007
4053
|
return candidates.sort((a, b) => {
|
@@ -4031,10 +4077,12 @@ var getZoneId2 = (candidate) => {
|
|
4031
4077
|
}
|
4032
4078
|
return id;
|
4033
4079
|
};
|
4034
|
-
var getPointerCollisions = (position, manager
|
4035
|
-
var _a;
|
4080
|
+
var getPointerCollisions = (position, manager) => {
|
4036
4081
|
const candidates = [];
|
4037
|
-
let elements = ownerDocument.elementsFromPoint(
|
4082
|
+
let elements = position.target.ownerDocument.elementsFromPoint(
|
4083
|
+
position.x,
|
4084
|
+
position.y
|
4085
|
+
);
|
4038
4086
|
const previewFrame = elements.find(
|
4039
4087
|
(el) => el.getAttribute("data-puck-preview")
|
4040
4088
|
);
|
@@ -4043,17 +4091,9 @@ var getPointerCollisions = (position, manager, ownerDocument) => {
|
|
4043
4091
|
elements = [drawer];
|
4044
4092
|
}
|
4045
4093
|
if (previewFrame) {
|
4046
|
-
const
|
4047
|
-
if (
|
4048
|
-
|
4049
|
-
const frame = getFrame();
|
4050
|
-
if (frame) {
|
4051
|
-
const scaleFactor = rect.width / (((_a = iframe.contentWindow) == null ? void 0 : _a.innerWidth) || 1);
|
4052
|
-
elements = frame.elementsFromPoint(
|
4053
|
-
(position.x - rect.left) / scaleFactor,
|
4054
|
-
(position.y - rect.top) / scaleFactor
|
4055
|
-
);
|
4056
|
-
}
|
4094
|
+
const frame = getFrame();
|
4095
|
+
if (frame) {
|
4096
|
+
elements = frame.elementsFromPoint(position.frame.x, position.frame.y);
|
4057
4097
|
}
|
4058
4098
|
}
|
4059
4099
|
if (elements) {
|
@@ -4070,9 +4110,9 @@ var getPointerCollisions = (position, manager, ownerDocument) => {
|
|
4070
4110
|
}
|
4071
4111
|
return candidates;
|
4072
4112
|
};
|
4073
|
-
var findDeepestCandidate = (position, manager
|
4113
|
+
var findDeepestCandidate = (position, manager) => {
|
4074
4114
|
var _a;
|
4075
|
-
const candidates = getPointerCollisions(position, manager
|
4115
|
+
const candidates = getPointerCollisions(position, manager);
|
4076
4116
|
if (candidates.length > 0) {
|
4077
4117
|
const sortedCandidates = depthSort(candidates);
|
4078
4118
|
const draggable = manager.dragOperation.source;
|
@@ -4125,22 +4165,18 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
4125
4165
|
}
|
4126
4166
|
const cleanupEffect = (0, import_state.effects)(() => {
|
4127
4167
|
const handleMove = (event) => {
|
4128
|
-
const
|
4168
|
+
const target = event.originalTarget || event.target;
|
4169
|
+
const position = new GlobalPosition(target, {
|
4129
4170
|
x: event.clientX,
|
4130
4171
|
y: event.clientY
|
4131
|
-
};
|
4132
|
-
const target = event.originalTarget || event.target;
|
4133
|
-
const ownerDocument = target == null ? void 0 : target.ownerDocument;
|
4172
|
+
});
|
4134
4173
|
const elements = document.elementsFromPoint(
|
4135
|
-
|
4136
|
-
|
4174
|
+
position.global.x,
|
4175
|
+
position.global.y
|
4137
4176
|
);
|
4138
4177
|
const overEl = elements.some((el) => el.id === id);
|
4139
4178
|
if (overEl) {
|
4140
|
-
onChange(
|
4141
|
-
findDeepestCandidate(position, manager, ownerDocument),
|
4142
|
-
manager
|
4143
|
-
);
|
4179
|
+
onChange(findDeepestCandidate(position, manager), manager);
|
4144
4180
|
}
|
4145
4181
|
};
|
4146
4182
|
const handleMoveThrottled = throttle(handleMove, 50);
|
@@ -4721,6 +4757,9 @@ var _PointerSensor = class _PointerSensor extends import_abstract10.Sensor {
|
|
4721
4757
|
}
|
4722
4758
|
}
|
4723
4759
|
handlePointerUp(event) {
|
4760
|
+
if (!this.source) {
|
4761
|
+
return;
|
4762
|
+
}
|
4724
4763
|
event.preventDefault();
|
4725
4764
|
event.stopPropagation();
|
4726
4765
|
const { status } = this.manager.dragOperation;
|
@@ -5342,7 +5381,7 @@ var Drawer = ({
|
|
5342
5381
|
"Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging."
|
5343
5382
|
);
|
5344
5383
|
}
|
5345
|
-
const
|
5384
|
+
const id = (0, import_react32.useId)();
|
5346
5385
|
const { ref } = useDroppableSafe({
|
5347
5386
|
id,
|
5348
5387
|
type: "void",
|
@@ -5643,19 +5682,33 @@ var useResolvedFields = () => {
|
|
5643
5682
|
lastData
|
5644
5683
|
});
|
5645
5684
|
}),
|
5646
|
-
[data, config, componentData, selectedItem, resolvedFields, state]
|
5685
|
+
[data, config, componentData, selectedItem, resolvedFields, state, parent]
|
5647
5686
|
);
|
5687
|
+
const [hasParent, setHasParent] = (0, import_react35.useState)(false);
|
5648
5688
|
(0, import_react35.useEffect)(() => {
|
5649
|
-
|
5650
|
-
|
5651
|
-
|
5652
|
-
|
5653
|
-
|
5654
|
-
|
5655
|
-
|
5656
|
-
|
5689
|
+
setHasParent(!!parent);
|
5690
|
+
}, [parent]);
|
5691
|
+
(0, import_react35.useEffect)(() => {
|
5692
|
+
var _a2, _b2;
|
5693
|
+
if (!((_a2 = state.ui.itemSelector) == null ? void 0 : _a2.zone) || ((_b2 = state.ui.itemSelector) == null ? void 0 : _b2.zone) === "default-zone" || hasParent) {
|
5694
|
+
if (hasResolver) {
|
5695
|
+
setFieldsLoading(true);
|
5696
|
+
resolveFields(defaultFields).then((fields) => {
|
5697
|
+
setResolvedFields(fields || {});
|
5698
|
+
setFieldsLoading(false);
|
5699
|
+
});
|
5700
|
+
} else {
|
5701
|
+
setResolvedFields(defaultFields);
|
5702
|
+
}
|
5657
5703
|
}
|
5658
|
-
}, [
|
5704
|
+
}, [
|
5705
|
+
data,
|
5706
|
+
defaultFields,
|
5707
|
+
state.ui.itemSelector,
|
5708
|
+
selectedItem,
|
5709
|
+
hasResolver,
|
5710
|
+
hasParent
|
5711
|
+
]);
|
5659
5712
|
return [resolvedFields, fieldsLoading];
|
5660
5713
|
};
|
5661
5714
|
var Fields = () => {
|
package/dist/index.mjs
CHANGED
@@ -2425,7 +2425,7 @@ init_react_import();
|
|
2425
2425
|
var styles_module_default10 = { "Drawer": "_Drawer_fkqfo_1", "Drawer-draggable": "_Drawer-draggable_fkqfo_8", "Drawer-draggableBg": "_Drawer-draggableBg_fkqfo_12", "Drawer-draggableFg": "_Drawer-draggableFg_fkqfo_21", "DrawerItem-draggable": "_DrawerItem-draggable_fkqfo_25", "DrawerItem--disabled": "_DrawerItem--disabled_fkqfo_38", "DrawerItem": "_DrawerItem_fkqfo_25", "Drawer--isDraggingFrom": "_Drawer--isDraggingFrom_fkqfo_48", "DrawerItem-name": "_DrawerItem-name_fkqfo_66" };
|
2426
2426
|
|
2427
2427
|
// components/Drawer/index.tsx
|
2428
|
-
import { useMemo as useMemo9, useState as useState18 } from "react";
|
2428
|
+
import { useId as useId2, useMemo as useMemo9, useState as useState18 } from "react";
|
2429
2429
|
|
2430
2430
|
// components/DragDropContext/index.tsx
|
2431
2431
|
init_react_import();
|
@@ -3506,8 +3506,9 @@ import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs10 } from "react/jsx-r
|
|
3506
3506
|
var getClassName17 = get_class_name_factory_default("DropZone", styles_module_default12);
|
3507
3507
|
var getRandomColor = () => `#${Math.floor(Math.random() * 16777215).toString(16)}`;
|
3508
3508
|
var RENDER_DEBUG = false;
|
3509
|
+
var DropZoneEditPure = (props) => /* @__PURE__ */ jsx22(DropZoneEdit, __spreadValues({}, props));
|
3509
3510
|
var DropZoneEdit = forwardRef3(
|
3510
|
-
function
|
3511
|
+
function DropZoneEditInternal({
|
3511
3512
|
zone,
|
3512
3513
|
allow,
|
3513
3514
|
disallow,
|
@@ -3668,7 +3669,7 @@ var DropZoneEdit = forwardRef3(
|
|
3668
3669
|
var _a, _b, _c, _d, _e;
|
3669
3670
|
const componentId = item.props.id;
|
3670
3671
|
const puckProps = {
|
3671
|
-
renderDropZone:
|
3672
|
+
renderDropZone: DropZoneEditPure,
|
3672
3673
|
isEditing: true,
|
3673
3674
|
dragRef: null
|
3674
3675
|
};
|
@@ -3731,8 +3732,9 @@ var DropZoneEdit = forwardRef3(
|
|
3731
3732
|
);
|
3732
3733
|
}
|
3733
3734
|
);
|
3735
|
+
var DropZoneRenderPure = (props) => /* @__PURE__ */ jsx22(DropZoneRender, __spreadValues({}, props));
|
3734
3736
|
var DropZoneRender = forwardRef3(
|
3735
|
-
function
|
3737
|
+
function DropZoneRenderInternal({ className, style, zone }, ref) {
|
3736
3738
|
const ctx = useContext6(dropZoneContext);
|
3737
3739
|
const { data, areaId = "root", config } = ctx || {};
|
3738
3740
|
let zoneCompound = rootDroppableId;
|
@@ -3770,7 +3772,9 @@ var DropZoneRender = forwardRef3(
|
|
3770
3772
|
children: /* @__PURE__ */ jsx22(
|
3771
3773
|
Component.render,
|
3772
3774
|
__spreadProps(__spreadValues({}, item.props), {
|
3773
|
-
puck: {
|
3775
|
+
puck: {
|
3776
|
+
renderDropZone: DropZoneRenderPure
|
3777
|
+
}
|
3774
3778
|
})
|
3775
3779
|
)
|
3776
3780
|
},
|
@@ -3845,6 +3849,48 @@ var getFrame = () => {
|
|
3845
3849
|
return (frameEl == null ? void 0 : frameEl.ownerDocument) || document;
|
3846
3850
|
};
|
3847
3851
|
|
3852
|
+
// lib/global-position.ts
|
3853
|
+
init_react_import();
|
3854
|
+
var GlobalPosition = class {
|
3855
|
+
constructor(target, original) {
|
3856
|
+
this.scaleFactor = 1;
|
3857
|
+
this.frameEl = null;
|
3858
|
+
this.frameRect = null;
|
3859
|
+
var _a;
|
3860
|
+
this.target = target;
|
3861
|
+
this.original = original;
|
3862
|
+
this.frameEl = document.querySelector("iframe");
|
3863
|
+
if (this.frameEl) {
|
3864
|
+
this.frameRect = this.frameEl.getBoundingClientRect();
|
3865
|
+
this.scaleFactor = this.frameRect.width / (((_a = this.frameEl.contentWindow) == null ? void 0 : _a.innerWidth) || 1);
|
3866
|
+
}
|
3867
|
+
}
|
3868
|
+
get x() {
|
3869
|
+
return this.original.x;
|
3870
|
+
}
|
3871
|
+
get y() {
|
3872
|
+
return this.original.y;
|
3873
|
+
}
|
3874
|
+
get global() {
|
3875
|
+
if (document !== this.target.ownerDocument && this.frameRect) {
|
3876
|
+
return {
|
3877
|
+
x: this.x * this.scaleFactor + this.frameRect.left,
|
3878
|
+
y: this.y * this.scaleFactor + this.frameRect.top
|
3879
|
+
};
|
3880
|
+
}
|
3881
|
+
return this.original;
|
3882
|
+
}
|
3883
|
+
get frame() {
|
3884
|
+
if (document === this.target.ownerDocument && this.frameRect) {
|
3885
|
+
return {
|
3886
|
+
x: (this.x - this.frameRect.left) / this.scaleFactor,
|
3887
|
+
y: (this.y - this.frameRect.top) / this.scaleFactor
|
3888
|
+
};
|
3889
|
+
}
|
3890
|
+
return this.original;
|
3891
|
+
}
|
3892
|
+
};
|
3893
|
+
|
3848
3894
|
// lib/dnd/NestedDroppablePlugin.ts
|
3849
3895
|
var depthSort = (candidates) => {
|
3850
3896
|
return candidates.sort((a, b) => {
|
@@ -3874,10 +3920,12 @@ var getZoneId2 = (candidate) => {
|
|
3874
3920
|
}
|
3875
3921
|
return id;
|
3876
3922
|
};
|
3877
|
-
var getPointerCollisions = (position, manager
|
3878
|
-
var _a;
|
3923
|
+
var getPointerCollisions = (position, manager) => {
|
3879
3924
|
const candidates = [];
|
3880
|
-
let elements = ownerDocument.elementsFromPoint(
|
3925
|
+
let elements = position.target.ownerDocument.elementsFromPoint(
|
3926
|
+
position.x,
|
3927
|
+
position.y
|
3928
|
+
);
|
3881
3929
|
const previewFrame = elements.find(
|
3882
3930
|
(el) => el.getAttribute("data-puck-preview")
|
3883
3931
|
);
|
@@ -3886,17 +3934,9 @@ var getPointerCollisions = (position, manager, ownerDocument) => {
|
|
3886
3934
|
elements = [drawer];
|
3887
3935
|
}
|
3888
3936
|
if (previewFrame) {
|
3889
|
-
const
|
3890
|
-
if (
|
3891
|
-
|
3892
|
-
const frame = getFrame();
|
3893
|
-
if (frame) {
|
3894
|
-
const scaleFactor = rect.width / (((_a = iframe.contentWindow) == null ? void 0 : _a.innerWidth) || 1);
|
3895
|
-
elements = frame.elementsFromPoint(
|
3896
|
-
(position.x - rect.left) / scaleFactor,
|
3897
|
-
(position.y - rect.top) / scaleFactor
|
3898
|
-
);
|
3899
|
-
}
|
3937
|
+
const frame = getFrame();
|
3938
|
+
if (frame) {
|
3939
|
+
elements = frame.elementsFromPoint(position.frame.x, position.frame.y);
|
3900
3940
|
}
|
3901
3941
|
}
|
3902
3942
|
if (elements) {
|
@@ -3913,9 +3953,9 @@ var getPointerCollisions = (position, manager, ownerDocument) => {
|
|
3913
3953
|
}
|
3914
3954
|
return candidates;
|
3915
3955
|
};
|
3916
|
-
var findDeepestCandidate = (position, manager
|
3956
|
+
var findDeepestCandidate = (position, manager) => {
|
3917
3957
|
var _a;
|
3918
|
-
const candidates = getPointerCollisions(position, manager
|
3958
|
+
const candidates = getPointerCollisions(position, manager);
|
3919
3959
|
if (candidates.length > 0) {
|
3920
3960
|
const sortedCandidates = depthSort(candidates);
|
3921
3961
|
const draggable = manager.dragOperation.source;
|
@@ -3968,22 +4008,18 @@ var createNestedDroppablePlugin = ({ onChange }, id) => class NestedDroppablePlu
|
|
3968
4008
|
}
|
3969
4009
|
const cleanupEffect = effects(() => {
|
3970
4010
|
const handleMove = (event) => {
|
3971
|
-
const
|
4011
|
+
const target = event.originalTarget || event.target;
|
4012
|
+
const position = new GlobalPosition(target, {
|
3972
4013
|
x: event.clientX,
|
3973
4014
|
y: event.clientY
|
3974
|
-
};
|
3975
|
-
const target = event.originalTarget || event.target;
|
3976
|
-
const ownerDocument = target == null ? void 0 : target.ownerDocument;
|
4015
|
+
});
|
3977
4016
|
const elements = document.elementsFromPoint(
|
3978
|
-
|
3979
|
-
|
4017
|
+
position.global.x,
|
4018
|
+
position.global.y
|
3980
4019
|
);
|
3981
4020
|
const overEl = elements.some((el) => el.id === id);
|
3982
4021
|
if (overEl) {
|
3983
|
-
onChange(
|
3984
|
-
findDeepestCandidate(position, manager, ownerDocument),
|
3985
|
-
manager
|
3986
|
-
);
|
4022
|
+
onChange(findDeepestCandidate(position, manager), manager);
|
3987
4023
|
}
|
3988
4024
|
};
|
3989
4025
|
const handleMoveThrottled = throttle(handleMove, 50);
|
@@ -4573,6 +4609,9 @@ var _PointerSensor = class _PointerSensor extends Sensor {
|
|
4573
4609
|
}
|
4574
4610
|
}
|
4575
4611
|
handlePointerUp(event) {
|
4612
|
+
if (!this.source) {
|
4613
|
+
return;
|
4614
|
+
}
|
4576
4615
|
event.preventDefault();
|
4577
4616
|
event.stopPropagation();
|
4578
4617
|
const { status } = this.manager.dragOperation;
|
@@ -5194,7 +5233,7 @@ var Drawer = ({
|
|
5194
5233
|
"Warning: The `direction` prop on Drawer is deprecated and no longer required to achieve multi-directional dragging."
|
5195
5234
|
);
|
5196
5235
|
}
|
5197
|
-
const
|
5236
|
+
const id = useId2();
|
5198
5237
|
const { ref } = useDroppableSafe({
|
5199
5238
|
id,
|
5200
5239
|
type: "void",
|
@@ -5501,19 +5540,33 @@ var useResolvedFields = () => {
|
|
5501
5540
|
lastData
|
5502
5541
|
});
|
5503
5542
|
}),
|
5504
|
-
[data, config, componentData, selectedItem, resolvedFields, state]
|
5543
|
+
[data, config, componentData, selectedItem, resolvedFields, state, parent]
|
5505
5544
|
);
|
5545
|
+
const [hasParent, setHasParent] = useState19(false);
|
5506
5546
|
useEffect16(() => {
|
5507
|
-
|
5508
|
-
|
5509
|
-
|
5510
|
-
|
5511
|
-
|
5512
|
-
|
5513
|
-
|
5514
|
-
|
5547
|
+
setHasParent(!!parent);
|
5548
|
+
}, [parent]);
|
5549
|
+
useEffect16(() => {
|
5550
|
+
var _a2, _b2;
|
5551
|
+
if (!((_a2 = state.ui.itemSelector) == null ? void 0 : _a2.zone) || ((_b2 = state.ui.itemSelector) == null ? void 0 : _b2.zone) === "default-zone" || hasParent) {
|
5552
|
+
if (hasResolver) {
|
5553
|
+
setFieldsLoading(true);
|
5554
|
+
resolveFields(defaultFields).then((fields) => {
|
5555
|
+
setResolvedFields(fields || {});
|
5556
|
+
setFieldsLoading(false);
|
5557
|
+
});
|
5558
|
+
} else {
|
5559
|
+
setResolvedFields(defaultFields);
|
5560
|
+
}
|
5515
5561
|
}
|
5516
|
-
}, [
|
5562
|
+
}, [
|
5563
|
+
data,
|
5564
|
+
defaultFields,
|
5565
|
+
state.ui.itemSelector,
|
5566
|
+
selectedItem,
|
5567
|
+
hasResolver,
|
5568
|
+
hasParent
|
5569
|
+
]);
|
5517
5570
|
return [resolvedFields, fieldsLoading];
|
5518
5571
|
};
|
5519
5572
|
var Fields = () => {
|
package/package.json
CHANGED