@webiny/app-headless-cms 5.35.0 → 5.35.1
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/admin/plugins/index.d.ts +2 -2
- package/allPlugins.d.ts +2 -2
- package/package.json +29 -29
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.d.ts +0 -7
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.js +0 -65
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.d.ts +0 -7
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.js +0 -67
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.d.ts +0 -2
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.js +0 -26
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.d.ts +0 -1
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.js +0 -20
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.d.ts +0 -2
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.js +0 -23
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.d.ts +0 -1
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.js +0 -20
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.d.ts +0 -7
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js +0 -137
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js.map +0 -1
- package/admin/plugins/upgrades/5.19.0/types.d.ts +0 -47
- package/admin/plugins/upgrades/5.19.0/types.js +0 -5
- package/admin/plugins/upgrades/5.19.0/types.js.map +0 -1
- package/admin/plugins/upgrades/5.33.0/locales.d.ts +0 -7
- package/admin/plugins/upgrades/5.33.0/locales.js +0 -65
- package/admin/plugins/upgrades/5.33.0/locales.js.map +0 -1
- package/admin/plugins/upgrades/5.33.0/types.d.ts +0 -7
- package/admin/plugins/upgrades/5.33.0/types.js +0 -5
- package/admin/plugins/upgrades/5.33.0/types.js.map +0 -1
- package/admin/plugins/upgrades/5.33.0/upgrade.d.ts +0 -8
- package/admin/plugins/upgrades/5.33.0/upgrade.js +0 -81
- package/admin/plugins/upgrades/5.33.0/upgrade.js.map +0 -1
- package/admin/plugins/upgrades/v5.0.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.0.0.js +0 -111
- package/admin/plugins/upgrades/v5.0.0.js.map +0 -1
- package/admin/plugins/upgrades/v5.19.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.19.0.js +0 -684
- package/admin/plugins/upgrades/v5.19.0.js.map +0 -1
- package/admin/plugins/upgrades/v5.33.0.d.ts +0 -6
- package/admin/plugins/upgrades/v5.33.0.js +0 -191
- package/admin/plugins/upgrades/v5.33.0.js.map +0 -1
- package/admin/plugins/upgrades/v5.5.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.5.0.js +0 -111
- package/admin/plugins/upgrades/v5.5.0.js.map +0 -1
- package/admin/plugins/upgrades/v5.8.0.d.ts +0 -5
- package/admin/plugins/upgrades/v5.8.0.js +0 -111
- package/admin/plugins/upgrades/v5.8.0.js.map +0 -1
- package/admin/views/contentEntries/experiment/Property.d.ts +0 -34
- package/admin/views/contentEntries/experiment/Property.js +0 -248
- package/admin/views/contentEntries/experiment/Property.js.map +0 -1
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.PropertyContainer = exports.Property = void 0;
|
|
11
|
-
exports.toArray = toArray;
|
|
12
|
-
exports.toObject = toObject;
|
|
13
|
-
|
|
14
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
-
|
|
16
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
17
|
-
|
|
18
|
-
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
19
|
-
|
|
20
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
25
|
-
|
|
26
|
-
var _useDeepCompareEffect = _interopRequireDefault(require("use-deep-compare-effect"));
|
|
27
|
-
|
|
28
|
-
var _utils = require("@webiny/utils");
|
|
29
|
-
|
|
30
|
-
var _excluded = ["children", "name", "value"];
|
|
31
|
-
|
|
32
|
-
function toObject(property) {
|
|
33
|
-
if (property.value !== undefined) {
|
|
34
|
-
return (0, _defineProperty2.default)({}, property.name, property.value);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var obj = {};
|
|
38
|
-
property.properties.forEach(function (prop) {
|
|
39
|
-
// Check if this is a single occurrence of this property
|
|
40
|
-
var isSingle = property.properties.filter(function (p) {
|
|
41
|
-
return p.name === prop.name;
|
|
42
|
-
}).length === 1;
|
|
43
|
-
|
|
44
|
-
if (prop.value !== undefined) {
|
|
45
|
-
obj[prop.name] = isSingle ? prop.value : [].concat((0, _toConsumableArray2.default)(obj[prop.name] || []), [prop.value]);
|
|
46
|
-
} else {
|
|
47
|
-
var asObject = toObject(prop);
|
|
48
|
-
|
|
49
|
-
if (!isSingle) {
|
|
50
|
-
obj[prop.name] = [].concat((0, _toConsumableArray2.default)(obj[prop.name] || []), [asObject[prop.name]]);
|
|
51
|
-
} else {
|
|
52
|
-
obj[prop.name] = asObject[prop.name];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
return obj;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function toArray(objects) {
|
|
60
|
-
return objects.map(function (obj) {
|
|
61
|
-
return obj.properties.reduce(function (acc, item) {
|
|
62
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, acc), toObject(item));
|
|
63
|
-
}, {});
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function mergeProperties(properties1, properties2) {
|
|
68
|
-
var temp = [].concat((0, _toConsumableArray2.default)(properties1), (0, _toConsumableArray2.default)(properties2));
|
|
69
|
-
return Object.values(temp.reduce(function (acc, item) {
|
|
70
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, acc), {}, (0, _defineProperty2.default)({}, item.id, item));
|
|
71
|
-
}, {}));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var PropertyContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
75
|
-
PropertyContext.displayName = "PropertyContext";
|
|
76
|
-
|
|
77
|
-
var useProperty = function useProperty() {
|
|
78
|
-
return (0, _react.useContext)(PropertyContext);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
var PropertyContainerContext = /*#__PURE__*/(0, _react.createContext)();
|
|
82
|
-
|
|
83
|
-
function cleanup(properties) {
|
|
84
|
-
return properties.map(function (property) {
|
|
85
|
-
if ("$remove" in property) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return (0, _objectSpread3.default)((0, _objectSpread3.default)({}, property), {}, {
|
|
90
|
-
properties: cleanup(property.properties)
|
|
91
|
-
});
|
|
92
|
-
}).filter(Boolean);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
var store = new Map();
|
|
96
|
-
|
|
97
|
-
var PropertyContainer = function PropertyContainer(_ref2) {
|
|
98
|
-
var name = _ref2.name,
|
|
99
|
-
onChange = _ref2.onChange,
|
|
100
|
-
children = _ref2.children;
|
|
101
|
-
var ref = (0, _react.useRef)(store);
|
|
102
|
-
var context = (0, _react.useMemo)(function () {
|
|
103
|
-
return {
|
|
104
|
-
updateContainer: function updateContainer(updater) {
|
|
105
|
-
var current = store.get(name) || [];
|
|
106
|
-
var properties = cleanup(updater(current));
|
|
107
|
-
store.set(name, properties);
|
|
108
|
-
onChange(properties);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
}, [ref]);
|
|
112
|
-
return /*#__PURE__*/_react.default.createElement(PropertyContainerContext.Provider, {
|
|
113
|
-
value: context
|
|
114
|
-
}, children);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
exports.PropertyContainer = PropertyContainer;
|
|
118
|
-
|
|
119
|
-
var Property = function Property(_ref3) {
|
|
120
|
-
var children = _ref3.children,
|
|
121
|
-
name = _ref3.name,
|
|
122
|
-
value = _ref3.value,
|
|
123
|
-
props = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
124
|
-
var id = (0, _react.useRef)(props.id || (0, _utils.generateAlphaNumericId)(21));
|
|
125
|
-
|
|
126
|
-
var _useState = (0, _react.useState)([]),
|
|
127
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
128
|
-
properties = _useState2[0],
|
|
129
|
-
setProperties = _useState2[1];
|
|
130
|
-
|
|
131
|
-
var _useContext = (0, _react.useContext)(PropertyContainerContext),
|
|
132
|
-
updateContainer = _useContext.updateContainer;
|
|
133
|
-
|
|
134
|
-
var parentProperty = useProperty();
|
|
135
|
-
var context = {
|
|
136
|
-
removeProperty: function removeProperty(id) {
|
|
137
|
-
setProperties(function (properties) {
|
|
138
|
-
var index = properties.findIndex(function (p) {
|
|
139
|
-
return p.id === id;
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
if (index > -1) {
|
|
143
|
-
return [].concat((0, _toConsumableArray2.default)(properties.slice(0, index)), [(0, _objectSpread3.default)((0, _objectSpread3.default)({}, properties[index]), {}, {
|
|
144
|
-
$remove: true
|
|
145
|
-
})], (0, _toConsumableArray2.default)(properties.slice(index + 1)));
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
return properties;
|
|
149
|
-
});
|
|
150
|
-
},
|
|
151
|
-
updateProperty: function updateProperty(property) {
|
|
152
|
-
setProperties(function (properties) {
|
|
153
|
-
var index = properties.findIndex(function (p) {
|
|
154
|
-
return p.id === property.id;
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
if (index > -1) {
|
|
158
|
-
return [].concat((0, _toConsumableArray2.default)(properties.slice(0, index)), [(0, _objectSpread3.default)((0, _objectSpread3.default)({}, properties[index]), property)], (0, _toConsumableArray2.default)(properties.slice(index + 1)));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return [].concat((0, _toConsumableArray2.default)(properties), [property]);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
var indexById = function indexById(p) {
|
|
167
|
-
return p.id === props.id;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
var indexByName = function indexByName(p) {
|
|
171
|
-
return p.name === name;
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
var updateParentContainer = function updateParentContainer(property) {
|
|
175
|
-
updateContainer(function (properties) {
|
|
176
|
-
// Check if this property already exists in the parent container.
|
|
177
|
-
var index = properties.findIndex(props.id ? indexById : indexByName);
|
|
178
|
-
|
|
179
|
-
if (props.remove) {
|
|
180
|
-
if (index > -1) {
|
|
181
|
-
return [].concat((0, _toConsumableArray2.default)(properties.slice(0, index)), [(0, _objectSpread3.default)((0, _objectSpread3.default)({}, properties[index]), {}, {
|
|
182
|
-
$remove: true
|
|
183
|
-
})], (0, _toConsumableArray2.default)(properties.slice(index + 1)));
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return properties;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (props.replace) {
|
|
190
|
-
if (index > -1) {
|
|
191
|
-
return [].concat((0, _toConsumableArray2.default)(properties.slice(0, index)), [(0, _objectSpread3.default)({}, property)], (0, _toConsumableArray2.default)(properties.slice(index + 1)));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return [].concat((0, _toConsumableArray2.default)(properties), [property]);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (props.merge) {
|
|
198
|
-
if (index > -1) {
|
|
199
|
-
return [].concat((0, _toConsumableArray2.default)(properties.slice(0, index)), [(0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, properties[index]), property), {}, {
|
|
200
|
-
properties: mergeProperties(properties[index].properties, property.properties)
|
|
201
|
-
})], (0, _toConsumableArray2.default)(properties.slice(index + 1)));
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return [].concat((0, _toConsumableArray2.default)(properties), [property]);
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
(0, _useDeepCompareEffect.default)(function () {
|
|
210
|
-
var property = {
|
|
211
|
-
id: id.current,
|
|
212
|
-
name: name,
|
|
213
|
-
value: value,
|
|
214
|
-
properties: properties
|
|
215
|
-
};
|
|
216
|
-
|
|
217
|
-
if (!parentProperty) {
|
|
218
|
-
return updateParentContainer(property);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
parentProperty.updateProperty(property);
|
|
222
|
-
}, [properties]);
|
|
223
|
-
(0, _useDeepCompareEffect.default)(function () {
|
|
224
|
-
// On mount, we need to report to our parent.
|
|
225
|
-
if (parentProperty) {
|
|
226
|
-
if (props.remove) {
|
|
227
|
-
parentProperty.removeProperty(id.current);
|
|
228
|
-
} else {
|
|
229
|
-
parentProperty.updateProperty({
|
|
230
|
-
id: id.current,
|
|
231
|
-
name: name,
|
|
232
|
-
value: value,
|
|
233
|
-
properties: properties
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}, [props.remove, properties]);
|
|
238
|
-
|
|
239
|
-
if (!children) {
|
|
240
|
-
return null;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
return /*#__PURE__*/_react.default.createElement(PropertyContext.Provider, {
|
|
244
|
-
value: context
|
|
245
|
-
}, children);
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
exports.Property = Property;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["toObject","property","value","undefined","name","obj","properties","forEach","prop","isSingle","filter","p","length","asObject","toArray","objects","map","reduce","acc","item","mergeProperties","properties1","properties2","temp","Object","values","id","PropertyContext","createContext","displayName","useProperty","useContext","PropertyContainerContext","cleanup","Boolean","store","Map","PropertyContainer","onChange","children","ref","useRef","context","useMemo","updateContainer","updater","current","get","set","Property","props","generateAlphaNumericId","useState","setProperties","parentProperty","removeProperty","index","findIndex","slice","$remove","updateProperty","indexById","indexByName","updateParentContainer","remove","replace","merge","useDeepCompareEffect"],"sources":["Property.tsx"],"sourcesContent":["// @ts-nocheck\n/**\n * Note by @pavel910:\n *\n * TS is disabled in this file, as this is a wild experiment, and I need to come back and fix some types, which are not very\n * obvious. I don't have time to do it right now. If the experiment is successful, I'll come back and clean this up, and\n * extract this whole logic into a separate package, as this is a tiny framework for building data objects using React, and\n * we might want to use it in many more places (all views, Page Builder Editor, etc.).\n *\n * More on this a bit later, if the experiment is successful.\n */\nimport React, { createContext, FC, useContext, useMemo, useRef, useState } from \"react\";\nimport useDeepCompareEffect from \"use-deep-compare-effect\";\nimport { generateAlphaNumericId } from \"@webiny/utils\";\n\nexport function toObject<T = unknown>(property: Property): T {\n if (property.value !== undefined) {\n return { [property.name]: property.value };\n }\n\n const obj = {};\n property.properties.forEach(prop => {\n // Check if this is a single occurrence of this property\n const isSingle = property.properties.filter(p => p.name === prop.name).length === 1;\n if (prop.value !== undefined) {\n obj[prop.name] = isSingle ? prop.value : [...(obj[prop.name] || []), prop.value];\n } else {\n const asObject = toObject(prop);\n\n if (!isSingle) {\n obj[prop.name] = [...(obj[prop.name] || []), asObject[prop.name]];\n } else {\n obj[prop.name] = asObject[prop.name];\n }\n }\n });\n\n return obj;\n}\n\nexport function toArray(objects: Property[]) {\n return objects.map(obj =>\n obj.properties.reduce((acc, item) => {\n return { ...acc, ...toObject(item) };\n }, {})\n );\n}\n\nfunction mergeProperties(properties1: Property[], properties2: Property[]) {\n const temp: Property[] = [...properties1, ...properties2];\n\n return Object.values(\n temp.reduce((acc, item) => {\n return { ...acc, [item.id]: item };\n }, {})\n );\n}\n\ninterface PropertyContext {\n removeProperty(id: string): void;\n updateProperty(property: Property): void;\n}\n\nconst PropertyContext = createContext<PropertyContext>(null);\nPropertyContext.displayName = \"PropertyContext\";\n\nconst useProperty = () => {\n return useContext(PropertyContext);\n};\n\ninterface PropertyContainerContext {\n updateContainer(update): void;\n}\n\nexport interface Property<TValue = unknown> {\n id?: string;\n name: string;\n value?: TValue;\n properties?: Property[];\n}\n\nconst PropertyContainerContext = createContext<PropertyContainerContext>();\n\nfunction cleanup(properties: Property[]): Property[] {\n return properties\n .map(property => {\n if (\"$remove\" in property) {\n return null;\n }\n\n return {\n ...property,\n properties: cleanup(property.properties)\n };\n })\n .filter(Boolean);\n}\n\nconst store = new Map<string, any>();\n\ninterface PropertyContainerProps {\n name: string;\n // TODO: create a proper type\n onChange: any;\n}\n\nexport const PropertyContainer: FC<PropertyContainerProps> = ({ name, onChange, children }) => {\n const ref = useRef(store);\n const context = useMemo(\n () => ({\n updateContainer(updater) {\n const current = store.get(name) || [];\n const properties = cleanup(updater(current));\n store.set(name, properties);\n onChange(properties);\n }\n }),\n [ref]\n );\n\n return (\n <PropertyContainerContext.Provider value={context}>\n {children}\n </PropertyContainerContext.Provider>\n );\n};\n\ninterface PropertyProps {\n id?: string;\n name: string;\n value?: unknown;\n merge?: boolean;\n replace?: boolean;\n remove?: boolean;\n}\n\nexport const Property: FC<PropertyProps> = ({ children, name, value, ...props }) => {\n const id = useRef(props.id || generateAlphaNumericId(21));\n const [properties, setProperties] = useState([]);\n const { updateContainer } = useContext(PropertyContainerContext);\n const parentProperty = useProperty();\n\n const context: PropertyContext = {\n removeProperty(id: string) {\n setProperties(properties => {\n const index = properties.findIndex(p => p.id === id);\n if (index > -1) {\n return [\n ...properties.slice(0, index),\n { ...properties[index], $remove: true },\n ...properties.slice(index + 1)\n ];\n }\n return properties;\n });\n },\n updateProperty(property) {\n setProperties(properties => {\n const index = properties.findIndex(p => p.id === property.id);\n if (index > -1) {\n return [\n ...properties.slice(0, index),\n { ...properties[index], ...property },\n ...properties.slice(index + 1)\n ];\n }\n return [...properties, property];\n });\n }\n };\n\n const indexById = p => p.id === props.id;\n const indexByName = p => p.name === name;\n\n const updateParentContainer = property => {\n updateContainer((properties: Property[]) => {\n // Check if this property already exists in the parent container.\n const index = properties.findIndex(props.id ? indexById : indexByName);\n\n if (props.remove) {\n if (index > -1) {\n return [\n ...properties.slice(0, index),\n { ...properties[index], $remove: true },\n ...properties.slice(index + 1)\n ];\n }\n\n return properties;\n }\n\n if (props.replace) {\n if (index > -1) {\n return [\n ...properties.slice(0, index),\n { ...property },\n ...properties.slice(index + 1)\n ];\n }\n\n return [...properties, property];\n }\n\n if (props.merge) {\n if (index > -1) {\n return [\n ...properties.slice(0, index),\n {\n ...properties[index],\n ...property,\n properties: mergeProperties(\n properties[index].properties,\n property.properties\n )\n },\n ...properties.slice(index + 1)\n ];\n }\n }\n\n return [...properties, property];\n });\n };\n\n useDeepCompareEffect(() => {\n const property = { id: id.current, name, value, properties };\n\n if (!parentProperty) {\n return updateParentContainer(property);\n }\n\n parentProperty.updateProperty(property);\n }, [properties]);\n\n useDeepCompareEffect(() => {\n // On mount, we need to report to our parent.\n if (parentProperty) {\n if (props.remove) {\n parentProperty.removeProperty(id.current);\n } else {\n parentProperty.updateProperty({ id: id.current, name, value, properties });\n }\n }\n }, [props.remove, properties]);\n\n if (!children) {\n return null;\n }\n\n return <PropertyContext.Provider value={context}>{children}</PropertyContext.Provider>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAWA;;AACA;;AACA;;;;AAEO,SAASA,QAAT,CAA+BC,QAA/B,EAAsD;EACzD,IAAIA,QAAQ,CAACC,KAAT,KAAmBC,SAAvB,EAAkC;IAC9B,yCAAUF,QAAQ,CAACG,IAAnB,EAA0BH,QAAQ,CAACC,KAAnC;EACH;;EAED,IAAMG,GAAG,GAAG,EAAZ;EACAJ,QAAQ,CAACK,UAAT,CAAoBC,OAApB,CAA4B,UAAAC,IAAI,EAAI;IAChC;IACA,IAAMC,QAAQ,GAAGR,QAAQ,CAACK,UAAT,CAAoBI,MAApB,CAA2B,UAAAC,CAAC;MAAA,OAAIA,CAAC,CAACP,IAAF,KAAWI,IAAI,CAACJ,IAApB;IAAA,CAA5B,EAAsDQ,MAAtD,KAAiE,CAAlF;;IACA,IAAIJ,IAAI,CAACN,KAAL,KAAeC,SAAnB,EAA8B;MAC1BE,GAAG,CAACG,IAAI,CAACJ,IAAN,CAAH,GAAiBK,QAAQ,GAAGD,IAAI,CAACN,KAAR,8CAAqBG,GAAG,CAACG,IAAI,CAACJ,IAAN,CAAH,IAAkB,EAAvC,IAA4CI,IAAI,CAACN,KAAjD,EAAzB;IACH,CAFD,MAEO;MACH,IAAMW,QAAQ,GAAGb,QAAQ,CAACQ,IAAD,CAAzB;;MAEA,IAAI,CAACC,QAAL,EAAe;QACXJ,GAAG,CAACG,IAAI,CAACJ,IAAN,CAAH,8CAAsBC,GAAG,CAACG,IAAI,CAACJ,IAAN,CAAH,IAAkB,EAAxC,IAA6CS,QAAQ,CAACL,IAAI,CAACJ,IAAN,CAArD;MACH,CAFD,MAEO;QACHC,GAAG,CAACG,IAAI,CAACJ,IAAN,CAAH,GAAiBS,QAAQ,CAACL,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