@avocadostudio-ai/preview-adapter 0.8.0 → 0.10.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/bridge-functions.d.ts +13 -26
- package/dist/bridge-functions.js +14 -40
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -200,39 +200,26 @@ export declare function removeSkeletons(): void;
|
|
|
200
200
|
*/
|
|
201
201
|
export declare function missingBlockWrapperWarning(blockCount: number, editableCount: number): string | null;
|
|
202
202
|
/**
|
|
203
|
-
*
|
|
203
|
+
* Every integration problem the overlay can diagnose from the page alone.
|
|
204
204
|
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* scroll-to-block, the badges, the property panel and every edit made through
|
|
214
|
-
* it all work, because the panel is built from the block manifest and never
|
|
215
|
-
* looks at the page. What is silently off is everything the overlay finds by
|
|
216
|
-
* walking the DOM: inline text editing, the field pills on hover, the image
|
|
217
|
-
* Change/Remove buttons, and the live-draft path that streams a field into the
|
|
218
|
-
* node that draws it. A reviewer sees a preview that responds to clicks and
|
|
219
|
-
* concludes it is wired.
|
|
220
|
-
*
|
|
221
|
-
* Like its mirror this is an all-or-nothing test, not a coverage check: one
|
|
222
|
-
* marked field means the integrator knows the attribute exists, and which of
|
|
223
|
-
* their fields deserve it is their call, not ours.
|
|
205
|
+
* One, today. Its mirror — every block wrapped and not one field marked — used
|
|
206
|
+
* to be reported here too, and was withdrawn: that state is a preview whose
|
|
207
|
+
* selection, property panel, chat and publish all work, missing an opt-in step
|
|
208
|
+
* the integrator has not taken yet. Saying so on a dev overlay put a red
|
|
209
|
+
* Console Error on a working integration, which reads as a defect in the
|
|
210
|
+
* product rather than as an invitation. Marking fields is now its own named
|
|
211
|
+
* step in the docs, and whether a page has taken it is what
|
|
212
|
+
* `site-sdk/coverage` measures, on demand, for someone who asked.
|
|
224
213
|
*/
|
|
225
|
-
export declare function missingEditableTargetsWarning(blockCount: number, editableCount: number): string | null;
|
|
226
|
-
/** Every integration problem the overlay can diagnose from the page alone. */
|
|
227
214
|
export declare function previewIntegrationWarnings(blockCount: number, editableCount: number): string[];
|
|
228
215
|
/**
|
|
229
216
|
* Put the diagnosis where the person is looking.
|
|
230
217
|
*
|
|
231
|
-
*
|
|
232
|
-
* console
|
|
218
|
+
* The warning above describes a preview that looks like it works, so the
|
|
219
|
+
* console it would print to is the one nobody opens — and in the editor it is
|
|
233
220
|
* the *iframe's* console, two context menus away from the window in front of
|
|
234
|
-
* the user. The symptom is "
|
|
235
|
-
*
|
|
221
|
+
* the user. The symptom is "clicking a block does nothing"; the explanation
|
|
222
|
+
* has to be in the preview.
|
|
236
223
|
*
|
|
237
224
|
* Development only, and dismissible: it sits over the site's own design, and
|
|
238
225
|
* once read it has done its work.
|
package/dist/bridge-functions.js
CHANGED
|
@@ -606,54 +606,28 @@ export function missingBlockWrapperWarning(blockCount, editableCount) {
|
|
|
606
606
|
"editor-selectable class that the field pills are scoped to.");
|
|
607
607
|
}
|
|
608
608
|
/**
|
|
609
|
-
*
|
|
609
|
+
* Every integration problem the overlay can diagnose from the page alone.
|
|
610
610
|
*
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
619
|
-
* scroll-to-block, the badges, the property panel and every edit made through
|
|
620
|
-
* it all work, because the panel is built from the block manifest and never
|
|
621
|
-
* looks at the page. What is silently off is everything the overlay finds by
|
|
622
|
-
* walking the DOM: inline text editing, the field pills on hover, the image
|
|
623
|
-
* Change/Remove buttons, and the live-draft path that streams a field into the
|
|
624
|
-
* node that draws it. A reviewer sees a preview that responds to clicks and
|
|
625
|
-
* concludes it is wired.
|
|
626
|
-
*
|
|
627
|
-
* Like its mirror this is an all-or-nothing test, not a coverage check: one
|
|
628
|
-
* marked field means the integrator knows the attribute exists, and which of
|
|
629
|
-
* their fields deserve it is their call, not ours.
|
|
611
|
+
* One, today. Its mirror — every block wrapped and not one field marked — used
|
|
612
|
+
* to be reported here too, and was withdrawn: that state is a preview whose
|
|
613
|
+
* selection, property panel, chat and publish all work, missing an opt-in step
|
|
614
|
+
* the integrator has not taken yet. Saying so on a dev overlay put a red
|
|
615
|
+
* Console Error on a working integration, which reads as a defect in the
|
|
616
|
+
* product rather than as an invitation. Marking fields is now its own named
|
|
617
|
+
* step in the docs, and whether a page has taken it is what
|
|
618
|
+
* `site-sdk/coverage` measures, on demand, for someone who asked.
|
|
630
619
|
*/
|
|
631
|
-
export function missingEditableTargetsWarning(blockCount, editableCount) {
|
|
632
|
-
if (editableCount > 0 || blockCount === 0)
|
|
633
|
-
return null;
|
|
634
|
-
return (`[avocado] The overlay found ${blockCount} [data-block-id] wrapper(s) and no ` +
|
|
635
|
-
"data-editable-target attribute. Selection and the property panel work; inline text " +
|
|
636
|
-
"editing, the field pills and the image Change/Remove buttons are all off, because every " +
|
|
637
|
-
"one of them is found by walking the marked fields in the page.\n" +
|
|
638
|
-
"Mark the element that draws each editable prop with editableProps(path, { kind }) from " +
|
|
639
|
-
"@avocadostudio-ai/site-sdk/editor — e.g. editableProps(\"imageUrl\", { kind: \"image\" }) " +
|
|
640
|
-
"on the wrapper around an image, editableProps(\"heading\") on the element holding it.");
|
|
641
|
-
}
|
|
642
|
-
/** Every integration problem the overlay can diagnose from the page alone. */
|
|
643
620
|
export function previewIntegrationWarnings(blockCount, editableCount) {
|
|
644
|
-
return [
|
|
645
|
-
missingBlockWrapperWarning(blockCount, editableCount),
|
|
646
|
-
missingEditableTargetsWarning(blockCount, editableCount),
|
|
647
|
-
].filter((w) => w !== null);
|
|
621
|
+
return [missingBlockWrapperWarning(blockCount, editableCount)].filter((w) => w !== null);
|
|
648
622
|
}
|
|
649
623
|
/**
|
|
650
624
|
* Put the diagnosis where the person is looking.
|
|
651
625
|
*
|
|
652
|
-
*
|
|
653
|
-
* console
|
|
626
|
+
* The warning above describes a preview that looks like it works, so the
|
|
627
|
+
* console it would print to is the one nobody opens — and in the editor it is
|
|
654
628
|
* the *iframe's* console, two context menus away from the window in front of
|
|
655
|
-
* the user. The symptom is "
|
|
656
|
-
*
|
|
629
|
+
* the user. The symptom is "clicking a block does nothing"; the explanation
|
|
630
|
+
* has to be in the preview.
|
|
657
631
|
*
|
|
658
632
|
* Development only, and dismissible: it sits over the site's own design, and
|
|
659
633
|
* once read it has done its work.
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { PreviewBridge } from "./preview-bridge.tsx";
|
|
|
2
2
|
export { PreviewBridgeCore } from "./preview-bridge-core.tsx";
|
|
3
3
|
export type { PreviewBridgeConfig, PreviewBridgeCoreProps } from "./preview-bridge-core.tsx";
|
|
4
4
|
export { getPreviewWrapperProps } from "./selectable.ts";
|
|
5
|
-
export { createBridgeFunctions, createBridgeState, findBlockNode, findEditableNode, scrollBlockIntoView, parseListItemPath, supportsInlineEditablePath, readNodeText, placeCaretAtEnd, orderedBlockNodes, blockOrderIndex, computeMoveAfter, computeInsertBefore, groupListItemNodes, commonItemRoot, markdownToHtml, withPreviewParams, setNestedLabelsVisibility, clearChildFocus, clearListItemSelection, removeOverlayControls, clearAllHighlights, showSkeleton, removeSkeletons, ensureBlockBadges, applyAiFieldLoading, cleanupOverlayElements, isImageEditable, isInlineEditable, isMultilineEditable, missingBlockWrapperWarning,
|
|
5
|
+
export { createBridgeFunctions, createBridgeState, findBlockNode, findEditableNode, scrollBlockIntoView, parseListItemPath, supportsInlineEditablePath, readNodeText, placeCaretAtEnd, orderedBlockNodes, blockOrderIndex, computeMoveAfter, computeInsertBefore, groupListItemNodes, commonItemRoot, markdownToHtml, withPreviewParams, setNestedLabelsVisibility, clearChildFocus, clearListItemSelection, removeOverlayControls, clearAllHighlights, showSkeleton, removeSkeletons, ensureBlockBadges, applyAiFieldLoading, cleanupOverlayElements, isImageEditable, isInlineEditable, isMultilineEditable, missingBlockWrapperWarning, previewIntegrationWarnings, } from "./bridge-functions.ts";
|
|
6
6
|
export type { BridgeCallbacks, BridgeState, BridgeFunctions } from "./bridge-functions.ts";
|
|
7
7
|
export { LivePreviewProvider, useLivePreviewBlocks, useLivePreviewBridgeApi, } from "./live-preview-store.tsx";
|
|
8
8
|
export type { LivePreviewPage, LivePreviewBridgeApi } from "./live-preview-store.tsx";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { PreviewBridge } from "./preview-bridge.js";
|
|
2
2
|
export { PreviewBridgeCore } from "./preview-bridge-core.js";
|
|
3
3
|
export { getPreviewWrapperProps } from "./selectable.js";
|
|
4
|
-
export { createBridgeFunctions, createBridgeState, findBlockNode, findEditableNode, scrollBlockIntoView, parseListItemPath, supportsInlineEditablePath, readNodeText, placeCaretAtEnd, orderedBlockNodes, blockOrderIndex, computeMoveAfter, computeInsertBefore, groupListItemNodes, commonItemRoot, markdownToHtml, withPreviewParams, setNestedLabelsVisibility, clearChildFocus, clearListItemSelection, removeOverlayControls, clearAllHighlights, showSkeleton, removeSkeletons, ensureBlockBadges, applyAiFieldLoading, cleanupOverlayElements, isImageEditable, isInlineEditable, isMultilineEditable, missingBlockWrapperWarning,
|
|
4
|
+
export { createBridgeFunctions, createBridgeState, findBlockNode, findEditableNode, scrollBlockIntoView, parseListItemPath, supportsInlineEditablePath, readNodeText, placeCaretAtEnd, orderedBlockNodes, blockOrderIndex, computeMoveAfter, computeInsertBefore, groupListItemNodes, commonItemRoot, markdownToHtml, withPreviewParams, setNestedLabelsVisibility, clearChildFocus, clearListItemSelection, removeOverlayControls, clearAllHighlights, showSkeleton, removeSkeletons, ensureBlockBadges, applyAiFieldLoading, cleanupOverlayElements, isImageEditable, isInlineEditable, isMultilineEditable, missingBlockWrapperWarning, previewIntegrationWarnings, } from "./bridge-functions.js";
|
|
5
5
|
export { LivePreviewProvider, useLivePreviewBlocks, useLivePreviewBridgeApi, } from "./live-preview-store.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avocadostudio-ai/preview-adapter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"src/styles.css"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@avocadostudio-ai/shared": "^0.
|
|
40
|
+
"@avocadostudio-ai/shared": "^0.10.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"next": ">=15.0.0",
|