@feedmepos/mf-miniprogram-v2 0.1.0-dev.27 → 0.1.0-dev.29
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/{ControlPlaneView-Dz-wlq8R.js → ControlPlaneView-D9JAV8cA.js} +4691 -4503
- package/dist/app.js +1 -1
- package/dist/package.json +1 -1
- package/dist/src/composables/annotationEditing.d.ts +25 -2
- package/dist/src/composables/imageAttachments.d.ts +23 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/app.js
CHANGED
package/dist/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PreviewBridgeElement } from './types';
|
|
2
|
-
export type AnnotationStyleKey = 'color' | 'backgroundColor' | 'borderColor' | 'opacity' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'lineHeight' | 'letterSpacing' | 'textAlign' | 'borderRadius' | 'borderWidth' | 'width' | 'height' | 'padding' | 'margin';
|
|
2
|
+
export type AnnotationStyleKey = 'color' | 'backgroundColor' | 'borderColor' | 'opacity' | 'fontFamily' | 'fontSize' | 'fontWeight' | 'lineHeight' | 'letterSpacing' | 'textAlign' | 'borderRadius' | 'borderWidth' | 'width' | 'height' | 'padding' | 'margin' | 'objectFit' | 'aspectRatio' | 'fill' | 'stroke' | 'display' | 'gap' | 'justifyContent' | 'alignItems';
|
|
3
3
|
/** Which editor a property gets. The bridge validates every value with
|
|
4
4
|
* `CSS.supports` and rejects the whole patch on a miss, so controls must only
|
|
5
5
|
* ever emit complete values — never the intermediate state of a keystroke. */
|
|
6
|
-
export type AnnotationControlKind = 'color' | 'length' | 'ratio' | '
|
|
6
|
+
export type AnnotationControlKind = 'color' | 'length' | 'ratio' | 'choice' | 'align' | 'font' | 'box';
|
|
7
7
|
export interface AnnotationChoice {
|
|
8
8
|
value: string;
|
|
9
9
|
label: string;
|
|
@@ -41,6 +41,18 @@ export interface AnnotationSection {
|
|
|
41
41
|
defaultOpen: boolean;
|
|
42
42
|
}
|
|
43
43
|
export declare const ANNOTATION_SECTIONS: readonly AnnotationSection[];
|
|
44
|
+
export type AnnotationElementKind = 'media' | 'text' | 'container' | 'control';
|
|
45
|
+
/** Which family of controls the element deserves. Deliberately a heuristic used
|
|
46
|
+
* only to order and pre-collapse sections — never to remove a control — because
|
|
47
|
+
* a `<span style="display:block">` or a div used purely as a label would
|
|
48
|
+
* otherwise lose the properties it actually needs. */
|
|
49
|
+
export declare function annotationElementKind(element: PreviewBridgeElement | null): AnnotationElementKind;
|
|
50
|
+
/** Sections ordered for the element, with the relevant ones expanded. */
|
|
51
|
+
export declare function annotationSectionsFor(kind: AnnotationElementKind): AnnotationSection[];
|
|
52
|
+
/** CSS ignores width, height and vertical padding on a non-replaced inline box.
|
|
53
|
+
* The control still works, so this only feeds a tooltip — silently doing
|
|
54
|
+
* nothing is what makes the panel feel broken. */
|
|
55
|
+
export declare function ignoredOnInline(element: PreviewBridgeElement | null, key: AnnotationStyleKey): boolean;
|
|
44
56
|
export interface AnnotationStyleDiff {
|
|
45
57
|
property: AnnotationStyleKey;
|
|
46
58
|
before: string;
|
|
@@ -95,6 +107,10 @@ export declare function brandKitPresets(colors: Record<string, string>, fonts: R
|
|
|
95
107
|
colors: Record<string, string>;
|
|
96
108
|
fonts: Record<string, string>;
|
|
97
109
|
}): BrandKitPreset[];
|
|
110
|
+
/** An `<img>` reports no nearby text, so without its src and alt the agent is
|
|
111
|
+
* told only that "some image" changed and has to guess which file — the failure
|
|
112
|
+
* mode being an invented asset path that breaks the build. */
|
|
113
|
+
export declare function annotationAssetContext(element: PreviewBridgeElement | null): string | null;
|
|
98
114
|
export declare function serializeAnnotationPrompt(input: {
|
|
99
115
|
id: number;
|
|
100
116
|
route: string;
|
|
@@ -104,4 +120,11 @@ export declare function serializeAnnotationPrompt(input: {
|
|
|
104
120
|
styleDiffs: AnnotationStyleDiff[];
|
|
105
121
|
textBefore?: string;
|
|
106
122
|
textAfter?: string;
|
|
123
|
+
/** Images the user attached to this marker. One message carries every
|
|
124
|
+
* annotation, so the filename prefix is what pairs a saved upload with the
|
|
125
|
+
* marker it was dropped on. */
|
|
126
|
+
attachments?: {
|
|
127
|
+
count: number;
|
|
128
|
+
prefix: string;
|
|
129
|
+
};
|
|
107
130
|
}): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { OutgoingAttachment } from './types';
|
|
2
|
+
export interface PendingImage extends OutgoingAttachment {
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const ACCEPTED_IMAGE_MIME: Set<string>;
|
|
6
|
+
export declare const MAX_ATTACHMENT_BYTES: number;
|
|
7
|
+
export declare const MAX_ATTACHMENTS = 4;
|
|
8
|
+
export declare function readAsDataUrl(file: File): Promise<string>;
|
|
9
|
+
export declare function imageFilesFromPaste(event: ClipboardEvent): File[];
|
|
10
|
+
export declare function imageFilesFromDrop(event: DragEvent): File[];
|
|
11
|
+
/** Reads files into pending attachments. Returns rather than mutates so each
|
|
12
|
+
* caller keeps ownership of its own list (the chat has one, an annotation has
|
|
13
|
+
* one per marker). */
|
|
14
|
+
export declare function collectImages(files: File[], existingCount: number, max?: number): Promise<{
|
|
15
|
+
added: PendingImage[];
|
|
16
|
+
error: string | null;
|
|
17
|
+
}>;
|
|
18
|
+
/** One chat message carries every annotation, so an image has to say which
|
|
19
|
+
* marker it belongs to. The upload endpoint keeps the name it is given (after
|
|
20
|
+
* sanitizing and adding a timestamp prefix), so the marker survives into the
|
|
21
|
+
* saved path and the agent can pair them up. */
|
|
22
|
+
export declare function annotationAttachmentPrefix(marker: number): string;
|
|
23
|
+
export declare function annotationAttachmentName(marker: number, filename?: string): string;
|