@salesforce/storefront-next-runtime 0.1.0

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.
Files changed (49) hide show
  1. package/LICENSE.txt +181 -0
  2. package/README.md +158 -0
  3. package/dist/ComponentContext.js +14 -0
  4. package/dist/ComponentContext.js.map +1 -0
  5. package/dist/DesignContext.js +769 -0
  6. package/dist/DesignContext.js.map +1 -0
  7. package/dist/DesignContext2.js +6 -0
  8. package/dist/PageDesignerProvider.js +53 -0
  9. package/dist/PageDesignerProvider.js.map +1 -0
  10. package/dist/PageRegistration.js +29 -0
  11. package/dist/PageRegistration.js.map +1 -0
  12. package/dist/PreviewContext.js +18 -0
  13. package/dist/PreviewContext.js.map +1 -0
  14. package/dist/design-messaging.d.ts +3 -0
  15. package/dist/design-messaging.js +3 -0
  16. package/dist/design-mode.d.ts +40 -0
  17. package/dist/design-mode.d.ts.map +1 -0
  18. package/dist/design-mode.js +3 -0
  19. package/dist/design-react-core.d.ts +69 -0
  20. package/dist/design-react-core.d.ts.map +1 -0
  21. package/dist/design-react-core.js +23 -0
  22. package/dist/design-react-core.js.map +1 -0
  23. package/dist/design-react.d.ts +130 -0
  24. package/dist/design-react.d.ts.map +1 -0
  25. package/dist/design-react.js +488 -0
  26. package/dist/design-react.js.map +1 -0
  27. package/dist/design-styles.css +232 -0
  28. package/dist/design.d.ts +2 -0
  29. package/dist/design.js +219 -0
  30. package/dist/design.js.map +1 -0
  31. package/dist/events.d.ts +208 -0
  32. package/dist/events.d.ts.map +1 -0
  33. package/dist/events.js +104 -0
  34. package/dist/events.js.map +1 -0
  35. package/dist/index.d.ts +215 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index2.d.ts +1171 -0
  38. package/dist/index2.d.ts.map +1 -0
  39. package/dist/messaging-api.js +340 -0
  40. package/dist/messaging-api.js.map +1 -0
  41. package/dist/modeDetection.js +50 -0
  42. package/dist/modeDetection.js.map +1 -0
  43. package/dist/scapi.d.ts +29278 -0
  44. package/dist/scapi.d.ts.map +1 -0
  45. package/dist/scapi.js +2 -0
  46. package/dist/scapi.js.map +1 -0
  47. package/dist/types.d.ts +13293 -0
  48. package/dist/types.d.ts.map +1 -0
  49. package/package.json +108 -0
