@pyreon/dnd 0.52.0 → 0.53.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/README.md +4 -0
- package/lib/index.js +1 -1
- package/lib/native-plugin.js +269 -0
- package/lib/native-plugin.js.map +1 -0
- package/lib/types/native-plugin.d.ts +13 -0
- package/package.json +22 -7
package/README.md
CHANGED
|
@@ -207,6 +207,10 @@ useDraggable({
|
|
|
207
207
|
|
|
208
208
|
The signal-driven layer adds **near-zero overhead** over calling pdnd directly. A package-level benchmark (`bun run bench`) measures the _wrapper tax_ — the JS the ergonomic hook adds over a hand-rolled Pyreon+pdnd integration wiring the same reactive state — against the **real** pdnd build under happy-dom, with per-`(op × impl)` process isolation and a bootstrap CI95. `useDraggable` / `useDroppable` / `useSortable`-item mount→unmount lifecycles all tie the hand-rolled baseline (CI overlap); `useDragMonitor` adds ~one closure allocation per mount; per drag-event dispatch adds one optional-callback hop. Reactive DnD at ~raw-pdnd cost. The bench also measures the ROW-BINDING idiom at scale: at N=1000 sortable rows, one row-enter costs ~26µs with the naive `overId() === key` equality idiom (every row subscribes — O(N) notifies) vs ~1.5µs with the `isOverKey(key)` selector idiom (**~18× / 94% faster**, `createSelector`-backed O(2) notifies — use the selectors, they exist for exactly this). (Real pointer-gesture timing is browser-dependent and out of scope for the micro-bench; author-judge disclosed.)
|
|
209
209
|
|
|
210
|
+
## Native (iOS / Android)
|
|
211
|
+
|
|
212
|
+
`useSortable({ items, by, onReorder })` lowers to the `PyreonSortableState` engine on SwiftUI and Compose, and `ref={s.containerRef}` / `ref={s.itemRef(key)}` to the drag view modifiers (list reorder within one list — cross-list boards and the element-getter hooks have no native lowering). The compile-time half ships in this package (`src/native-plugin/`, declared in `package.json` as `pyreon.native.plugin` and discovered by `pyreon native`), not in `@pyreon/native-compiler`. `--no-plugins` builds treat the package like any unclaimed library.
|
|
213
|
+
|
|
210
214
|
## Documentation
|
|
211
215
|
|
|
212
216
|
Full docs: [pyreon.dev/docs/dnd](https://pyreon.dev/docs/dnd) (or `docs/src/content/docs/dnd.md` in this repo).
|
package/lib/index.js
CHANGED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { staticPropKey, unwrapTypeLayers } from "@pyreon/native-compiler/plugin-api";
|
|
2
|
+
|
|
3
|
+
//#region src/native-plugin/stubs.ts
|
|
4
|
+
const DND_SWIFT_STUBS = `// @pyreon/dnd — the PyreonSortableState engine + its two View modifiers.
|
|
5
|
+
// Mirrors PyreonSortable.swift EXACTLY (minus @Observable/@available, which are
|
|
6
|
+
// runtime-reactivity/availability macros rather than type-level contract — the
|
|
7
|
+
// same omission PyreonTableState/PyreonNetworkStatus document).
|
|
8
|
+
public enum PyreonSortAxis: String, Equatable { case vertical, horizontal }
|
|
9
|
+
public enum PyreonDropEdge: String, Equatable { case top, bottom, left, right }
|
|
10
|
+
public final class PyreonSortableState<T> {
|
|
11
|
+
public init(axis: PyreonSortAxis = .vertical) {}
|
|
12
|
+
public func bind(
|
|
13
|
+
items: @escaping () -> [T],
|
|
14
|
+
by: @escaping (T) -> String,
|
|
15
|
+
onReorder: @escaping ([T]) -> Void
|
|
16
|
+
) {}
|
|
17
|
+
public func isActive(_ key: String) -> Bool { false }
|
|
18
|
+
public func isOverKey(_ key: String) -> Bool { false }
|
|
19
|
+
public func activeId() -> String? { nil }
|
|
20
|
+
public func overId() -> String? { nil }
|
|
21
|
+
public func overEdge() -> String? { nil }
|
|
22
|
+
public func pickUp(_ key: String) {}
|
|
23
|
+
public func dragOver(_ key: String, edge: PyreonDropEdge) {}
|
|
24
|
+
public func dragLeave(_ key: String) {}
|
|
25
|
+
public func cancel() {}
|
|
26
|
+
@discardableResult
|
|
27
|
+
public func drop(source: String, on target: String, edge: PyreonDropEdge) -> Bool { false }
|
|
28
|
+
public static func moveIndex(_ list: [T], from: Int, to: Int) -> [T] { list }
|
|
29
|
+
public func reordered(dragKey: String, dropKey: String, edge: PyreonDropEdge) -> [T]? { nil }
|
|
30
|
+
public func edgeAt(_ point: CGPoint, in size: CGSize) -> PyreonDropEdge { .top }
|
|
31
|
+
public private(set) var activeKey: String?
|
|
32
|
+
public private(set) var overKey: String?
|
|
33
|
+
public private(set) var currentEdge: PyreonDropEdge?
|
|
34
|
+
public let axis: PyreonSortAxis = .vertical
|
|
35
|
+
}
|
|
36
|
+
extension View {
|
|
37
|
+
public func pyreonSortableItem<T>(
|
|
38
|
+
_ state: PyreonSortableState<T>,
|
|
39
|
+
key: String
|
|
40
|
+
) -> some View { self }
|
|
41
|
+
public func pyreonSortableContainer<T>(
|
|
42
|
+
_ state: PyreonSortableState<T>
|
|
43
|
+
) -> some View { self }
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
const DND_KOTLIN_STUBS = `// @pyreon/dnd — the PyreonSortableState engine. Mirrors PyreonSortable.kt.
|
|
47
|
+
// The Modifier extensions it pairs with (PyreonSortableModifier.kt) are top-level
|
|
48
|
+
// extensions on Modifier in the real runtime, and are declared the same way here.
|
|
49
|
+
enum class PyreonSortAxis { VERTICAL, HORIZONTAL }
|
|
50
|
+
enum class PyreonDropEdge { TOP, BOTTOM, LEFT, RIGHT }
|
|
51
|
+
class PyreonSortableState<T>(
|
|
52
|
+
val axis: PyreonSortAxis = PyreonSortAxis.VERTICAL,
|
|
53
|
+
) {
|
|
54
|
+
fun bind(items: () -> List<T>, by: (T) -> String, onReorder: (List<T>) -> Unit) {}
|
|
55
|
+
fun isActive(key: String): Boolean = false
|
|
56
|
+
fun isOverKey(key: String): Boolean = false
|
|
57
|
+
fun activeId(): String? = null
|
|
58
|
+
fun overId(): String? = null
|
|
59
|
+
fun overEdge(): String? = null
|
|
60
|
+
fun pickUp(key: String) {}
|
|
61
|
+
fun dragBy(delta: Float, extent: Float) {}
|
|
62
|
+
fun drop(): Boolean = false
|
|
63
|
+
fun cancel() {}
|
|
64
|
+
fun reordered(dragKey: String, dropKey: String, edge: PyreonDropEdge): List<T>? = null
|
|
65
|
+
val activeKey: String? get() = null
|
|
66
|
+
val overKey: String? get() = null
|
|
67
|
+
val currentEdge: PyreonDropEdge? get() = null
|
|
68
|
+
companion object {
|
|
69
|
+
fun <T> moveIndex(list: List<T>, from: Long, to: Long): List<T> = list
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
@Suppress("UNUSED_PARAMETER")
|
|
73
|
+
fun <T> Modifier.pyreonSortableItem(state: PyreonSortableState<T>, key: String): Modifier = this
|
|
74
|
+
@Suppress("UNUSED_PARAMETER")
|
|
75
|
+
fun <T> Modifier.pyreonSortableContainer(state: PyreonSortableState<T>): Modifier = this
|
|
76
|
+
`;
|
|
77
|
+
/** The `PyreonSortableState` compile-gate stubs, appended only to an emit that names the engine or its modifiers. */
|
|
78
|
+
const dndStubs = {
|
|
79
|
+
swift: (source) => /\bPyreonSort(?:ableState|Axis)\b|\bpyreonSortable(?:Item|Container)\b/.test(source) ? DND_SWIFT_STUBS : "",
|
|
80
|
+
kotlin: (source) => /\bPyreonSort(?:ableState|Axis)\b|\bpyreonSortable(?:Item|Container)\b/.test(source) ? DND_KOTLIN_STUBS : ""
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/native-plugin/plugin.ts
|
|
85
|
+
const SORTABLE_TYPE = "sortable";
|
|
86
|
+
const DND_PLUGIN_NAME = "@pyreon/dnd";
|
|
87
|
+
const payloadOf = (decl) => decl.payload;
|
|
88
|
+
const recognizeSortable = (_call, ctx) => {
|
|
89
|
+
const name = ctx.declName;
|
|
90
|
+
const configArg = unwrapTypeLayers(ctx.args[0]);
|
|
91
|
+
if (!configArg || configArg.type !== "ObjectExpression") {
|
|
92
|
+
ctx.report(`useSortable declaration \`${name}\`: argument must be an object literal { items, by, onReorder } to lower natively. Falling back to silent-drop.`);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
let itemsBody;
|
|
96
|
+
let keyParam;
|
|
97
|
+
let keyBody;
|
|
98
|
+
let reorderParam;
|
|
99
|
+
let reorderBody;
|
|
100
|
+
let axis = "vertical";
|
|
101
|
+
for (const prop of configArg.properties ?? []) {
|
|
102
|
+
if (prop?.type !== "Property" && prop?.type !== "ObjectProperty") continue;
|
|
103
|
+
if (ctx.hasDynamicKey(prop)) {
|
|
104
|
+
ctx.warnDynamicKey(prop, `useSortable declaration \`${name}\`: config`);
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
const keyName = staticPropKey(prop);
|
|
108
|
+
if (!keyName) continue;
|
|
109
|
+
const valueNode = unwrapTypeLayers(prop.value);
|
|
110
|
+
if (keyName === "items") {
|
|
111
|
+
if ((valueNode?.type === "ArrowFunctionExpression" || valueNode?.type === "FunctionExpression") && valueNode.body?.type !== "BlockStatement") itemsBody = ctx.expr(valueNode.body);
|
|
112
|
+
} else if (keyName === "by") {
|
|
113
|
+
if (valueNode?.type === "ArrowFunctionExpression" && valueNode.params?.length === 1 && valueNode.body?.type !== "BlockStatement") {
|
|
114
|
+
const p = valueNode.params[0]?.name;
|
|
115
|
+
if (p !== void 0) {
|
|
116
|
+
keyParam = p;
|
|
117
|
+
keyBody = ctx.expr(valueNode.body);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
} else if (keyName === "onReorder") {
|
|
121
|
+
if (valueNode?.type === "ArrowFunctionExpression") {
|
|
122
|
+
reorderParam = (valueNode.params?.[0])?.name ?? "next";
|
|
123
|
+
reorderBody = valueNode.body?.type === "BlockStatement" ? ctx.statements(valueNode.body) : [{
|
|
124
|
+
kind: "expr",
|
|
125
|
+
expr: ctx.expr(valueNode.body)
|
|
126
|
+
}];
|
|
127
|
+
}
|
|
128
|
+
} else if (keyName === "axis") {
|
|
129
|
+
if (valueNode?.type === "Literal" && valueNode.value === "horizontal") axis = "horizontal";
|
|
130
|
+
} else if (keyName === "groupId" || keyName === "onCrossListDrop" || keyName === "onCrossListReceive") ctx.report(`useSortable declaration \`${name}\`: \`${keyName}\` (cross-list boards) has NO native lowering — the native engine reorders WITHIN one list only, so a drag between two lists will not fire on iOS/Android. Keep a cross-list board behind a \`<Web>\` escape hatch, or model the move explicitly (remove from one signal, insert into the other).`);
|
|
131
|
+
else if (keyName === "label") ctx.report(`useSortable declaration \`${name}\`: \`label\` (screen-reader announcement text) is not used natively — VoiceOver/TalkBack announce the item's own accessibility label instead. Set \`accessibilityLabel\` on the row for a native-friendly announcement.`);
|
|
132
|
+
}
|
|
133
|
+
if (!itemsBody) {
|
|
134
|
+
ctx.report(`useSortable declaration \`${name}\`: \`items\` must be an expression-body getter (\`() => rows()\`) to lower natively. Falling back to silent-drop.`);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (keyParam === void 0 || !keyBody) {
|
|
138
|
+
ctx.report(`useSortable declaration \`${name}\`: \`by\` must be a single-param expression-body arrow (\`(item) => item.id\`) to lower natively. Falling back to silent-drop.`);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (reorderParam === void 0 || !reorderBody) {
|
|
142
|
+
ctx.report(`useSortable declaration \`${name}\`: \`onReorder\` must be an arrow function (\`(next) => items.set(next)\`) to lower natively. Falling back to silent-drop.`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
type: SORTABLE_TYPE,
|
|
147
|
+
payload: {
|
|
148
|
+
itemsBody,
|
|
149
|
+
keyParam,
|
|
150
|
+
keyBody,
|
|
151
|
+
reorderParam,
|
|
152
|
+
reorderBody,
|
|
153
|
+
axis
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const rowElement = (type) => type.kind === "array" ? type.element : { kind: "unknown" };
|
|
158
|
+
/**
|
|
159
|
+
* The `by` key, coerced to `String`. The web `by` returns `string | number` (both are valid `<For by>` keys), but
|
|
160
|
+
* the native engine keys on `String` so one drag payload type serves every row type — `String` already conforms
|
|
161
|
+
* to `Transferable`, which is what lets a consumer's row type stay conformance-free. A string-typed key passes
|
|
162
|
+
* through unchanged; anything else is interpolated (total, and identical to `String(describing:)` for the scalar
|
|
163
|
+
* keys this accepts).
|
|
164
|
+
*/
|
|
165
|
+
const swiftKey = (ctx, key, at) => {
|
|
166
|
+
const emitted = ctx.expr(key, at);
|
|
167
|
+
return ctx.inferType(key).kind === "string" ? emitted : `"\\(${emitted})"`;
|
|
168
|
+
};
|
|
169
|
+
const kotlinKey = (ctx, key, at) => {
|
|
170
|
+
const emitted = ctx.expr(key, at);
|
|
171
|
+
return ctx.inferType(key).kind === "string" ? emitted : `(${emitted}).toString()`;
|
|
172
|
+
};
|
|
173
|
+
const sortableDecl = {
|
|
174
|
+
legacyKind: SORTABLE_TYPE,
|
|
175
|
+
lifecycle: {
|
|
176
|
+
stableHost: true,
|
|
177
|
+
midOrder: 20,
|
|
178
|
+
swift(decl, ctx) {
|
|
179
|
+
const { itemsBody, keyParam, keyBody, reorderParam, reorderBody } = payloadOf(decl);
|
|
180
|
+
const name = ctx.ident(decl.name);
|
|
181
|
+
const body = reorderBody.length === 0 ? [""] : ctx.statements(reorderBody, 10).map((st) => ` ${st}`);
|
|
182
|
+
return [
|
|
183
|
+
`.onAppear {`,
|
|
184
|
+
` ${name}.bind(`,
|
|
185
|
+
` items: { ${ctx.expr(itemsBody, 10)} },`,
|
|
186
|
+
` by: { ${ctx.ident(keyParam)} in ${swiftKey(ctx, keyBody, 10)} },`,
|
|
187
|
+
` onReorder: { ${ctx.ident(reorderParam)} in`,
|
|
188
|
+
...body,
|
|
189
|
+
` }`,
|
|
190
|
+
` )`,
|
|
191
|
+
`}`
|
|
192
|
+
];
|
|
193
|
+
},
|
|
194
|
+
kotlin(decl, ctx) {
|
|
195
|
+
const { itemsBody, keyParam, keyBody, reorderParam, reorderBody } = payloadOf(decl);
|
|
196
|
+
const body = reorderBody.length === 0 ? [""] : ctx.statements(reorderBody, 4).map((st) => ` ${st}`);
|
|
197
|
+
return [
|
|
198
|
+
`${ctx.ident(decl.name)}.bind({ ${ctx.expr(itemsBody, 2)} }, { ${ctx.ident(keyParam)} -> ${kotlinKey(ctx, keyBody, 2)} }) { ${ctx.ident(reorderParam)} ->`,
|
|
199
|
+
...body,
|
|
200
|
+
`}`
|
|
201
|
+
];
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
swift(decl, ctx) {
|
|
205
|
+
const { itemsBody, axis } = payloadOf(decl);
|
|
206
|
+
const element = rowElement(ctx.inferType(itemsBody));
|
|
207
|
+
const axisArg = axis === "horizontal" ? "axis: .horizontal" : "";
|
|
208
|
+
return `@State private var ${ctx.ident(decl.name)} = PyreonSortableState<${ctx.rowType(element)}>(${axisArg})`;
|
|
209
|
+
},
|
|
210
|
+
kotlin(decl, ctx) {
|
|
211
|
+
const { itemsBody, axis } = payloadOf(decl);
|
|
212
|
+
const element = rowElement(ctx.inferType(itemsBody));
|
|
213
|
+
const axisArg = axis === "horizontal" ? "PyreonSortAxis.HORIZONTAL" : "";
|
|
214
|
+
return `val ${ctx.ident(decl.name)} = remember { PyreonSortableState<${ctx.rowType(element)}>(${axisArg}) }`;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
function classifyRef(value, isSortable) {
|
|
218
|
+
if (value.kind === "member" && value.property === "containerRef" && value.object.kind === "identifier" && isSortable(value.object.name)) return {
|
|
219
|
+
kind: "container",
|
|
220
|
+
state: value.object.name
|
|
221
|
+
};
|
|
222
|
+
if (value.kind === "call" && value.callee.kind === "member" && value.callee.property === "itemRef" && value.callee.object.kind === "identifier" && isSortable(value.callee.object.name) && value.args.length === 1) return {
|
|
223
|
+
kind: "item",
|
|
224
|
+
state: value.callee.object.name,
|
|
225
|
+
key: value.args[0]
|
|
226
|
+
};
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
const bindsSortable = (ctx) => (name) => ctx.decls(DND_PLUGIN_NAME, SORTABLE_TYPE).some((d) => d.name === name);
|
|
230
|
+
/**
|
|
231
|
+
* `ref={s.containerRef}` / `ref={s.itemRef(key)}` → the sortable modifiers. Appended LAST so the drag wrapper sits
|
|
232
|
+
* outside the element's own padding / background, which is what an author writing the SwiftUI by hand would do
|
|
233
|
+
* (the lifted row carries its styling with it).
|
|
234
|
+
*/
|
|
235
|
+
const sortableRefs = {
|
|
236
|
+
swift(ref, _el, ctx) {
|
|
237
|
+
const binding = classifyRef(ref, bindsSortable(ctx));
|
|
238
|
+
if (binding === null) return void 0;
|
|
239
|
+
const state = ctx.ident(binding.state);
|
|
240
|
+
return binding.kind === "container" ? `.pyreonSortableContainer(${state})` : `.pyreonSortableItem(${state}, key: ${swiftKey(ctx, binding.key, 0)})`;
|
|
241
|
+
},
|
|
242
|
+
kotlin(ref, _el, ctx) {
|
|
243
|
+
const binding = classifyRef(ref, bindsSortable(ctx));
|
|
244
|
+
if (binding === null) return void 0;
|
|
245
|
+
const state = ctx.ident(binding.state);
|
|
246
|
+
return binding.kind === "container" ? `.pyreonSortableContainer(${state})` : `.pyreonSortableItem(${state}, ${kotlinKey(ctx, binding.key, 0)})`;
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
/**
|
|
250
|
+
* The `@pyreon/dnd` native plugin. Shipped by `@pyreon/dnd` itself and discovered from its manifest
|
|
251
|
+
* (`pyreon.native.plugin`) when a source file imports the package.
|
|
252
|
+
*/
|
|
253
|
+
const dndPlugin = {
|
|
254
|
+
name: DND_PLUGIN_NAME,
|
|
255
|
+
apiVersion: 2,
|
|
256
|
+
modules: ["@pyreon/dnd"],
|
|
257
|
+
calls: { useSortable: recognizeSortable },
|
|
258
|
+
decls: { [SORTABLE_TYPE]: sortableDecl },
|
|
259
|
+
refModifiers: sortableRefs,
|
|
260
|
+
unlowered: { "@pyreon/dnd": {
|
|
261
|
+
supported: ["useSortable"],
|
|
262
|
+
advice: "`useSortable({ items, by, onReorder })` DOES lower — it emits the native PyreonSortableState engine, and `ref={s.containerRef}` / `ref={s.itemRef(key)}` become SwiftUI .draggable/.dropDestination + Compose long-press drag modifiers. The element-getter hooks (useDraggable/useDroppable) are imperative DOM registration, useDragMonitor is a page-global drag bus, and useFileDrop is OS-level file DnD — none of the three has a native analogue"
|
|
263
|
+
} },
|
|
264
|
+
stubs: dndStubs
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
//#endregion
|
|
268
|
+
export { dndPlugin as default, dndPlugin, dndStubs };
|
|
269
|
+
//# sourceMappingURL=native-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native-plugin.js","names":[],"sources":["../src/native-plugin/stubs.ts","../src/native-plugin/plugin.ts"],"sourcesContent":["/**\n * The compile-gate stubs the `@pyreon/dnd` lowering's emit needs beyond the SwiftUI / Compose stub bundle: the\n * `PyreonSortableState` engine a `useSortable` declaration emits and the two modifiers `ref={s.containerRef}` /\n * `ref={s.itemRef(key)}` lower to. They mirror the REAL runtimes (`@pyreon/dnd/native`) exactly — a superset stub\n * masks real breakage, a narrower one manufactures it.\n *\n * Appended to the bundle only for an emit that names the engine (see {@link dndStubs}); the compiler never reads them.\n */\n\nimport type { StubAugmentation } from '@pyreon/native-compiler/plugin-api'\n\nexport const DND_SWIFT_STUBS = `// @pyreon/dnd — the PyreonSortableState engine + its two View modifiers.\n// Mirrors PyreonSortable.swift EXACTLY (minus @Observable/@available, which are\n// runtime-reactivity/availability macros rather than type-level contract — the\n// same omission PyreonTableState/PyreonNetworkStatus document).\npublic enum PyreonSortAxis: String, Equatable { case vertical, horizontal }\npublic enum PyreonDropEdge: String, Equatable { case top, bottom, left, right }\npublic final class PyreonSortableState<T> {\n public init(axis: PyreonSortAxis = .vertical) {}\n public func bind(\n items: @escaping () -> [T],\n by: @escaping (T) -> String,\n onReorder: @escaping ([T]) -> Void\n ) {}\n public func isActive(_ key: String) -> Bool { false }\n public func isOverKey(_ key: String) -> Bool { false }\n public func activeId() -> String? { nil }\n public func overId() -> String? { nil }\n public func overEdge() -> String? { nil }\n public func pickUp(_ key: String) {}\n public func dragOver(_ key: String, edge: PyreonDropEdge) {}\n public func dragLeave(_ key: String) {}\n public func cancel() {}\n @discardableResult\n public func drop(source: String, on target: String, edge: PyreonDropEdge) -> Bool { false }\n public static func moveIndex(_ list: [T], from: Int, to: Int) -> [T] { list }\n public func reordered(dragKey: String, dropKey: String, edge: PyreonDropEdge) -> [T]? { nil }\n public func edgeAt(_ point: CGPoint, in size: CGSize) -> PyreonDropEdge { .top }\n public private(set) var activeKey: String?\n public private(set) var overKey: String?\n public private(set) var currentEdge: PyreonDropEdge?\n public let axis: PyreonSortAxis = .vertical\n}\nextension View {\n public func pyreonSortableItem<T>(\n _ state: PyreonSortableState<T>,\n key: String\n ) -> some View { self }\n public func pyreonSortableContainer<T>(\n _ state: PyreonSortableState<T>\n ) -> some View { self }\n}\n`\n\nexport const DND_KOTLIN_STUBS = `// @pyreon/dnd — the PyreonSortableState engine. Mirrors PyreonSortable.kt.\n// The Modifier extensions it pairs with (PyreonSortableModifier.kt) are top-level\n// extensions on Modifier in the real runtime, and are declared the same way here.\nenum class PyreonSortAxis { VERTICAL, HORIZONTAL }\nenum class PyreonDropEdge { TOP, BOTTOM, LEFT, RIGHT }\nclass PyreonSortableState<T>(\n val axis: PyreonSortAxis = PyreonSortAxis.VERTICAL,\n) {\n fun bind(items: () -> List<T>, by: (T) -> String, onReorder: (List<T>) -> Unit) {}\n fun isActive(key: String): Boolean = false\n fun isOverKey(key: String): Boolean = false\n fun activeId(): String? = null\n fun overId(): String? = null\n fun overEdge(): String? = null\n fun pickUp(key: String) {}\n fun dragBy(delta: Float, extent: Float) {}\n fun drop(): Boolean = false\n fun cancel() {}\n fun reordered(dragKey: String, dropKey: String, edge: PyreonDropEdge): List<T>? = null\n val activeKey: String? get() = null\n val overKey: String? get() = null\n val currentEdge: PyreonDropEdge? get() = null\n companion object {\n fun <T> moveIndex(list: List<T>, from: Long, to: Long): List<T> = list\n }\n}\n@Suppress(\"UNUSED_PARAMETER\")\nfun <T> Modifier.pyreonSortableItem(state: PyreonSortableState<T>, key: String): Modifier = this\n@Suppress(\"UNUSED_PARAMETER\")\nfun <T> Modifier.pyreonSortableContainer(state: PyreonSortableState<T>): Modifier = this\n`\n\n/** The `PyreonSortableState` compile-gate stubs, appended only to an emit that names the engine or its modifiers. */\nexport const dndStubs: StubAugmentation = {\n swift: (source) => (/\\bPyreonSort(?:ableState|Axis)\\b|\\bpyreonSortable(?:Item|Container)\\b/.test(source) ? DND_SWIFT_STUBS : ''),\n kotlin: (source) => (/\\bPyreonSort(?:ableState|Axis)\\b|\\bpyreonSortable(?:Item|Container)\\b/.test(source) ? DND_KOTLIN_STUBS : ''),\n}\n","// How `@pyreon/dnd` crosses to native: `const s = useSortable({ items, by, onReorder, axis? })` lowers to the\n// `PyreonSortableState` engine both runtimes ship (list REORDER within one list). The web hook returns ref\n// callbacks the author attaches to DOM nodes; on native `ref={s.containerRef}` / `ref={s.itemRef(key)}` become\n// SwiftUI `.draggable` / `.dropDestination` and Compose long-press drag modifiers. The engine reads its source\n// and reorder sink through closures over the component's own state, so they are bound where the compiler binds\n// containers (`midOrder`): `.onAppear` on SwiftUI (a `@State` initializer cannot capture `self`), a `bind` call\n// in the composable body on Compose.\n//\n// v1 lowers the four load-bearing options. Options that would silently do NOTHING natively — `groupId` /\n// `onCrossListDrop` / `onCrossListReceive` (cross-list boards) and `label` (screen-reader announcement text) —\n// WARN by name rather than being dropped without a word, because a board that quietly stops accepting\n// cross-list drops on device is the worst possible failure.\n\nimport {\n staticPropKey,\n unwrapTypeLayers,\n type CallRecognizer,\n type CompilerPlugin,\n type DeclEmitter,\n type EmitContext,\n type ExprIR,\n type ExtDecl,\n type RefModifierLowering,\n type StatementIR,\n type TypeIR,\n} from '@pyreon/native-compiler/plugin-api'\nimport { dndStubs } from './stubs'\n\n// biome-ignore lint/suspicious/noExplicitAny: ESTree nodes are read structurally, as in the compiler.\ntype AnyNode = any\n\nconst SORTABLE_TYPE = 'sortable'\nexport const DND_PLUGIN_NAME = '@pyreon/dnd'\n\ninterface SortablePayload {\n readonly itemsBody: ExprIR\n readonly keyParam: string\n readonly keyBody: ExprIR\n readonly reorderParam: string\n readonly reorderBody: readonly StatementIR[]\n readonly axis: 'vertical' | 'horizontal'\n}\n\nconst payloadOf = (decl: ExtDecl): SortablePayload => decl.payload as unknown as SortablePayload\n\nconst recognizeSortable: CallRecognizer = (_call, ctx) => {\n const name = ctx.declName\n const configArg = unwrapTypeLayers(ctx.args[0] as AnyNode | undefined)\n if (!configArg || configArg.type !== 'ObjectExpression') {\n ctx.report(\n `useSortable declaration \\`${name}\\`: argument must be an object literal { items, by, onReorder } to lower natively. Falling back to silent-drop.`,\n )\n return undefined\n }\n\n let itemsBody: ExprIR | undefined\n let keyParam: string | undefined\n let keyBody: ExprIR | undefined\n let reorderParam: string | undefined\n let reorderBody: StatementIR[] | undefined\n let axis: 'vertical' | 'horizontal' = 'vertical'\n\n for (const prop of (configArg.properties as AnyNode[] | undefined) ?? []) {\n if (prop?.type !== 'Property' && prop?.type !== 'ObjectProperty') continue\n if (ctx.hasDynamicKey(prop)) {\n ctx.warnDynamicKey(prop, `useSortable declaration \\`${name}\\`: config`)\n continue\n }\n const keyName = staticPropKey(prop)\n if (!keyName) continue\n const valueNode = unwrapTypeLayers(prop.value as AnyNode | undefined)\n\n if (keyName === 'items') {\n // `items: () => rows()` — an expression-body getter, the same contract as createTableState's `data`.\n if ((valueNode?.type === 'ArrowFunctionExpression' || valueNode?.type === 'FunctionExpression') && valueNode.body?.type !== 'BlockStatement') {\n itemsBody = ctx.expr(valueNode.body as AnyNode)\n }\n } else if (keyName === 'by') {\n if (valueNode?.type === 'ArrowFunctionExpression' && (valueNode.params as AnyNode[] | undefined)?.length === 1 && valueNode.body?.type !== 'BlockStatement') {\n const p = ((valueNode.params as AnyNode[])[0] as AnyNode | undefined)?.name as string | undefined\n if (p !== undefined) {\n keyParam = p\n keyBody = ctx.expr(valueNode.body as AnyNode)\n }\n }\n } else if (keyName === 'onReorder') {\n // A VOID callback, so an expression body must lower to a bare expression statement — NOT a function declaration,\n // whose `return <expr>` is invalid inside a Kotlin lambda (`return` there targets the enclosing function, and an\n // assignment is not an expression).\n if (valueNode?.type === 'ArrowFunctionExpression') {\n const p = ((valueNode.params as AnyNode[] | undefined)?.[0] as AnyNode | undefined)?.name as string | undefined\n reorderParam = p ?? 'next'\n reorderBody =\n valueNode.body?.type === 'BlockStatement'\n ? ctx.statements(valueNode.body as AnyNode)\n : [{ kind: 'expr' as const, expr: ctx.expr(valueNode.body as AnyNode) }]\n }\n } else if (keyName === 'axis') {\n if (valueNode?.type === 'Literal' && valueNode.value === 'horizontal') axis = 'horizontal'\n } else if (keyName === 'groupId' || keyName === 'onCrossListDrop' || keyName === 'onCrossListReceive') {\n ctx.report(\n `useSortable declaration \\`${name}\\`: \\`${keyName}\\` (cross-list boards) has NO native lowering — the native engine reorders WITHIN one list only, so a drag between two lists will not fire on iOS/Android. Keep a cross-list board behind a \\`<Web>\\` escape hatch, or model the move explicitly (remove from one signal, insert into the other).`,\n )\n } else if (keyName === 'label') {\n ctx.report(\n `useSortable declaration \\`${name}\\`: \\`label\\` (screen-reader announcement text) is not used natively — VoiceOver/TalkBack announce the item's own accessibility label instead. Set \\`accessibilityLabel\\` on the row for a native-friendly announcement.`,\n )\n }\n }\n\n if (!itemsBody) {\n ctx.report(\n `useSortable declaration \\`${name}\\`: \\`items\\` must be an expression-body getter (\\`() => rows()\\`) to lower natively. Falling back to silent-drop.`,\n )\n return undefined\n }\n if (keyParam === undefined || !keyBody) {\n ctx.report(\n `useSortable declaration \\`${name}\\`: \\`by\\` must be a single-param expression-body arrow (\\`(item) => item.id\\`) to lower natively. Falling back to silent-drop.`,\n )\n return undefined\n }\n if (reorderParam === undefined || !reorderBody) {\n ctx.report(\n `useSortable declaration \\`${name}\\`: \\`onReorder\\` must be an arrow function (\\`(next) => items.set(next)\\`) to lower natively. Falling back to silent-drop.`,\n )\n return undefined\n }\n return { type: SORTABLE_TYPE, payload: { itemsBody, keyParam, keyBody, reorderParam, reorderBody, axis } as never }\n}\n\nconst rowElement = (type: TypeIR): TypeIR => (type.kind === 'array' ? type.element : { kind: 'unknown' })\n\n/**\n * The `by` key, coerced to `String`. The web `by` returns `string | number` (both are valid `<For by>` keys), but\n * the native engine keys on `String` so one drag payload type serves every row type — `String` already conforms\n * to `Transferable`, which is what lets a consumer's row type stay conformance-free. A string-typed key passes\n * through unchanged; anything else is interpolated (total, and identical to `String(describing:)` for the scalar\n * keys this accepts).\n */\nconst swiftKey = (ctx: EmitContext, key: ExprIR, at: number): string => {\n const emitted = ctx.expr(key, at)\n return ctx.inferType(key).kind === 'string' ? emitted : `\"\\\\(${emitted})\"`\n}\nconst kotlinKey = (ctx: EmitContext, key: ExprIR, at: number): string => {\n const emitted = ctx.expr(key, at)\n return ctx.inferType(key).kind === 'string' ? emitted : `(${emitted}).toString()`\n}\n\nconst sortableDecl: DeclEmitter = {\n // The declaration was a closed `sortable` compiler kind before it moved here; the struct names the compiler\n // derives from a declaration's shape hash it under that name, so emitted names did not move.\n legacyKind: SORTABLE_TYPE,\n lifecycle: {\n // A `.onAppear` on a transparent conditional would restart with every branch flip (see `DeclLifecycle.stableHost`).\n stableHost: true,\n midOrder: 20,\n swift(decl, ctx) {\n const { itemsBody, keyParam, keyBody, reorderParam, reorderBody } = payloadOf(decl)\n const name = ctx.ident(decl.name)\n // An empty callback body is ONE blank line (the statements joined), which a caller leaves unindented.\n const body = reorderBody.length === 0 ? [''] : ctx.statements(reorderBody, 10).map((st) => ` ${st}`)\n return [\n `.onAppear {`,\n ` ${name}.bind(`,\n ` items: { ${ctx.expr(itemsBody, 10)} },`,\n ` by: { ${ctx.ident(keyParam)} in ${swiftKey(ctx, keyBody, 10)} },`,\n ` onReorder: { ${ctx.ident(reorderParam)} in`,\n ...body,\n ` }`,\n ` )`,\n `}`,\n ]\n },\n kotlin(decl, ctx) {\n const { itemsBody, keyParam, keyBody, reorderParam, reorderBody } = payloadOf(decl)\n const body = reorderBody.length === 0 ? [''] : ctx.statements(reorderBody, 4).map((st) => ` ${st}`)\n return [\n `${ctx.ident(decl.name)}.bind({ ${ctx.expr(itemsBody, 2)} }, { ${ctx.ident(keyParam)} -> ${kotlinKey(ctx, keyBody, 2)} }) { ${ctx.ident(reorderParam)} ->`,\n ...body,\n `}`,\n ]\n },\n },\n swift(decl, ctx) {\n const { itemsBody, axis } = payloadOf(decl)\n const element = rowElement(ctx.inferType(itemsBody))\n const axisArg = axis === 'horizontal' ? 'axis: .horizontal' : ''\n return `@State private var ${ctx.ident(decl.name)} = PyreonSortableState<${ctx.rowType(element)}>(${axisArg})`\n },\n kotlin(decl, ctx) {\n const { itemsBody, axis } = payloadOf(decl)\n const element = rowElement(ctx.inferType(itemsBody))\n const axisArg = axis === 'horizontal' ? 'PyreonSortAxis.HORIZONTAL' : ''\n return `val ${ctx.ident(decl.name)} = remember { PyreonSortableState<${ctx.rowType(element)}>(${axisArg}) }`\n },\n}\n\n/** What a `ref` value binds: the sortable's container, or one item by key. `null` for every other ref, which keeps its existing behaviour. */\ntype SortableRefBinding = { readonly kind: 'container'; readonly state: string } | { readonly kind: 'item'; readonly state: string; readonly key: ExprIR }\n\nfunction classifyRef(value: ExprIR, isSortable: (name: string) => boolean): SortableRefBinding | null {\n // `ref={s.containerRef}` — a bare member read.\n if (value.kind === 'member' && value.property === 'containerRef' && value.object.kind === 'identifier' && isSortable(value.object.name)) {\n return { kind: 'container', state: value.object.name }\n }\n // `ref={s.itemRef(key)}` — a one-argument call on the member.\n if (\n value.kind === 'call' &&\n value.callee.kind === 'member' &&\n value.callee.property === 'itemRef' &&\n value.callee.object.kind === 'identifier' &&\n isSortable(value.callee.object.name) &&\n value.args.length === 1\n ) {\n return { kind: 'item', state: value.callee.object.name, key: value.args[0] as ExprIR }\n }\n return null\n}\n\nconst bindsSortable = (ctx: EmitContext) => (name: string) => ctx.decls(DND_PLUGIN_NAME, SORTABLE_TYPE).some((d) => d.name === name)\n\n/**\n * `ref={s.containerRef}` / `ref={s.itemRef(key)}` → the sortable modifiers. Appended LAST so the drag wrapper sits\n * outside the element's own padding / background, which is what an author writing the SwiftUI by hand would do\n * (the lifted row carries its styling with it).\n */\nconst sortableRefs: RefModifierLowering = {\n swift(ref, _el, ctx) {\n const binding = classifyRef(ref, bindsSortable(ctx))\n if (binding === null) return undefined\n const state = ctx.ident(binding.state)\n return binding.kind === 'container' ? `.pyreonSortableContainer(${state})` : `.pyreonSortableItem(${state}, key: ${swiftKey(ctx, binding.key, 0)})`\n },\n kotlin(ref, _el, ctx) {\n const binding = classifyRef(ref, bindsSortable(ctx))\n if (binding === null) return undefined\n const state = ctx.ident(binding.state)\n return binding.kind === 'container' ? `.pyreonSortableContainer(${state})` : `.pyreonSortableItem(${state}, ${kotlinKey(ctx, binding.key, 0)})`\n },\n}\n\n/**\n * The `@pyreon/dnd` native plugin. Shipped by `@pyreon/dnd` itself and discovered from its manifest\n * (`pyreon.native.plugin`) when a source file imports the package.\n */\nexport const dndPlugin: CompilerPlugin = {\n name: DND_PLUGIN_NAME,\n apiVersion: 2,\n modules: ['@pyreon/dnd'],\n calls: { useSortable: recognizeSortable },\n decls: { [SORTABLE_TYPE]: sortableDecl },\n refModifiers: sortableRefs,\n // `useSortable` lowers; the rest do not, and the reasons differ per hook rather than per package — so name the one\n // that crosses instead of letting the blanket \"web-only\" line imply none do.\n //\n // useDraggable / useDroppable take `element: () => HTMLElement | null` — an imperative DOM-registration shape with no\n // declarative analogue on either target. useDragMonitor is a page-global drag bus neither SwiftUI nor Compose\n // exposes. useFileDrop is an OS-level file drag between apps (iPad multitasking / Android multi-window), a different\n // model entirely.\n unlowered: {\n '@pyreon/dnd': {\n supported: ['useSortable'],\n advice:\n '`useSortable({ items, by, onReorder })` DOES lower — it emits the native PyreonSortableState engine, and `ref={s.containerRef}` / `ref={s.itemRef(key)}` become SwiftUI .draggable/.dropDestination + Compose long-press drag modifiers. The element-getter hooks (useDraggable/useDroppable) are imperative DOM registration, useDragMonitor is a page-global drag bus, and useFileDrop is OS-level file DnD — none of the three has a native analogue',\n },\n },\n stubs: dndStubs,\n}\n"],"mappings":";;;AAWA,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,IAAI,MAAM,QAAQ,KAAK;EACrC,OAAO,QAAQ,SAAS,cAAc,4BAA4B,MAAM,KAAK,uBAAuB,MAAM,IAAI,UAAU,KAAK,QAAQ,KAAK,CAAC,EAAE;CAC/I;AACF;;;;;AAMA,MAAa,YAA4B;CACvC,MAAM;CACN,YAAY;CACZ,SAAS,CAAC,aAAa;CACvB,OAAO,EAAE,aAAa,kBAAkB;CACxC,OAAO,GAAG,gBAAgB,aAAa;CACvC,cAAc;CAQd,WAAW,EACT,eAAe;EACb,WAAW,CAAC,aAAa;EACzB,QACE;CACJ,EACF;CACA,OAAO;AACT"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CompilerPlugin, StubAugmentation } from "@pyreon/native-compiler/plugin-api";
|
|
2
|
+
//#region src/native-plugin/plugin.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The `@pyreon/dnd` native plugin. Shipped by `@pyreon/dnd` itself and discovered from its manifest
|
|
5
|
+
* (`pyreon.native.plugin`) when a source file imports the package.
|
|
6
|
+
*/
|
|
7
|
+
export declare const dndPlugin: CompilerPlugin;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/native-plugin/stubs.d.ts
|
|
10
|
+
/** The `PyreonSortableState` compile-gate stubs, appended only to an emit that names the engine or its modifiers. */
|
|
11
|
+
export declare const dndStubs: StubAugmentation;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { dndPlugin as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pyreon/dnd",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "Signal-driven drag and drop for Pyreon — wraps @atlaskit/pragmatic-drag-and-drop",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/pyreon/pyreon/tree/main/packages/fundamentals/dnd#readme",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
".": {
|
|
19
19
|
"import": "./lib/index.js",
|
|
20
20
|
"types": "./lib/types/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./native-plugin": {
|
|
23
|
+
"import": "./lib/native-plugin.js",
|
|
24
|
+
"types": "./lib/types/native-plugin.d.ts"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"files": [
|
|
@@ -38,21 +42,28 @@
|
|
|
38
42
|
"lint": "oxlint ."
|
|
39
43
|
},
|
|
40
44
|
"peerDependencies": {
|
|
41
|
-
"@pyreon/core": "^0.
|
|
42
|
-
"@pyreon/reactivity": "^0.
|
|
45
|
+
"@pyreon/core": "^0.53.0",
|
|
46
|
+
"@pyreon/reactivity": "^0.53.0",
|
|
47
|
+
"@pyreon/native-compiler": "^0.53.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"@pyreon/native-compiler": {
|
|
51
|
+
"optional": true
|
|
52
|
+
}
|
|
43
53
|
},
|
|
44
54
|
"dependencies": {
|
|
45
55
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
46
56
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.1",
|
|
47
57
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^3.0.0",
|
|
48
|
-
"@pyreon/a11y": "^0.
|
|
58
|
+
"@pyreon/a11y": "^0.53.0"
|
|
49
59
|
},
|
|
50
60
|
"devDependencies": {
|
|
51
61
|
"@happy-dom/global-registrator": "^20.14.5",
|
|
52
62
|
"@pyreon/manifest": "0.50.0",
|
|
53
|
-
"@pyreon/
|
|
54
|
-
"@pyreon/
|
|
55
|
-
"@pyreon/
|
|
63
|
+
"@pyreon/native-compiler": "0.53.0",
|
|
64
|
+
"@pyreon/test-utils": "^0.50.3",
|
|
65
|
+
"@pyreon/tsconfig": "0.50.3",
|
|
66
|
+
"@pyreon/typescript": "^0.53.0",
|
|
56
67
|
"@pyreon/vitest-config": "0.50.0",
|
|
57
68
|
"@vitest/browser-playwright": "^5.0.2"
|
|
58
69
|
},
|
|
@@ -70,6 +81,10 @@
|
|
|
70
81
|
},
|
|
71
82
|
"kotlinSdkOnly": [
|
|
72
83
|
"PyreonSortableModifier.kt"
|
|
84
|
+
],
|
|
85
|
+
"plugin": "./lib/native-plugin.js",
|
|
86
|
+
"modules": [
|
|
87
|
+
"@pyreon/dnd"
|
|
73
88
|
]
|
|
74
89
|
}
|
|
75
90
|
}
|