@nascentdigital/funnel-editor 8.1.2 → 8.1.3
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.
|
@@ -14,20 +14,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
exports.ObjectEditor = void 0;
|
|
15
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
16
|
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
17
|
+
const hooks_1 = require("@nascentdigital/funnel-ui/hooks");
|
|
17
18
|
const react_1 = require("react");
|
|
18
|
-
const hooks_1 = require("../../../hooks");
|
|
19
19
|
const interaction_1 = require("../../interaction");
|
|
20
20
|
const FieldsPanel_1 = require("../FieldsPanel");
|
|
21
21
|
// component
|
|
22
22
|
exports.ObjectEditor = (0, react_1.forwardRef)(function ObjectEditor(_, ref) {
|
|
23
23
|
// bind props + hooks
|
|
24
|
+
const touch = (0, hooks_1.useTouch)();
|
|
24
25
|
const [deferral, setDeferral] = (0, react_1.useState)(undefined);
|
|
25
26
|
const [result, setResult] = (0, react_1.useState)();
|
|
26
27
|
const [schema, setSchema] = (0, react_1.useState)();
|
|
27
28
|
const [field, setField] = (0, react_1.useState)();
|
|
28
29
|
const [popupProps, setPopupProps] = (0, react_1.useState)();
|
|
29
30
|
// sync field
|
|
30
|
-
(0,
|
|
31
|
+
(0, react_1.useEffect)(() => {
|
|
32
|
+
// bail if no field
|
|
33
|
+
if (!field) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// subscribe to fields
|
|
37
|
+
const subscription = field.fieldsChanged$.subscribe(touch);
|
|
38
|
+
// unmount
|
|
39
|
+
return () => subscription.unsubscribe();
|
|
40
|
+
}, [field, touch]);
|
|
31
41
|
// export service
|
|
32
42
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
33
43
|
edit: async (_a) => {
|
|
@@ -41,7 +41,7 @@ export declare class BlockConfiguration {
|
|
|
41
41
|
get messageFields(): Partial<FieldModel.Config.FromSchema<MessagePanel.Config.Schema>>;
|
|
42
42
|
get visualFields(): Partial<FieldModel.Config.FromSchema<VisualPanel.Config.Schema>>;
|
|
43
43
|
get listFields(): Partial<FieldModel.Config.FromSchema<ListPanel.Config.Schema>>;
|
|
44
|
-
get extendedFields():
|
|
44
|
+
get extendedFields(): FieldModel.Config[];
|
|
45
45
|
get layout(): BlockLayout | undefined;
|
|
46
46
|
getPossibleField<TKey extends PanelledBlock.Config.Schema.All.Keys>(fieldId: TKey): Field<PanelledBlock.Config.Schema.All[TKey]> | undefined;
|
|
47
47
|
getFieldsForTags(...tagsRaw: ReadonlyArray<Schema.FieldTag>): Record<string, FieldModel.Config>;
|
|
@@ -142,7 +142,7 @@ class BlockConfiguration {
|
|
|
142
142
|
this.getPossibleField('rowAlign'),
|
|
143
143
|
this.getPossibleField('rowSplit'),
|
|
144
144
|
this.getPossibleField('fullHeight'),
|
|
145
|
-
...
|
|
145
|
+
...this.extendedFields
|
|
146
146
|
].filter(funnel_core_1.Value.isDefined);
|
|
147
147
|
}
|
|
148
148
|
get blockFieldData() {
|
|
@@ -278,21 +278,9 @@ class BlockConfiguration {
|
|
|
278
278
|
get extendedFields() {
|
|
279
279
|
// get all top-level keys
|
|
280
280
|
const { fields } = this;
|
|
281
|
-
const coreKeys =
|
|
282
|
-
...funnel_ui_1.Block.Config.Schema.Core.Keys.values,
|
|
283
|
-
...funnel_ui_1.MessagePanel.Config.Keys.values,
|
|
284
|
-
...funnel_ui_1.VisualPanel.Config.Keys.values,
|
|
285
|
-
...funnel_ui_1.ListPanel.Config.Keys.values
|
|
286
|
-
];
|
|
281
|
+
const coreKeys = funnel_ui_1.Block.Config.Schema.All.keys;
|
|
287
282
|
// return all editable fields, minus the core keys
|
|
288
|
-
return fields.
|
|
289
|
-
// add field if not core
|
|
290
|
-
if (!coreKeys.includes(field.id)) {
|
|
291
|
-
fields[field.id] = field;
|
|
292
|
-
}
|
|
293
|
-
// keep reducing
|
|
294
|
-
return fields;
|
|
295
|
-
}, {});
|
|
283
|
+
return fields.filter(field => !coreKeys.includes(field.id));
|
|
296
284
|
}
|
|
297
285
|
get layout() {
|
|
298
286
|
return this._layout;
|
package/dist/styles/index.css
CHANGED
|
@@ -501,10 +501,10 @@ video {
|
|
|
501
501
|
}
|
|
502
502
|
|
|
503
503
|
[popover]{
|
|
504
|
-
inset: var(--toolwind-toggle-
|
|
505
|
-
background-color: var(--toolwind-toggle-
|
|
506
|
-
color: var(--toolwind-toggle-
|
|
507
|
-
margin: var(--toolwind-toggle-
|
|
504
|
+
inset: var(--toolwind-toggle-REUDWZY8NE, 0px);
|
|
505
|
+
background-color: var(--toolwind-toggle-ggez78rAVf, canvas);
|
|
506
|
+
color: var(--toolwind-toggle-jdGbaA0KC5, canvastext);
|
|
507
|
+
margin: var(--toolwind-toggle-mb4Z5lJXZq, auto);
|
|
508
508
|
}
|
|
509
509
|
html, body, #__next, #root, .Editor-wrap{
|
|
510
510
|
position: relative;
|
|
@@ -6220,10 +6220,10 @@ img.nd-Visual-image {
|
|
|
6220
6220
|
.anchored\/\[--nd-popup-anchor\]:where(.anchored\/\[--nd-popup-anchor\]){
|
|
6221
6221
|
position: absolute;
|
|
6222
6222
|
view-transition-name: --tw-anchor-view-transition-2j1919322s193433343934192p322r2w33362l;
|
|
6223
|
-
--toolwind-toggle-
|
|
6224
|
-
--toolwind-toggle-
|
|
6225
|
-
--toolwind-toggle-
|
|
6226
|
-
--toolwind-toggle-
|
|
6223
|
+
--toolwind-toggle-REUDWZY8NE: auto;
|
|
6224
|
+
--toolwind-toggle-ggez78rAVf: transparent;
|
|
6225
|
+
--toolwind-toggle-jdGbaA0KC5: inherit;
|
|
6226
|
+
--toolwind-toggle-mb4Z5lJXZq: 0px;
|
|
6227
6227
|
}
|
|
6228
6228
|
.counter-l1{
|
|
6229
6229
|
counter-reset: l1;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nascentdigital/funnel-editor",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"ts-jest": "^29",
|
|
93
93
|
"type-fest": "^4"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "68d48abbc294945af6b56a8489644b210e5ac661"
|
|
96
96
|
}
|