@@ -0,0 +1,488 @@
1
+ import "./messaging-api.js";
2
+ import { a as isComponentTypeAllowedInRegion, i as useDesignState, o as useComponentDiscovery, r as useDesignContext } from "./DesignContext.js";
3
+ import "./modeDetection.js";
4
+ import { n as usePageDesignerMode } from "./PageDesignerProvider.js";
5
+ import { i as useRegionContext, n as useComponentContext, r as RegionContext, t as ComponentContext } from "./ComponentContext.js";
6
+ import React, { useCallback, useMemo, useRef } from "react";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+
9
+ //#region src/design/react/hooks/useComponentDecoratorClasses.ts
10
+ function useComponentDecoratorClasses({ componentId, isFragment, isLocalized }) {
11
+ const { selectedComponentId, hoveredComponentId, dragState } = useDesignState();
12
+ const isSelected = selectedComponentId === componentId;
13
+ const isHovered = !dragState.isDragging && hoveredComponentId === componentId;
14
+ const showFrame = (isSelected || isHovered) && !dragState.isDragging;
15
+ const isMoving = dragState.isDragging && dragState.sourceComponentId === componentId;
16
+ const isDropTarget = dragState.currentDropTarget?.componentId === componentId;
17
+ const dropTargetInsertType = dragState.currentDropTarget?.insertType;
18
+ const dropTargetAxis = dropTargetInsertType?.axis;
19
+ return [
20
+ "pd-design__decorator",
21
+ isFragment ? "pd-design__fragment" : "pd-design__component",
22
+ showFrame && "pd-design__frame--visible",
23
+ isSelected && "pd-design__decorator--selected",
24
+ isHovered && "pd-design__decorator--hovered",
25
+ isMoving && "pd-design__decorator--moving",
26
+ !isLocalized && "pd-design__component--unlocalized",
27
+ isDropTarget && dropTargetAxis && dropTargetInsertType && `pd-design__drop-target__${dropTargetAxis}-${dropTargetInsertType.type}`
28
+ ].filter(Boolean).join(" ");
29
+ }
30
+
31
+ //#endregion
32
+ //#region src/design/react/hooks/useFocusedComponentHandler.ts
33
+ /**
34
+ * Focuses a component when the focused component id matches the component id.
35
+ * @param componentId - The id of the component to focus.
36
+ * @param nodeRef - The ref object to the node to focus.
37
+ */
38
+ function useFocusedComponentHandler(componentId, nodeRef) {
39
+ const { focusedComponentId, focusComponent } = useDesignState();
40
+ React.useEffect(() => {
41
+ if (focusedComponentId === componentId && nodeRef.current) focusComponent(nodeRef.current);
42
+ }, [
43
+ focusedComponentId,
44
+ componentId,
45
+ focusComponent,
46
+ nodeRef
47
+ ]);
48
+ }
49
+
50
+ //#endregion
51
+ //#region src/design/react/hooks/useNodeToTargetStore.ts
52
+ function useNodeToTargetStore({ parentId, componentId, regionId, nodeRef, type, componentIds, componentTypeInclusions, componentTypeExclusions }) {
53
+ const { nodeToTargetMap } = useDesignState();
54
+ React.useEffect(() => {
55
+ if (nodeRef.current) nodeToTargetMap.set(nodeRef.current, {
56
+ parentId,
57
+ componentId,
58
+ regionId,
59
+ type,
60
+ componentIds,
61
+ componentTypeInclusions,
62
+ componentTypeExclusions
63
+ });
64
+ }, [
65
+ nodeRef,
66
+ parentId,
67
+ componentId,
68
+ regionId,
69
+ type,
70
+ componentIds,
71
+ nodeToTargetMap,
72
+ componentTypeInclusions,
73
+ componentTypeExclusions
74
+ ]);
75
+ }
76
+
77
+ //#endregion
78
+ //#region src/design/react/hooks/useComponentType.ts
79
+ function useComponentType(componentId) {
80
+ const { pageDesignerConfig } = useDesignContext();
81
+ const { type = "" } = pageDesignerConfig?.components[componentId] ?? {};
82
+ return pageDesignerConfig?.componentTypes[type] ?? null;
83
+ }
84
+
85
+ //#endregion
86
+ //#region src/design/react/components/DeleteToolboxButton.tsx
87
+ const DeleteToolboxButton = ({ title, onClick, onMouseDown = () => {} }) => /* @__PURE__ */ jsx("button", {
88
+ className: "pd-design__frame__toolbox-button",
89
+ title,
90
+ type: "button",
91
+ onMouseDown,
92
+ onClick,
93
+ children: /* @__PURE__ */ jsx("svg", {
94
+ className: "pd-design__frame__delete-icon",
95
+ viewBox: "0 0 24 24",
96
+ fill: "none",
97
+ xmlns: "http://www.w3.org/2000/svg",
98
+ children: /* @__PURE__ */ jsx("path", {
99
+ d: "M18 6L6 18M6 6l12 12",
100
+ stroke: "currentColor",
101
+ strokeWidth: "2",
102
+ strokeLinecap: "round",
103
+ strokeLinejoin: "round"
104
+ })
105
+ })
106
+ });
107
+
108
+ //#endregion
109
+ //#region src/design/react/components/MoveToolboxButton.tsx
110
+ const MoveToolboxButton = ({ title }) => /* @__PURE__ */ jsx("button", {
111
+ className: "pd-design__frame__toolbox-button",
112
+ title,
113
+ type: "button",
114
+ children: /* @__PURE__ */ jsx("svg", {
115
+ className: "pd-design__frame__move-icon",
116
+ viewBox: "0 0 24 24",
117
+ xmlns: "http://www.w3.org/2000/svg",
118
+ children: /* @__PURE__ */ jsx("path", {
119
+ d: "M22.9 11.7l-3.8-4.2c-.3-.3-.6 0-.6.4v2.7h-4.7c-.2 0-.4-.2-.4-.4V5.5h2.7c.5 0 .7-.4.4-.6l-4.1-3.8c-.2-.2-.5-.2-.7 0L7.6 4.9c-.3.3-.1.6.4.6h2.6v4.7c0 .2-.2.4-.4.4H5.5V7.9c0-.5-.4-.7-.6-.4l-3.8 4.1c-.2.2-.2.5 0 .7l3.8 4.1c.3.3.6.1.6-.4v-2.6h4.7c.2 0 .4.2.4.4v4.7H7.9c-.5 0-.7.4-.4.6l4.1 3.8c.2.2.5.2.7 0l4.1-3.8c.3-.3.1-.6-.4-.6h-2.6v-4.7c0-.2.2-.4.4-.4h4.7v2.7c0 .5.4.7.6.4l3.8-4.1c.2-.3.2-.5 0-.7z",
120
+ stroke: "currentColor",
121
+ strokeWidth: "2",
122
+ strokeLinecap: "round",
123
+ strokeLinejoin: "round"
124
+ })
125
+ })
126
+ });
127
+
128
+ //#endregion
129
+ //#region src/design/react/hooks/useLabels.ts
130
+ function useLabels() {
131
+ const { pageDesignerConfig } = useDesignContext();
132
+ return pageDesignerConfig?.labels ?? {};
133
+ }
134
+
135
+ //#endregion
136
+ //#region src/design/react/components/DesignOverlay.tsx
137
+ /**
138
+ * Copyright 2026 Salesforce, Inc.
139
+ *
140
+ * Licensed under the Apache License, Version 2.0 (the "License");
141
+ * you may not use this file except in compliance with the License.
142
+ * You may obtain a copy of the License at
143
+ *
144
+ * http://www.apache.org/licenses/LICENSE-2.0
145
+ *
146
+ * Unless required by applicable law or agreed to in writing, software
147
+ * distributed under the License is distributed on an "AS IS" BASIS,
148
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
+ * See the License for the specific language governing permissions and
150
+ * limitations under the License.
151
+ */
152
+ const DesignOverlay = () => {
153
+ return /* @__PURE__ */ jsx("div", {
154
+ className: "pd-design__frame__overlay",
155
+ children: /* @__PURE__ */ jsx("svg", {
156
+ xmlns: "http://www.w3.org/2000/svg",
157
+ x: "0px",
158
+ y: "0px",
159
+ width: "52px",
160
+ height: "52px",
161
+ viewBox: "0 0 52 52",
162
+ enableBackground: "new 0 0 52 52",
163
+ xmlSpace: "preserve",
164
+ children: /* @__PURE__ */ jsx("path", {
165
+ fill: "#FFFFFF",
166
+ d: "M26,2C12.7,2,2,12.7,2,26s10.7,24,24,24s24-10.7,24-24S39.3,2,26,2z M26,7C26,7,26,7,26,7C26,7,26,7,26,7\n C26,7,26,7,26,7z M28,7.1c-0.1,0-0.1,0-0.2,0C27.9,7.1,28,7.1,28,7.1z M26,45C15.5,45,7,36.5,7,26c0-1,0.1-2.1,0.3-3\n c1.3,0.2,2.9,0.7,3.7,1.5c1.7,1.8,3.6,3.9,5.4,4.3c0,0-0.2,0.1-0.4,0.4c-0.2,0.3-0.4,0.9-0.4,1.9c0,4.7,4.4,1.9,4.4,6.6\n c0,4.7,5.3,6.6,5.3,2.8s3.5-5.6,3.5-8.5s-2.7-2.8-4.4-3.8c-1.8-0.9-2.7-2.4-6.1-1.9c-1.8-1.7-2.8-3.1-2-4.7c0.9-1.7,4.6-2,4.6-4.6\n s-2.5-3.1-4.3-3.1c-0.8,0-2.5-0.6-3.9-1.3c1.7-1.7,3.8-3.1,6-4.1c1.6,0.7,4.3,1.8,6.6,1.8c2.7,0,4.1-1.9,3.7-3.1\n c4.5,0.7,8.5,3,11.4,6.2c-1.5,0.9-3.5,1.9-7,1.9c-4.6,0-4.6,4.7-1.9,5.6c2.8,0.9,5.6-1.8,6.5,0c0.9,1.8-6.5,1.8-4.6,6.4\n c1.9,4.6,3.7-0.1,5.6,4.5c1.9,4.6,5.6-0.7,2.8-4.3c-1.2-1.6-0.9-6.5,1.9-6.5h0.9c0.4,1.6,0.7,3.3,0.7,5C45,36.5,36.5,45,26,45z"
167
+ })
168
+ })
169
+ });
170
+ };
171
+
172
+ //#endregion
173
+ //#region src/design/react/components/DesignFrame.tsx
174
+ const DesignFrame = ({ componentId, children, name, parentId, regionId, localized = false, showFrame = false, showToolbox = true, isMoveable = true }) => {
175
+ const componentType = useComponentType(componentId ?? "");
176
+ const { deleteComponent } = useDesignState();
177
+ const labels = useLabels();
178
+ const nodeRef = React.useRef(null);
179
+ const handleDelete = React.useCallback((event) => {
180
+ event.stopPropagation();
181
+ if (componentId) deleteComponent({
182
+ componentId,
183
+ sourceComponentId: parentId ?? "",
184
+ sourceRegionId: regionId ?? ""
185
+ });
186
+ }, [
187
+ deleteComponent,
188
+ componentId,
189
+ parentId,
190
+ regionId
191
+ ]);
192
+ const stopPropagation = (event) => event.stopPropagation();
193
+ return /* @__PURE__ */ jsxs("div", {
194
+ className: ["pd-design__frame", showFrame && "pd-design__frame--visible"].filter(Boolean).join(" "),
195
+ ref: nodeRef,
196
+ children: [
197
+ showFrame && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", { className: "pd-design__frame--x" }), /* @__PURE__ */ jsx("div", { className: "pd-design__frame--y" })] }),
198
+ /* @__PURE__ */ jsxs("div", {
199
+ className: "pd-design__frame__label",
200
+ onMouseDown: stopPropagation,
201
+ children: [
202
+ componentType?.image && /* @__PURE__ */ jsx("span", {
203
+ className: "pd-design__icon",
204
+ children: /* @__PURE__ */ jsx("img", {
205
+ src: componentType.image,
206
+ alt: ""
207
+ })
208
+ }),
209
+ /* @__PURE__ */ jsx("span", {
210
+ className: "pd-design__frame__name",
211
+ children: name
212
+ }),
213
+ !localized && /* @__PURE__ */ jsx("span", {
214
+ className: "pd-design__frame__fallback-badge",
215
+ children: labels.fallback ?? "Fallback"
216
+ })
217
+ ]
218
+ }),
219
+ showToolbox && /* @__PURE__ */ jsxs("div", {
220
+ className: "pd-design__frame__toolbox",
221
+ children: [isMoveable && /* @__PURE__ */ jsx(MoveToolboxButton, { title: labels.moveComponent ?? "Move component" }), /* @__PURE__ */ jsx(DeleteToolboxButton, {
222
+ title: labels.deleteComponent ?? "Delete component",
223
+ onMouseDown: stopPropagation,
224
+ onClick: handleDelete
225
+ })]
226
+ }),
227
+ /* @__PURE__ */ jsx(DesignOverlay, {}),
228
+ children
229
+ ]
230
+ });
231
+ };
232
+ DesignFrame.defaultProps = {
233
+ parentId: void 0,
234
+ componentId: void 0,
235
+ showToolbox: true,
236
+ regionId: void 0,
237
+ showFrame: false
238
+ };
239
+
240
+ //#endregion
241
+ //#region src/design/react/components/DesignComponent.tsx
242
+ function DesignComponent(props) {
243
+ const { designMetadata, children } = props;
244
+ const { id, name, isFragment, isVisible, isLocalized } = designMetadata;
245
+ const componentId = id;
246
+ const componentType = useComponentType(componentId);
247
+ const componentName = componentType?.label || name || "Component";
248
+ const dragRef = useRef(null);
249
+ const { regionId } = useRegionContext() ?? {};
250
+ const { componentId: parentComponentId } = useComponentContext() ?? {};
251
+ const { nodeToTargetMap } = useDesignState();
252
+ const { selectedComponentId, hoveredComponentId, setSelectedComponent, setHoveredComponent, startComponentMove, setPendingComponentDragId, dragState: { pendingComponentDragId, isDragging, sourceComponentId: draggingSourceComponentId } } = useDesignState();
253
+ useFocusedComponentHandler(componentId, dragRef);
254
+ useNodeToTargetStore({
255
+ type: "component",
256
+ nodeRef: dragRef,
257
+ parentId: parentComponentId,
258
+ regionId,
259
+ componentId
260
+ });
261
+ const discoverComponents = useComponentDiscovery({ nodeToTargetMap });
262
+ const isPendingDrag = pendingComponentDragId === componentId;
263
+ const handleMouseEnter = useCallback((event) => {
264
+ event.stopPropagation();
265
+ setHoveredComponent(componentId);
266
+ }, [setHoveredComponent, componentId]);
267
+ const handleMouseLeave = useCallback((event) => {
268
+ event.stopPropagation();
269
+ setHoveredComponent(discoverComponents({
270
+ x: event.clientX,
271
+ y: event.clientY,
272
+ filter: (entry) => entry.type === "component"
273
+ })[0]?.componentId ?? null);
274
+ }, [setHoveredComponent, discoverComponents]);
275
+ const handleClick = useCallback((e) => {
276
+ e.stopPropagation();
277
+ setSelectedComponent(componentId);
278
+ }, [setSelectedComponent, componentId]);
279
+ const showFrame = [selectedComponentId, hoveredComponentId].includes(componentId) && !isDragging;
280
+ const isDraggable = Boolean(componentId && regionId && componentType?.id);
281
+ const classes = useComponentDecoratorClasses({
282
+ componentId,
283
+ isLocalized,
284
+ isFragment: Boolean(isFragment)
285
+ });
286
+ const context = React.useMemo(() => ({
287
+ componentId: id,
288
+ name
289
+ }), [id, name]);
290
+ const handleDragOver = React.useCallback((event) => {
291
+ if (draggingSourceComponentId !== componentId) event.preventDefault();
292
+ }, [draggingSourceComponentId, componentId]);
293
+ const handleMouseDown = React.useCallback((event) => {
294
+ if (componentId) {
295
+ event.stopPropagation();
296
+ setPendingComponentDragId(componentId);
297
+ }
298
+ }, [componentId, setPendingComponentDragId]);
299
+ const handleDragStart = React.useCallback((event) => {
300
+ event.stopPropagation();
301
+ if (componentId && regionId && componentType?.id) startComponentMove(componentId, regionId, componentType.id);
302
+ }, [
303
+ componentId,
304
+ regionId,
305
+ componentType?.id,
306
+ startComponentMove
307
+ ]);
308
+ if (!isVisible) return /* @__PURE__ */ jsx(Fragment, {});
309
+ return /* @__PURE__ */ jsxs("div", {
310
+ ref: dragRef,
311
+ className: classes,
312
+ draggable: isPendingDrag && isDraggable,
313
+ onClick: handleClick,
314
+ onDragOver: handleDragOver,
315
+ onDragStart: handleDragStart,
316
+ onMouseEnter: handleMouseEnter,
317
+ onMouseLeave: handleMouseLeave,
318
+ onMouseDown: handleMouseDown,
319
+ "data-component-type": componentType?.id,
320
+ "data-testid": `design-component-${componentId}`,
321
+ children: [/* @__PURE__ */ jsx("div", { className: "pd-design__component__drop-target" }), /* @__PURE__ */ jsx(DesignFrame, {
322
+ showFrame,
323
+ componentId,
324
+ localized: isLocalized,
325
+ name: componentName,
326
+ parentId: parentComponentId,
327
+ isMoveable: isDraggable,
328
+ regionId,
329
+ children: /* @__PURE__ */ jsx(ComponentContext.Provider, {
330
+ value: context,
331
+ children
332
+ })
333
+ })]
334
+ });
335
+ }
336
+
337
+ //#endregion
338
+ //#region src/design/react/components/ComponentDecorator.tsx
339
+ /**
340
+ * Creates a higher-order component that wraps React components with design-time functionality.
341
+ * In design mode, adds visual indicators, selection handling, and host communication.
342
+ * In normal mode, renders the component unchanged for optimal performance.
343
+ *
344
+ * @template TProps - The props type of the component being decorated
345
+ * @param Component - The React component to wrap with design functionality
346
+ * @returns A new component with design-time capabilities
347
+ */
348
+ function createReactComponentDesignDecorator(Component) {
349
+ return function DesignDecoratedComponent(props) {
350
+ const { designMetadata, children,...componentProps } = props;
351
+ const { isDesignMode } = usePageDesignerMode();
352
+ return isDesignMode ? /* @__PURE__ */ jsx(DesignComponent, {
353
+ designMetadata,
354
+ children: /* @__PURE__ */ jsx(Component, {
355
+ ...componentProps,
356
+ children
357
+ })
358
+ }) : /* @__PURE__ */ jsx(Component, {
359
+ ...componentProps,
360
+ children
361
+ });
362
+ };
363
+ }
364
+
365
+ //#endregion
366
+ //#region src/design/react/hooks/useRegionDecoratorClasses.ts
367
+ function useRegionDecoratorClasses({ regionId, componentTypeInclusions, componentTypeExclusions }) {
368
+ const { dragState: { currentDropTarget, componentType } } = useDesignState();
369
+ const isHovered = regionId && currentDropTarget?.regionId === regionId;
370
+ const isComponentAllowed = useMemo(() => isComponentTypeAllowedInRegion(componentType, componentTypeInclusions, componentTypeExclusions), [
371
+ componentType,
372
+ componentTypeInclusions,
373
+ componentTypeExclusions
374
+ ]);
375
+ return [
376
+ "pd-design__decorator",
377
+ "pd-design__region",
378
+ isHovered && isComponentAllowed && "pd-design__region--hovered pd-design__frame--visible"
379
+ ].filter(Boolean).join(" ");
380
+ }
381
+
382
+ //#endregion
383
+ //#region src/design/react/components/DesignRegion.tsx
384
+ function DesignRegion(props) {
385
+ const { designMetadata, children } = props;
386
+ const { name, id, componentIds, componentTypeInclusions, componentTypeExclusions } = designMetadata;
387
+ const nodeRef = React.useRef(null);
388
+ const classes = useRegionDecoratorClasses({
389
+ regionId: id,
390
+ componentTypeInclusions,
391
+ componentTypeExclusions
392
+ });
393
+ const { dragState } = useDesignState();
394
+ const labels = useLabels();
395
+ const showFrame = Boolean(id && dragState.currentDropTarget?.regionId === id);
396
+ const { componentId: parentComponentId } = useComponentContext() ?? {};
397
+ useNodeToTargetStore({
398
+ type: "region",
399
+ nodeRef,
400
+ parentId: parentComponentId,
401
+ componentIds,
402
+ componentId: parentComponentId ?? "",
403
+ regionId: id,
404
+ componentTypeInclusions,
405
+ componentTypeExclusions
406
+ });
407
+ const context = React.useMemo(() => ({
408
+ regionId: id,
409
+ componentIds
410
+ }), [id, componentIds]);
411
+ return /* @__PURE__ */ jsx("div", {
412
+ className: classes,
413
+ ref: nodeRef,
414
+ onDragOver: useCallback((event) => {
415
+ if (isComponentTypeAllowedInRegion(dragState.componentType, componentTypeInclusions, componentTypeExclusions)) event.preventDefault();
416
+ }, [
417
+ dragState.componentType,
418
+ componentTypeInclusions,
419
+ componentTypeExclusions
420
+ ]),
421
+ "data-region-id": id,
422
+ children: /* @__PURE__ */ jsx(DesignFrame, {
423
+ name: name ?? labels.defaultRegionName ?? "Region",
424
+ parentId: parentComponentId,
425
+ regionId: id,
426
+ localized: true,
427
+ showFrame,
428
+ showToolbox: false,
429
+ children: /* @__PURE__ */ jsx(RegionContext.Provider, {
430
+ value: context,
431
+ children
432
+ })
433
+ })
434
+ });
435
+ }
436
+
437
+ //#endregion
438
+ //#region src/design/react/components/RegionDecorator.tsx
439
+ function createReactRegionDesignDecorator(Region) {
440
+ return function DesignDecoratedRegion(props) {
441
+ const { designMetadata, children,...componentProps } = props;
442
+ const { isDesignMode } = usePageDesignerMode();
443
+ return isDesignMode ? /* @__PURE__ */ jsx(DesignRegion, {
444
+ designMetadata,
445
+ children: /* @__PURE__ */ jsx(Region, {
446
+ ...componentProps,
447
+ children
448
+ })
449
+ }) : /* @__PURE__ */ jsx(Region, {
450
+ ...componentProps,
451
+ children
452
+ });
453
+ };
454
+ }
455
+
456
+ //#endregion
457
+ //#region src/design/react/registry/adapter.ts
458
+ /**
459
+ * React framework adapter that implements React-specific behavior
460
+ * for the framework-agnostic component registry.
461
+ */
462
+ var ReactAdapter = class {
463
+ /**
464
+ * Creates a React lazy component from an importer function.
465
+ */
466
+ createLazyComponent(importer) {
467
+ return React.lazy(async () => {
468
+ return { default: (await importer()).default };
469
+ });
470
+ }
471
+ /**
472
+ * Decorates a React component with design-time capabilities.
473
+ * Uses the React-specific design decorator directly.
474
+ */
475
+ decorateComponent(component) {
476
+ return createReactComponentDesignDecorator(component);
477
+ }
478
+ };
479
+ /**
480
+ * Creates a React adapter instance with optional configuration.
481
+ */
482
+ function createReactAdapter() {
483
+ return new ReactAdapter();
484
+ }
485
+
486
+ //#endregion
487
+ export { createReactAdapter, createReactComponentDesignDecorator, createReactRegionDesignDecorator, useDesignContext };
488
+ //# sourceMappingURL=design-react.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-react.js","names":[],"sources":["../src/design/react/hooks/useComponentDecoratorClasses.ts","../src/design/react/hooks/useFocusedComponentHandler.ts","../src/design/react/hooks/useNodeToTargetStore.ts","../src/design/react/hooks/useComponentType.ts","../src/design/react/components/DeleteToolboxButton.tsx","../src/design/react/components/MoveToolboxButton.tsx","../src/design/react/hooks/useLabels.ts","../src/design/react/components/DesignOverlay.tsx","../src/design/react/components/DesignFrame.tsx","../src/design/react/components/DesignComponent.tsx","../src/design/react/components/ComponentDecorator.tsx","../src/design/react/hooks/useRegionDecoratorClasses.ts","../src/design/react/components/DesignRegion.tsx","../src/design/react/components/RegionDecorator.tsx","../src/design/react/registry/adapter.ts"],"sourcesContent":["/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useDesignState } from './useDesignState';\n\nexport function useComponentDecoratorClasses({\n componentId,\n isFragment,\n isLocalized,\n}: {\n componentId: string;\n isFragment: boolean;\n isLocalized: boolean;\n}): string {\n const { selectedComponentId, hoveredComponentId, dragState } = useDesignState();\n\n const isSelected = selectedComponentId === componentId;\n const isHovered = !dragState.isDragging && hoveredComponentId === componentId;\n const showFrame = (isSelected || isHovered) && !dragState.isDragging;\n const isMoving = dragState.isDragging && dragState.sourceComponentId === componentId;\n const isDropTarget = dragState.currentDropTarget?.componentId === componentId;\n const dropTargetInsertType = dragState.currentDropTarget?.insertType;\n const dropTargetAxis = dropTargetInsertType?.axis;\n\n return [\n 'pd-design__decorator',\n isFragment ? 'pd-design__fragment' : 'pd-design__component',\n showFrame && 'pd-design__frame--visible',\n isSelected && 'pd-design__decorator--selected',\n isHovered && 'pd-design__decorator--hovered',\n isMoving && 'pd-design__decorator--moving',\n !isLocalized && 'pd-design__component--unlocalized',\n isDropTarget &&\n dropTargetAxis &&\n dropTargetInsertType &&\n `pd-design__drop-target__${dropTargetAxis}-${dropTargetInsertType.type}`,\n ]\n .filter(Boolean)\n .join(' ');\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { useDesignState } from './useDesignState';\n\n/**\n * Focuses a component when the focused component id matches the component id.\n * @param componentId - The id of the component to focus.\n * @param nodeRef - The ref object to the node to focus.\n */\nexport function useFocusedComponentHandler(componentId: string, nodeRef: React.RefObject<Element | null>): void {\n const { focusedComponentId, focusComponent } = useDesignState();\n\n React.useEffect(() => {\n if (focusedComponentId === componentId && nodeRef.current) {\n focusComponent(nodeRef.current);\n }\n }, [focusedComponentId, componentId, focusComponent, nodeRef]);\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { useDesignState } from './useDesignState';\nimport type { NodeToTargetMapEntry } from '../context/DesignStateContext';\n\nexport function useNodeToTargetStore({\n parentId,\n componentId,\n regionId,\n nodeRef,\n type,\n componentIds,\n componentTypeInclusions,\n componentTypeExclusions,\n}: Partial<NodeToTargetMapEntry> & {\n nodeRef: React.RefObject<Element | null>;\n}): void {\n const { nodeToTargetMap } = useDesignState();\n\n React.useEffect(() => {\n if (nodeRef.current) {\n nodeToTargetMap.set(nodeRef.current, {\n parentId,\n componentId,\n regionId,\n type,\n componentIds,\n componentTypeInclusions,\n componentTypeExclusions,\n } as NodeToTargetMapEntry);\n }\n }, [\n nodeRef,\n parentId,\n componentId,\n regionId,\n type,\n componentIds,\n nodeToTargetMap,\n componentTypeInclusions,\n componentTypeExclusions,\n ]);\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useDesignContext } from '../context/DesignContext';\nimport type { ComponentType } from '../../messaging-api/domain-types';\n\nexport function useComponentType(componentId: string): ComponentType | null {\n const { pageDesignerConfig } = useDesignContext();\n const { type = '' } = pageDesignerConfig?.components[componentId] ?? {};\n\n return pageDesignerConfig?.componentTypes[type] ?? null;\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type React from 'react';\n\nexport const DeleteToolboxButton = ({\n title,\n onClick,\n onMouseDown = () => {\n /* noop */\n },\n}: {\n title: string;\n onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;\n onMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;\n}): React.JSX.Element => (\n <button\n className=\"pd-design__frame__toolbox-button\"\n title={title}\n type=\"button\"\n onMouseDown={onMouseDown}\n onClick={onClick}>\n <svg\n className=\"pd-design__frame__delete-icon\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M18 6L6 18M6 6l12 12\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n);\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type React from 'react';\n\nexport const MoveToolboxButton = ({ title }: { title: string }): React.JSX.Element => (\n <button className=\"pd-design__frame__toolbox-button\" title={title} type=\"button\">\n <svg className=\"pd-design__frame__move-icon\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M22.9 11.7l-3.8-4.2c-.3-.3-.6 0-.6.4v2.7h-4.7c-.2 0-.4-.2-.4-.4V5.5h2.7c.5 0 .7-.4.4-.6l-4.1-3.8c-.2-.2-.5-.2-.7 0L7.6 4.9c-.3.3-.1.6.4.6h2.6v4.7c0 .2-.2.4-.4.4H5.5V7.9c0-.5-.4-.7-.6-.4l-3.8 4.1c-.2.2-.2.5 0 .7l3.8 4.1c.3.3.6.1.6-.4v-2.6h4.7c.2 0 .4.2.4.4v4.7H7.9c-.5 0-.7.4-.4.6l4.1 3.8c.2.2.5.2.7 0l4.1-3.8c.3-.3.1-.6-.4-.6h-2.6v-4.7c0-.2.2-.4.4-.4h4.7v2.7c0 .5.4.7.6.4l3.8-4.1c.2-.3.2-.5 0-.7z\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n);\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useDesignContext } from '../context/DesignContext';\n\nexport function useLabels(): Record<string, string> {\n const { pageDesignerConfig } = useDesignContext();\n\n return pageDesignerConfig?.labels ?? {};\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport const DesignOverlay = () => {\n return (\n <div className=\"pd-design__frame__overlay\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n x=\"0px\"\n y=\"0px\"\n width=\"52px\"\n height=\"52px\"\n viewBox=\"0 0 52 52\"\n enableBackground=\"new 0 0 52 52\"\n xmlSpace=\"preserve\">\n <path\n fill=\"#FFFFFF\"\n d=\"M26,2C12.7,2,2,12.7,2,26s10.7,24,24,24s24-10.7,24-24S39.3,2,26,2z M26,7C26,7,26,7,26,7C26,7,26,7,26,7\n\tC26,7,26,7,26,7z M28,7.1c-0.1,0-0.1,0-0.2,0C27.9,7.1,28,7.1,28,7.1z M26,45C15.5,45,7,36.5,7,26c0-1,0.1-2.1,0.3-3\n\tc1.3,0.2,2.9,0.7,3.7,1.5c1.7,1.8,3.6,3.9,5.4,4.3c0,0-0.2,0.1-0.4,0.4c-0.2,0.3-0.4,0.9-0.4,1.9c0,4.7,4.4,1.9,4.4,6.6\n\tc0,4.7,5.3,6.6,5.3,2.8s3.5-5.6,3.5-8.5s-2.7-2.8-4.4-3.8c-1.8-0.9-2.7-2.4-6.1-1.9c-1.8-1.7-2.8-3.1-2-4.7c0.9-1.7,4.6-2,4.6-4.6\n\ts-2.5-3.1-4.3-3.1c-0.8,0-2.5-0.6-3.9-1.3c1.7-1.7,3.8-3.1,6-4.1c1.6,0.7,4.3,1.8,6.6,1.8c2.7,0,4.1-1.9,3.7-3.1\n\tc4.5,0.7,8.5,3,11.4,6.2c-1.5,0.9-3.5,1.9-7,1.9c-4.6,0-4.6,4.7-1.9,5.6c2.8,0.9,5.6-1.8,6.5,0c0.9,1.8-6.5,1.8-4.6,6.4\n\tc1.9,4.6,3.7-0.1,5.6,4.5c1.9,4.6,5.6-0.7,2.8-4.3c-1.2-1.6-0.9-6.5,1.9-6.5h0.9c0.4,1.6,0.7,3.3,0.7,5C45,36.5,36.5,45,26,45z\"\n />\n </svg>\n </div>\n );\n};\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { useComponentType } from '../hooks/useComponentType';\nimport { DeleteToolboxButton } from './DeleteToolboxButton';\nimport { MoveToolboxButton } from './MoveToolboxButton';\nimport { useDesignState } from '../hooks/useDesignState';\nimport { useLabels } from '../hooks/useLabels';\nimport { DesignOverlay } from './DesignOverlay';\n\nexport const DesignFrame = ({\n componentId,\n children,\n name,\n parentId,\n regionId,\n localized = false,\n showFrame = false,\n showToolbox = true,\n isMoveable = true,\n}: React.PropsWithChildren<{\n componentId?: string;\n name: string;\n localized?: boolean;\n parentId?: string;\n regionId?: string;\n showToolbox?: boolean;\n showFrame?: boolean;\n isMoveable?: boolean;\n}>): React.JSX.Element => {\n const componentType = useComponentType(componentId ?? '');\n const { deleteComponent } = useDesignState();\n const labels = useLabels();\n const nodeRef = React.useRef<HTMLDivElement>(null);\n\n const handleDelete = React.useCallback(\n (event: React.MouseEvent) => {\n // Stop propagation so we don't select the component as well when\n // this bubbles up.\n event.stopPropagation();\n\n if (componentId) {\n deleteComponent({\n componentId,\n sourceComponentId: parentId ?? '',\n sourceRegionId: regionId ?? '',\n });\n }\n },\n [deleteComponent, componentId, parentId, regionId]\n );\n\n const stopPropagation = (event: React.MouseEvent) => event.stopPropagation();\n\n const classes = ['pd-design__frame', showFrame && 'pd-design__frame--visible'].filter(Boolean).join(' ');\n\n // TODO: For the frame label, when there is not enough space above the component to display it, we\n // need to display it inside the container instead.\n return (\n <div className={classes} ref={nodeRef}>\n {showFrame && (\n <>\n <div className=\"pd-design__frame--x\" />\n <div className=\"pd-design__frame--y\" />\n </>\n )}\n <div className=\"pd-design__frame__label\" onMouseDown={stopPropagation}>\n {componentType?.image && (\n <span className=\"pd-design__icon\">\n <img src={componentType.image} alt=\"\" />\n </span>\n )}\n <span className=\"pd-design__frame__name\">{name}</span>\n {!localized && (\n <span className=\"pd-design__frame__fallback-badge\">{labels.fallback ?? 'Fallback'}</span>\n )}\n </div>\n {showToolbox && (\n <div className=\"pd-design__frame__toolbox\">\n {isMoveable && <MoveToolboxButton title={labels.moveComponent ?? 'Move component'} />}\n <DeleteToolboxButton\n title={labels.deleteComponent ?? 'Delete component'}\n onMouseDown={stopPropagation}\n onClick={handleDelete}\n />\n </div>\n )}\n <DesignOverlay />\n {children}\n </div>\n );\n};\n\nDesignFrame.defaultProps = {\n parentId: undefined,\n componentId: undefined,\n showToolbox: true,\n regionId: undefined,\n showFrame: false,\n};\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { useRef, useCallback } from 'react';\nimport type { ComponentDecoratorProps } from './component.types';\nimport { useComponentDecoratorClasses } from '../hooks/useComponentDecoratorClasses';\nimport { useDesignState } from '../hooks/useDesignState';\nimport { useFocusedComponentHandler } from '../hooks/useFocusedComponentHandler';\nimport { useNodeToTargetStore } from '../hooks/useNodeToTargetStore';\nimport { DesignFrame } from './DesignFrame';\nimport { useRegionContext } from '../core/RegionContext';\nimport { ComponentContext, useComponentContext, type ComponentContextType } from '../core/ComponentContext';\nimport { useComponentDiscovery } from '../hooks/useComponentDiscovery';\nimport { useComponentType } from '../hooks/useComponentType';\n\nexport function DesignComponent(props: ComponentDecoratorProps<unknown>): React.JSX.Element {\n const { designMetadata, children } = props;\n const { id, name, isFragment, isVisible, isLocalized } = designMetadata;\n const componentId = id;\n const componentType = useComponentType(componentId);\n const componentName = componentType?.label || name || 'Component';\n const dragRef = useRef<HTMLDivElement>(null);\n const { regionId } = useRegionContext() ?? {};\n const { componentId: parentComponentId } = useComponentContext() ?? {};\n const { nodeToTargetMap } = useDesignState();\n\n const {\n selectedComponentId,\n hoveredComponentId,\n setSelectedComponent,\n setHoveredComponent,\n startComponentMove,\n setPendingComponentDragId,\n dragState: { pendingComponentDragId, isDragging, sourceComponentId: draggingSourceComponentId },\n } = useDesignState();\n\n useFocusedComponentHandler(componentId, dragRef);\n useNodeToTargetStore({\n type: 'component',\n nodeRef: dragRef,\n parentId: parentComponentId,\n regionId,\n componentId,\n });\n\n const discoverComponents = useComponentDiscovery({\n nodeToTargetMap,\n });\n\n const isPendingDrag = pendingComponentDragId === componentId;\n\n const handleMouseEnter = useCallback(\n (event: React.MouseEvent) => {\n event.stopPropagation();\n setHoveredComponent(componentId);\n },\n [setHoveredComponent, componentId]\n );\n\n const handleMouseLeave = useCallback(\n (event: React.MouseEvent) => {\n event.stopPropagation();\n\n // If we hover off a component, we could still be hovering over a parent component\n // that contains that child. In this instance, the mouse enter doesn't fire and that parent\n // would not be highlighted. Everytime we leave a component, we check\n // if we are hovering over a component at those coordinates. If we are,\n // we set the hovered component to that component.\n const components = discoverComponents({\n x: event.clientX,\n y: event.clientY,\n filter: (entry) => entry.type === 'component',\n });\n\n setHoveredComponent(components[0]?.componentId ?? null);\n },\n [setHoveredComponent, discoverComponents]\n );\n\n const handleClick = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n setSelectedComponent(componentId);\n },\n [setSelectedComponent, componentId]\n );\n\n const showFrame = [selectedComponentId, hoveredComponentId].includes(componentId) && !isDragging;\n const isDraggable = Boolean(componentId && regionId && componentType?.id);\n\n const classes = useComponentDecoratorClasses({\n componentId,\n isLocalized,\n isFragment: Boolean(isFragment),\n });\n\n const context = React.useMemo<ComponentContextType>(() => ({ componentId: id, name }), [id, name]);\n\n // Makes the component a drop target.\n const handleDragOver = React.useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n // Don't prevent propagation here.\n // We depend on the global listener to handle the drag over event.\n // If we are moving a component, don't let it be droppable on itself.\n if (draggingSourceComponentId !== componentId) {\n event.preventDefault();\n }\n },\n [draggingSourceComponentId, componentId]\n );\n\n // When dragging, we don't consider the component as dragging until the drag start event\n // is triggered. However, we need to mark the component as draggable on mouse down so that\n // it can even be dragged via the native drag and drop API.\n //\n // If we were to mark the components as dragging on mouse down instead, a selection of a component\n // would first remove the frame because this thinks we are dragging the component instead of selecting it.\n // This is why it is split up into two events.\n const handleMouseDown = React.useCallback(\n (event: React.MouseEvent) => {\n if (componentId) {\n event.stopPropagation();\n setPendingComponentDragId(componentId);\n }\n },\n [componentId, setPendingComponentDragId]\n );\n\n const handleDragStart = React.useCallback(\n (event: React.DragEvent) => {\n event.stopPropagation();\n\n if (componentId && regionId && componentType?.id) {\n startComponentMove(componentId, regionId, componentType.id);\n }\n },\n [componentId, regionId, componentType?.id, startComponentMove]\n );\n\n // Don't render anything if the components is hidden via visibility rules.\n // We still want the component to be reactive in case the use changes the\n // visibility rules or the render context.\n if (!isVisible) {\n return <></>;\n }\n\n return (\n <div\n ref={dragRef}\n className={classes}\n draggable={isPendingDrag && isDraggable}\n onClick={handleClick}\n onDragOver={handleDragOver}\n onDragStart={handleDragStart}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onMouseDown={handleMouseDown}\n data-component-type={componentType?.id}\n data-testid={`design-component-${componentId}`}>\n <div className=\"pd-design__component__drop-target\" />\n <DesignFrame\n showFrame={showFrame}\n componentId={componentId}\n localized={isLocalized}\n name={componentName}\n parentId={parentComponentId}\n isMoveable={isDraggable}\n regionId={regionId}>\n <ComponentContext.Provider value={context}>{children}</ComponentContext.Provider>\n </DesignFrame>\n </div>\n );\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type React from 'react';\nimport type { ComponentDecoratorProps } from './component.types';\nimport { DesignComponent } from './DesignComponent';\nimport { usePageDesignerMode } from '../core/PageDesignerProvider';\n\n/**\n * Creates a higher-order component that wraps React components with design-time functionality.\n * In design mode, adds visual indicators, selection handling, and host communication.\n * In normal mode, renders the component unchanged for optimal performance.\n *\n * @template TProps - The props type of the component being decorated\n * @param Component - The React component to wrap with design functionality\n * @returns A new component with design-time capabilities\n */\nexport function createReactComponentDesignDecorator<TProps>(\n Component: React.ComponentType<TProps>\n): (props: ComponentDecoratorProps<TProps>) => React.JSX.Element {\n return function DesignDecoratedComponent(props: ComponentDecoratorProps<TProps>) {\n const { designMetadata, children, ...componentProps } = props;\n\n // Only use design context if in design mode\n const { isDesignMode } = usePageDesignerMode();\n\n return isDesignMode ? (\n <DesignComponent designMetadata={designMetadata}>\n <Component {...(componentProps as unknown as TProps)}>{children}</Component>\n </DesignComponent>\n ) : (\n <Component {...(componentProps as unknown as TProps)}>{children}</Component>\n );\n };\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { useMemo } from 'react';\nimport { useDesignState } from './useDesignState';\nimport { isComponentTypeAllowedInRegion } from '../utils/regionUtils';\n\nexport function useRegionDecoratorClasses({\n regionId,\n componentTypeInclusions,\n componentTypeExclusions,\n}: {\n regionId: string;\n componentTypeInclusions: string[];\n componentTypeExclusions: string[];\n}): string {\n const {\n dragState: { currentDropTarget, componentType },\n } = useDesignState();\n\n const isHovered = regionId && currentDropTarget?.regionId === regionId;\n\n const isComponentAllowed = useMemo(\n () => isComponentTypeAllowedInRegion(componentType, componentTypeInclusions, componentTypeExclusions),\n [componentType, componentTypeInclusions, componentTypeExclusions]\n );\n\n // Only show hover state if the region is hovered and the component is allowed\n const shouldShowHover = isHovered && isComponentAllowed;\n\n return [\n 'pd-design__decorator',\n 'pd-design__region',\n shouldShowHover && 'pd-design__region--hovered pd-design__frame--visible',\n ]\n .filter(Boolean)\n .join(' ');\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React, { useCallback } from 'react';\nimport type { RegionDecoratorProps } from './component.types';\nimport { useRegionDecoratorClasses } from '../hooks/useRegionDecoratorClasses';\nimport { useNodeToTargetStore } from '../hooks/useNodeToTargetStore';\nimport { DesignFrame } from './DesignFrame';\nimport { useLabels } from '../hooks/useLabels';\nimport { RegionContext, type RegionContextType } from '../core/RegionContext';\nimport { useComponentContext } from '../core/ComponentContext';\nimport { useDesignState } from '../hooks/useDesignState';\nimport { isComponentTypeAllowedInRegion } from '../utils/regionUtils';\n\nexport function DesignRegion(props: RegionDecoratorProps<unknown>): React.JSX.Element {\n const { designMetadata, children } = props;\n const { name, id, componentIds, componentTypeInclusions, componentTypeExclusions } = designMetadata;\n const nodeRef = React.useRef<HTMLDivElement>(null);\n const classes = useRegionDecoratorClasses({\n regionId: id,\n componentTypeInclusions,\n componentTypeExclusions,\n });\n const { dragState } = useDesignState();\n const labels = useLabels();\n const showFrame = Boolean(id && dragState.currentDropTarget?.regionId === id);\n const { componentId: parentComponentId } = useComponentContext() ?? {};\n\n useNodeToTargetStore({\n type: 'region',\n nodeRef,\n parentId: parentComponentId,\n componentIds,\n componentId: parentComponentId ?? '',\n regionId: id,\n componentTypeInclusions,\n componentTypeExclusions,\n });\n\n const context = React.useMemo<RegionContextType>(() => ({ regionId: id, componentIds }), [id, componentIds]);\n\n const handleDragOver = useCallback(\n (event: React.DragEvent<HTMLDivElement>) => {\n const isComponentAllowed = isComponentTypeAllowedInRegion(\n dragState.componentType,\n componentTypeInclusions,\n componentTypeExclusions\n );\n\n if (isComponentAllowed) {\n event.preventDefault();\n }\n },\n [dragState.componentType, componentTypeInclusions, componentTypeExclusions]\n );\n\n return (\n <div className={classes} ref={nodeRef} onDragOver={handleDragOver} data-region-id={id}>\n <DesignFrame\n name={name ?? labels.defaultRegionName ?? 'Region'}\n parentId={parentComponentId}\n regionId={id}\n localized\n showFrame={showFrame}\n showToolbox={false}>\n <RegionContext.Provider value={context}>{children}</RegionContext.Provider>\n </DesignFrame>\n </div>\n );\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport type React from 'react';\nimport type { RegionDecoratorProps } from './component.types';\nimport { DesignRegion } from './DesignRegion';\nimport { usePageDesignerMode } from '../core/PageDesignerProvider';\n\nexport function createReactRegionDesignDecorator<TProps>(\n Region: React.ComponentType<TProps>\n): (props: RegionDecoratorProps<TProps>) => React.JSX.Element {\n return function DesignDecoratedRegion(props: RegionDecoratorProps<TProps>) {\n const { designMetadata, children, ...componentProps } = props;\n const { isDesignMode } = usePageDesignerMode();\n\n return isDesignMode ? (\n <DesignRegion designMetadata={designMetadata}>\n <Region {...(componentProps as unknown as TProps)}>{children}</Region>\n </DesignRegion>\n ) : (\n <Region {...(componentProps as unknown as TProps)}>{children}</Region>\n );\n };\n}\n","/**\n * Copyright 2026 Salesforce, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { type ComponentModule, type FrameworkAdapter } from '../../index';\nimport { createReactComponentDesignDecorator } from '../index';\n\n/* ==================== React-Specific Types ==================== */\n\nexport type ReactComponentModule<TProps> = ComponentModule<TProps, ReactDesignComponentType<TProps>>;\n\n/**\n * A React component that optionally accepts design metadata.\n * Any component returned from the registry could potentially accept design metadata.\n * This includes both regular components and lazy components with their React-specific properties.\n */\nexport type ReactDesignComponentType<TProps> =\n | React.ComponentType<TProps>\n | React.LazyExoticComponent<React.ComponentType<TProps>>;\n\n/* ==================== React Adapter Implementation ==================== */\n\n/**\n * React framework adapter that implements React-specific behavior\n * for the framework-agnostic component registry.\n */\nexport class ReactAdapter<TProps> implements FrameworkAdapter<TProps, ReactDesignComponentType<TProps>> {\n /**\n * Creates a React lazy component from an importer function.\n */\n createLazyComponent(importer: () => Promise<ReactComponentModule<TProps>>): ReactDesignComponentType<TProps> {\n const lazyComp = React.lazy(async () => {\n const m = await importer();\n\n const component = m.default as React.ComponentType<TProps>;\n\n return { default: component };\n });\n\n return lazyComp as ReactDesignComponentType<TProps>;\n }\n\n /**\n * Decorates a React component with design-time capabilities.\n * Uses the React-specific design decorator directly.\n */\n decorateComponent(component: ReactDesignComponentType<TProps>): ReactDesignComponentType<TProps> {\n const reactComponent = component as React.ComponentType<TProps>;\n\n return createReactComponentDesignDecorator(reactComponent) as ReactDesignComponentType<TProps>;\n }\n}\n\n/**\n * Creates a React adapter instance with optional configuration.\n */\nexport function createReactAdapter<TProps>(): ReactAdapter<TProps> {\n return new ReactAdapter<TProps>();\n}\n"],"mappings":";;;;;;;;;AAiBA,SAAgB,6BAA6B,EACzC,aACA,YACA,eAKO;CACP,MAAM,EAAE,qBAAqB,oBAAoB,cAAc,gBAAgB;CAE/E,MAAM,aAAa,wBAAwB;CAC3C,MAAM,YAAY,CAAC,UAAU,cAAc,uBAAuB;CAClE,MAAM,aAAa,cAAc,cAAc,CAAC,UAAU;CAC1D,MAAM,WAAW,UAAU,cAAc,UAA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