@open-mercato/ui 0.6.7-develop.6758.1.697eade236 → 0.6.7-develop.6766.1.40c9011995
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/backend/CrudForm.js +4 -3
- package/dist/backend/CrudForm.js.map +2 -2
- package/dist/backend/DataTable.js +10 -9
- package/dist/backend/DataTable.js.map +2 -2
- package/dist/backend/injection/spotIds.js +23 -18
- package/dist/backend/injection/spotIds.js.map +2 -2
- package/package.json +3 -3
- package/src/backend/CrudForm.tsx +8 -3
- package/src/backend/DataTable.tsx +11 -10
- package/src/backend/injection/__tests__/spotIds.extension-points.test.ts +38 -0
- package/src/backend/injection/spotIds.ts +23 -18
package/dist/backend/CrudForm.js
CHANGED
|
@@ -100,6 +100,7 @@ import { InjectedField } from "./injection/InjectedField.js";
|
|
|
100
100
|
import { insertByInjectionPlacement } from "@open-mercato/shared/modules/widgets/injection-position";
|
|
101
101
|
import { evaluateInjectedVisibility } from "./injection/visibility-utils.js";
|
|
102
102
|
import { ComponentReplacementHandles } from "@open-mercato/shared/modules/widgets/component-registry";
|
|
103
|
+
import { crudFormExtensionSpotId, extensionSpotChildId } from "@open-mercato/shared/modules/widgets/extension-points";
|
|
103
104
|
import { RichEditor } from "../primitives/rich-editor.js";
|
|
104
105
|
import MarkdownField from "./inputs/MarkdownField.js";
|
|
105
106
|
const logger = createLogger("ui").child({ component: "CrudForm" });
|
|
@@ -453,7 +454,7 @@ function CrudForm({
|
|
|
453
454
|
if (injectionSpotId) return injectionSpotId;
|
|
454
455
|
if (resolvedEntityIds.length) {
|
|
455
456
|
const normalized = resolvedEntityIds[0].replace(/[:]+/g, ".");
|
|
456
|
-
return
|
|
457
|
+
return crudFormExtensionSpotId(normalized);
|
|
457
458
|
}
|
|
458
459
|
return void 0;
|
|
459
460
|
}, [injectionSpotId, resolvedEntityIds]);
|
|
@@ -462,7 +463,7 @@ function CrudForm({
|
|
|
462
463
|
if (resolvedEntityIds.length) return ComponentReplacementHandles.crudForm(resolvedEntityIds[0].replace(/[:]+/g, "."));
|
|
463
464
|
return ComponentReplacementHandles.crudForm("unknown");
|
|
464
465
|
}, [replacementHandle, resolvedEntityIds]);
|
|
465
|
-
const headerInjectionSpotId = resolvedInjectionSpotId ?
|
|
466
|
+
const headerInjectionSpotId = resolvedInjectionSpotId ? extensionSpotChildId(resolvedInjectionSpotId, "header") : void 0;
|
|
466
467
|
const recordId = React.useMemo(() => {
|
|
467
468
|
const raw = values.id;
|
|
468
469
|
if (typeof raw === "string") return raw;
|
|
@@ -679,7 +680,7 @@ function CrudForm({
|
|
|
679
680
|
triggerOnLoad: true
|
|
680
681
|
});
|
|
681
682
|
const { widgets: injectedFieldWidgets } = useInjectionDataWidgets(
|
|
682
|
-
resolvedInjectionSpotId ?
|
|
683
|
+
resolvedInjectionSpotId ? extensionSpotChildId(resolvedInjectionSpotId, "fields") : "__disabled__:fields"
|
|
683
684
|
);
|
|
684
685
|
const { triggerEvent: triggerInjectionEvent } = useInjectionSpotEvents(resolvedInjectionSpotId ?? "", injectionWidgets);
|
|
685
686
|
const extendedInjectionEventsEnabled = CRUDFORM_EXTENDED_EVENTS_ENABLED && Boolean(resolvedInjectionSpotId);
|