@buoy-gg/shared-ui 7.0.35 → 7.0.36
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/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/icons/index.js +7 -0
- package/lib/commonjs/index.js +48 -0
- package/lib/commonjs/sync/keyedArrays.js +209 -0
- package/lib/commonjs/sync/toolAttention.test.js +51 -0
- package/lib/commonjs/sync/toolUiBridge.js +58 -0
- package/lib/commonjs/sync/typedEdit.js +228 -0
- package/lib/commonjs/sync/valuePath.js +337 -0
- package/lib/commonjs/sync/valueShape.js +161 -0
- package/lib/commonjs/ui/components/ExpandablePopover.js +38 -6
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/icons/index.js +3 -1
- package/lib/module/index.js +4 -0
- package/lib/module/sync/keyedArrays.js +204 -0
- package/lib/module/sync/toolAttention.test.js +50 -0
- package/lib/module/sync/toolUiBridge.js +55 -0
- package/lib/module/sync/typedEdit.js +220 -0
- package/lib/module/sync/valuePath.js +330 -0
- package/lib/module/sync/valueShape.js +153 -0
- package/lib/module/ui/components/ExpandablePopover.js +38 -6
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts +1 -1
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/sync/keyedArrays.d.ts +35 -0
- package/lib/typescript/commonjs/sync/keyedArrays.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/toolAttention.test.d.ts +2 -0
- package/lib/typescript/commonjs/sync/toolAttention.test.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/toolUiBridge.d.ts +25 -0
- package/lib/typescript/commonjs/sync/toolUiBridge.d.ts.map +1 -1
- package/lib/typescript/commonjs/sync/typedEdit.d.ts +70 -0
- package/lib/typescript/commonjs/sync/typedEdit.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/valuePath.d.ts +52 -0
- package/lib/typescript/commonjs/sync/valuePath.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/valueShape.d.ts +77 -0
- package/lib/typescript/commonjs/sync/valueShape.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ExpandablePopover.d.ts +14 -1
- package/lib/typescript/commonjs/ui/components/ExpandablePopover.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts +1 -1
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +4 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/sync/keyedArrays.d.ts +35 -0
- package/lib/typescript/module/sync/keyedArrays.d.ts.map +1 -0
- package/lib/typescript/module/sync/toolAttention.test.d.ts +2 -0
- package/lib/typescript/module/sync/toolAttention.test.d.ts.map +1 -0
- package/lib/typescript/module/sync/toolUiBridge.d.ts +25 -0
- package/lib/typescript/module/sync/toolUiBridge.d.ts.map +1 -1
- package/lib/typescript/module/sync/typedEdit.d.ts +70 -0
- package/lib/typescript/module/sync/typedEdit.d.ts.map +1 -0
- package/lib/typescript/module/sync/valuePath.d.ts +52 -0
- package/lib/typescript/module/sync/valuePath.d.ts.map +1 -0
- package/lib/typescript/module/sync/valueShape.d.ts +77 -0
- package/lib/typescript/module/sync/valueShape.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ExpandablePopover.d.ts +14 -1
- package/lib/typescript/module/ui/components/ExpandablePopover.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A compact type sketch of a runtime value — one implementation, shared by every
|
|
3
|
+
* adapter that hands data to a model.
|
|
4
|
+
*
|
|
5
|
+
* WHY. A model cannot write a well-formed item into a list it has never seen the
|
|
6
|
+
* shape of, and we were not showing it. Measured on `cart/bag-still-zustand`: the
|
|
7
|
+
* rendered prompt is 83,000 characters and the words `lineId`, `itemId`,
|
|
8
|
+
* `sizeId`, `addonIds` and `unitPrice` appear in it ZERO times. Every model
|
|
9
|
+
* "failing" that case invented a line shape because inventing was the only move
|
|
10
|
+
* available. The zustand typed-edit guard would have caught the invention — but
|
|
11
|
+
* only on a list that already holds an item, since it builds its template from
|
|
12
|
+
* `list[0]`. On an EMPTY list there is no template, the guard has nothing to
|
|
13
|
+
* compare against, and the invented shape is written silently.
|
|
14
|
+
*
|
|
15
|
+
* So the sketch has two jobs, and the second is the one that pays:
|
|
16
|
+
*
|
|
17
|
+
* 1. Say what the items in a list look like, so an addition can match.
|
|
18
|
+
* 2. Say when NOTHING knows — an empty list's item shape is not merely
|
|
19
|
+
* unread, it is unknowable from runtime state, and the honest answer is to
|
|
20
|
+
* admit that rather than let a guess through unremarked.
|
|
21
|
+
*
|
|
22
|
+
* It is deliberately tiny. A sketch of a 120-line bag is the same size as a
|
|
23
|
+
* sketch of a 2-line one, so unlike the data it survives the engine's 24,000-
|
|
24
|
+
* character result cap — which is the whole point, because the cases where the
|
|
25
|
+
* model most needs the shape are exactly the ones where the data got cut off.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* `{lineId: string, qty: number, addonIds: string[]}` — a one-line type for a
|
|
29
|
+
* value, built from the value itself.
|
|
30
|
+
*
|
|
31
|
+
* An array is described by its FIRST item, because a list whose items disagree
|
|
32
|
+
* is a list nothing can safely add to and the guard will say so anyway. An empty
|
|
33
|
+
* array is `unknown[]`, which is the true answer and the one that matters: it
|
|
34
|
+
* tells a reader that adding to this list is unchecked.
|
|
35
|
+
*/
|
|
36
|
+
export declare function shapeOf(value: unknown, depth?: number): string;
|
|
37
|
+
export interface ListShape {
|
|
38
|
+
/** Dotted path from the value's root: `lines`, `user.addresses`. */
|
|
39
|
+
path: string;
|
|
40
|
+
/** How many items are in it right now. */
|
|
41
|
+
length: number;
|
|
42
|
+
/** The item type, or undefined when the list is empty and nothing can know it. */
|
|
43
|
+
item?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Every list inside a value, with the shape of what goes in it.
|
|
47
|
+
*
|
|
48
|
+
* This is what a caller needs before adding to a list, and it is the part that
|
|
49
|
+
* cannot be recovered from a truncated read of the data itself.
|
|
50
|
+
*
|
|
51
|
+
* A list with `item: undefined` is the warning case: it is empty, so its item
|
|
52
|
+
* shape exists nowhere in the running app — not in the store, not in the
|
|
53
|
+
* persisted copy, not in this sketch. Anything added to it goes in unchecked.
|
|
54
|
+
*/
|
|
55
|
+
export declare function listShapes(value: unknown, path?: string, out?: ListShape[], depth?: number, budget?: {
|
|
56
|
+
visited: number;
|
|
57
|
+
}): ListShape[];
|
|
58
|
+
/** True when a sketch stopped early, so a caller can say so rather than imply completeness. */
|
|
59
|
+
export declare function shapesWereTruncated(value: unknown): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The lists in a value that a caller could add to WITHOUT any way to know the
|
|
62
|
+
* item shape. Empty by definition on a healthy value; non-empty means a write
|
|
63
|
+
* into one of these paths cannot be checked by anything.
|
|
64
|
+
*/
|
|
65
|
+
export declare function unshapedLists(value: unknown): string[];
|
|
66
|
+
/**
|
|
67
|
+
* The sketch an adapter attaches to a read: the value's own type, plus the item
|
|
68
|
+
* type of every list in it.
|
|
69
|
+
*
|
|
70
|
+
* Returns undefined when there is nothing worth saying (a scalar, or an object
|
|
71
|
+
* holding no lists) so adapters can spread it and add no noise.
|
|
72
|
+
*/
|
|
73
|
+
export declare function shapeSummary(value: unknown): {
|
|
74
|
+
shape: string;
|
|
75
|
+
lists?: ListShape[];
|
|
76
|
+
} | undefined;
|
|
77
|
+
//# sourceMappingURL=valueShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueShape.d.ts","sourceRoot":"","sources":["../../../../src/sync/valueShape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAkBH;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,SAAI,GAAG,MAAM,CAkBzD;AAED,MAAM,WAAW,SAAS;IACxB,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,OAAO,EACd,IAAI,SAAK,EACT,GAAG,GAAE,SAAS,EAAO,EACrB,KAAK,SAAI,EACT,MAAM,GAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAmB,GAC3C,SAAS,EAAE,CAwBb;AAED,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI3D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CAItD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,SAAS,CAM/F"}
|
|
@@ -33,6 +33,19 @@ export interface ExpandablePopoverProps {
|
|
|
33
33
|
testID?: string;
|
|
34
34
|
/** Handle for the collapse button at the bottom of the expanded panel. */
|
|
35
35
|
collapseTestID?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Something inside needs the user — drawn on the COLLAPSED peek too.
|
|
38
|
+
*
|
|
39
|
+
* A badge on a chip nobody can see is no badge: the dock folds to a
|
|
40
|
+
* peek tab, and a minimized tool's "needs your approval" was invisible
|
|
41
|
+
* until someone happened to expand it. `color` paints the dot; `glyph`
|
|
42
|
+
* (e.g. "!") sits inside it for the case that needs a tap.
|
|
43
|
+
*/
|
|
44
|
+
attention?: {
|
|
45
|
+
color: string;
|
|
46
|
+
glyph?: string;
|
|
47
|
+
label?: string;
|
|
48
|
+
} | null;
|
|
36
49
|
}
|
|
37
|
-
export declare function ExpandablePopover({ hasItems, itemCount, showCount, width, children, expandedHeight, onExpandedChange, defaultExpanded, collapsedContent, collapsedLabel, expandedStyle, persistState, storageKey, peekHeight, testID, collapseTestID, }: ExpandablePopoverProps): React.JSX.Element | null;
|
|
50
|
+
export declare function ExpandablePopover({ hasItems, itemCount, showCount, width, children, expandedHeight, onExpandedChange, defaultExpanded, collapsedContent, collapsedLabel, attention, expandedStyle, persistState, storageKey, peekHeight, testID, collapseTestID, }: ExpandablePopoverProps): React.JSX.Element | null;
|
|
38
51
|
//# sourceMappingURL=ExpandablePopover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandablePopover.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ExpandablePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAML,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAQtB,MAAM,WAAW,sBAAsB;IACrC,mFAAmF;IACnF,QAAQ,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,8DAA8D;IAC9D,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,6BAA6B;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpandablePopover.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ExpandablePopover.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,EAML,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAQtB,MAAM,WAAW,sBAAsB;IACrC,mFAAmF;IACnF,QAAQ,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,8DAA8D;IAC9D,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,6BAA6B;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,iDAAiD;IACjD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,8DAA8D;IAC9D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACtE;AAoKD,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,SAAS,EACT,SAAgB,EAChB,KAAqB,EACrB,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,eAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,SAAgB,EAChB,aAAa,EACb,YAAoB,EACpB,UAAU,EACV,UAAgC,EAChC,MAAM,EACN,cAAc,GACf,EAAE,sBAAsB,4BAuIxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/shared-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.36",
|
|
4
4
|
"description": "Shared UI components, hooks, and utilities",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -136,10 +136,10 @@
|
|
|
136
136
|
],
|
|
137
137
|
"sideEffects": false,
|
|
138
138
|
"dependencies": {
|
|
139
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
139
|
+
"@buoy-gg/floating-tools-core": "^7.0.36"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|
|
142
|
-
"@buoy-gg/license": "7.0.
|
|
142
|
+
"@buoy-gg/license": "7.0.36",
|
|
143
143
|
"@react-native-clipboard/clipboard": "*",
|
|
144
144
|
"expo-clipboard": "*",
|
|
145
145
|
"expo-file-system": "*",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"expo-clipboard": "~7.1.5",
|
|
168
168
|
"react-native-safe-area-context": "^5.6.2",
|
|
169
169
|
"typescript": "~5.8.3",
|
|
170
|
-
"@buoy-gg/license": "^7.0.
|
|
170
|
+
"@buoy-gg/license": "^7.0.36"
|
|
171
171
|
},
|
|
172
172
|
"react-native-builder-bob": {
|
|
173
173
|
"source": "src",
|