@syntrologie/adapt-content 2.12.0 → 2.14.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-editor-ui.d.ts","sourceRoot":"","sources":["../src/content-editor-ui.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"content-editor-ui.d.ts","sourceRoot":"","sources":["../src/content-editor-ui.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AA+BH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgBhD,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CAmjB3E;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAAe,CAAC;AAExC,eAAe,aAAa,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
5
5
|
* Main editor component with tab switching, item selection, form inputs,
|
|
6
6
|
* save/publish, and highlight on page.
|
|
7
7
|
*/
|
|
8
|
-
import { DetectionBadge, DismissedSection, EditorBody, EditorCard,
|
|
8
|
+
import { DetectionBadge, DismissedSection, EditorBody, EditorCard, EditorHeader, EditorInput, EditorLayout, EditorSelect, EditorTextarea, EmptyState, GroupHeader, } from '@syntrologie/shared-editor-ui';
|
|
9
9
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
10
10
|
import { AnchorPicker } from './components/AnchorPicker';
|
|
11
11
|
import { filterConfig, flattenItems, parseItemKey, resolveAnchorRoute, resolveAnchorSelector, SECTION_ICON_MAP, savePendingHighlight, useAnchorDetection, } from './content-editor-state';
|
|
@@ -122,7 +122,7 @@ export function ContentEditor({ config, onChange, editor }) {
|
|
|
122
122
|
onChange(updated);
|
|
123
123
|
editor.setDirty(true);
|
|
124
124
|
}, [typedConfig, onChange, editor]);
|
|
125
|
-
const
|
|
125
|
+
const _handlePublish = useCallback(() => {
|
|
126
126
|
// Filter dismissed items before publishing
|
|
127
127
|
if (dismissedKeys.size > 0) {
|
|
128
128
|
const filtered = filterConfig(typedConfig, dismissedKeys);
|
|
@@ -274,7 +274,7 @@ export function ContentEditor({ config, onChange, editor }) {
|
|
|
274
274
|
})] })), dismissedItems.length > 0 && (_jsx(DismissedSection, { count: dismissedItems.length, children: dismissedItems.map((item) => (_jsxs("div", { className: "se-flex se-items-center se-gap-2 se-py-1.5 se-px-2.5 se-rounded-lg se-border se-border-white/[0.03] se-bg-transparent se-mb-0.5 se-cursor-pointer se-text-sm se-text-text-tertiary se-opacity-60", children: [_jsx("span", { className: "se-shrink-0 se-flex se-items-center -se-ml-1", children: _jsx(SectionIcon, { section: item.section }) }), _jsx("span", { className: "se-flex-1 se-overflow-hidden se-text-ellipsis se-whitespace-nowrap se-line-through", children: item.summary }), _jsx("button", { type: "button", className: "se-py-0.5 se-px-1.5 se-rounded se-border-none se-bg-transparent se-text-blue-5 se-text-[11px] se-cursor-pointer se-shrink-0 se-leading-none", onClick: (e) => {
|
|
275
275
|
e.stopPropagation();
|
|
276
276
|
handleRestore(item.key);
|
|
277
|
-
}, children: "Restore" })] }, item.key))) }))] })) }), _jsx(
|
|
277
|
+
}, children: "Restore" })] }, item.key))) }))] })) }), _jsx(AnchorPicker, { isActive: createMode === 'picking', onPick: handleElementPicked, onCancel: () => setCreateMode('form') })] }));
|
|
278
278
|
}
|
|
279
279
|
/**
|
|
280
280
|
* Editor module configuration.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnchorPicker.d.ts","sourceRoot":"","sources":["../../src/components/AnchorPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAWH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;8DAE0D;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAKD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,iBAAyB,EACzB,eAAuJ,GACxJ,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"AnchorPicker.d.ts","sourceRoot":"","sources":["../../src/components/AnchorPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAWH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;8DAE0D;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAKD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,iBAAyB,EACzB,eAAuJ,GACxJ,EAAE,iBAAiB,sCA2MnB"}
|
|
@@ -27,11 +27,14 @@ export function AnchorPicker({ isActive, onPick, onCancel, passthroughClicks = f
|
|
|
27
27
|
const overlayRef = useRef(null);
|
|
28
28
|
const handleMouseMove = useCallback((e) => {
|
|
29
29
|
const overlay = overlayRef.current;
|
|
30
|
-
|
|
30
|
+
// In passthrough mode the overlay is already pointerEvents:'none',
|
|
31
|
+
// so elementFromPoint can see through it — no toggle needed.
|
|
32
|
+
// In non-passthrough mode, temporarily disable to detect elements underneath.
|
|
33
|
+
if (overlay && !passthroughClicks) {
|
|
31
34
|
overlay.style.pointerEvents = 'none';
|
|
32
35
|
}
|
|
33
36
|
const elementAtPoint = document.elementFromPoint(e.clientX, e.clientY);
|
|
34
|
-
if (overlay) {
|
|
37
|
+
if (overlay && !passthroughClicks) {
|
|
35
38
|
overlay.style.pointerEvents = 'auto';
|
|
36
39
|
}
|
|
37
40
|
if (!elementAtPoint) {
|
|
@@ -52,7 +55,7 @@ export function AnchorPicker({ isActive, onPick, onCancel, passthroughClicks = f
|
|
|
52
55
|
setHoveredElement(elementAtPoint);
|
|
53
56
|
const selector = generateSelector(elementAtPoint);
|
|
54
57
|
setHoveredSelector(selector);
|
|
55
|
-
}, [excludeSelector]);
|
|
58
|
+
}, [excludeSelector, passthroughClicks]);
|
|
56
59
|
const handleClick = useCallback((e) => {
|
|
57
60
|
if (passthroughClicks)
|
|
58
61
|
return; // Let click propagate to PostHog
|