@contentstack/studio-react-editor 1.7.0 → 1.8.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.
- package/dist/components/EditableRenderer.js +6 -19
- package/dist/components/EditableRenderer.js.map +1 -1
- package/dist/components/Element.js +36 -21
- package/dist/components/Element.js.map +1 -1
- package/dist/components/PreviewRenderer.js +0 -19
- package/dist/components/PreviewRenderer.js.map +1 -1
- package/dist/components/WelcomeState.js +1 -17
- package/dist/components/WelcomeState.js.map +1 -1
- package/dist/components/elements/ConditionBlock.js +2 -15
- package/dist/components/elements/ConditionBlock.js.map +1 -1
- package/dist/components/elements/Repeater.js +1 -15
- package/dist/components/elements/Repeater.js.map +1 -1
- package/dist/components/elements/SectionSlot.js +59 -2
- package/dist/components/elements/SectionSlot.js.map +1 -1
- package/dist/components/styles.js +69 -0
- package/dist/components/styles.js.map +1 -1
- package/dist/hooks/use-active-node-path.hook.js +0 -19
- package/dist/hooks/use-active-node-path.hook.js.map +1 -1
- package/dist/hooks/use-condition-block-context.js +0 -20
- package/dist/hooks/use-condition-block-context.js.map +1 -1
- package/dist/hooks/use-design-preview.hook.js +0 -20
- package/dist/hooks/use-design-preview.hook.js.map +1 -1
- package/dist/hooks/use-preview-mode.hook.js +0 -20
- package/dist/hooks/use-preview-mode.hook.js.map +1 -1
- package/dist/hooks/use-register-section.hook.js +0 -1
- package/dist/hooks/use-register-section.hook.js.map +1 -1
- package/dist/hooks/use-renderer.hook.js +0 -20
- package/dist/hooks/use-renderer.hook.js.map +1 -1
- package/dist/hooks/use-repeater.hook.js +0 -20
- package/dist/hooks/use-repeater.hook.js.map +1 -1
- package/dist/hooks/use-should-show-design.hook.js +1 -20
- package/dist/hooks/use-should-show-design.hook.js.map +1 -1
- package/dist/hooks/use-spec-data-listener.hook.js +55 -10
- package/dist/hooks/use-spec-data-listener.hook.js.map +1 -1
- package/package.json +12 -13
- package/dist/components/elements/Symbol.js +0 -65
- package/dist/components/elements/Symbol.js.map +0 -1
- package/dist/contexts/providers/symbol-ui.provider.js +0 -88
- package/dist/contexts/providers/symbol-ui.provider.js.map +0 -1
- package/dist/hooks/use-register-symbol.hook.js +0 -54
- package/dist/hooks/use-register-symbol.hook.js.map +0 -1
- package/dist/hooks/use-symbol-events.hook.js +0 -45
- package/dist/hooks/use-symbol-events.hook.js.map +0 -1
- package/dist/hooks/use-symbol-ui-listener.hook.js +0 -17
- package/dist/hooks/use-symbol-ui-listener.hook.js.map +0 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { ELEMENT_TO_NODE, COMPOSABLE_DATA_ATTRIBUTES, NODE_TO_PARENT, NODE_TO_PATH_NODE } from '@contentstack/studio-client';
|
|
3
3
|
import { SectionInstanceSlotsCtx, DataCtxProvider, CurrentNodeContext } from '@contentstack/studio-react-components/contexts';
|
|
4
4
|
import { useCurrentNode, useData } from '@contentstack/studio-react-components/hooks';
|
|
5
|
+
import { composableStudioEventManager, POST_MESSAGE_EVENTS } from '@contentstack/studio-messenger';
|
|
6
|
+
import { Button } from '@contentstack/studio-core';
|
|
5
7
|
import { css } from 'goober';
|
|
6
8
|
import classNames from 'classnames';
|
|
7
9
|
import { useContext, useCallback, useMemo } from 'react';
|
|
@@ -9,6 +11,7 @@ import { styleFactory } from '../styles.js';
|
|
|
9
11
|
import { SelectedNodeProvider } from '../../contexts/providers/selected-node.provider.js';
|
|
10
12
|
import { PreviewModeContext } from '../../contexts/providers/preview-mode.provider.js';
|
|
11
13
|
import { SectionModeContext } from '../../contexts/providers/section-mode.provider.js';
|
|
14
|
+
import { useRenderer } from '../../hooks/use-renderer.hook.js';
|
|
12
15
|
import MemoizedElement from '../Element.js';
|
|
13
16
|
|
|
14
17
|
/**
|
|
@@ -57,6 +60,10 @@ function SectionSlot({ studioAttributes, label, _uid, defaultSection, }) {
|
|
|
57
60
|
// ALL hooks unconditionally at the top — React doesn't allow conditional
|
|
58
61
|
// hook calls and the component returns early for authoring/empty modes.
|
|
59
62
|
const sectionCtx = useContext(SectionInstanceSlotsCtx);
|
|
63
|
+
// Registry resolves the authored Default section's human title for the
|
|
64
|
+
// design-mode hint (COMS-1770). Sections register with `type = section.uid`
|
|
65
|
+
// and `displayName = section.title`, so a uid lookup yields the title.
|
|
66
|
+
const { componentRegistry } = useRenderer();
|
|
60
67
|
// When the enclosing placed section is in preview mode, the slot renders like
|
|
61
68
|
// production: an empty slot collapses to nothing and a filled slot drops its
|
|
62
69
|
// drop-chrome / selection affordances.
|
|
@@ -141,6 +148,42 @@ function SectionSlot({ studioAttributes, label, _uid, defaultSection, }) {
|
|
|
141
148
|
const slotUid = _uid ||
|
|
142
149
|
studioAttributes?.[COMPOSABLE_DATA_ATTRIBUTES.ID] ||
|
|
143
150
|
"section-slot";
|
|
151
|
+
// Design-mode hint (COMS-1770): resolve the Default section's title for the
|
|
152
|
+
// message. `getComponent` throws for a uid outside the locally-known catalog,
|
|
153
|
+
// so fall back to a nameless hint instead of crashing the slot.
|
|
154
|
+
let defaultSectionTitle;
|
|
155
|
+
if (defaultSection) {
|
|
156
|
+
try {
|
|
157
|
+
defaultSectionTitle =
|
|
158
|
+
componentRegistry.getComponent(defaultSection)?.displayName;
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
defaultSectionTitle = undefined;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// COMS-1809: open the section-slot picker. The button lives here in the
|
|
165
|
+
// iframe, but the picker is a parent-app overlay (reusing the Component tab
|
|
166
|
+
// card + hover preview + section catalog — ADR 0010), so we only post the
|
|
167
|
+
// slot identity plus the button's viewport rect. Studio offsets the rect by
|
|
168
|
+
// the iframe's own position to anchor the popover. Plain function (used only
|
|
169
|
+
// in the consumption design-empty branch below), not a hook.
|
|
170
|
+
const handleSelectSection = (event) => {
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
event.stopPropagation();
|
|
173
|
+
const r = event.currentTarget.getBoundingClientRect();
|
|
174
|
+
composableStudioEventManager?.send(POST_MESSAGE_EVENTS.OPEN_SECTION_SLOT_PICKER, {
|
|
175
|
+
sectionInstanceUid: sectionCtx?.sectionInstanceUid,
|
|
176
|
+
slotUid,
|
|
177
|
+
buttonRect: {
|
|
178
|
+
top: r.top,
|
|
179
|
+
left: r.left,
|
|
180
|
+
right: r.right,
|
|
181
|
+
bottom: r.bottom,
|
|
182
|
+
width: r.width,
|
|
183
|
+
height: r.height,
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
};
|
|
144
187
|
// Authoring mode: section is the top-level composition being edited.
|
|
145
188
|
if (!sectionCtx) {
|
|
146
189
|
return (jsx("div", { [COMPOSABLE_DATA_ATTRIBUTES.SLOT]: true,
|
|
@@ -171,7 +214,15 @@ function SectionSlot({ studioAttributes, label, _uid, defaultSection, }) {
|
|
|
171
214
|
currentNodePath: [...parentNodePath, [slotUid, 0]],
|
|
172
215
|
}, children: jsx(MemoizedElement, { node: synth, renderError: () => null }) }) }) }) }) }));
|
|
173
216
|
}
|
|
174
|
-
return (
|
|
217
|
+
return (jsxs("div", { ref: slotDomRef, ...dropZoneAttrs, ...studioAttributes,
|
|
218
|
+
// Always column now (COMS-1809): the "Select section" button stacks
|
|
219
|
+
// below the drop copy in every design-mode empty slot.
|
|
220
|
+
className: classNames(styles.slotStyle, styles.slotColumnStyle), children: [jsxs("span", { className: styles.slotDropText, children: [jsx(AddIcon, {}), " ", defaultSection
|
|
221
|
+
? "Drop a section here to replace it."
|
|
222
|
+
: "Drop a section here."] }), defaultSection ? (jsxs("p", { className: styles.slotDefaultHint, children: ["(When this slot is empty, the default section", defaultSectionTitle ? (jsxs(Fragment, { children: [" (", jsx("strong", { children: defaultSectionTitle }), ")"] })) : null, " added by the section author is shown in Preview and on the live page.)"] })) : null, jsx("p", { className: styles.slotOrDivider, children: "OR" }), jsx("p", { className: styles.slotAllowedLabel, children: "Add from the allowed Sections" }), jsxs(Button, { type: "button", "data-studio-ui": true, className: styles.slotSelectButton,
|
|
223
|
+
// Swallow mousedown so the slot's drag-select never starts from the
|
|
224
|
+
// button; the click opens the picker instead.
|
|
225
|
+
onMouseDown: (e) => e.stopPropagation(), onClick: handleSelectSection, children: [jsx(SelectSectionIcon, {}), " Select section"] })] }));
|
|
175
226
|
}
|
|
176
227
|
// Transclude filled children. Anchor each child's slate path under the
|
|
177
228
|
// page-side section-composition node + this slot's uid. In design mode, exit
|
|
@@ -194,6 +245,12 @@ function SectionSlot({ studioAttributes, label, _uid, defaultSection, }) {
|
|
|
194
245
|
const AddIcon = () => {
|
|
195
246
|
return (jsxs("svg", { width: "22", height: "22", viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { x: "0.5", y: "0.5", width: "21", height: "21", rx: "4.5", fill: "white" }), jsx("rect", { x: "0.5", y: "0.5", width: "21", height: "21", rx: "4.5", stroke: "#475161" }), jsx("path", { d: "M11.2808 6.78125C11.2808 6.62592 11.1548 6.5 10.9995 6.5C10.8442 6.5 10.7183 6.62592 10.7183 6.78125V10.7184H6.78125C6.62592 10.7184 6.5 10.8443 6.5 10.9996C6.5 11.155 6.62592 11.2809 6.78125 11.2809H10.7183V15.218C10.7183 15.3733 10.8442 15.4993 10.9995 15.4993C11.1548 15.4993 11.2808 15.3733 11.2808 15.218V11.2809H15.218C15.3733 11.2809 15.4993 11.155 15.4993 10.9996C15.4993 10.8443 15.3733 10.7184 15.218 10.7184H11.2808V6.78125Z", fill: "#475161" })] }));
|
|
196
247
|
};
|
|
248
|
+
// Marquee-select glyph for the "Select section" button (COMS-1809) — the
|
|
249
|
+
// design's asset verbatim, with fills switched to `currentColor` so it
|
|
250
|
+
// inherits the button's white text.
|
|
251
|
+
const SelectSectionIcon = () => {
|
|
252
|
+
return (jsxs("svg", { width: "18", height: "12", viewBox: "0 0 18 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.09375 0.9375C1.00746 0.9375 0.9375 1.00746 0.9375 1.09375V2.34375C0.9375 2.60263 0.727633 2.8125 0.46875 2.8125C0.209867 2.8125 0 2.60263 0 2.34375V1.09375C0 0.489689 0.489688 0 1.09375 0H2.34375C2.60263 0 2.8125 0.209867 2.8125 0.46875C2.8125 0.727633 2.60263 0.9375 2.34375 0.9375H1.09375ZM4.375 0.46875C4.375 0.209867 4.58487 0 4.84375 0H7.34375C7.60263 0 7.8125 0.209867 7.8125 0.46875C7.8125 0.727633 7.60263 0.9375 7.34375 0.9375H4.84375C4.58487 0.9375 4.375 0.727633 4.375 0.46875ZM9.375 0.46875C9.375 0.209867 9.58487 0 9.84375 0H12.3438C12.6026 0 12.8125 0.209867 12.8125 0.46875C12.8125 0.727633 12.6026 0.9375 12.3438 0.9375H9.84375C9.58487 0.9375 9.375 0.727633 9.375 0.46875ZM14.375 0.46875C14.375 0.209867 14.5849 0 14.8438 0H16.0938C16.6978 0 17.1875 0.489688 17.1875 1.09375V2.5C17.1875 2.75888 16.9776 2.96875 16.7188 2.96875C16.4599 2.96875 16.25 2.75888 16.25 2.5V1.09375C16.25 1.00746 16.18 0.9375 16.0938 0.9375H14.8438C14.5849 0.9375 14.375 0.727633 14.375 0.46875ZM0.46875 4.375C0.727633 4.375 0.9375 4.58487 0.9375 4.84375V6.09375C0.9375 6.18004 1.00746 6.25 1.09375 6.25H2.03125C2.29013 6.25 2.5 6.45987 2.5 6.71875C2.5 6.97763 2.29013 7.1875 2.03125 7.1875H1.09375C0.489689 7.1875 0 6.69781 0 6.09375V4.84375C0 4.58487 0.209867 4.375 0.46875 4.375ZM16.7188 4.84375C16.9776 4.84375 17.1875 5.05362 17.1875 5.3125V6.71875C17.1875 6.97763 16.9776 7.1875 16.7188 7.1875C16.4599 7.1875 16.25 6.97763 16.25 6.71875V5.3125C16.25 5.05362 16.4599 4.84375 16.7188 4.84375ZM3.4375 6.71875C3.4375 6.45987 3.64737 6.25 3.90625 6.25H5.78125C6.04013 6.25 6.25 6.45987 6.25 6.71875C6.25 6.97763 6.04013 7.1875 5.78125 7.1875H3.90625C3.64737 7.1875 3.4375 6.97763 3.4375 6.71875ZM7.1875 6.71875C7.1875 6.45987 7.39737 6.25 7.65625 6.25H8.59375C8.85263 6.25 9.0625 6.45987 9.0625 6.71875C9.0625 6.97763 8.85263 7.1875 8.59375 7.1875H7.65625C7.39737 7.1875 7.1875 6.97763 7.1875 6.71875Z", fill: "currentColor" }), jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9.79852 4.73594C9.72732 4.06274 10.4877 3.62376 11.0351 4.02202L16.3345 7.8776C16.9193 8.30303 16.6619 9.22617 15.9414 9.28775L13.3774 9.5069L11.9056 11.6178C11.492 12.211 10.5639 11.9723 10.4878 11.2532L9.79852 4.73594ZM10.7678 4.98694L11.3761 10.7381L12.6503 8.91063C12.783 8.7203 12.9934 8.5988 13.2246 8.57904L15.4443 8.38932L10.7678 4.98694Z", fill: "currentColor" })] }));
|
|
253
|
+
};
|
|
197
254
|
|
|
198
255
|
export { SectionSlot };
|
|
199
256
|
//# sourceMappingURL=SectionSlot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionSlot.js","sources":["../../../src/components/elements/SectionSlot.tsx"],"sourcesContent":["import {\n COMPOSABLE_DATA_ATTRIBUTES,\n ELEMENT_TO_NODE,\n NODE_TO_PARENT,\n NODE_TO_PATH_NODE,\n} from \"@contentstack/studio-client\";\nimport { Node, Path } from \"@contentstack/studio-internal\";\nimport {\n CurrentNodeContext,\n DataCtxProvider,\n SectionInstanceSlotsCtx,\n} from \"@contentstack/studio-react-components/contexts\";\nimport {\n useCurrentNode,\n useData,\n} from \"@contentstack/studio-react-components/hooks\";\nimport { css } from \"goober\";\nimport classNames from \"classnames\";\nimport { useCallback, useContext, useMemo } from \"react\";\nimport { styleFactory } from \"../styles\";\nimport { StudioAttributes } from \"../../types\";\nimport { SelectedNodeProvider } from \"../../contexts/providers/selected-node.provider\";\nimport { PreviewModeContext } from \"../../contexts/providers/preview-mode.provider\";\nimport { SectionModeContext } from \"../../contexts/providers/section-mode.provider\";\nimport Element from \"../Element\";\n\ninterface SectionSlotEditorProps extends StudioAttributes {\n label?: string;\n _uid?: string;\n /** Authored Slot default section uid (COMS-1659). Rendered when the slot is\n * empty in preview mode; design mode keeps the dropzone. */\n defaultSection?: string;\n}\n\n/**\n * In-memory `section-composition` node for a slot's authored default. Rendered\n * through the normal element path so the default's spec resolves by\n * `compositionUID` and nested defaults recurse. Stable uid → no remount. Never\n * persisted into the placement.\n */\nfunction makeDefaultSectionNode(\n instanceUid: string | undefined,\n slotUid: string,\n defaultUid: string,\n): Node {\n // Key by the enclosing placement instance too (COMS-1659): the same section\n // placed twice shares one internal `slotUid`, so a slot-uid-only key would\n // collide across placements and make their empty-slot defaults share one\n // uid-keyed data context. The instance uid makes each placement's default\n // distinct.\n const prefix = instanceUid ? `${instanceUid}-` : \"\";\n return {\n type: \"section-composition\",\n uid: `${prefix}${slotUid}-default-${defaultUid}`,\n metadata: { compositionUID: defaultUid, mode: \"preview\" },\n attrs: {},\n props: {},\n slots: {},\n styles: {},\n } as Node;\n}\n\n/**\n * Editor variant of section-slot. Two modes:\n *\n * 1. **Authoring mode** (no SectionInstanceSlotsCtx in scope) — the section\n * composition is being authored. Render a labelled drop-zone-style\n * placeholder; not droppable into (section slots only accept drops when\n * the section is consumed in a page composition).\n *\n * 2. **Consumption mode** (SectionInstanceSlotsCtx present) — the section\n * is being rendered inside a page composition. Look up the page-side\n * slots map by this slot's stable uid (== this node's uid). If filled,\n * transclude the children via <Element> with their paths anchored to\n * the page-side section-composition node, and lift them out of preview\n * mode so they're individually selectable / hover-targetable / draggable\n * like any other page-tree node. If empty, render a labelled drop\n * target that itself acts as a builder node (attributes mapped to the\n * page-side section-composition parent), so hover highlights only the\n * slot zone — not the whole section.\n */\nexport function SectionSlot({\n studioAttributes,\n label,\n _uid,\n defaultSection,\n}: SectionSlotEditorProps) {\n // ALL hooks unconditionally at the top — React doesn't allow conditional\n // hook calls and the component returns early for authoring/empty modes.\n const sectionCtx = useContext(SectionInstanceSlotsCtx);\n // When the enclosing placed section is in preview mode, the slot renders like\n // production: an empty slot collapses to nothing and a filled slot drops its\n // drop-chrome / selection affordances.\n const isSectionPreview = useContext(SectionModeContext) === \"preview\";\n const { currentNodePath: parentNodePath = [] } = useCurrentNode();\n // Current section-local data (template scoped to section, in-section\n // repeater item if surrounding, etc.). Slot children inherit this as\n // their *default* context — the user's authored bindings on slot\n // children resolve against this by default.\n const sectionLocalData = useData();\n const slotDomRef = useCallback(\n (el: HTMLElement | null) => {\n if (el && sectionCtx?.sectionNode) {\n ELEMENT_TO_NODE.set(el, sectionCtx.sectionNode);\n }\n },\n [sectionCtx?.sectionNode],\n );\n // Slot child's data context namespace:\n //\n // dataSources.template = section-local scoped template; if the\n // slot sits inside an in-section\n // Repeater that's currently iterating,\n // this is the active iteration item.\n // Matches what the Data Picker writes\n // when authoring against fields from\n // the slot's surrounding section scope.\n // dataSources.repeater[uid] = in-section Repeater map (full\n // per-uid context). Inherited from\n // sectionLocal via {...sectionDS}.\n // dataSources.static_value = section's persisted static values.\n // dataSources.page = OUTERMOST page-level namespace\n // ({ template, contentstack,\n // contentstack_queries, ... }).\n // Always points to the real page even\n // across recursive slot nesting — see\n // `truePageNamespace` below.\n //\n // Until Phase 8 lands, picker emits `dataSources.<src>.X` paths only.\n // retrieve-data.ts retries unresolved `dataSources.<src>.X` lookups under\n // `dataSources.page.<src>.X` so page-level bindings authored on slot\n // children still resolve.\n const slotChildData = useMemo(() => {\n const sectionLocal: any = sectionLocalData || {};\n const pageOuter: any = sectionCtx?.pageOuterData || {};\n const pageDS = pageOuter?.dataSources || {};\n const sectionDS = sectionLocal?.dataSources || {};\n\n const repeaterMap = (sectionDS.repeater || {}) as Record<string, any>;\n const repeaterUids = Object.keys(repeaterMap);\n const activeRepeaterUid =\n repeaterUids.length > 0\n ? repeaterUids[repeaterUids.length - 1]\n : undefined;\n const activeItem = activeRepeaterUid\n ? repeaterMap[activeRepeaterUid]?.context\n : undefined;\n const sectionLocalTemplate = activeItem ?? sectionDS.template;\n\n // Slot child's default namespace = section-local context AS IS (template,\n // repeater, static_value, …). Page-level sources are nested under `page.*`\n // as the explicit escape. This matches what the Data Picker writes when\n // authoring a slot child (picker shows the slot child's surrounding\n // scope, so its `template.X` / `repeater[uid].context.X` paths resolve\n // natively without rewriting).\n //\n // For nested cases (Section B in Section A's slot), `page` must always\n // point to the OUTERMOST page context — not to Section A's slot-local\n // view. Otherwise each nesting level shadows `page` with the surrounding\n // section's local, and `dataSources.page.template.title` would resolve\n // to a modular_block item instead of the page entry. So: if the outer\n // dataSources already has its own `page` key (because the section we're\n // inside is itself in another slot), inherit THAT — it's the real page.\n const outerPage = (pageDS as any)?.page;\n const truePageNamespace = outerPage ?? pageDS;\n return {\n ...sectionLocal,\n dataSources: {\n ...sectionDS,\n template: sectionLocalTemplate,\n page: truePageNamespace,\n },\n };\n }, [sectionLocalData, sectionCtx?.pageOuterData]);\n\n // ALL hooks above are unconditional. From here, branch based on mode.\n const styles = styleFactory(css);\n const text = label && label.trim().length > 0 ? label : \"Drop Here\";\n const slotUid =\n _uid ||\n (studioAttributes as any)?.[COMPOSABLE_DATA_ATTRIBUTES.ID] ||\n \"section-slot\";\n\n // Authoring mode: section is the top-level composition being edited.\n if (!sectionCtx) {\n return (\n <div\n {...{\n [COMPOSABLE_DATA_ATTRIBUTES.SLOT]: true,\n [COMPOSABLE_DATA_ATTRIBUTES.SLOT_UID]: slotUid,\n }}\n {...studioAttributes}\n className={classNames(styles.slotStyle)}\n >\n <span className={styles.slotDropText}>\n <AddIcon /> {text}\n </span>\n </div>\n );\n }\n\n // Consumption mode.\n const filled = (sectionCtx.slotsMap[slotUid] || []) as Node[];\n const dropZoneAttrs = {\n [COMPOSABLE_DATA_ATTRIBUTES.BUILDER]: true,\n [COMPOSABLE_DATA_ATTRIBUTES.NODE]: true,\n [COMPOSABLE_DATA_ATTRIBUTES.ID]: sectionCtx.sectionInstanceUid,\n [COMPOSABLE_DATA_ATTRIBUTES.SLOT]: true,\n [COMPOSABLE_DATA_ATTRIBUTES.SLOT_UID]: slotUid,\n };\n\n if (filled.length === 0) {\n // Preview mode: an empty slot falls back to its authored default section\n // (COMS-1659), rendered like production — non-interactive, no drop chrome.\n // With no default it collapses to nothing. Design mode always shows the\n // dropzone below (default never shown while authoring the placement).\n if (isSectionPreview) {\n if (!defaultSection) return null;\n const synth = makeDefaultSectionNode(\n sectionCtx.sectionInstanceUid,\n slotUid,\n defaultSection,\n );\n NODE_TO_PARENT.set(synth, sectionCtx.sectionNode);\n NODE_TO_PATH_NODE.set(synth, [slotUid, 0]);\n return (\n <DataCtxProvider value={slotChildData}>\n <PreviewModeContext.Provider value={true}>\n <div style={{ display: \"contents\" }}>\n <SectionInstanceSlotsCtx.Provider value={undefined}>\n <CurrentNodeContext.Provider\n value={{\n currentNodeUid: synth.uid,\n currentNodePath: [...parentNodePath, [slotUid, 0]],\n }}\n >\n <Element node={synth} renderError={() => null as any} />\n </CurrentNodeContext.Provider>\n </SectionInstanceSlotsCtx.Provider>\n </div>\n </PreviewModeContext.Provider>\n </DataCtxProvider>\n );\n }\n return (\n <div\n ref={slotDomRef as any}\n {...dropZoneAttrs}\n {...studioAttributes}\n className={classNames(styles.slotStyle)}\n >\n <span className={styles.slotDropText}>\n <AddIcon /> {text}\n </span>\n </div>\n );\n }\n\n // Transclude filled children. Anchor each child's slate path under the\n // page-side section-composition node + this slot's uid. In design mode, exit\n // preview so Element's internalAttributes get applied — making each child\n // selectable, hover-highlightable, and draggable like a normal node. In\n // preview mode, keep them inside preview (non-interactive) and drop the\n // drop-zone attributes so the slot reads like production.\n return (\n <DataCtxProvider value={slotChildData}>\n <PreviewModeContext.Provider value={isSectionPreview}>\n <div\n ref={slotDomRef as any}\n {...(isSectionPreview ? {} : dropZoneAttrs)}\n {...studioAttributes}\n style={{ display: \"contents\" }}\n >\n {/*\n * The filled children are PAGE-authored content the composer dropped\n * into this slot — not part of the section's authored body. Clear the\n * section-instance context for them so their own internal slots render\n * normally (e.g. an empty Repeater dropped here shows its \"Drop Here\"\n * placeholder instead of being suppressed by Slot.tsx's\n * in-section-consumption guard, which would make it disappear).\n */}\n <SectionInstanceSlotsCtx.Provider value={undefined}>\n {filled.map((child, idx) => {\n if (!child || typeof child !== \"object\") return null;\n NODE_TO_PARENT.set(child, sectionCtx.sectionNode);\n NODE_TO_PATH_NODE.set(child, [slotUid, idx]);\n const childPath: Path = [...parentNodePath, [slotUid, idx]];\n return (\n <CurrentNodeContext.Provider\n key={child.uid}\n value={{\n currentNodeUid: child.uid,\n currentNodePath: childPath,\n }}\n >\n <SelectedNodeProvider>\n <Element node={child} renderError={() => null as any} />\n </SelectedNodeProvider>\n </CurrentNodeContext.Provider>\n );\n })}\n </SectionInstanceSlotsCtx.Provider>\n </div>\n </PreviewModeContext.Provider>\n </DataCtxProvider>\n );\n}\n\nconst AddIcon: React.FC = () => {\n return (\n <svg\n width=\"22\"\n height=\"22\"\n viewBox=\"0 0 22 22\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"0.5\" y=\"0.5\" width=\"21\" height=\"21\" rx=\"4.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"0.5\" width=\"21\" height=\"21\" rx=\"4.5\" stroke=\"#475161\" />\n <path\n d=\"M11.2808 6.78125C11.2808 6.62592 11.1548 6.5 10.9995 6.5C10.8442 6.5 10.7183 6.62592 10.7183 6.78125V10.7184H6.78125C6.62592 10.7184 6.5 10.8443 6.5 10.9996C6.5 11.155 6.62592 11.2809 6.78125 11.2809H10.7183V15.218C10.7183 15.3733 10.8442 15.4993 10.9995 15.4993C11.1548 15.4993 11.2808 15.3733 11.2808 15.218V11.2809H15.218C15.3733 11.2809 15.4993 11.155 15.4993 10.9996C15.4993 10.8443 15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EACX,KAAK,EAAC,4BAA4B,EAAA,QAAA,EAAA,CAElCD,cAAM,CAAC,EAAC,KAAK,EAAC,CAAC,EAAC,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,KAAK,EAAC,IAAI,EAAC,OAAO,EAAA,CAAG,EACrEA,GAAA,CAAA,MAAA,EAAA,EAAM,CAAC,EAAC,KAAK,EAAC,CAAC,EAAC,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,KAAK,EAAC,MAAM,EAAC,SAAS,GAAG,EACzEA,GAAA,CAAA,MAAA,EAAA,EACE,CAAC,EAAC,qbAAqb,EACvb,IAAI,EAAC,SAAS,EAAA,CACd,CAAA,EAAA,CACE;AAEV,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"SectionSlot.js","sources":["../../../src/components/elements/SectionSlot.tsx"],"sourcesContent":["import {\n COMPOSABLE_DATA_ATTRIBUTES,\n ELEMENT_TO_NODE,\n NODE_TO_PARENT,\n NODE_TO_PATH_NODE,\n} from \"@contentstack/studio-client\";\nimport { Node, Path } from \"@contentstack/studio-internal\";\nimport {\n CurrentNodeContext,\n DataCtxProvider,\n SectionInstanceSlotsCtx,\n} from \"@contentstack/studio-react-components/contexts\";\nimport {\n useCurrentNode,\n useData,\n} from \"@contentstack/studio-react-components/hooks\";\nimport {\n POST_MESSAGE_EVENTS,\n composableStudioEventManager,\n} from \"@contentstack/studio-messenger\";\nimport { Button } from \"@contentstack/studio-core\";\nimport { css } from \"goober\";\nimport classNames from \"classnames\";\nimport { MouseEvent, useCallback, useContext, useMemo } from \"react\";\nimport { styleFactory } from \"../styles\";\nimport { StudioAttributes } from \"../../types\";\nimport { SelectedNodeProvider } from \"../../contexts/providers/selected-node.provider\";\nimport { PreviewModeContext } from \"../../contexts/providers/preview-mode.provider\";\nimport { SectionModeContext } from \"../../contexts/providers/section-mode.provider\";\nimport { useRenderer } from \"../../hooks/use-renderer.hook\";\nimport Element from \"../Element\";\n\ninterface SectionSlotEditorProps extends StudioAttributes {\n label?: string;\n _uid?: string;\n /** Authored Slot default section uid (COMS-1659). Rendered when the slot is\n * empty in preview mode; design mode keeps the dropzone. */\n defaultSection?: string;\n}\n\n/**\n * In-memory `section-composition` node for a slot's authored default. Rendered\n * through the normal element path so the default's spec resolves by\n * `compositionUID` and nested defaults recurse. Stable uid → no remount. Never\n * persisted into the placement.\n */\nfunction makeDefaultSectionNode(\n instanceUid: string | undefined,\n slotUid: string,\n defaultUid: string,\n): Node {\n // Key by the enclosing placement instance too (COMS-1659): the same section\n // placed twice shares one internal `slotUid`, so a slot-uid-only key would\n // collide across placements and make their empty-slot defaults share one\n // uid-keyed data context. The instance uid makes each placement's default\n // distinct.\n const prefix = instanceUid ? `${instanceUid}-` : \"\";\n return {\n type: \"section-composition\",\n uid: `${prefix}${slotUid}-default-${defaultUid}`,\n metadata: { compositionUID: defaultUid, mode: \"preview\" },\n attrs: {},\n props: {},\n slots: {},\n styles: {},\n } as Node;\n}\n\n/**\n * Editor variant of section-slot. Two modes:\n *\n * 1. **Authoring mode** (no SectionInstanceSlotsCtx in scope) — the section\n * composition is being authored. Render a labelled drop-zone-style\n * placeholder; not droppable into (section slots only accept drops when\n * the section is consumed in a page composition).\n *\n * 2. **Consumption mode** (SectionInstanceSlotsCtx present) — the section\n * is being rendered inside a page composition. Look up the page-side\n * slots map by this slot's stable uid (== this node's uid). If filled,\n * transclude the children via <Element> with their paths anchored to\n * the page-side section-composition node, and lift them out of preview\n * mode so they're individually selectable / hover-targetable / draggable\n * like any other page-tree node. If empty, render a labelled drop\n * target that itself acts as a builder node (attributes mapped to the\n * page-side section-composition parent), so hover highlights only the\n * slot zone — not the whole section.\n */\nexport function SectionSlot({\n studioAttributes,\n label,\n _uid,\n defaultSection,\n}: SectionSlotEditorProps) {\n // ALL hooks unconditionally at the top — React doesn't allow conditional\n // hook calls and the component returns early for authoring/empty modes.\n const sectionCtx = useContext(SectionInstanceSlotsCtx);\n // Registry resolves the authored Default section's human title for the\n // design-mode hint (COMS-1770). Sections register with `type = section.uid`\n // and `displayName = section.title`, so a uid lookup yields the title.\n const { componentRegistry } = useRenderer();\n // When the enclosing placed section is in preview mode, the slot renders like\n // production: an empty slot collapses to nothing and a filled slot drops its\n // drop-chrome / selection affordances.\n const isSectionPreview = useContext(SectionModeContext) === \"preview\";\n const { currentNodePath: parentNodePath = [] } = useCurrentNode();\n // Current section-local data (template scoped to section, in-section\n // repeater item if surrounding, etc.). Slot children inherit this as\n // their *default* context — the user's authored bindings on slot\n // children resolve against this by default.\n const sectionLocalData = useData();\n const slotDomRef = useCallback(\n (el: HTMLElement | null) => {\n if (el && sectionCtx?.sectionNode) {\n ELEMENT_TO_NODE.set(el, sectionCtx.sectionNode);\n }\n },\n [sectionCtx?.sectionNode],\n );\n // Slot child's data context namespace:\n //\n // dataSources.template = section-local scoped template; if the\n // slot sits inside an in-section\n // Repeater that's currently iterating,\n // this is the active iteration item.\n // Matches what the Data Picker writes\n // when authoring against fields from\n // the slot's surrounding section scope.\n // dataSources.repeater[uid] = in-section Repeater map (full\n // per-uid context). Inherited from\n // sectionLocal via {...sectionDS}.\n // dataSources.static_value = section's persisted static values.\n // dataSources.page = OUTERMOST page-level namespace\n // ({ template, contentstack,\n // contentstack_queries, ... }).\n // Always points to the real page even\n // across recursive slot nesting — see\n // `truePageNamespace` below.\n //\n // Until Phase 8 lands, picker emits `dataSources.<src>.X` paths only.\n // retrieve-data.ts retries unresolved `dataSources.<src>.X` lookups under\n // `dataSources.page.<src>.X` so page-level bindings authored on slot\n // children still resolve.\n const slotChildData = useMemo(() => {\n const sectionLocal: any = sectionLocalData || {};\n const pageOuter: any = sectionCtx?.pageOuterData || {};\n const pageDS = pageOuter?.dataSources || {};\n const sectionDS = sectionLocal?.dataSources || {};\n\n const repeaterMap = (sectionDS.repeater || {}) as Record<string, any>;\n const repeaterUids = Object.keys(repeaterMap);\n const activeRepeaterUid =\n repeaterUids.length > 0\n ? repeaterUids[repeaterUids.length - 1]\n : undefined;\n const activeItem = activeRepeaterUid\n ? repeaterMap[activeRepeaterUid]?.context\n : undefined;\n const sectionLocalTemplate = activeItem ?? sectionDS.template;\n\n // Slot child's default namespace = section-local context AS IS (template,\n // repeater, static_value, …). Page-level sources are nested under `page.*`\n // as the explicit escape. This matches what the Data Picker writes when\n // authoring a slot child (picker shows the slot child's surrounding\n // scope, so its `template.X` / `repeater[uid].context.X` paths resolve\n // natively without rewriting).\n //\n // For nested cases (Section B in Section A's slot), `page` must always\n // point to the OUTERMOST page context — not to Section A's slot-local\n // view. Otherwise each nesting level shadows `page` with the surrounding\n // section's local, and `dataSources.page.template.title` would resolve\n // to a modular_block item instead of the page entry. So: if the outer\n // dataSources already has its own `page` key (because the section we're\n // inside is itself in another slot), inherit THAT — it's the real page.\n const outerPage = (pageDS as any)?.page;\n const truePageNamespace = outerPage ?? pageDS;\n return {\n ...sectionLocal,\n dataSources: {\n ...sectionDS,\n template: sectionLocalTemplate,\n page: truePageNamespace,\n },\n };\n }, [sectionLocalData, sectionCtx?.pageOuterData]);\n\n // ALL hooks above are unconditional. From here, branch based on mode.\n const styles = styleFactory(css);\n const text = label && label.trim().length > 0 ? label : \"Drop Here\";\n const slotUid =\n _uid ||\n (studioAttributes as any)?.[COMPOSABLE_DATA_ATTRIBUTES.ID] ||\n \"section-slot\";\n\n // Design-mode hint (COMS-1770): resolve the Default section's title for the\n // message. `getComponent` throws for a uid outside the locally-known catalog,\n // so fall back to a nameless hint instead of crashing the slot.\n let defaultSectionTitle: string | undefined;\n if (defaultSection) {\n try {\n defaultSectionTitle =\n componentRegistry.getComponent(defaultSection)?.displayName;\n } catch {\n defaultSectionTitle = undefined;\n }\n }\n\n // COMS-1809: open the section-slot picker. The button lives here in the\n // iframe, but the picker is a parent-app overlay (reusing the Component tab\n // card + hover preview + section catalog — ADR 0010), so we only post the\n // slot identity plus the button's viewport rect. Studio offsets the rect by\n // the iframe's own position to anchor the popover. Plain function (used only\n // in the consumption design-empty branch below), not a hook.\n const handleSelectSection = (event: MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n event.stopPropagation();\n const r = event.currentTarget.getBoundingClientRect();\n composableStudioEventManager?.send(\n POST_MESSAGE_EVENTS.OPEN_SECTION_SLOT_PICKER,\n {\n sectionInstanceUid: sectionCtx?.sectionInstanceUid,\n slotUid,\n buttonRect: {\n top: r.top,\n left: r.left,\n right: r.right,\n bottom: r.bottom,\n width: r.width,\n height: r.height,\n },\n },\n );\n };\n\n // Authoring mode: section is the top-level composition being edited.\n if (!sectionCtx) {\n return (\n <div\n {...{\n [COMPOSABLE_DATA_ATTRIBUTES.SLOT]: true,\n [COMPOSABLE_DATA_ATTRIBUTES.SLOT_UID]: slotUid,\n }}\n {...studioAttributes}\n className={classNames(styles.slotStyle)}\n >\n <span className={styles.slotDropText}>\n <AddIcon /> {text}\n </span>\n </div>\n );\n }\n\n // Consumption mode.\n const filled = (sectionCtx.slotsMap[slotUid] || []) as Node[];\n const dropZoneAttrs = {\n [COMPOSABLE_DATA_ATTRIBUTES.BUILDER]: true,\n [COMPOSABLE_DATA_ATTRIBUTES.NODE]: true,\n [COMPOSABLE_DATA_ATTRIBUTES.ID]: sectionCtx.sectionInstanceUid,\n [COMPOSABLE_DATA_ATTRIBUTES.SLOT]: true,\n [COMPOSABLE_DATA_ATTRIBUTES.SLOT_UID]: slotUid,\n };\n\n if (filled.length === 0) {\n // Preview mode: an empty slot falls back to its authored default section\n // (COMS-1659), rendered like production — non-interactive, no drop chrome.\n // With no default it collapses to nothing. Design mode always shows the\n // dropzone below (default never shown while authoring the placement).\n if (isSectionPreview) {\n if (!defaultSection) return null;\n const synth = makeDefaultSectionNode(\n sectionCtx.sectionInstanceUid,\n slotUid,\n defaultSection,\n );\n NODE_TO_PARENT.set(synth, sectionCtx.sectionNode);\n NODE_TO_PATH_NODE.set(synth, [slotUid, 0]);\n return (\n <DataCtxProvider value={slotChildData}>\n <PreviewModeContext.Provider value={true}>\n <div style={{ display: \"contents\" }}>\n <SectionInstanceSlotsCtx.Provider value={undefined}>\n <CurrentNodeContext.Provider\n value={{\n currentNodeUid: synth.uid,\n currentNodePath: [...parentNodePath, [slotUid, 0]],\n }}\n >\n <Element node={synth} renderError={() => null as any} />\n </CurrentNodeContext.Provider>\n </SectionInstanceSlotsCtx.Provider>\n </div>\n </PreviewModeContext.Provider>\n </DataCtxProvider>\n );\n }\n return (\n <div\n ref={slotDomRef as any}\n {...dropZoneAttrs}\n {...studioAttributes}\n // Always column now (COMS-1809): the \"Select section\" button stacks\n // below the drop copy in every design-mode empty slot.\n className={classNames(styles.slotStyle, styles.slotColumnStyle)}\n >\n {/* One empty-state layout regardless of a configured default — only\n the parenthetical hint below is default-only. The drop copy keeps\n \"…to replace it\" solely when there IS a default to replace. */}\n <span className={styles.slotDropText}>\n <AddIcon />{\" \"}\n {defaultSection\n ? \"Drop a section here to replace it.\"\n : \"Drop a section here.\"}\n </span>\n {/* Design-mode hint (COMS-1770): tell the page composer that leaving\n this slot empty will render the author's Default section in preview\n and on the live page. Mirrors the repeater's condition-block hint\n (Slot.tsx). Only shown when a default is configured. */}\n {defaultSection ? (\n <p className={styles.slotDefaultHint}>\n {\"(When this slot is empty, the default section\"}\n {defaultSectionTitle ? (\n <>\n {\" (\"}\n <strong>{defaultSectionTitle}</strong>\n {\")\"}\n </>\n ) : null}\n {\n \" added by the section author is shown in Preview and on the live page.)\"\n }\n </p>\n ) : null}\n {/* COMS-1809: click-to-pick alternative to drag-and-drop. The \"OR\"\n reads DND vs picker, so it shows in every empty slot. */}\n <p className={styles.slotOrDivider}>OR</p>\n <p className={styles.slotAllowedLabel}>Add from the allowed Sections</p>\n <Button\n type=\"button\"\n data-studio-ui={true}\n className={styles.slotSelectButton}\n // Swallow mousedown so the slot's drag-select never starts from the\n // button; the click opens the picker instead.\n onMouseDown={(e) => e.stopPropagation()}\n onClick={handleSelectSection}\n >\n <SelectSectionIcon /> Select section\n </Button>\n </div>\n );\n }\n\n // Transclude filled children. Anchor each child's slate path under the\n // page-side section-composition node + this slot's uid. In design mode, exit\n // preview so Element's internalAttributes get applied — making each child\n // selectable, hover-highlightable, and draggable like a normal node. In\n // preview mode, keep them inside preview (non-interactive) and drop the\n // drop-zone attributes so the slot reads like production.\n return (\n <DataCtxProvider value={slotChildData}>\n <PreviewModeContext.Provider value={isSectionPreview}>\n <div\n ref={slotDomRef as any}\n {...(isSectionPreview ? {} : dropZoneAttrs)}\n {...studioAttributes}\n style={{ display: \"contents\" }}\n >\n {/*\n * The filled children are PAGE-authored content the composer dropped\n * into this slot — not part of the section's authored body. Clear the\n * section-instance context for them so their own internal slots render\n * normally (e.g. an empty Repeater dropped here shows its \"Drop Here\"\n * placeholder instead of being suppressed by Slot.tsx's\n * in-section-consumption guard, which would make it disappear).\n */}\n <SectionInstanceSlotsCtx.Provider value={undefined}>\n {filled.map((child, idx) => {\n if (!child || typeof child !== \"object\") return null;\n NODE_TO_PARENT.set(child, sectionCtx.sectionNode);\n NODE_TO_PATH_NODE.set(child, [slotUid, idx]);\n const childPath: Path = [...parentNodePath, [slotUid, idx]];\n return (\n <CurrentNodeContext.Provider\n key={child.uid}\n value={{\n currentNodeUid: child.uid,\n currentNodePath: childPath,\n }}\n >\n <SelectedNodeProvider>\n <Element node={child} renderError={() => null as any} />\n </SelectedNodeProvider>\n </CurrentNodeContext.Provider>\n );\n })}\n </SectionInstanceSlotsCtx.Provider>\n </div>\n </PreviewModeContext.Provider>\n </DataCtxProvider>\n );\n}\n\nconst AddIcon: React.FC = () => {\n return (\n <svg\n width=\"22\"\n height=\"22\"\n viewBox=\"0 0 22 22\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"0.5\" y=\"0.5\" width=\"21\" height=\"21\" rx=\"4.5\" fill=\"white\" />\n <rect x=\"0.5\" y=\"0.5\" width=\"21\" height=\"21\" rx=\"4.5\" stroke=\"#475161\" />\n <path\n d=\"M11.2808 6.78125C11.2808 6.62592 11.1548 6.5 10.9995 6.5C10.8442 6.5 10.7183 6.62592 10.7183 6.78125V10.7184H6.78125C6.62592 10.7184 6.5 10.8443 6.5 10.9996C6.5 11.155 6.62592 11.2809 6.78125 11.2809H10.7183V15.218C10.7183 15.3733 10.8442 15.4993 10.9995 15.4993C11.1548 15.4993 11.2808 15.3733 11.2808 15.218V11.2809H15.218C15.3733 11.2809 15.4993 11.155 15.4993 10.9996C15.4993 10.8443 15.3733 10.7184 15.218 10.7184H11.2808V6.78125Z\"\n fill=\"#475161\"\n />\n </svg>\n );\n};\n\n// Marquee-select glyph for the \"Select section\" button (COMS-1809) — the\n// design's asset verbatim, with fills switched to `currentColor` so it\n// inherits the button's white text.\nconst SelectSectionIcon: React.FC = () => {\n return (\n <svg\n width=\"18\"\n height=\"12\"\n viewBox=\"0 0 18 12\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n aria-hidden=\"true\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M1.09375 0.9375C1.00746 0.9375 0.9375 1.00746 0.9375 1.09375V2.34375C0.9375 2.60263 0.727633 2.8125 0.46875 2.8125C0.209867 2.8125 0 2.60263 0 2.34375V1.09375C0 0.489689 0.489688 0 1.09375 0H2.34375C2.60263 0 2.8125 0.209867 2.8125 0.46875C2.8125 0.727633 2.60263 0.9375 2.34375 0.9375H1.09375ZM4.375 0.46875C4.375 0.209867 4.58487 0 4.84375 0H7.34375C7.60263 0 7.8125 0.209867 7.8125 0.46875C7.8125 0.727633 7.60263 0.9375 7.34375 0.9375H4.84375C4.58487 0.9375 4.375 0.727633 4.375 0.46875ZM9.375 0.46875C9.375 0.209867 9.58487 0 9.84375 0H12.3438C12.6026 0 12.8125 0.209867 12.8125 0.46875C12.8125 0.727633 12.6026 0.9375 12.3438 0.9375H9.84375C9.58487 0.9375 9.375 0.727633 9.375 0.46875ZM14.375 0.46875C14.375 0.209867 14.5849 0 14.8438 0H16.0938C16.6978 0 17.1875 0.489688 17.1875 1.09375V2.5C17.1875 2.75888 16.9776 2.96875 16.7188 2.96875C16.4599 2.96875 16.25 2.75888 16.25 2.5V1.09375C16.25 1.00746 16.18 0.9375 16.0938 0.9375H14.8438C14.5849 0.9375 14.375 0.727633 14.375 0.46875ZM0.46875 4.375C0.727633 4.375 0.9375 4.58487 0.9375 4.84375V6.09375C0.9375 6.18004 1.00746 6.25 1.09375 6.25H2.03125C2.29013 6.25 2.5 6.45987 2.5 6.71875C2.5 6.97763 2.29013 7.1875 2.03125 7.1875H1.09375C0.489689 7.1875 0 6.69781 0 6.09375V4.84375C0 4.58487 0.209867 4.375 0.46875 4.375ZM16.7188 4.84375C16.9776 4.84375 17.1875 5.05362 17.1875 5.3125V6.71875C17.1875 6.97763 16.9776 7.1875 16.7188 7.1875C16.4599 7.1875 16.25 6.97763 16.25 6.71875V5.3125C16.25 5.05362 16.4599 4.84375 16.7188 4.84375ZM3.4375 6.71875C3.4375 6.45987 3.64737 6.25 3.90625 6.25H5.78125C6.04013 6.25 6.25 6.45987 6.25 6.71875C6.25 6.97763 6.04013 7.1875 5.78125 7.1875H3.90625C3.64737 7.1875 3.4375 6.97763 3.4375 6.71875ZM7.1875 6.71875C7.1875 6.45987 7.39737 6.25 7.65625 6.25H8.59375C8.85263 6.25 9.0625 6.45987 9.0625 6.71875C9.0625 6.97763 8.85263 7.1875 8.59375 7.1875H7.65625C7.39737 7.1875 7.1875 6.97763 7.1875 6.71875Z\"\n fill=\"currentColor\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9.79852 4.73594C9.72732 4.06274 10.4877 3.62376 11.0351 4.02202L16.3345 7.8776C16.9193 8.30303 16.6619 9.22617 15.9414 9.28775L13.3774 9.5069L11.9056 11.6178C11.492 12.211 10.5639 11.9723 10.4878 11.2532L9.79852 4.73594ZM10.7678 4.98694L11.3761 10.7381L12.6503 8.91063C12.783 8.7203 12.9934 8.5988 13.2246 8.57904L15.4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AQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,22DAA22D,EAC72D,IAAI,EAAC,cAAc,EAAA,CACnB,EACFA,GAAA,CAAA,MAAA,EAAA,EACE,QAAQ,EAAC,SAAS,EAClB,QAAQ,EAAC,SAAS,EAClB,CAAC,EAAC,6VAA6V,EAC/V,IAAI,EAAC,cAAc,EAAA,CACnB,CAAA,EAAA,CACE;AAEV,CAAC;;;;"}
|
|
@@ -50,6 +50,75 @@ const styleFactory = (css) => ({
|
|
|
50
50
|
textAlign: "center",
|
|
51
51
|
margin: 0,
|
|
52
52
|
}),
|
|
53
|
+
// Section-slot Default-section hint (COMS-1770). Typography pinned to the
|
|
54
|
+
// Figma spec (Text/Secondary_Text — Tarmac Grey N700). `!important` because
|
|
55
|
+
// this chrome renders inside the customer's page, whose CSS would otherwise
|
|
56
|
+
// override the weight/color (e.g. render it bold).
|
|
57
|
+
slotDefaultHint: css({
|
|
58
|
+
margin: 0,
|
|
59
|
+
textAlign: "center",
|
|
60
|
+
fontFamily: "Inter !important",
|
|
61
|
+
fontSize: "14px !important",
|
|
62
|
+
fontStyle: "normal !important",
|
|
63
|
+
fontWeight: "400 !important",
|
|
64
|
+
lineHeight: "24px !important",
|
|
65
|
+
letterSpacing: "0 !important",
|
|
66
|
+
color: "#475161 !important",
|
|
67
|
+
}),
|
|
68
|
+
// Section-slot "Select section" affordance (COMS-1809). Renders inside the
|
|
69
|
+
// customer's page, so — like slotDefaultHint — the visual props are pinned
|
|
70
|
+
// with `!important` to survive the host page's CSS. The button overrides the
|
|
71
|
+
// shared studio-core Button base (light-purple outline) to the filled-purple
|
|
72
|
+
// primary shown in the design.
|
|
73
|
+
slotSelectButton: css({
|
|
74
|
+
backgroundColor: "#6c5ce7 !important",
|
|
75
|
+
color: "#ffffff !important",
|
|
76
|
+
border: "1px solid #6c5ce7 !important",
|
|
77
|
+
fontWeight: "600 !important",
|
|
78
|
+
// Pin the icon/text alignment too — the studio-core base sets flex
|
|
79
|
+
// centering, but host-page CSS can override it, leaving the icon riding
|
|
80
|
+
// above the label. The svg is inline by default (baseline-aligned), so
|
|
81
|
+
// make it a block flex item.
|
|
82
|
+
display: "inline-flex !important",
|
|
83
|
+
alignItems: "center !important",
|
|
84
|
+
justifyContent: "center !important",
|
|
85
|
+
gap: "0.5rem !important",
|
|
86
|
+
// Typography pinned as well: a host font-size/line-height override makes
|
|
87
|
+
// the label's line box taller than the 12px icon and drags its visual
|
|
88
|
+
// center away from the icon's. line-height 1 makes the text flex item
|
|
89
|
+
// exactly glyph-high, so both centers coincide.
|
|
90
|
+
fontSize: "0.875rem !important",
|
|
91
|
+
lineHeight: "1 !important",
|
|
92
|
+
fontFamily: "'Inter', sans-serif !important",
|
|
93
|
+
"& svg": {
|
|
94
|
+
display: "block",
|
|
95
|
+
flexShrink: 0,
|
|
96
|
+
// Optical centering: the flex boxes align exactly (verified — svg/text
|
|
97
|
+
// center deltas are 0), but the asset's dashed marquee occupies only the
|
|
98
|
+
// top 7.2px of its 18x12 box with the pointer overhanging below-right,
|
|
99
|
+
// so a box-centered icon READS ~2px high. Nudge down so the marquee —
|
|
100
|
+
// the dominant shape — centers on the label, pointer descending like a
|
|
101
|
+
// glyph descender (matches the design).
|
|
102
|
+
transform: "translateY(2px)",
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
slotOrDivider: css({
|
|
106
|
+
margin: 0,
|
|
107
|
+
textAlign: "center",
|
|
108
|
+
fontFamily: "Inter !important",
|
|
109
|
+
fontSize: "12px !important",
|
|
110
|
+
fontWeight: "400 !important",
|
|
111
|
+
color: "#647696 !important",
|
|
112
|
+
textTransform: "uppercase",
|
|
113
|
+
}),
|
|
114
|
+
slotAllowedLabel: css({
|
|
115
|
+
margin: 0,
|
|
116
|
+
textAlign: "center",
|
|
117
|
+
fontFamily: "Inter !important",
|
|
118
|
+
fontSize: "12px !important",
|
|
119
|
+
fontWeight: "600 !important",
|
|
120
|
+
color: "#647696 !important",
|
|
121
|
+
}),
|
|
53
122
|
embeddedSectionHost: css({
|
|
54
123
|
position: "relative",
|
|
55
124
|
".cs-embedded-section-edit-btn": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../src/components/styles.ts"],"sourcesContent":["import { css as gooberCss } from \"goober\";\n\nexport const styleFactory = (css: typeof gooberCss) => ({\n embedStyle: css({\n height: \"100%\",\n width: \"100%\",\n display: \"grid\",\n placeItems: \"center\",\n padding: \"1rem\",\n border: \"1px solid #dde3ee\",\n }),\n embedIconStyle: css({\n opacity: 0.5,\n }),\n pageStyle: css({\n height: \"100%\",\n }),\n slotStyle: css({\n boxSizing: \"border-box\",\n // width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n gap: \"4px\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: \"1px dashed #6c5ce7\",\n color: \"#475161\",\n fontSize: \"14px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"24px\",\n userSelect: \"none\",\n fontFamily: \"Inter\",\n paddingInline: \"2rem\",\n paddingBlock: \"1rem\",\n transition: \"background-color 0.3s ease\",\n }),\n slotContentStyle: css({\n marginBottom: 0,\n marginTop: 0,\n }),\n slotColumnStyle: css({\n flexDirection: \"column\",\n gap: \"4px\",\n }),\n slotDropText: css({\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"4px\",\n }),\n slotHintStyle: css({\n textAlign: \"center\",\n margin: 0,\n }),\n embeddedSectionHost: css({\n position: \"relative\",\n \".cs-embedded-section-edit-btn\": {\n display: \"none\",\n },\n \"&:hover\": {\n \".cs-embedded-section-edit-btn\": {\n display: \"flex\",\n },\n },\n }),\n embeddedSectionButton: css({\n position: \"absolute\",\n top: \"0.75rem\",\n right: \"0.75rem\",\n zIndex: 2,\n }),\n rendererErrorComponent: css({\n boxSizing: \"border-box\",\n backgroundColor: \"#fff0ed\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"#fdafa3\",\n boxShadow: `0px 2px 4px rgba(0, 0, 0, 0.14),\n 0px 5px 5px rgba(0, 0, 0, 0.12),\n 0px 1px 10px rgba(108, 92, 231, 0.2)`,\n borderRadius: \"4px\",\n padding: \"1rem\",\n color: \"#475161\",\n fontFamily: \"Inter, sans-serif\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"1rem\",\n \".header\": {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n },\n h3: {\n fontSize: \"14px\",\n fontWeight: 600,\n margin: 0,\n },\n p: {\n fontSize: \"1rem\",\n fontWeight: 400,\n lineHeight: \"24px\",\n letterSpacing: \"1%\",\n margin: 0,\n },\n }),\n welcomeContainer: css({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"40px 20px\",\n textAlign: \"center\",\n minHeight: \"400px\",\n }),\n welcomeTitle: css({\n fontSize: \"20px\",\n fontWeight: \"600\",\n color: \"#475161\",\n margin: \"20px 0 10px 0\",\n fontFamily: \"Inter, sans-serif\",\n }),\n welcomeSubtitle: css({\n fontSize: \"14px\",\n color: \"#6E6B86\",\n margin: \"0 0 30px 0\",\n maxWidth: \"400px\",\n fontFamily: \"Inter, sans-serif\",\n lineHeight: \"1.5\",\n }),\n welcomeSteps: css({\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"16px\",\n maxWidth: \"1000px\",\n width: \"100%\",\n }),\n welcomeStep: css({\n padding: \"16px\",\n border: \"1px solid #DDE3EE\",\n borderRadius: \"8px\",\n textAlign: \"left\",\n \"& h3\": {\n fontSize: \"16px\",\n fontWeight: \"600\",\n color: \"#475161\",\n margin: \"0 0 8px 0\",\n fontFamily: \"Inter, sans-serif\",\n },\n \"& p\": {\n fontSize: \"14px\",\n color: \"#6E6B86\",\n margin: 0,\n fontFamily: \"Inter, sans-serif\",\n lineHeight: \"1.4\",\n },\n }),\n activeWelcomeStep: css({\n backgroundColor: \"#F9F8FF\",\n border: \"1px solid #6C5CE7\",\n }),\n});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K;AACnB,QAAA,SAAS,EAAE,MAAM;AACjB,QAAA,MAAM,EAAE;AACN,YAAA,QAAQ,EAAE,MAAM;AAChB,YAAA,UAAU,EAAE,KAAK;AACjB,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,MAAM,EAAE,WAAW;AACnB,YAAA,UAAU,EAAE,mBAAmB;AAChC,SAAA;AACD,QAAA,KAAK,EAAE;AACL,YAAA,QAAQ,EAAE,MAAM;AAChB,YAAA,KAAK,EAAE,SAAS;AAChB,YAAA,MAAM,EAAE,CAAC;AACT,YAAA,UAAU,EAAE,mBAAmB;AAC/B,YAAA,UAAU,EAAE,KAAK;AAClB,SAAA;KACF,CAAC;IACF,iBAAiB,EAAE,GAAG,CAAC;AACrB,QAAA,eAAe,EAAE,SAAS;AAC1B,QAAA,MAAM,EAAE,mBAAmB;KAC5B,CAAC;AACH,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../src/components/styles.ts"],"sourcesContent":["import { css as gooberCss } from \"goober\";\n\nexport const styleFactory = (css: typeof gooberCss) => ({\n embedStyle: css({\n height: \"100%\",\n width: \"100%\",\n display: \"grid\",\n placeItems: \"center\",\n padding: \"1rem\",\n border: \"1px solid #dde3ee\",\n }),\n embedIconStyle: css({\n opacity: 0.5,\n }),\n pageStyle: css({\n height: \"100%\",\n }),\n slotStyle: css({\n boxSizing: \"border-box\",\n // width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n gap: \"4px\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: \"1px dashed #6c5ce7\",\n color: \"#475161\",\n fontSize: \"14px\",\n fontStyle: \"normal\",\n fontWeight: 400,\n lineHeight: \"24px\",\n userSelect: \"none\",\n fontFamily: \"Inter\",\n paddingInline: \"2rem\",\n paddingBlock: \"1rem\",\n transition: \"background-color 0.3s ease\",\n }),\n slotContentStyle: css({\n marginBottom: 0,\n marginTop: 0,\n }),\n slotColumnStyle: css({\n flexDirection: \"column\",\n gap: \"4px\",\n }),\n slotDropText: css({\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: \"4px\",\n }),\n slotHintStyle: css({\n textAlign: \"center\",\n margin: 0,\n }),\n // Section-slot Default-section hint (COMS-1770). Typography pinned to the\n // Figma spec (Text/Secondary_Text — Tarmac Grey N700). `!important` because\n // this chrome renders inside the customer's page, whose CSS would otherwise\n // override the weight/color (e.g. render it bold).\n slotDefaultHint: css({\n margin: 0,\n textAlign: \"center\",\n fontFamily: \"Inter !important\",\n fontSize: \"14px !important\",\n fontStyle: \"normal !important\",\n fontWeight: \"400 !important\",\n lineHeight: \"24px !important\",\n letterSpacing: \"0 !important\",\n color: \"#475161 !important\",\n }),\n // Section-slot \"Select section\" affordance (COMS-1809). Renders inside the\n // customer's page, so — like slotDefaultHint — the visual props are pinned\n // with `!important` to survive the host page's CSS. The button overrides the\n // shared studio-core Button base (light-purple outline) to the filled-purple\n // primary shown in the design.\n slotSelectButton: css({\n backgroundColor: \"#6c5ce7 !important\",\n color: \"#ffffff !important\",\n border: \"1px solid #6c5ce7 !important\",\n fontWeight: \"600 !important\",\n // Pin the icon/text alignment too — the studio-core base sets flex\n // centering, but host-page CSS can override it, leaving the icon riding\n // above the label. The svg is inline by default (baseline-aligned), so\n // make it a block flex item.\n display: \"inline-flex !important\",\n alignItems: \"center !important\",\n justifyContent: \"center !important\",\n gap: \"0.5rem !important\",\n // Typography pinned as well: a host font-size/line-height override makes\n // the label's line box taller than the 12px icon and drags its visual\n // center away from the icon's. line-height 1 makes the text flex item\n // exactly glyph-high, so both centers coincide.\n fontSize: \"0.875rem !important\",\n lineHeight: \"1 !important\",\n fontFamily: \"'Inter', sans-serif !important\",\n \"& svg\": {\n display: \"block\",\n flexShrink: 0,\n // Optical centering: the flex boxes align exactly (verified — svg/text\n // center deltas are 0), but the asset's dashed marquee occupies only the\n // top 7.2px of its 18x12 box with the pointer overhanging below-right,\n // so a box-centered icon READS ~2px high. Nudge down so the marquee —\n // the dominant shape — centers on the label, pointer descending like a\n // glyph descender (matches the design).\n transform: \"translateY(2px)\",\n },\n }),\n slotOrDivider: css({\n margin: 0,\n textAlign: \"center\",\n fontFamily: \"Inter !important\",\n fontSize: \"12px !important\",\n fontWeight: \"400 !important\",\n color: \"#647696 !important\",\n textTransform: \"uppercase\",\n }),\n slotAllowedLabel: css({\n margin: 0,\n textAlign: \"center\",\n fontFamily: \"Inter !important\",\n fontSize: \"12px !important\",\n fontWeight: \"600 !important\",\n color: \"#647696 !important\",\n }),\n embeddedSectionHost: css({\n position: \"relative\",\n \".cs-embedded-section-edit-btn\": {\n display: \"none\",\n },\n \"&:hover\": {\n \".cs-embedded-section-edit-btn\": {\n display: \"flex\",\n },\n },\n }),\n embeddedSectionButton: css({\n position: \"absolute\",\n top: \"0.75rem\",\n right: \"0.75rem\",\n zIndex: 2,\n }),\n rendererErrorComponent: css({\n boxSizing: \"border-box\",\n backgroundColor: \"#fff0ed\",\n borderWidth: \"1px\",\n borderStyle: \"solid\",\n borderColor: \"#fdafa3\",\n boxShadow: `0px 2px 4px rgba(0, 0, 0, 0.14),\n 0px 5px 5px rgba(0, 0, 0, 0.12),\n 0px 1px 10px rgba(108, 92, 231, 0.2)`,\n borderRadius: \"4px\",\n padding: \"1rem\",\n color: \"#475161\",\n fontFamily: \"Inter, sans-serif\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"1rem\",\n \".header\": {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n },\n h3: {\n fontSize: \"14px\",\n fontWeight: 600,\n margin: 0,\n },\n p: {\n fontSize: \"1rem\",\n fontWeight: 400,\n lineHeight: \"24px\",\n letterSpacing: \"1%\",\n margin: 0,\n },\n }),\n welcomeContainer: css({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"40px 20px\",\n textAlign: \"center\",\n minHeight: \"400px\",\n }),\n welcomeTitle: css({\n fontSize: \"20px\",\n fontWeight: \"600\",\n color: \"#475161\",\n margin: \"20px 0 10px 0\",\n fontFamily: \"Inter, sans-serif\",\n }),\n welcomeSubtitle: css({\n fontSize: \"14px\",\n color: \"#6E6B86\",\n margin: \"0 0 30px 0\",\n maxWidth: \"400px\",\n fontFamily: \"Inter, sans-serif\",\n lineHeight: \"1.5\",\n }),\n welcomeSteps: css({\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"16px\",\n maxWidth: \"1000px\",\n width: \"100%\",\n }),\n welcomeStep: css({\n padding: \"16px\",\n border: \"1px solid #DDE3EE\",\n borderRadius: \"8px\",\n textAlign: \"left\",\n \"& h3\": {\n fontSize: \"16px\",\n fontWeight: \"600\",\n color: \"#475161\",\n margin: \"0 0 8px 0\",\n fontFamily: \"Inter, sans-serif\",\n },\n \"& p\": {\n fontSize: \"14px\",\n color: \"#6E6B86\",\n margin: 0,\n fontFamily: \"Inter, sans-serif\",\n lineHeight: \"1.4\",\n },\n }),\n activeWelcomeStep: css({\n backgroundColor: \"#F9F8FF\",\n border: \"1px solid #6C5CE7\",\n }),\n});\n"],"names":[],"mappings":"MAEa,YAAY,GAAG,CAAC,GAAqB,MAAM;IACtD,UAAU,EAAE,GAAG,CAAC;AACd,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,KAAK,EAAE,MAAM;AACb,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,MAAM,EAAE,mBAAmB;KAC5B,CAAC;IACF,cAAc,EAAE,GAAG,CAAC;AAClB,QAAA,OAAO,EAAE,GAAG;KACb,CAAC;IACF,SAAS,EAAE,GAAG,CAAC;AACb,QAAA,MAAM,EAAE,MAAM;KACf,CAAC;IACF,SAAS,EAAE,GAAG,CAAC;AACb,QAAA,SAAS,EAAE,YAAY;;AAEvB,QAAA,MAAM,EAAE,MAAM;AACd,QAAA,OAAO,EAAE,MAAM;AACf,QAAA,GAAG,EAAE,KAAK;AACV,QAAA,UAAU,EAAE,QAAQ;AACpB,QAAA,cAAc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EAAE,GAAG,CAAC;AACrB,QAAA,eAAe,EAAE,SAAS;AAC1B,QAAA,MAAM,EAAE,mBAAmB;KAC5B,CAAC;AACH,CAAA;;;;"}
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
import { highlightNodeManager } from '@contentstack/studio-client';
|
|
2
2
|
import { useContext, useState, useEffect } from 'react';
|
|
3
|
-
import '../contexts/providers/renderer.provider.js';
|
|
4
|
-
import '../contexts/providers/edit-context.provider.js';
|
|
5
3
|
import { ActiveComponentPathContext } from '../contexts/providers/active-node.provider.js';
|
|
6
|
-
import 'react/jsx-runtime';
|
|
7
|
-
import '@contentstack/studio-messenger';
|
|
8
|
-
import '@contentstack/studio-react-components/contexts';
|
|
9
|
-
import 'immer';
|
|
10
|
-
import './use-edit-context-listener.hook.js';
|
|
11
|
-
import '@contentstack/studio-internal';
|
|
12
|
-
import '@contentstack/studio-core';
|
|
13
|
-
import '@contentstack/studio-react-components/basic-components';
|
|
14
|
-
import '@contentstack/studio-react-components/hooks';
|
|
15
|
-
import 'goober';
|
|
16
|
-
import '../components/Element.js';
|
|
17
|
-
import '../contexts/providers/section-mode.provider.js';
|
|
18
|
-
import '@contentstack/studio-registry';
|
|
19
|
-
import '../contexts/providers/use-design-preview.provider.js';
|
|
20
|
-
import '../contexts/providers/use-repeater.provider.js';
|
|
21
|
-
import '../contexts/providers/use-condition-block.provider.js';
|
|
22
|
-
import '../contexts/providers/preview-mode.provider.js';
|
|
23
4
|
|
|
24
5
|
function useActiveComponentPath() {
|
|
25
6
|
const activeComponentPath = useContext(ActiveComponentPathContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-active-node-path.hook.js","sources":["../../src/hooks/use-active-node-path.hook.ts"],"sourcesContent":["import { StudioSpec, highlightNodeManager } from \"@contentstack/studio-client\";\nimport { Path } from \"@contentstack/studio-internal\";\nimport { useContext, useEffect, useState } from \"react\";\nimport {\n ActiveComponentPathContext,\n ActiveComponentPathContextType,\n} from \"../contexts/providers\";\n\nexport function useActiveComponentPath() {\n const activeComponentPath = useContext(ActiveComponentPathContext);\n return activeComponentPath;\n}\n\nexport function useGetActiveComponentPathContext(\n spec: StudioSpec,\n): ActiveComponentPathContextType {\n const [activeComponentPath, setActiveComponentPath] =\n useState<ActiveComponentPathContextType>({\n activeNodeUid: null,\n activeNodePath: null,\n });\n\n useEffect(() => {\n function getActiveNodeCallback(\n activeNodeUid: string,\n activeNodePath: Path,\n ) {\n if (!spec) return;\n\n setActiveComponentPath({\n activeNodeUid,\n activeNodePath,\n });\n }\n\n highlightNodeManager.onActiveNodeChange(getActiveNodeCallback, {\n syncToExistingValue: true,\n });\n\n return () => {\n highlightNodeManager.unsubscribeFromActiveNodeChange(\n getActiveNodeCallback,\n );\n };\n }, [spec]);\n\n return activeComponentPath;\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-active-node-path.hook.js","sources":["../../src/hooks/use-active-node-path.hook.ts"],"sourcesContent":["import { StudioSpec, highlightNodeManager } from \"@contentstack/studio-client\";\nimport { Path } from \"@contentstack/studio-internal\";\nimport { useContext, useEffect, useState } from \"react\";\nimport {\n ActiveComponentPathContext,\n ActiveComponentPathContextType,\n} from \"../contexts/providers/active-node.provider\";\n\nexport function useActiveComponentPath() {\n const activeComponentPath = useContext(ActiveComponentPathContext);\n return activeComponentPath;\n}\n\nexport function useGetActiveComponentPathContext(\n spec: StudioSpec,\n): ActiveComponentPathContextType {\n const [activeComponentPath, setActiveComponentPath] =\n useState<ActiveComponentPathContextType>({\n activeNodeUid: null,\n activeNodePath: null,\n });\n\n useEffect(() => {\n function getActiveNodeCallback(\n activeNodeUid: string,\n activeNodePath: Path,\n ) {\n if (!spec) return;\n\n setActiveComponentPath({\n activeNodeUid,\n activeNodePath,\n });\n }\n\n highlightNodeManager.onActiveNodeChange(getActiveNodeCallback, {\n syncToExistingValue: true,\n });\n\n return () => {\n highlightNodeManager.unsubscribeFromActiveNodeChange(\n getActiveNodeCallback,\n );\n };\n }, [spec]);\n\n return activeComponentPath;\n}\n"],"names":[],"mappings":";;;;SAQgB,sBAAsB,GAAA;AACpC,IAAA,MAAM,mBAAmB,GAAG,UAAU,CAAC,0BAA0B,CAAC;AAClE,IAAA,OAAO,mBAAmB;AAC5B;AAEM,SAAU,gCAAgC,CAC9C,IAAgB,EAAA;AAEhB,IAAA,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GACjD,QAAQ,CAAiC;AACvC,QAAA,aAAa,EAAE,IAAI;AACnB,QAAA,cAAc,EAAE,IAAI;AACrB,KAAA,CAAC;IAEJ,SAAS,CAAC,MAAK;AACb,QAAA,SAAS,qBAAqB,CAC5B,aAAqB,EACrB,cAAoB,EAAA;AAEpB,YAAA,IAAI,CAAC,IAAI;gBAAE;AAEX,YAAA,sBAAsB,CAAC;gBACrB,aAAa;gBACb,cAAc;AACf,aAAA,CAAC;QACJ;AAEA,QAAA,oBAAoB,CAAC,kBAAkB,CAAC,qBAAqB,EAAE;AAC7D,YAAA,mBAAmB,EAAE,IAAI;AAC1B,SAAA,CAAC;AAEF,QAAA,OAAO,MAAK;AACV,YAAA,oBAAoB,CAAC,+BAA+B,CAClD,qBAAqB,CACtB;AACH,QAAA,CAAC;AACH,IAAA,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAEV,IAAA,OAAO,mBAAmB;AAC5B;;;;"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import '../contexts/providers/renderer.provider.js';
|
|
3
|
-
import '../contexts/providers/edit-context.provider.js';
|
|
4
|
-
import '../contexts/providers/active-node.provider.js';
|
|
5
|
-
import 'react/jsx-runtime';
|
|
6
|
-
import '@contentstack/studio-client';
|
|
7
|
-
import '@contentstack/studio-messenger';
|
|
8
|
-
import '@contentstack/studio-react-components/contexts';
|
|
9
|
-
import 'immer';
|
|
10
|
-
import './use-edit-context-listener.hook.js';
|
|
11
|
-
import '@contentstack/studio-internal';
|
|
12
|
-
import '@contentstack/studio-core';
|
|
13
|
-
import '@contentstack/studio-react-components/basic-components';
|
|
14
|
-
import '@contentstack/studio-react-components/hooks';
|
|
15
|
-
import 'goober';
|
|
16
|
-
import '../components/Element.js';
|
|
17
|
-
import '../contexts/providers/section-mode.provider.js';
|
|
18
|
-
import '@contentstack/studio-registry';
|
|
19
|
-
import '../contexts/providers/use-design-preview.provider.js';
|
|
20
|
-
import '../contexts/providers/use-repeater.provider.js';
|
|
21
2
|
import { ConditionBlockContext } from '../contexts/providers/use-condition-block.provider.js';
|
|
22
|
-
import '../contexts/providers/preview-mode.provider.js';
|
|
23
3
|
|
|
24
4
|
const useConditionBlockContext = () => useContext(ConditionBlockContext);
|
|
25
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-condition-block-context.js","sources":["../../src/hooks/use-condition-block-context.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { ConditionBlockContext } from \"../contexts/providers\";\n\nexport const useConditionBlockContext = () => useContext(ConditionBlockContext);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-condition-block-context.js","sources":["../../src/hooks/use-condition-block-context.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { ConditionBlockContext } from \"../contexts/providers/use-condition-block.provider\";\n\nexport const useConditionBlockContext = () => useContext(ConditionBlockContext);\n"],"names":[],"mappings":";;;AAGO,MAAM,wBAAwB,GAAG,MAAM,UAAU,CAAC,qBAAqB;;;;"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import '../contexts/providers/renderer.provider.js';
|
|
3
|
-
import '../contexts/providers/edit-context.provider.js';
|
|
4
|
-
import '../contexts/providers/active-node.provider.js';
|
|
5
|
-
import 'react/jsx-runtime';
|
|
6
|
-
import '@contentstack/studio-client';
|
|
7
|
-
import '@contentstack/studio-messenger';
|
|
8
|
-
import '@contentstack/studio-react-components/contexts';
|
|
9
|
-
import 'immer';
|
|
10
|
-
import './use-edit-context-listener.hook.js';
|
|
11
|
-
import '@contentstack/studio-internal';
|
|
12
|
-
import '@contentstack/studio-core';
|
|
13
|
-
import '@contentstack/studio-react-components/basic-components';
|
|
14
|
-
import '@contentstack/studio-react-components/hooks';
|
|
15
|
-
import 'goober';
|
|
16
|
-
import '../components/Element.js';
|
|
17
|
-
import '../contexts/providers/section-mode.provider.js';
|
|
18
|
-
import '@contentstack/studio-registry';
|
|
19
2
|
import { DesignPreviewContext } from '../contexts/providers/use-design-preview.provider.js';
|
|
20
|
-
import '../contexts/providers/use-repeater.provider.js';
|
|
21
|
-
import '../contexts/providers/use-condition-block.provider.js';
|
|
22
|
-
import '../contexts/providers/preview-mode.provider.js';
|
|
23
3
|
|
|
24
4
|
const useDesignPreviewContext = () => useContext(DesignPreviewContext);
|
|
25
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-design-preview.hook.js","sources":["../../src/hooks/use-design-preview.hook.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { DesignPreviewContext } from \"../contexts/providers\";\n\nexport const useDesignPreviewContext = () => useContext(DesignPreviewContext);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-design-preview.hook.js","sources":["../../src/hooks/use-design-preview.hook.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { DesignPreviewContext } from \"../contexts/providers/use-design-preview.provider\";\n\nexport const useDesignPreviewContext = () => useContext(DesignPreviewContext);\n"],"names":[],"mappings":";;;AAGO,MAAM,uBAAuB,GAAG,MAAM,UAAU,CAAC,oBAAoB;;;;"}
|
|
@@ -1,24 +1,4 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import '../contexts/providers/renderer.provider.js';
|
|
3
|
-
import '../contexts/providers/edit-context.provider.js';
|
|
4
|
-
import '../contexts/providers/active-node.provider.js';
|
|
5
|
-
import 'react/jsx-runtime';
|
|
6
|
-
import '@contentstack/studio-client';
|
|
7
|
-
import '@contentstack/studio-messenger';
|
|
8
|
-
import '@contentstack/studio-react-components/contexts';
|
|
9
|
-
import 'immer';
|
|
10
|
-
import './use-edit-context-listener.hook.js';
|
|
11
|
-
import '@contentstack/studio-internal';
|
|
12
|
-
import '@contentstack/studio-core';
|
|
13
|
-
import '@contentstack/studio-react-components/basic-components';
|
|
14
|
-
import '@contentstack/studio-react-components/hooks';
|
|
15
|
-
import 'goober';
|
|
16
|
-
import '../components/Element.js';
|
|
17
|
-
import '../contexts/providers/section-mode.provider.js';
|
|
18
|
-
import '@contentstack/studio-registry';
|
|
19
|
-
import '../contexts/providers/use-design-preview.provider.js';
|
|
20
|
-
import '../contexts/providers/use-repeater.provider.js';
|
|
21
|
-
import '../contexts/providers/use-condition-block.provider.js';
|
|
22
2
|
import { PreviewModeContext } from '../contexts/providers/preview-mode.provider.js';
|
|
23
3
|
|
|
24
4
|
const usePreviewMode = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-preview-mode.hook.js","sources":["../../src/hooks/use-preview-mode.hook.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { PreviewModeContext } from \"../contexts/providers\";\n\nexport const usePreviewMode = () => {\n return useContext(PreviewModeContext);\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-preview-mode.hook.js","sources":["../../src/hooks/use-preview-mode.hook.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { PreviewModeContext } from \"../contexts/providers/preview-mode.provider\";\n\nexport const usePreviewMode = () => {\n return useContext(PreviewModeContext);\n};\n"],"names":[],"mappings":";;;AAGO,MAAM,cAAc,GAAG,MAAK;AACjC,IAAA,OAAO,UAAU,CAAC,kBAAkB,CAAC;AACvC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-register-section.hook.js","sources":["../../src/hooks/use-register-section.hook.tsx"],"sourcesContent":["import {\n SectionCompositionEntry,\n StudioSpec,\n preProcessStaticValues,\n} from \"@contentstack/studio-client\";\nimport {\n ComponentRegistry,\n Props,\n RegisterComponentOptionsInput,\n} from \"@contentstack/studio-registry\";\nimport { Node, NodePropType } from \"@contentstack/studio-internal\";\nimport { ReactNode, useMemo } from \"react\";\nimport { SectionComposition } from \"../components/elements/SectionComposition\";\nimport { useRenderer } from \"./use-renderer.hook\";\n\ninterface ExposedPropDef {\n uid: string;\n nodeUid: string;\n propKey: string;\n propType: string;\n displayName: string;\n}\n\ntype SectionRegistryConfig = RegisterComponentOptionsInput<\n (props?: any) => ReactNode\n>;\n\n/**\n * Reads sectionExposedProps from the section's UI metadata and converts them\n * into the Props format that the component registry understands.\n *\n * This is what makes retrievePropValue resolve exposed-prop bindings on the\n * page-level section-composition node — without these registered props the\n * resolver skips them entirely and the override values never reach the section.\n *\n * Each exposed prop is enriched with the FULL schema of the internal component\n * prop it was exposed from (looked up via the internal node's registered\n * component). Registering only { type, displayName } loses `placeholder` and\n * `defaultValue`, so a CLEARED exposed prop resolves to an empty value instead\n * of the component's editor placeholder (e.g. \"Your text here\"). With the full\n * schema, a cleared exposed prop resolves exactly like a normal unbound node —\n * showing the placeholder in Studio — and the override carries it down to the\n * internal node. The editor panel registration enriches the same way.\n */\nfunction buildRegisteredProps(\n section: SectionCompositionEntry,\n componentRegistry: ComponentRegistry<unknown>,\n): Props {\n const exposedPropDefs: ExposedPropDef[] =\n (section.ui?.metadata?.sectionExposedProps as\n | ExposedPropDef[]\n | undefined) ?? [];\n\n // Index the section's internal nodes by uid so each exposed prop can recover\n // its originating component prop schema.\n const nodeByUid = new Map<string, Node>();\n if (section.ui) {\n for (const [node] of Node.nodes(section.ui as Node)) {\n if (node?.uid) nodeByUid.set(node.uid, node as Node);\n }\n }\n\n const props = Object.fromEntries(\n exposedPropDefs.map((ep) => {\n const internalNode = nodeByUid.get(ep.nodeUid);\n const fullProp = internalNode\n ? componentRegistry.getComponentByNode(internalNode)?.props?.[\n ep.propKey\n ]\n : undefined;\n return [\n ep.uid,\n {\n ...(fullProp ?? {}),\n type: ep.propType as NodePropType,\n displayName: ep.displayName,\n } as Props[string],\n ];\n }),\n );\n\n return props;\n}\n\n/**\n * Registers section composition entries as React components in the component registry.\n * Each section is registered with its exposed props so the page-level binding\n * resolver can resolve override values and pass them down to SectionComposition.\n */\nexport const registerSectionComponents = (\n sections: SectionCompositionEntry[],\n componentRegistry: ComponentRegistry<unknown>,\n) => {\n const sectionConfigs: SectionRegistryConfig[] = sections.map((section) => {\n // Section entries store `static_value` in raw shape (`{ text: [...] }`).\n // The data binder expects the pre-processed flat shape (`{ key: value }`),\n // so transform here before handing the section's spec to the renderer.\n // Without this, every string prop on the section (e.g. SectionSlot's\n // `label`) resolves to empty in consumption mode.\n const rawStaticValue = ((section as any)?.static_value ?? {}) as any;\n const sectionSpec: StudioSpec = {\n ui: section.ui,\n data: {\n dataSources: {},\n static_value: preProcessStaticValues(rawStaticValue),\n },\n compositionEntry: section,\n
|
|
1
|
+
{"version":3,"file":"use-register-section.hook.js","sources":["../../src/hooks/use-register-section.hook.tsx"],"sourcesContent":["import {\n SectionCompositionEntry,\n StudioSpec,\n preProcessStaticValues,\n} from \"@contentstack/studio-client\";\nimport {\n ComponentRegistry,\n Props,\n RegisterComponentOptionsInput,\n} from \"@contentstack/studio-registry\";\nimport { Node, NodePropType } from \"@contentstack/studio-internal\";\nimport { ReactNode, useMemo } from \"react\";\nimport { SectionComposition } from \"../components/elements/SectionComposition\";\nimport { useRenderer } from \"./use-renderer.hook\";\n\ninterface ExposedPropDef {\n uid: string;\n nodeUid: string;\n propKey: string;\n propType: string;\n displayName: string;\n}\n\ntype SectionRegistryConfig = RegisterComponentOptionsInput<\n (props?: any) => ReactNode\n>;\n\n/**\n * Reads sectionExposedProps from the section's UI metadata and converts them\n * into the Props format that the component registry understands.\n *\n * This is what makes retrievePropValue resolve exposed-prop bindings on the\n * page-level section-composition node — without these registered props the\n * resolver skips them entirely and the override values never reach the section.\n *\n * Each exposed prop is enriched with the FULL schema of the internal component\n * prop it was exposed from (looked up via the internal node's registered\n * component). Registering only { type, displayName } loses `placeholder` and\n * `defaultValue`, so a CLEARED exposed prop resolves to an empty value instead\n * of the component's editor placeholder (e.g. \"Your text here\"). With the full\n * schema, a cleared exposed prop resolves exactly like a normal unbound node —\n * showing the placeholder in Studio — and the override carries it down to the\n * internal node. The editor panel registration enriches the same way.\n */\nfunction buildRegisteredProps(\n section: SectionCompositionEntry,\n componentRegistry: ComponentRegistry<unknown>,\n): Props {\n const exposedPropDefs: ExposedPropDef[] =\n (section.ui?.metadata?.sectionExposedProps as\n | ExposedPropDef[]\n | undefined) ?? [];\n\n // Index the section's internal nodes by uid so each exposed prop can recover\n // its originating component prop schema.\n const nodeByUid = new Map<string, Node>();\n if (section.ui) {\n for (const [node] of Node.nodes(section.ui as Node)) {\n if (node?.uid) nodeByUid.set(node.uid, node as Node);\n }\n }\n\n const props = Object.fromEntries(\n exposedPropDefs.map((ep) => {\n const internalNode = nodeByUid.get(ep.nodeUid);\n const fullProp = internalNode\n ? componentRegistry.getComponentByNode(internalNode)?.props?.[\n ep.propKey\n ]\n : undefined;\n return [\n ep.uid,\n {\n ...(fullProp ?? {}),\n type: ep.propType as NodePropType,\n displayName: ep.displayName,\n } as Props[string],\n ];\n }),\n );\n\n return props;\n}\n\n/**\n * Registers section composition entries as React components in the component registry.\n * Each section is registered with its exposed props so the page-level binding\n * resolver can resolve override values and pass them down to SectionComposition.\n */\nexport const registerSectionComponents = (\n sections: SectionCompositionEntry[],\n componentRegistry: ComponentRegistry<unknown>,\n) => {\n const sectionConfigs: SectionRegistryConfig[] = sections.map((section) => {\n // Section entries store `static_value` in raw shape (`{ text: [...] }`).\n // The data binder expects the pre-processed flat shape (`{ key: value }`),\n // so transform here before handing the section's spec to the renderer.\n // Without this, every string prop on the section (e.g. SectionSlot's\n // `label`) resolves to empty in consumption mode.\n const rawStaticValue = ((section as any)?.static_value ?? {}) as any;\n const sectionSpec: StudioSpec = {\n ui: section.ui,\n data: {\n dataSources: {},\n static_value: preProcessStaticValues(rawStaticValue),\n },\n compositionEntry: section,\n sectionCompositions: sections,\n };\n\n return {\n type: section.uid,\n displayName: section.title,\n thumbnailUrl: section?.ui_preview?.url,\n wrap: false,\n // Exposed props registered here so retrievePropValue resolves their\n // page-level bindings and passes the values to SectionComposition.\n props: buildRegisteredProps(section, componentRegistry),\n component: (props) => {\n return (\n <SectionComposition\n {...props}\n compositionUID={section.uid}\n spec={sectionSpec}\n />\n );\n },\n metadata: {\n uid: section.uid,\n type: \"section-composition\",\n },\n };\n });\n\n componentRegistry.registerSectionComponent(sectionConfigs);\n};\n\n/**\n * React hook that registers section components when sections array changes.\n * Automatically handles component registration lifecycle in React components.\n *\n * @param sections - Optional array of section composition entries\n */\nexport const useRegisterSectionComponents = (\n sections?: SectionCompositionEntry[],\n) => {\n const { componentRegistry } = useRenderer();\n\n useMemo(() => {\n if (!sections?.length) return;\n registerSectionComponents(sections, componentRegistry);\n }, [sections, componentRegistry]);\n};\n"],"names":["_jsx"],"mappings":";;;;;;;AA2BA;;;;;;;;;;;;;;;;AAgBG;AACH,SAAS,oBAAoB,CAC3B,OAAgC,EAChC,iBAA6C,EAAA;IAE7C,MAAM,eAAe,GAClB,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,mBAET,IAAI,EAAE;;;AAItB,IAAA,MAAM,SAAS,GAAG,IAAI,GAAG,EAAgB;AACzC,IAAA,IAAI,OAAO,CAAC,EAAE,EAAE;AACd,QAAA,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAU,CAAC,EAAE;YACnD,IAAI,IAAI,EAAE,GAAG;gBAAE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAY,CAAC;QACtD;IACF;AAEA,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAC9B,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,KAAI;QACzB,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,OAAO,C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AA,CACjB;YAEN,CAAC;AACD,YAAA,QAAQ,EAAE;gBACR,GAAG,EAAE,OAAO,CAAC,GAAG;AAChB,gBAAA,IAAI,EAAE,qBAAqB;AAC5B,aAAA;SACF;AACH,IAAA,CAAC,CAAC;AAEF,IAAA,iBAAiB,CAAC,wBAAwB,CAAC,cAAc,CAAC;AAC5D;AAEA;;;;;AAKG;AACI,MAAM,4BAA4B,GAAG,CAC1C,QAAoC,KAClC;AACF,IAAA,MAAM,EAAE,iBAAiB,EAAE,GAAG,WAAW,EAAE;IAE3C,OAAO,CAAC,MAAK;QACX,IAAI,CAAC,QAAQ,EAAE,MAAM;YAAE;AACvB,QAAA,yBAAyB,CAAC,QAAQ,EAAE,iBAAiB,CAAC;AACxD,IAAA,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AACnC;;;;"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { rendererContext } from '../contexts/providers/renderer.provider.js';
|
|
2
|
-
import '../contexts/providers/edit-context.provider.js';
|
|
3
|
-
import '../contexts/providers/active-node.provider.js';
|
|
4
|
-
import 'react/jsx-runtime';
|
|
5
|
-
import '@contentstack/studio-client';
|
|
6
|
-
import '@contentstack/studio-messenger';
|
|
7
|
-
import '@contentstack/studio-react-components/contexts';
|
|
8
|
-
import 'immer';
|
|
9
2
|
import { useContext } from 'react';
|
|
10
|
-
import './use-edit-context-listener.hook.js';
|
|
11
|
-
import '@contentstack/studio-internal';
|
|
12
|
-
import '@contentstack/studio-core';
|
|
13
|
-
import '@contentstack/studio-react-components/basic-components';
|
|
14
|
-
import '@contentstack/studio-react-components/hooks';
|
|
15
|
-
import 'goober';
|
|
16
|
-
import '../components/Element.js';
|
|
17
|
-
import '../contexts/providers/section-mode.provider.js';
|
|
18
|
-
import '@contentstack/studio-registry';
|
|
19
|
-
import '../contexts/providers/use-design-preview.provider.js';
|
|
20
|
-
import '../contexts/providers/use-repeater.provider.js';
|
|
21
|
-
import '../contexts/providers/use-condition-block.provider.js';
|
|
22
|
-
import '../contexts/providers/preview-mode.provider.js';
|
|
23
3
|
|
|
24
4
|
const useRenderer = () => {
|
|
25
5
|
const context = useContext(rendererContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-renderer.hook.js","sources":["../../src/hooks/use-renderer.hook.ts"],"sourcesContent":["import { rendererContext } from \"../contexts/providers\";\nimport { useContext } from \"react\";\n\nexport const useRenderer = () => {\n const context = useContext(rendererContext);\n return context;\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-renderer.hook.js","sources":["../../src/hooks/use-renderer.hook.ts"],"sourcesContent":["import { rendererContext } from \"../contexts/providers/renderer.provider\";\nimport { useContext } from \"react\";\n\nexport const useRenderer = () => {\n const context = useContext(rendererContext);\n return context;\n};\n"],"names":[],"mappings":";;;AAGO,MAAM,WAAW,GAAG,MAAK;AAC9B,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,CAAC;AAC3C,IAAA,OAAO,OAAO;AAChB;;;;"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import '../contexts/providers/renderer.provider.js';
|
|
3
|
-
import '../contexts/providers/edit-context.provider.js';
|
|
4
|
-
import '../contexts/providers/active-node.provider.js';
|
|
5
|
-
import 'react/jsx-runtime';
|
|
6
|
-
import '@contentstack/studio-client';
|
|
7
|
-
import '@contentstack/studio-messenger';
|
|
8
|
-
import '@contentstack/studio-react-components/contexts';
|
|
9
|
-
import 'immer';
|
|
10
|
-
import './use-edit-context-listener.hook.js';
|
|
11
|
-
import '@contentstack/studio-internal';
|
|
12
|
-
import '@contentstack/studio-core';
|
|
13
|
-
import '@contentstack/studio-react-components/basic-components';
|
|
14
|
-
import '@contentstack/studio-react-components/hooks';
|
|
15
|
-
import 'goober';
|
|
16
|
-
import '../components/Element.js';
|
|
17
|
-
import '../contexts/providers/section-mode.provider.js';
|
|
18
|
-
import '@contentstack/studio-registry';
|
|
19
|
-
import '../contexts/providers/use-design-preview.provider.js';
|
|
20
2
|
import { RepeaterContext } from '../contexts/providers/use-repeater.provider.js';
|
|
21
|
-
import '../contexts/providers/use-condition-block.provider.js';
|
|
22
|
-
import '../contexts/providers/preview-mode.provider.js';
|
|
23
3
|
|
|
24
4
|
const useRepeaterContext = () => useContext(RepeaterContext);
|
|
25
5
|
|