@feedmepos/mf-miniprogram-v2 0.1.0-dev.26 → 0.1.0-dev.28

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/app.js CHANGED
@@ -3,7 +3,7 @@ const n = [
3
3
  {
4
4
  path: "/",
5
5
  name: "miniprogram-v2-control",
6
- component: () => import("./ControlPlaneView-BBd62o75.js")
6
+ component: () => import("./ControlPlaneView-CWOvqYJU.js")
7
7
  },
8
8
  {
9
9
  path: "/:pathMatch(.*)*",
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-miniprogram-v2",
3
- "version": "0.1.0-dev.26",
3
+ "version": "0.1.0-dev.28",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -0,0 +1,14 @@
1
+ import { type BrandKitPreset } from '../composables/annotationEditing';
2
+ type __VLS_Props = {
3
+ value: string;
4
+ label: string;
5
+ presets: BrandKitPreset[];
6
+ disabled?: boolean;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ update: (args_0: string) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onUpdate?: ((args_0: string) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,32 @@
1
+ import { type AnnotationStyleKey, type BrandKitPreset } from '../composables/annotationEditing';
2
+ import type { PreviewBridgeElement } from '../composables/types';
3
+ type __VLS_Props = {
4
+ element: PreviewBridgeElement;
5
+ values: Record<string, string>;
6
+ beforeValues: Record<string, string>;
7
+ textValue: string;
8
+ beforeText: string;
9
+ presets: BrandKitPreset[];
10
+ disabled?: boolean;
11
+ };
12
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ reset: (args_0: {
14
+ key: AnnotationStyleKey | "text";
15
+ }) => any;
16
+ change: (args_0: {
17
+ key: AnnotationStyleKey | "text";
18
+ value: string;
19
+ }) => any;
20
+ resetAll: () => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onReset?: ((args_0: {
23
+ key: AnnotationStyleKey | "text";
24
+ }) => any) | undefined;
25
+ onChange?: ((args_0: {
26
+ key: AnnotationStyleKey | "text";
27
+ value: string;
28
+ }) => any) | undefined;
29
+ onResetAll?: (() => any) | undefined;
30
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { type AnnotationFieldSpec, type BrandKitPreset } from '../composables/annotationEditing';
2
+ type __VLS_Props = {
3
+ spec: AnnotationFieldSpec;
4
+ value: string;
5
+ fontPresets: BrandKitPreset[];
6
+ disabled?: boolean;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ update: (args_0: string) => any;
10
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onUpdate?: ((args_0: string) => any) | undefined;
12
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,123 @@
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' | 'objectFit' | 'aspectRatio' | 'fill' | 'stroke' | 'display' | 'gap' | 'justifyContent' | 'alignItems';
3
+ /** Which editor a property gets. The bridge validates every value with
4
+ * `CSS.supports` and rejects the whole patch on a miss, so controls must only
5
+ * ever emit complete values — never the intermediate state of a keystroke. */
6
+ export type AnnotationControlKind = 'color' | 'length' | 'ratio' | 'choice' | 'align' | 'font' | 'box';
7
+ export interface AnnotationChoice {
8
+ value: string;
9
+ label: string;
10
+ icon?: string;
11
+ /** Computed styles serialize logical alignment as `start`/`end`. Treating those
12
+ * as the physical choice keeps the segment highlighted instead of showing an
13
+ * unset control, and avoids emitting a no-op `start → left` diff. */
14
+ aliases?: readonly string[];
15
+ }
16
+ export interface AnnotationFieldSpec {
17
+ key: AnnotationStyleKey;
18
+ label: string;
19
+ control: AnnotationControlKind;
20
+ units?: readonly string[];
21
+ /** Non-numeric values the property accepts (`auto`, `normal`). Offered in the
22
+ * unit dropdown so the numeric input can stay a number input. */
23
+ keywords?: readonly string[];
24
+ min?: number;
25
+ max?: number;
26
+ step?: number;
27
+ options?: readonly AnnotationChoice[];
28
+ /** One-click common values, offered next to the numeric input. */
29
+ presets?: readonly string[];
30
+ }
31
+ /** Order is load-bearing: it decides the order of `property before → after`
32
+ * lines in the agent prompt. */
33
+ export declare const ANNOTATION_FIELD_SPECS: readonly AnnotationFieldSpec[];
34
+ export declare function annotationFieldSpec(key: AnnotationStyleKey): AnnotationFieldSpec;
35
+ export interface AnnotationSection {
36
+ key: string;
37
+ label: string;
38
+ keys: readonly AnnotationStyleKey[];
39
+ /** Layout properties are the least-used and the most likely to break the
40
+ * preview, so they stay folded until asked for. */
41
+ defaultOpen: boolean;
42
+ }
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;
56
+ export interface AnnotationStyleDiff {
57
+ property: AnnotationStyleKey;
58
+ before: string;
59
+ after: string;
60
+ /** BrandKit token the new value came from, when it came from one. Carried into
61
+ * the prompt so the agent reaches for the token instead of hardcoding the
62
+ * literal value it happens to resolve to today. */
63
+ token?: string;
64
+ }
65
+ export interface BrandKitPreset {
66
+ key: string;
67
+ label: string;
68
+ value: string;
69
+ kind: 'color' | 'font';
70
+ }
71
+ export declare function sanitizeAnnotationValue(value: unknown): string;
72
+ /** Hex form for display and for `<input type="color">`. Fully transparent
73
+ * colors have no meaningful hex, so they read as "no color" instead. */
74
+ export declare function normalizeCssColor(value: string | undefined | null): string | null;
75
+ export declare function sameCssColor(a: string | undefined, b: string | undefined): boolean;
76
+ export interface CssLength {
77
+ value: number;
78
+ unit: string;
79
+ }
80
+ export declare function parseCssLength(value: string | undefined | null): CssLength | null;
81
+ export declare function formatCssLength(value: number, unit: string): string;
82
+ export interface CssBox {
83
+ top: string;
84
+ right: string;
85
+ bottom: string;
86
+ left: string;
87
+ }
88
+ /** Expands a 1–4 token padding/margin shorthand. Returns null for anything with
89
+ * `calc()` or keywords so the caller can fall back to raw text editing. */
90
+ export declare function parseCssBox(value: string | undefined | null): CssBox | null;
91
+ export declare function formatCssBox(box: CssBox): string;
92
+ export declare function annotationStyleValues(element: PreviewBridgeElement | null): Record<AnnotationStyleKey, string>;
93
+ export declare function changedStyleKeys(before: Record<string, string>, after: Record<string, string>): AnnotationStyleKey[];
94
+ export interface StyleOverridePatch {
95
+ styles: Record<string, string>;
96
+ appliedKeys: AnnotationStyleKey[];
97
+ }
98
+ /** Builds the temporary-override message for the preview bridge. Only changed
99
+ * properties are pushed: sending the whole computed set would inline
100
+ * width/height/padding onto the element and pin the layout it inherited from
101
+ * source, so an unrelated edit could visibly break it. A property the user
102
+ * reverted is sent as an empty value, which tells the bridge to drop the
103
+ * override instead of leaving the last one stuck on the element. */
104
+ export declare function buildStyleOverridePatch(before: Record<string, string>, draft: Record<string, string>, appliedKeys: readonly AnnotationStyleKey[]): StyleOverridePatch;
105
+ export declare function buildAnnotationStyleDiff(before: Record<string, string>, after: Record<string, string>, presets?: readonly BrandKitPreset[]): AnnotationStyleDiff[];
106
+ export declare function brandKitPresets(colors: Record<string, string>, fonts: Record<string, string>, labels: {
107
+ colors: Record<string, string>;
108
+ fonts: Record<string, string>;
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;
114
+ export declare function serializeAnnotationPrompt(input: {
115
+ id: number;
116
+ route: string;
117
+ device: string;
118
+ element: PreviewBridgeElement | null;
119
+ note: string;
120
+ styleDiffs: AnnotationStyleDiff[];
121
+ textBefore?: string;
122
+ textAfter?: string;
123
+ }): string;
@@ -0,0 +1,10 @@
1
+ /** Small UI preferences that should survive a reload (panel widths, collapsed
2
+ * state). Every access is guarded: localStorage throws in embedded and private
3
+ * browsing contexts, and a lost preference must never break the layout.
4
+ *
5
+ * Keys are namespaced `mpv2:<name>` so they cannot collide with the portal
6
+ * shell this microfrontend is mounted into. */
7
+ export declare function readStoredBoolean(key: string, fallback: boolean): boolean;
8
+ export declare function readStoredNumber(key: string, fallback: number): number;
9
+ export declare function writeStoredValue(key: string, value: string): void;
10
+ export declare function writeStoredBoolean(key: string, value: boolean): void;
@@ -1,9 +1,23 @@
1
+ /** One property (or the element's text) the user changed, in display terms. The
2
+ * card has to show the intent, not merely that some intent existed, so the
3
+ * before/after values travel with it rather than being summarized to a flag. */
4
+ export interface PreviewAnnotationChange {
5
+ label: string;
6
+ before: string;
7
+ after: string;
8
+ token?: string;
9
+ }
1
10
  export interface PreviewAnnotationItem {
2
11
  id: number;
3
12
  note: string;
4
13
  label: string;
5
14
  route?: string;
6
15
  device?: string;
16
+ changes?: PreviewAnnotationChange[];
17
+ /** Superseded by `changes`. Still read so cards in already-sent transcripts
18
+ * keep showing that properties were edited. */
19
+ hasProperties?: boolean;
20
+ source?: string;
7
21
  }
8
22
  export declare function wrapAnnotationPayload(items: PreviewAnnotationItem[]): string;
9
23
  export declare function parseAnnotationMessage(text: string): PreviewAnnotationItem[] | null;
@@ -32,13 +32,33 @@ export type ChatPart = {
32
32
  url: string;
33
33
  };
34
34
  /** An image attached to an outgoing prompt. `url` is a data: URI so the file
35
- * rides inline in the OpenCode prompt JSON through the transparent proxy
36
- * no separate upload channel exists (or is needed at screenshot sizes). */
35
+ * rides inline in the OpenCode prompt JSON through the transparent proxy. */
37
36
  export interface OutgoingAttachment {
38
37
  mime: string;
39
38
  filename?: string;
40
39
  url: string;
41
40
  }
41
+ export interface PreviewBridgeElement {
42
+ tag: string;
43
+ selector: string;
44
+ text: string;
45
+ nearbyText?: string;
46
+ attrs: Record<string, string>;
47
+ rect: {
48
+ x: number;
49
+ y: number;
50
+ width: number;
51
+ height: number;
52
+ };
53
+ computed: Record<string, string>;
54
+ canEditText?: boolean;
55
+ sourceInspector?: {
56
+ file: string;
57
+ line: number;
58
+ column: number;
59
+ } | null;
60
+ sourceInspectorRaw?: string | null;
61
+ }
42
62
  export type PromptState = 'queued' | 'submitting' | 'running' | 'failed';
43
63
  export interface ChatMessage {
44
64
  /** Stable render key. Starts as `local-{uuid}` for queued prompts and never
@@ -66,7 +86,7 @@ export interface ChatMessage {
66
86
  export type ConnectionStatus = 'idle' | 'starting' | 'ready' | 'error';
67
87
  export type ProjectProvisioningStatus = 'not_started' | 'provisioning' | 'ready' | 'failed';
68
88
  export type ArchiveCodeAction = 'save' | 'discard';
69
- export type CheckpointTrigger = 'manual' | 'turn_completed' | 'quick_edit' | 'interval' | 'archive' | 'pre_restore' | 'pre_discard' | 'turn_revert' | 'turn_unrevert' | 'restore' | 'release';
89
+ export type CheckpointTrigger = 'manual' | 'turn_completed' | 'interval' | 'archive' | 'pre_restore' | 'pre_discard' | 'turn_revert' | 'turn_unrevert' | 'restore' | 'release';
70
90
  export type CheckpointStatus = 'capturing' | 'local_only' | 'pushed_verified' | 'failed';
71
91
  export type CheckpointContextStatus = 'pending' | 'snapshotted' | 'failed' | 'unavailable';
72
92
  export type WorkspaceSyncState = 'unavailable' | 'diverged' | 'behind' | 'uncommitted' | 'unpushed' | 'saving' | 'save_failed' | 'synced' | 'unknown';