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

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-Dz-wlq8R.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.27",
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,107 @@
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';
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' | 'weight' | '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 interface AnnotationStyleDiff {
45
+ property: AnnotationStyleKey;
46
+ before: string;
47
+ after: string;
48
+ /** BrandKit token the new value came from, when it came from one. Carried into
49
+ * the prompt so the agent reaches for the token instead of hardcoding the
50
+ * literal value it happens to resolve to today. */
51
+ token?: string;
52
+ }
53
+ export interface BrandKitPreset {
54
+ key: string;
55
+ label: string;
56
+ value: string;
57
+ kind: 'color' | 'font';
58
+ }
59
+ export declare function sanitizeAnnotationValue(value: unknown): string;
60
+ /** Hex form for display and for `<input type="color">`. Fully transparent
61
+ * colors have no meaningful hex, so they read as "no color" instead. */
62
+ export declare function normalizeCssColor(value: string | undefined | null): string | null;
63
+ export declare function sameCssColor(a: string | undefined, b: string | undefined): boolean;
64
+ export interface CssLength {
65
+ value: number;
66
+ unit: string;
67
+ }
68
+ export declare function parseCssLength(value: string | undefined | null): CssLength | null;
69
+ export declare function formatCssLength(value: number, unit: string): string;
70
+ export interface CssBox {
71
+ top: string;
72
+ right: string;
73
+ bottom: string;
74
+ left: string;
75
+ }
76
+ /** Expands a 1–4 token padding/margin shorthand. Returns null for anything with
77
+ * `calc()` or keywords so the caller can fall back to raw text editing. */
78
+ export declare function parseCssBox(value: string | undefined | null): CssBox | null;
79
+ export declare function formatCssBox(box: CssBox): string;
80
+ export declare function annotationStyleValues(element: PreviewBridgeElement | null): Record<AnnotationStyleKey, string>;
81
+ export declare function changedStyleKeys(before: Record<string, string>, after: Record<string, string>): AnnotationStyleKey[];
82
+ export interface StyleOverridePatch {
83
+ styles: Record<string, string>;
84
+ appliedKeys: AnnotationStyleKey[];
85
+ }
86
+ /** Builds the temporary-override message for the preview bridge. Only changed
87
+ * properties are pushed: sending the whole computed set would inline
88
+ * width/height/padding onto the element and pin the layout it inherited from
89
+ * source, so an unrelated edit could visibly break it. A property the user
90
+ * reverted is sent as an empty value, which tells the bridge to drop the
91
+ * override instead of leaving the last one stuck on the element. */
92
+ export declare function buildStyleOverridePatch(before: Record<string, string>, draft: Record<string, string>, appliedKeys: readonly AnnotationStyleKey[]): StyleOverridePatch;
93
+ export declare function buildAnnotationStyleDiff(before: Record<string, string>, after: Record<string, string>, presets?: readonly BrandKitPreset[]): AnnotationStyleDiff[];
94
+ export declare function brandKitPresets(colors: Record<string, string>, fonts: Record<string, string>, labels: {
95
+ colors: Record<string, string>;
96
+ fonts: Record<string, string>;
97
+ }): BrandKitPreset[];
98
+ export declare function serializeAnnotationPrompt(input: {
99
+ id: number;
100
+ route: string;
101
+ device: string;
102
+ element: PreviewBridgeElement | null;
103
+ note: string;
104
+ styleDiffs: AnnotationStyleDiff[];
105
+ textBefore?: string;
106
+ textAfter?: string;
107
+ }): 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';