@syntrologie/adapt-content 2.8.0-canary.49 → 2.8.0-canary.50
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;AAgCH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgBhD,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"content-editor-ui.d.ts","sourceRoot":"","sources":["../src/content-editor-ui.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgCH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgBhD,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CAsjB3E;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAAe,CAAC;AAExC,eAAe,aAAa,CAAC"}
|
|
@@ -24,7 +24,7 @@ export function ContentEditor({ config, onChange, editor }) {
|
|
|
24
24
|
const typedConfig = config;
|
|
25
25
|
const [dismissedKeys, setDismissedKeys] = useState(() => editor.getDismissedKeys?.() ?? new Set());
|
|
26
26
|
const [editingKey, setEditingKey] = useState(null);
|
|
27
|
-
const [
|
|
27
|
+
const [, setPreviewMode] = useState('after');
|
|
28
28
|
// Sync dismissed keys back to navigation context on every change
|
|
29
29
|
useEffect(() => {
|
|
30
30
|
editor.setDismissedKeys?.(dismissedKeys);
|
|
@@ -77,7 +77,7 @@ export function ContentEditor({ config, onChange, editor }) {
|
|
|
77
77
|
const activeItems = allItems.filter((item) => !dismissedKeys.has(item.key));
|
|
78
78
|
const dismissedItems = allItems.filter((item) => dismissedKeys.has(item.key));
|
|
79
79
|
const totalChanges = activeItems.length;
|
|
80
|
-
const [
|
|
80
|
+
const [, setHoveredKey] = useState(null);
|
|
81
81
|
const detectionMap = useAnchorDetection(allItems);
|
|
82
82
|
const foundCount = activeItems.filter((item) => detectionMap.get(item.key)?.found).length;
|
|
83
83
|
const handleDismiss = useCallback((key) => {
|
|
@@ -113,16 +113,6 @@ export function ContentEditor({ config, onChange, editor }) {
|
|
|
113
113
|
editor.setBackHandler?.(editingKey !== null ? handleBackToList : null);
|
|
114
114
|
return () => editor.setBackHandler?.(null);
|
|
115
115
|
}, [editingKey, handleBackToList, editor]);
|
|
116
|
-
const _handleBeforeAfter = useCallback((mode) => {
|
|
117
|
-
setPreviewMode(mode);
|
|
118
|
-
if (mode === 'before') {
|
|
119
|
-
const filtered = filterConfig(typedConfig, new Set([editingKey]));
|
|
120
|
-
editor.previewConfig(filtered);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
editor.previewConfig(config);
|
|
124
|
-
}
|
|
125
|
-
}, [typedConfig, editingKey, editor, config]);
|
|
126
116
|
const handleFieldChange = useCallback((section, index, field, value) => {
|
|
127
117
|
const arr = (typedConfig[section] || []).slice();
|
|
128
118
|
const item = { ...arr[index] };
|
package/package.json
CHANGED