@botiverse/raft-ui 0.95.4 → 0.96.1
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/CHANGELOG.md +135 -98
- package/dist/components/combobox/combobox.mjs +1 -1
- package/dist/components/combobox-select/combobox-select.mjs +1 -1
- package/dist/components/context-menu/context-menu.mjs +1 -1
- package/dist/components/dialog/dialog-sheet-context.mjs +4 -2
- package/dist/components/dialog/dialog-sheet.mjs +9 -1
- package/dist/components/dialog/dialog.mjs +22 -10
- package/dist/components/drawer/drawer.d.mts +1 -1
- package/dist/components/drawer/drawer.mjs +17 -4
- package/dist/components/dropdown-menu/dropdown-menu.mjs +1 -1
- package/dist/components/lightbox/lightbox.d.mts +1 -1
- package/dist/components/lightbox/lightbox.mjs +11 -9
- package/dist/components/notification-center/notification-center.mjs +1 -1
- package/dist/components/popover/popover.mjs +1 -1
- package/dist/components/preview-card/preview-card.mjs +1 -1
- package/dist/components/select/select.mjs +1 -1
- package/dist/components/tooltip/tooltip.mjs +1 -1
- package/dist/lib/frame-insets.mjs +56 -12
- package/dist/lib/overlay-depth.d.mts +5 -0
- package/dist/lib/overlay-depth.mjs +30 -11
- package/dist/lib/popup-boundary.d.mts +24 -0
- package/dist/lib/popup-boundary.mjs +258 -0
- package/dist/lint/no-raw-z-index.mjs +4 -4
- package/dist/lint/prefer-scroll-area.d.mts +60 -19
- package/dist/lint/prefer-scroll-area.mjs +393 -38
- package/dist/wip-exports.d.mts +5 -4
- package/dist/wip-exports.mjs +4 -3
- package/dist/wip.d.mts +2 -1
- package/package.json +1 -1
- package/skills/raft-ui-guide/SKILL.md +3 -1
- package/skills/raft-ui-guide/rules/layout.md +1 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
// src/lint/prefer-scroll-area.ts
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"overflowY"
|
|
2
|
+
const OVERFLOW_CLASS = /(?<![\w-])overflow(?:-([xy]))?-(?:(auto|scroll)|\[([^\]\s]+)\])(?![\w-])|\[overflow(?:-([xy]))?:([^\]\s]+)\]/g;
|
|
3
|
+
const SCROLLING_VALUES = /* @__PURE__ */ new Set([
|
|
4
|
+
"auto",
|
|
5
|
+
"scroll",
|
|
6
|
+
"overlay"
|
|
8
7
|
]);
|
|
9
|
-
const
|
|
8
|
+
const STYLE_AXES = {
|
|
9
|
+
overflow: "",
|
|
10
|
+
overflowX: "x",
|
|
11
|
+
overflowY: "y"
|
|
12
|
+
};
|
|
10
13
|
const CLASS_FUNCTIONS = /* @__PURE__ */ new Set([
|
|
11
14
|
"cn",
|
|
12
15
|
"clsx",
|
|
@@ -36,10 +39,47 @@ const PASS_THROUGH = /* @__PURE__ */ new Set([
|
|
|
36
39
|
]);
|
|
37
40
|
const INIT_THROUGH = /* @__PURE__ */ new Set([...PASS_THROUGH, "CallExpression"]);
|
|
38
41
|
const ESCAPE = /\braft-ui:\s*native-scroll\s+\S/;
|
|
39
|
-
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Adds the axes an overflow value scrolls to `axes`. `axis` is the property's (`x`, `y`), or
|
|
44
|
+
* empty for `overflow` itself, whose one value is both axes and whose two are x then y.
|
|
45
|
+
*/
|
|
46
|
+
function addOverflowValue(axes, axis, tokens) {
|
|
47
|
+
const scrolls = tokens.map((token) => SCROLLING_VALUES.has(token.replace(/^!|!(?:important)?$/g, "")));
|
|
48
|
+
if (axis === "x") axes.x ||= scrolls.includes(true);
|
|
49
|
+
else if (axis === "y") axes.y ||= scrolls.includes(true);
|
|
50
|
+
else {
|
|
51
|
+
axes.x ||= scrolls[0] === true;
|
|
52
|
+
axes.y ||= scrolls[scrolls.length > 1 ? 1 : 0] === true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function axisOf({ x, y }) {
|
|
56
|
+
if (x && y) return "both";
|
|
57
|
+
return x ? "horizontal" : y ? "vertical" : void 0;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The way a class string scrolls natively: `vertical` for `overflow-y-*`, `horizontal` for
|
|
61
|
+
* `overflow-x-*`, `both` for `overflow-*` or the two together, undefined when it has no
|
|
62
|
+
* native-scrolling class.
|
|
63
|
+
*/
|
|
64
|
+
function nativeScrollAxis(value) {
|
|
65
|
+
if (!value.includes("overflow")) return void 0;
|
|
66
|
+
const axes = {
|
|
67
|
+
x: false,
|
|
68
|
+
y: false
|
|
69
|
+
};
|
|
70
|
+
for (const match of value.matchAll(OVERFLOW_CLASS)) addOverflowValue(axes, match[1] ?? match[4] ?? "", (match[2] ?? match[3] ?? match[5] ?? "").split("_"));
|
|
71
|
+
return axisOf(axes);
|
|
72
|
+
}
|
|
73
|
+
/** The way a `style` property scrolls natively: `overflow: "hidden auto"` is `vertical`. */
|
|
74
|
+
function nativeScrollStyleAxis(key, value) {
|
|
75
|
+
const axis = STYLE_AXES[key];
|
|
76
|
+
if (axis === void 0) return void 0;
|
|
77
|
+
const axes = {
|
|
78
|
+
x: false,
|
|
79
|
+
y: false
|
|
80
|
+
};
|
|
81
|
+
addOverflowValue(axes, axis, value.trim().split(/\s+/));
|
|
82
|
+
return axisOf(axes);
|
|
43
83
|
}
|
|
44
84
|
function attributeName(node) {
|
|
45
85
|
const name = node.name;
|
|
@@ -105,6 +145,181 @@ function propertyKey(property) {
|
|
|
105
145
|
if (property.computed) return stringValue(key);
|
|
106
146
|
return key.type === "Identifier" ? key.name : stringValue(key);
|
|
107
147
|
}
|
|
148
|
+
const CLASS_NAME = /^(?:class|className|classNames|\w+ClassNames?|(?!(?:is|has|should)[A-Z])[a-z]\w*[a-z0-9]Class)$/;
|
|
149
|
+
const CONTAINER_CLASS_NAME = /^(?:classNames|\w+ClassNames)$/;
|
|
150
|
+
const SCROLL_AREAS = /* @__PURE__ */ new Set([
|
|
151
|
+
"ScrollArea",
|
|
152
|
+
"PanelScrollViewport",
|
|
153
|
+
"ScrollAreaTextarea"
|
|
154
|
+
]);
|
|
155
|
+
const TEXTAREAS = /* @__PURE__ */ new Set(["textarea", "Textarea"]);
|
|
156
|
+
const NATIVE_ELEMENTS = /* @__PURE__ */ new Set([
|
|
157
|
+
"pre",
|
|
158
|
+
"html",
|
|
159
|
+
"body",
|
|
160
|
+
"iframe"
|
|
161
|
+
]);
|
|
162
|
+
const VALUE_THROUGH = /* @__PURE__ */ new Set([...PASS_THROUGH, "MemberExpression"]);
|
|
163
|
+
const WIDE_INIT_THROUGH = /* @__PURE__ */ new Set([...INIT_THROUGH, "MemberExpression"]);
|
|
164
|
+
const FUNCTIONS = /* @__PURE__ */ new Set(["ArrowFunctionExpression", "FunctionExpression"]);
|
|
165
|
+
const TYPE_WRAPPERS = /* @__PURE__ */ new Set([
|
|
166
|
+
"ParenthesizedExpression",
|
|
167
|
+
"TSAsExpression",
|
|
168
|
+
"TSNonNullExpression",
|
|
169
|
+
"TSSatisfiesExpression"
|
|
170
|
+
]);
|
|
171
|
+
/**
|
|
172
|
+
* What makes a node a class for this rule: a class attribute, a JSX spread, a class helper's
|
|
173
|
+
* call, a property or a parameter default with a class name. Undefined when it isn't one.
|
|
174
|
+
*
|
|
175
|
+
* One call that isn't a class helper may stand between the node and a class attribute, a class
|
|
176
|
+
* property or a spread (`className={wrap("…")}`, `{...guard("…")}`): its result is the class.
|
|
177
|
+
* Inside a class helper such a call is not read, in an attribute or outside one
|
|
178
|
+
* (`cn("p-2", t("…"))`): what it takes is its own. A spread takes only a call's arguments, and
|
|
179
|
+
* none under a key that isn't a class name or inside a function.
|
|
180
|
+
*/
|
|
181
|
+
function classUse(node) {
|
|
182
|
+
let child = node;
|
|
183
|
+
let parent = node.parent;
|
|
184
|
+
let calls = 0;
|
|
185
|
+
let underKey = false;
|
|
186
|
+
let inFunction = false;
|
|
187
|
+
while (parent) {
|
|
188
|
+
if (parent.type === "JSXAttribute") {
|
|
189
|
+
const name = attributeName(parent);
|
|
190
|
+
return name !== void 0 && CLASS_NAME.test(name) ? parent : void 0;
|
|
191
|
+
}
|
|
192
|
+
if (parent.type === "JSXSpreadAttribute") return calls > 0 && !underKey && !inFunction ? parent : void 0;
|
|
193
|
+
if (parent.type === "CallExpression") {
|
|
194
|
+
const callee = parent.callee;
|
|
195
|
+
if (callee === child) {
|
|
196
|
+
if (child.type !== "MemberExpression") return void 0;
|
|
197
|
+
} else if (!parent.arguments.includes(child)) return;
|
|
198
|
+
else if (callee.type === "Identifier" && CLASS_FUNCTIONS.has(callee.name)) return calls === 0 && !inFunction ? parent : void 0;
|
|
199
|
+
else {
|
|
200
|
+
if (calls > 0 || underKey || inFunction) return void 0;
|
|
201
|
+
calls = 1;
|
|
202
|
+
}
|
|
203
|
+
} else if (parent.type === "Property") {
|
|
204
|
+
if (parent.value === child) {
|
|
205
|
+
const key = propertyKey(parent);
|
|
206
|
+
if (key !== void 0 && CLASS_NAME.test(key)) return parent;
|
|
207
|
+
underKey = true;
|
|
208
|
+
}
|
|
209
|
+
} else if (parent.type === "AssignmentPattern") {
|
|
210
|
+
if (parent.right !== child) return void 0;
|
|
211
|
+
const owner = parent.parent;
|
|
212
|
+
const left = parent.left;
|
|
213
|
+
const name = owner?.type === "Property" && owner.value === parent ? propertyKey(owner) : left.type === "Identifier" ? left.name : void 0;
|
|
214
|
+
return name !== void 0 && CLASS_NAME.test(name) ? parent : void 0;
|
|
215
|
+
} else if (parent.type === "ArrowFunctionExpression" && parent.body === child) {
|
|
216
|
+
if (inFunction) return void 0;
|
|
217
|
+
inFunction = true;
|
|
218
|
+
} else if (parent.type === "ReturnStatement") {
|
|
219
|
+
let owner = parent.parent;
|
|
220
|
+
while (owner && (owner.type === "BlockStatement" || owner.type === "IfStatement")) owner = owner.parent;
|
|
221
|
+
if (!owner || !FUNCTIONS.has(owner.type) || inFunction) return void 0;
|
|
222
|
+
inFunction = true;
|
|
223
|
+
parent = owner;
|
|
224
|
+
} else if (!VALUE_THROUGH.has(parent.type)) return;
|
|
225
|
+
child = parent;
|
|
226
|
+
parent = parent.parent;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* What makes a node a style: a `style` attribute or a `style` property, through objects,
|
|
231
|
+
* spreads, conditionals, members and one call. Undefined when it isn't one.
|
|
232
|
+
*/
|
|
233
|
+
function styleUse(node) {
|
|
234
|
+
let child = node;
|
|
235
|
+
let parent = node.parent;
|
|
236
|
+
let calls = 0;
|
|
237
|
+
while (parent) {
|
|
238
|
+
if (parent.type === "JSXAttribute") return attributeName(parent) === "style" ? parent : void 0;
|
|
239
|
+
if (parent.type === "Property") {
|
|
240
|
+
if (parent.value !== child) return void 0;
|
|
241
|
+
if (propertyKey(parent) === "style") return parent;
|
|
242
|
+
} else if (parent.type === "CallExpression") {
|
|
243
|
+
if (!parent.arguments.includes(child) || calls > 0) return void 0;
|
|
244
|
+
calls = 1;
|
|
245
|
+
} else if (!VALUE_THROUGH.has(parent.type) || parent.type === "TemplateLiteral") return;
|
|
246
|
+
child = parent;
|
|
247
|
+
parent = parent.parent;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* The `const` whose initializer holds `node`, and the member it is under when the initializer is
|
|
252
|
+
* an object (`body` for a string in `const cls = { body: "…" }`): undefined for a string that
|
|
253
|
+
* isn't under one member, which then counts whichever member is read.
|
|
254
|
+
*/
|
|
255
|
+
function constHolder(node) {
|
|
256
|
+
let child = node;
|
|
257
|
+
let parent = node.parent;
|
|
258
|
+
let member;
|
|
259
|
+
let direct = true;
|
|
260
|
+
while (parent) {
|
|
261
|
+
if (parent.type === "VariableDeclarator") {
|
|
262
|
+
if (!(parent.id?.type === "Identifier" && parent.parent?.kind === "const") || parent.init !== child) return void 0;
|
|
263
|
+
return {
|
|
264
|
+
declarator: parent,
|
|
265
|
+
member: direct ? member : void 0
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
if (!WIDE_INIT_THROUGH.has(parent.type)) return void 0;
|
|
269
|
+
if (parent.type === "Property") {
|
|
270
|
+
member = parent.value === child ? propertyKey(parent) : void 0;
|
|
271
|
+
direct = true;
|
|
272
|
+
} else if (parent.type !== "ObjectExpression" && !TYPE_WRAPPERS.has(parent.type)) direct = false;
|
|
273
|
+
child = parent;
|
|
274
|
+
parent = parent.parent;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/** The member an identifier is read by (`body` in `cls.body`), or undefined for all of it. */
|
|
278
|
+
function memberRead(node) {
|
|
279
|
+
const parent = node.parent;
|
|
280
|
+
if (parent?.type !== "MemberExpression" || parent.object !== node) return void 0;
|
|
281
|
+
const property = parent.property;
|
|
282
|
+
if (!parent.computed) return property.type === "Identifier" ? property.name : void 0;
|
|
283
|
+
return stringValue(property);
|
|
284
|
+
}
|
|
285
|
+
function elementName(attribute) {
|
|
286
|
+
const name = attribute.parent?.name;
|
|
287
|
+
if (name?.type === "JSXIdentifier") return name.name;
|
|
288
|
+
return (name?.type === "JSXMemberExpression" ? name.property : void 0)?.name;
|
|
289
|
+
}
|
|
290
|
+
/** What a hit is written on, from what makes it a class or a style: it decides the message. */
|
|
291
|
+
function targetOf(use) {
|
|
292
|
+
let node = use;
|
|
293
|
+
if (node.type === "Property") {
|
|
294
|
+
const key = propertyKey(node);
|
|
295
|
+
if (key !== void 0 && CONTAINER_CLASS_NAME.test(key)) return "container";
|
|
296
|
+
}
|
|
297
|
+
while (node && node.type !== "JSXAttribute") {
|
|
298
|
+
if (node.type === "JSXSpreadAttribute" || node.type === "JSXElement") return "plain";
|
|
299
|
+
if (node.type === "JSXFragment" || node.type === "VariableDeclarator") return "plain";
|
|
300
|
+
node = node.parent;
|
|
301
|
+
}
|
|
302
|
+
if (!node) return "plain";
|
|
303
|
+
const name = attributeName(node);
|
|
304
|
+
if (name !== void 0 && CONTAINER_CLASS_NAME.test(name)) return "container";
|
|
305
|
+
if (name !== "className" && name !== "class" && name !== "style") return "plain";
|
|
306
|
+
const element = elementName(node) ?? "";
|
|
307
|
+
if (SCROLL_AREAS.has(element)) return "area";
|
|
308
|
+
if (TEXTAREAS.has(element)) return "textarea";
|
|
309
|
+
return NATIVE_ELEMENTS.has(element) ? "native" : "plain";
|
|
310
|
+
}
|
|
311
|
+
function messageFor(target, axis) {
|
|
312
|
+
if (target === "area") return "scrollAreaAlreadyScrolls";
|
|
313
|
+
if (target === "textarea") return "preferScrollAreaTextarea";
|
|
314
|
+
if (target === "native") return "nativeScrollElement";
|
|
315
|
+
if (target === "container") return "preferScrollAreaContainer";
|
|
316
|
+
if (axis === "both") return "preferScrollAreaBoth";
|
|
317
|
+
return axis === "horizontal" ? "preferScrollAreaHorizontal" : "preferScrollArea";
|
|
318
|
+
}
|
|
319
|
+
const DOCS = "Docs: https://raft-design.botiverse.build/components/scroll-area.md";
|
|
320
|
+
const OPT_OUT = "Only a region that must scroll natively (see the allowed cases in the docs) takes \"// raft-ui: native-scroll <reason>\" on the line above.";
|
|
321
|
+
const WHERE_CLASSES_GO = "Sizing classes (max-h-*, flex-1, min-h-0) stay on the area; grid/flex/gap/padding go on contentClassName.";
|
|
322
|
+
const AREA_CLASSES = "className=\"…sizing…\" contentClassName=\"…layout, gap, padding…\"";
|
|
108
323
|
const preferScrollArea = {
|
|
109
324
|
meta: {
|
|
110
325
|
type: "suggestion",
|
|
@@ -112,7 +327,15 @@ const preferScrollArea = {
|
|
|
112
327
|
description: "Scrolling regions use ScrollArea from @botiverse/raft-ui, not a native overflow.",
|
|
113
328
|
url: "https://raft-design.botiverse.build/about/use-raft-ui/#lint-rules"
|
|
114
329
|
},
|
|
115
|
-
messages: {
|
|
330
|
+
messages: {
|
|
331
|
+
preferScrollArea: `Use ScrollArea from @botiverse/raft-ui for a scrolling region: <ScrollArea ${AREA_CLASSES}>…</ScrollArea> (inside a Panel: PanelScrollViewport). ${WHERE_CLASSES_GO} ${OPT_OUT} ${DOCS}`,
|
|
332
|
+
preferScrollAreaHorizontal: `Use ScrollArea from @botiverse/raft-ui for a region that scrolls sideways: <ScrollArea orientation="horizontal" ${AREA_CLASSES}>…</ScrollArea>. ${WHERE_CLASSES_GO} ${OPT_OUT} ${DOCS}`,
|
|
333
|
+
preferScrollAreaBoth: `Use ScrollArea from @botiverse/raft-ui for a region that scrolls both ways: <ScrollArea orientation="both" ${AREA_CLASSES}>…</ScrollArea>. Leave orientation out (vertical, the default) only when nothing inside is wider than the area: a vertical area cuts off what is. ${WHERE_CLASSES_GO} ${OPT_OUT} ${DOCS}`,
|
|
334
|
+
preferScrollAreaTextarea: `Use ScrollAreaTextarea from @botiverse/raft-ui for a textarea that scrolls: <ScrollAreaTextarea wrapperClassName="…border, background, focus ring…" className="…padding…" />. A <textarea> can't hold ScrollArea's scrollbars, so ScrollAreaTextarea draws them over a frame around it. ${OPT_OUT} ${DOCS}`,
|
|
335
|
+
preferScrollAreaContainer: `These classes go to an element another component renders, so a ScrollArea can't take its place. Bind that element: const { containerProps, guttersProps } = useScrollAreaContainer(); give it containerProps (ref, className, style) and render <ScrollAreaGutters {...guttersProps} /> as its first child, with no overflow class ("Your own container" in the docs). Where the component takes neither, it scrolls natively: say so in "// raft-ui: native-scroll <reason>" on the line above. ${DOCS}`,
|
|
336
|
+
nativeScrollElement: `A ScrollArea can't take the place of this element (<pre>, <html>, <body>, <iframe>), so there is nothing to write instead. It may scroll natively only as one of the allowed cases in the docs (a <pre> of code is one, since it holds phrasing content only): say which in "// raft-ui: native-scroll <reason>" on the line above. ${DOCS}`,
|
|
337
|
+
scrollAreaAlreadyScrolls: `ScrollArea already scrolls: remove the overflow class (or style) and set the direction with orientation="vertical" (the default), "horizontal" or "both". ${DOCS}`
|
|
338
|
+
},
|
|
116
339
|
schema: []
|
|
117
340
|
},
|
|
118
341
|
create(context) {
|
|
@@ -121,39 +344,134 @@ const preferScrollArea = {
|
|
|
121
344
|
function line(index) {
|
|
122
345
|
return sourceCode.getLocFromIndex(index).line;
|
|
123
346
|
}
|
|
124
|
-
/**
|
|
347
|
+
/**
|
|
348
|
+
* The lines an escape comment covers: the one it ends on, and the next when the comment has
|
|
349
|
+
* its line to itself (after `{` too: `{/* … *\/}` between JSX children). A comment at the
|
|
350
|
+
* end of a line of code covers that line only.
|
|
351
|
+
*/
|
|
125
352
|
function escaped() {
|
|
126
353
|
if (escapeLines) return escapeLines;
|
|
127
354
|
escapeLines = /* @__PURE__ */ new Set();
|
|
355
|
+
const text = sourceCode?.text;
|
|
128
356
|
for (const comment of sourceCode?.getAllComments() ?? []) {
|
|
129
357
|
if (!ESCAPE.test(comment.value)) continue;
|
|
130
358
|
const end = comment.loc?.end.line ?? line(comment.range[1]);
|
|
131
359
|
escapeLines.add(end);
|
|
132
|
-
|
|
360
|
+
let ownLine = true;
|
|
361
|
+
if (text !== void 0 && comment.range) {
|
|
362
|
+
const start = comment.range[0];
|
|
363
|
+
const before = text.slice(text.lastIndexOf("\n", start - 1) + 1, start).trim();
|
|
364
|
+
ownLine = before === "" || before === "{";
|
|
365
|
+
}
|
|
366
|
+
if (ownLine) escapeLines.add(end + 1);
|
|
133
367
|
}
|
|
134
368
|
return escapeLines;
|
|
135
369
|
}
|
|
136
370
|
function startLine(node) {
|
|
137
371
|
return node.loc?.start.line ?? line(node.range[0]);
|
|
138
372
|
}
|
|
139
|
-
|
|
140
|
-
|
|
373
|
+
const reported = /* @__PURE__ */ new Set();
|
|
374
|
+
/** Reports `node`, once, unless an escape comment covers the line `anchor` starts on. */
|
|
375
|
+
function report(node, anchor, messageId) {
|
|
376
|
+
if (reported.has(node)) return;
|
|
377
|
+
reported.add(node);
|
|
141
378
|
const lines = escaped();
|
|
142
379
|
if (lines.size > 0 && lines.has(startLine(anchor))) return;
|
|
143
380
|
context.report({
|
|
144
381
|
node,
|
|
145
|
-
messageId
|
|
382
|
+
messageId
|
|
146
383
|
});
|
|
147
384
|
}
|
|
148
|
-
const
|
|
149
|
-
const
|
|
385
|
+
const classHits = /* @__PURE__ */ new Map();
|
|
386
|
+
const styleHits = /* @__PURE__ */ new Map();
|
|
387
|
+
const classUses = [];
|
|
388
|
+
const styleUses = [];
|
|
389
|
+
const references = [];
|
|
390
|
+
function hold(hits, declarator, hit) {
|
|
391
|
+
const list = hits.get(declarator);
|
|
392
|
+
if (list) list.push(hit);
|
|
393
|
+
else hits.set(declarator, [hit]);
|
|
394
|
+
}
|
|
150
395
|
function checkClassString(node, value) {
|
|
151
|
-
|
|
152
|
-
if (
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
const
|
|
156
|
-
|
|
396
|
+
const axis = nativeScrollAxis(value);
|
|
397
|
+
if (axis === void 0) return;
|
|
398
|
+
const use = classUse(node);
|
|
399
|
+
if (use) return report(node, node, messageFor(targetOf(use), axis));
|
|
400
|
+
const holder = constHolder(node);
|
|
401
|
+
if (holder) hold(classHits, holder.declarator, {
|
|
402
|
+
node,
|
|
403
|
+
anchor: node,
|
|
404
|
+
axis,
|
|
405
|
+
member: holder.member
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
/** The consts a name refers to: the one its scope resolves it to, or every one of that name. */
|
|
409
|
+
function resolver() {
|
|
410
|
+
const byName = /* @__PURE__ */ new Map();
|
|
411
|
+
const owners = [
|
|
412
|
+
...classHits.keys(),
|
|
413
|
+
...styleHits.keys(),
|
|
414
|
+
...references.map((r) => r.owner)
|
|
415
|
+
];
|
|
416
|
+
for (const declarator of new Set(owners)) {
|
|
417
|
+
const name = declarator.id.name;
|
|
418
|
+
byName.set(name, [...byName.get(name) ?? [], declarator]);
|
|
419
|
+
}
|
|
420
|
+
return (identifier) => {
|
|
421
|
+
const name = identifier.name;
|
|
422
|
+
const named = byName.get(name);
|
|
423
|
+
if (!named) return [];
|
|
424
|
+
let scope;
|
|
425
|
+
try {
|
|
426
|
+
scope = sourceCode?.getScope?.(identifier);
|
|
427
|
+
} catch {
|
|
428
|
+
scope = void 0;
|
|
429
|
+
}
|
|
430
|
+
if (!scope?.set) return named;
|
|
431
|
+
for (let current = scope; current; current = current.upper) {
|
|
432
|
+
const variable = current.set?.get(name);
|
|
433
|
+
if (!variable) continue;
|
|
434
|
+
const definition = variable.defs?.[0];
|
|
435
|
+
return definition?.type === "Variable" && named.includes(definition.node) ? [definition.node] : [];
|
|
436
|
+
}
|
|
437
|
+
return [];
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
/** Reports what the used consts hold, and what the consts they are built from hold. */
|
|
441
|
+
function reportUsed(uses, hits, resolve) {
|
|
442
|
+
if (hits.size === 0 || uses.length === 0) return;
|
|
443
|
+
const referencesOf = /* @__PURE__ */ new Map();
|
|
444
|
+
for (const reference of references) referencesOf.set(reference.owner, [...referencesOf.get(reference.owner) ?? [], reference]);
|
|
445
|
+
const used = /* @__PURE__ */ new Map();
|
|
446
|
+
for (const use of uses) for (const declarator of resolve(use.identifier)) {
|
|
447
|
+
const entry = used.get(declarator);
|
|
448
|
+
if (!entry) {
|
|
449
|
+
const members = use.member === void 0 ? void 0 : /* @__PURE__ */ new Set([use.member]);
|
|
450
|
+
used.set(declarator, {
|
|
451
|
+
members,
|
|
452
|
+
target: use.target
|
|
453
|
+
});
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
if (use.member === void 0) entry.members = void 0;
|
|
457
|
+
else entry.members?.add(use.member);
|
|
458
|
+
if (entry.target !== use.target) entry.target = "plain";
|
|
459
|
+
}
|
|
460
|
+
const visiting = /* @__PURE__ */ new Set();
|
|
461
|
+
function visit(declarator, members, target) {
|
|
462
|
+
if (visiting.has(declarator)) return;
|
|
463
|
+
visiting.add(declarator);
|
|
464
|
+
const read = (member) => member === void 0 || members === void 0 || members.has(member);
|
|
465
|
+
for (const hit of hits.get(declarator) ?? []) if (read(hit.member)) report(hit.node, hit.anchor, messageFor(target, hit.axis));
|
|
466
|
+
for (const reference of referencesOf.get(declarator) ?? []) {
|
|
467
|
+
if (!read(reference.ownerMember)) continue;
|
|
468
|
+
const inner = reference.member === void 0 ? void 0 : /* @__PURE__ */ new Set([reference.member]);
|
|
469
|
+
for (const next of resolve(reference.identifier)) visit(next, inner, target);
|
|
470
|
+
}
|
|
471
|
+
visiting.delete(declarator);
|
|
472
|
+
}
|
|
473
|
+
const order = [...used].sort(([, a], [, b]) => Number(a.target !== "plain") - Number(b.target !== "plain"));
|
|
474
|
+
for (const [declarator, { members, target }] of order) visit(declarator, members, target);
|
|
157
475
|
}
|
|
158
476
|
return {
|
|
159
477
|
Literal(node) {
|
|
@@ -165,24 +483,61 @@ const preferScrollArea = {
|
|
|
165
483
|
Identifier(node) {
|
|
166
484
|
const parent = node.parent;
|
|
167
485
|
if (parent?.type === "Property" && parent.key === node && !parent.computed && !parent.shorthand) return;
|
|
168
|
-
if (
|
|
486
|
+
if (parent?.type === "MemberExpression" && parent.property === node && !parent.computed) return;
|
|
487
|
+
if (parent?.type === "VariableDeclarator" && parent.id === node) return;
|
|
488
|
+
const member = memberRead(node);
|
|
489
|
+
const style = styleUse(node);
|
|
490
|
+
if (style) styleUses.push({
|
|
491
|
+
identifier: node,
|
|
492
|
+
member,
|
|
493
|
+
target: targetOf(style)
|
|
494
|
+
});
|
|
495
|
+
else {
|
|
496
|
+
const use = classUse(node);
|
|
497
|
+
if (use) classUses.push({
|
|
498
|
+
identifier: node,
|
|
499
|
+
member,
|
|
500
|
+
target: targetOf(use)
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
const holder = constHolder(node);
|
|
504
|
+
if (holder) references.push({
|
|
505
|
+
identifier: node,
|
|
506
|
+
member,
|
|
507
|
+
owner: holder.declarator,
|
|
508
|
+
ownerMember: holder.member
|
|
509
|
+
});
|
|
169
510
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
|
|
511
|
+
Property(node) {
|
|
512
|
+
const key = propertyKey(node);
|
|
513
|
+
if (key === void 0 || !(key in STYLE_AXES)) return;
|
|
514
|
+
let style;
|
|
515
|
+
let holder;
|
|
516
|
+
let looked = false;
|
|
517
|
+
for (const literal of styleValueStrings(node.value, [])) {
|
|
518
|
+
const axis = nativeScrollStyleAxis(key, stringValue(literal));
|
|
519
|
+
if (axis === void 0) continue;
|
|
520
|
+
if (!looked) {
|
|
521
|
+
looked = true;
|
|
522
|
+
style = styleUse(node);
|
|
523
|
+
holder = style ? void 0 : constHolder(node);
|
|
524
|
+
}
|
|
525
|
+
if (style) report(literal, node, messageFor(targetOf(style), axis));
|
|
526
|
+
else if (holder) hold(styleHits, holder.declarator, {
|
|
527
|
+
node: literal,
|
|
528
|
+
anchor: node,
|
|
529
|
+
axis,
|
|
530
|
+
member: holder.member
|
|
531
|
+
});
|
|
180
532
|
}
|
|
181
533
|
},
|
|
182
534
|
"Program:exit"() {
|
|
183
|
-
|
|
535
|
+
if (classHits.size === 0 && styleHits.size === 0) return;
|
|
536
|
+
const resolve = resolver();
|
|
537
|
+
reportUsed(classUses, classHits, resolve);
|
|
538
|
+
reportUsed(styleUses, styleHits, resolve);
|
|
184
539
|
}
|
|
185
540
|
};
|
|
186
541
|
}
|
|
187
542
|
};
|
|
188
|
-
export { attributeName, classContext, constDeclarator,
|
|
543
|
+
export { attributeName, classContext, constDeclarator, nativeScrollAxis, nativeScrollStyleAxis, preferScrollArea, propertyKey, stringValue };
|
package/dist/wip-exports.d.mts
CHANGED
|
@@ -53,16 +53,17 @@ import { LIFT_CLASS } from "./components/drag/drag.recipe.mjs";
|
|
|
53
53
|
import { DRAG_AUTO_SCROLL_ZONE_PX, DRAG_KEYBOARD_OFFSET_PX, DRAG_LIFT_Z_INDEX, DRAG_SETTLE, DRAG_SIBLING_TRANSITION, DROP_GLIDE, DragLift, DragLiftProps, ORIGIN_OPACITY, cancelDrag, keepGrabInside, useDragSiblingTransition } from "./components/drag/drag-lift.mjs";
|
|
54
54
|
import { DragRefusalHint, DragRefusalHintProps, DropPlaceholder, DropPlaceholderProps } from "./components/drag/drop-placeholder.mjs";
|
|
55
55
|
import { DragListsItems, DragLiveRegion, DraggedSlot, DraggedSlotProps, UseDragListsOptions, dragListStrategy, useDragAnnouncer, useDragLists } from "./components/drag/drag-lists.mjs";
|
|
56
|
-
import "./
|
|
56
|
+
import { SheetPopupBoundary, SheetPopupBoundaryProps } from "./lib/popup-boundary.mjs";
|
|
57
57
|
import { Ellipsis, EllipsisProps, EllipsisState, EllipsisToggle, EllipsisToggleProps } from "./components/ellipsis/ellipsis.mjs";
|
|
58
58
|
import { useTruncated } from "./lib/use-truncated.mjs";
|
|
59
|
+
import "./components/mobile-nav/index.mjs";
|
|
59
60
|
import "./components/preview-card/index.mjs";
|
|
60
61
|
import "./components/app-link-card/index.mjs";
|
|
61
62
|
import { PopoverActions, PopoverActionsProps, PopoverBody, PopoverBodyProps } from "./components/popover/popover.mjs";
|
|
62
|
-
import "./components/pull-to-refresh/index.mjs";
|
|
63
63
|
import { Meter, MeterHeader, MeterHeaderProps, MeterIndicator, MeterIndicatorProps, MeterLabel, MeterLabelProps, MeterProps, MeterTrack, MeterTrackProps, MeterValue, MeterValueProps } from "./components/meter/meter.mjs";
|
|
64
|
-
import "./components/
|
|
64
|
+
import "./components/pull-to-refresh/index.mjs";
|
|
65
65
|
import { FilterChip, FilterChipLabel, FilterChipLabelProps, FilterChipProps, FilterChipRemove, FilterChipRemoveProps } from "./components/filter-chip/filter-chip.mjs";
|
|
66
|
+
import "./components/choice-list/index.mjs";
|
|
66
67
|
import "./components/avatar/index.mjs";
|
|
67
68
|
import "./components/panel/index.mjs";
|
|
68
69
|
import { AppLinkCard, AppLinkCardActions, AppLinkCardActionsProps, AppLinkCardBadge, AppLinkCardBadgeProps, AppLinkCardBody, AppLinkCardBodyProps, AppLinkCardEyebrow, AppLinkCardEyebrowProps, AppLinkCardHeader, AppLinkCardHeaderProps, AppLinkCardHost, AppLinkCardHostProps, AppLinkCardIcon, AppLinkCardIconProps, AppLinkCardMeta, AppLinkCardMetaProps, AppLinkCardName, AppLinkCardNameProps, AppLinkCardPlaceholder, AppLinkCardPlaceholderProps, AppLinkCardTitle, AppLinkCardTitleProps } from "./components/app-link-card/app-link-card.mjs";
|
|
@@ -81,4 +82,4 @@ import { KbdButton, KbdButtonCaret, KbdButtonCaretProps, KbdButtonPlaceholder, K
|
|
|
81
82
|
import "./components/kbd-button/index.mjs";
|
|
82
83
|
import { WebTopBarCenter, WebTopBarCenterProps, WebTopBarEnd, WebTopBarEndProps, WebTopBarRoot, WebTopBarRootProps, WebTopBarStart, WebTopBarStartProps } from "./components/web-top-bar/web-top-bar.mjs";
|
|
83
84
|
import "./components/web-top-bar/index.mjs";
|
|
84
|
-
export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, AppLinkCard, AppLinkCardActions, type AppLinkCardActionsProps, AppLinkCardBadge, type AppLinkCardBadgeProps, AppLinkCardBody, type AppLinkCardBodyProps, AppLinkCardEyebrow, type AppLinkCardEyebrowProps, AppLinkCardHeader, type AppLinkCardHeaderProps, AppLinkCardHost, type AppLinkCardHostProps, AppLinkCardIcon, type AppLinkCardIconProps, AppLinkCardMeta, type AppLinkCardMetaProps, AppLinkCardName, type AppLinkCardNameProps, AppLinkCardPlaceholder, type AppLinkCardPlaceholderProps, AppLinkCardTitle, type AppLinkCardTitleProps, AvatarGroupButton, type AvatarGroupButtonProps, ButtonSplit, ButtonSplitMain, type ButtonSplitMainProps, ButtonSplitMenu, type ButtonSplitMenuProps, type ButtonSplitProps, type ButtonSplitSize, type ButtonSplitVariant, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ChoiceList, type ChoiceListGroup, type ChoiceListItem, type ChoiceListMultipleProps, type ChoiceListProps, type ChoiceListSingleProps, ComboboxSelect, type ComboboxSelectGroup, type ComboboxSelectMessages, type ComboboxSelectOption, type ComboboxSelectProps, type ComboboxSelectSelection, type ComboboxSelectValue, CommentCard, CommentCardMeta, type CommentCardMetaProps, type CommentCardProps, CommentCardQuote, type CommentCardQuoteProps, CommentCardTrigger, type CommentCardTriggerProps, CommentEntry, CommentEntryAuthor, type CommentEntryAuthorProps, CommentEntryBody, type CommentEntryBodyProps, CommentEntryHeader, type CommentEntryHeaderProps, type CommentEntryProps, CommentEntryTime, type CommentEntryTimeProps, CommentMargin, CommentMarginItem, type CommentMarginItemProps, type CommentMarginLayout, type CommentMarginLayoutItem, type CommentMarginLayoutOptions, type CommentMarginProps, CommentMarker, type CommentMarkerProps, DEFAULT_DRAG_MESSAGES, DRAG_AUTO_SCROLL_ZONE_PX, DRAG_KEYBOARD_CODES, DRAG_KEYBOARD_OFFSET_PX, DRAG_LIFT_Z_INDEX, DRAG_SETTLE, DRAG_SIBLING_TRANSITION, DROP_GLIDE, DialogFooterNote, type DialogFooterNoteProps, type DragAcrossLists, type DragAnnouncementSource, DragLift, type DragLiftProps, type DragListsItems, DragLiveRegion, type DragMessages, type DragNamed, type DragPlace, DragRefusalHint, type DragRefusalHintProps, DragRemeasure, type DragRemeasureProps, type DragSensorsOptions, DraggedSlot, type DraggedSlotProps, DropPlaceholder, type DropPlaceholderProps, DropdownMenuLinkItem, type DropdownMenuLinkItemProps, Ellipsis, type EllipsisProps, type EllipsisState, EllipsisToggle, type EllipsisToggleProps, FIT_SEARCH_MAX_LEAST, FilterChip, FilterChipLabel, type FilterChipLabelProps, type FilterChipProps, FilterChipRemove, type FilterChipRemoveProps, type FitItemOptions, type FitStep, type FitSteps, FitToolbar, FitToolbarButton, type FitToolbarButtonProps, FitToolbarGroup, type FitToolbarGroupProps, FitToolbarMore, FitToolbarMoreItems, type FitToolbarMoreProps, FitToolbarPicker, type FitToolbarPickerProps, type FitToolbarProps, FitToolbarSearch, type FitToolbarSearchProps, FitToolbarSplitButton, type FitToolbarSplitButtonProps, type HoldThenMoveOptions, HoldThenMoveTouchSensor, InboxItemLeadingBadge, type InboxItemLeadingBadgeProps, InboxItemLine, type InboxItemLineProps, InboxItemListGroup, type InboxItemListGroupProps, InboxItemListHeading, type InboxItemListHeadingProps, InboxItemSkeleton, InboxItemSkeletonList, type InboxItemSkeletonListProps, type InboxItemSkeletonProps, InboxItemStatus, type InboxItemStatusProps, KbdButton, KbdButtonCaret, type KbdButtonCaretProps, KbdButtonPlaceholder, type KbdButtonPlaceholderProps, type KbdButtonProps, type KbdKeyName, KbdShortcut, type KbdShortcutProps, type KeyboardPlatform, LIFT_CLASS, LightboxBody, type LightboxBodyProps, ListRowSkeleton, type ListRowSkeletonProps, MOUSE_DRAG_DISTANCE_PX, MessageItemDelegatedAvatar, type MessageItemDelegatedAvatarProps, MessageItemDelegatedBy, MessageItemDelegatedByButton, type MessageItemDelegatedByButtonProps, MessageItemDelegatedByName, type MessageItemDelegatedByNameProps, type MessageItemDelegatedByProps, MessageItemTrailing, type MessageItemTrailingProps, MessageListJumpControls, type MessageListJumpControlsProps, MessageListJumpPill, MessageListJumpPillDismiss, type MessageListJumpPillDismissProps, MessageListJumpPillGroup, type MessageListJumpPillGroupProps, type MessageListJumpPillProps, MessageQuotedPreviewAuthorDelegatedBy, type MessageQuotedPreviewAuthorDelegatedByProps, MessageReferenceIcon, type MessageReferenceIconProps, MessageReferenceReadMark, type MessageReferenceReadMarkProps, Meter, MeterHeader, type MeterHeaderProps, MeterIndicator, type MeterIndicatorProps, MeterLabel, type MeterLabelProps, type MeterProps, MeterTrack, type MeterTrackProps, MeterValue, type MeterValueProps, MobileNavServerItem, type MobileNavServerItemProps, MobileNavServerPopover, MobileNavServerPopoverContent, type MobileNavServerPopoverContentProps, MobileNavServerPopoverDestination, type MobileNavServerPopoverDestinationProps, MobileNavServerPopoverDestinations, type MobileNavServerPopoverDestinationsProps, MobileNavServerPopoverGroup, type MobileNavServerPopoverGroupProps, MobileNavServerPopoverList, type MobileNavServerPopoverListProps, type MobileNavServerPopoverProps, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, type MobileNavServerPopoverRowBodyProps, MobileNavServerPopoverRowDescription, type MobileNavServerPopoverRowDescriptionProps, MobileNavServerPopoverRowLabel, type MobileNavServerPopoverRowLabelProps, type MobileNavServerPopoverRowProps, MouseOnlyPointerSensor, ORIGIN_OPACITY, type OverlayLayerKind, OverlayLayerProvider, type OverlayLayerProviderProps, PULL_TO_REFRESH_DAMPING, PULL_TO_REFRESH_HOLD_DISTANCE, PULL_TO_REFRESH_MAX_DISTANCE, PULL_TO_REFRESH_POINTER_QUERY, PULL_TO_REFRESH_SNAP_BACK_MS, PULL_TO_REFRESH_THRESHOLD, PanelSplitAction, PanelSplitActionMain, type PanelSplitActionMainProps, PanelSplitActionMenu, type PanelSplitActionMenuProps, type PanelSplitActionProps, PanelSplitActionToggle, type PanelSplitActionToggleProps, PopoverActions, type PopoverActionsProps, PopoverBody, type PopoverBodyProps, PreviewCardActions, type PreviewCardActionsProps, PreviewCardBody, type PreviewCardBodyProps, PreviewCardEyebrow, type PreviewCardEyebrowProps, PreviewCardFooter, type PreviewCardFooterProps, PreviewCardMeta, type PreviewCardMetaProps, type PullToRefresh, PullToRefreshIndicator, type PullToRefreshIndicatorProps, type PullToRefreshPlatform, type PullToRefreshState, SaveStatus, SaveStatusError, type SaveStatusErrorProps, type SaveStatusProps, SaveStatusSaved, type SaveStatusSavedProps, SelectionToolbar, SelectionToolbarAction, type SelectionToolbarActionProps, SelectionToolbarActions, type SelectionToolbarActionsProps, SelectionToolbarClose, type SelectionToolbarCloseProps, SelectionToolbarCount, type SelectionToolbarCountProps, SelectionToolbarCountValue, type SelectionToolbarCountValueProps, SelectionToolbarDock, type SelectionToolbarDockProps, SelectionToolbarHint, type SelectionToolbarHintProps, SelectionToolbarItem, type SelectionToolbarItemProps, SelectionToolbarMore, SelectionToolbarMoreItems, type SelectionToolbarMoreProps, type SelectionToolbarProps, TOUCH_DRAG_DISTANCE_PX, TOUCH_DRAG_HOLD_MS, TOUCH_DRAG_TOLERANCE_PX, type TableSort, TableSortButton, type TableSortButtonProps, TableSortableHead, type TableSortableHeadProps, TaskCompletionControl, type TaskCompletionControlProps, type UseCommentMarginFitsOptions, type UseDragListsOptions, type UsePullToRefreshOptions, WebTopBarCenter, type WebTopBarCenterProps, WebTopBarEnd, type WebTopBarEndProps, WebTopBarRoot, type WebTopBarRootProps, WebTopBarStart, type WebTopBarStartProps, cancelDrag, createDragAnnouncements, dragInstructions, dragListStrategy, dragMessages, keepGrabInside, listKeyboardCoordinates, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useDragAcrossLists, useDragAnnouncer, useDragLists, useDragSensors, useDragSiblingTransition, useFitItem, useFitMore, useHoldThenMoveTouchSensor, useInFitToolbar, useKeyboardPlatform, useMouseOnlyPointerSensor, useParentOverlayKind, usePullToRefresh, useTruncated };
|
|
85
|
+
export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, AppLinkCard, AppLinkCardActions, type AppLinkCardActionsProps, AppLinkCardBadge, type AppLinkCardBadgeProps, AppLinkCardBody, type AppLinkCardBodyProps, AppLinkCardEyebrow, type AppLinkCardEyebrowProps, AppLinkCardHeader, type AppLinkCardHeaderProps, AppLinkCardHost, type AppLinkCardHostProps, AppLinkCardIcon, type AppLinkCardIconProps, AppLinkCardMeta, type AppLinkCardMetaProps, AppLinkCardName, type AppLinkCardNameProps, AppLinkCardPlaceholder, type AppLinkCardPlaceholderProps, AppLinkCardTitle, type AppLinkCardTitleProps, AvatarGroupButton, type AvatarGroupButtonProps, ButtonSplit, ButtonSplitMain, type ButtonSplitMainProps, ButtonSplitMenu, type ButtonSplitMenuProps, type ButtonSplitProps, type ButtonSplitSize, type ButtonSplitVariant, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ChoiceList, type ChoiceListGroup, type ChoiceListItem, type ChoiceListMultipleProps, type ChoiceListProps, type ChoiceListSingleProps, ComboboxSelect, type ComboboxSelectGroup, type ComboboxSelectMessages, type ComboboxSelectOption, type ComboboxSelectProps, type ComboboxSelectSelection, type ComboboxSelectValue, CommentCard, CommentCardMeta, type CommentCardMetaProps, type CommentCardProps, CommentCardQuote, type CommentCardQuoteProps, CommentCardTrigger, type CommentCardTriggerProps, CommentEntry, CommentEntryAuthor, type CommentEntryAuthorProps, CommentEntryBody, type CommentEntryBodyProps, CommentEntryHeader, type CommentEntryHeaderProps, type CommentEntryProps, CommentEntryTime, type CommentEntryTimeProps, CommentMargin, CommentMarginItem, type CommentMarginItemProps, type CommentMarginLayout, type CommentMarginLayoutItem, type CommentMarginLayoutOptions, type CommentMarginProps, CommentMarker, type CommentMarkerProps, DEFAULT_DRAG_MESSAGES, DRAG_AUTO_SCROLL_ZONE_PX, DRAG_KEYBOARD_CODES, DRAG_KEYBOARD_OFFSET_PX, DRAG_LIFT_Z_INDEX, DRAG_SETTLE, DRAG_SIBLING_TRANSITION, DROP_GLIDE, DialogFooterNote, type DialogFooterNoteProps, type DragAcrossLists, type DragAnnouncementSource, DragLift, type DragLiftProps, type DragListsItems, DragLiveRegion, type DragMessages, type DragNamed, type DragPlace, DragRefusalHint, type DragRefusalHintProps, DragRemeasure, type DragRemeasureProps, type DragSensorsOptions, DraggedSlot, type DraggedSlotProps, DropPlaceholder, type DropPlaceholderProps, DropdownMenuLinkItem, type DropdownMenuLinkItemProps, Ellipsis, type EllipsisProps, type EllipsisState, EllipsisToggle, type EllipsisToggleProps, FIT_SEARCH_MAX_LEAST, FilterChip, FilterChipLabel, type FilterChipLabelProps, type FilterChipProps, FilterChipRemove, type FilterChipRemoveProps, type FitItemOptions, type FitStep, type FitSteps, FitToolbar, FitToolbarButton, type FitToolbarButtonProps, FitToolbarGroup, type FitToolbarGroupProps, FitToolbarMore, FitToolbarMoreItems, type FitToolbarMoreProps, FitToolbarPicker, type FitToolbarPickerProps, type FitToolbarProps, FitToolbarSearch, type FitToolbarSearchProps, FitToolbarSplitButton, type FitToolbarSplitButtonProps, type HoldThenMoveOptions, HoldThenMoveTouchSensor, InboxItemLeadingBadge, type InboxItemLeadingBadgeProps, InboxItemLine, type InboxItemLineProps, InboxItemListGroup, type InboxItemListGroupProps, InboxItemListHeading, type InboxItemListHeadingProps, InboxItemSkeleton, InboxItemSkeletonList, type InboxItemSkeletonListProps, type InboxItemSkeletonProps, InboxItemStatus, type InboxItemStatusProps, KbdButton, KbdButtonCaret, type KbdButtonCaretProps, KbdButtonPlaceholder, type KbdButtonPlaceholderProps, type KbdButtonProps, type KbdKeyName, KbdShortcut, type KbdShortcutProps, type KeyboardPlatform, LIFT_CLASS, LightboxBody, type LightboxBodyProps, ListRowSkeleton, type ListRowSkeletonProps, MOUSE_DRAG_DISTANCE_PX, MessageItemDelegatedAvatar, type MessageItemDelegatedAvatarProps, MessageItemDelegatedBy, MessageItemDelegatedByButton, type MessageItemDelegatedByButtonProps, MessageItemDelegatedByName, type MessageItemDelegatedByNameProps, type MessageItemDelegatedByProps, MessageItemTrailing, type MessageItemTrailingProps, MessageListJumpControls, type MessageListJumpControlsProps, MessageListJumpPill, MessageListJumpPillDismiss, type MessageListJumpPillDismissProps, MessageListJumpPillGroup, type MessageListJumpPillGroupProps, type MessageListJumpPillProps, MessageQuotedPreviewAuthorDelegatedBy, type MessageQuotedPreviewAuthorDelegatedByProps, MessageReferenceIcon, type MessageReferenceIconProps, MessageReferenceReadMark, type MessageReferenceReadMarkProps, Meter, MeterHeader, type MeterHeaderProps, MeterIndicator, type MeterIndicatorProps, MeterLabel, type MeterLabelProps, type MeterProps, MeterTrack, type MeterTrackProps, MeterValue, type MeterValueProps, MobileNavServerItem, type MobileNavServerItemProps, MobileNavServerPopover, MobileNavServerPopoverContent, type MobileNavServerPopoverContentProps, MobileNavServerPopoverDestination, type MobileNavServerPopoverDestinationProps, MobileNavServerPopoverDestinations, type MobileNavServerPopoverDestinationsProps, MobileNavServerPopoverGroup, type MobileNavServerPopoverGroupProps, MobileNavServerPopoverList, type MobileNavServerPopoverListProps, type MobileNavServerPopoverProps, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, type MobileNavServerPopoverRowBodyProps, MobileNavServerPopoverRowDescription, type MobileNavServerPopoverRowDescriptionProps, MobileNavServerPopoverRowLabel, type MobileNavServerPopoverRowLabelProps, type MobileNavServerPopoverRowProps, MouseOnlyPointerSensor, ORIGIN_OPACITY, type OverlayLayerKind, OverlayLayerProvider, type OverlayLayerProviderProps, PULL_TO_REFRESH_DAMPING, PULL_TO_REFRESH_HOLD_DISTANCE, PULL_TO_REFRESH_MAX_DISTANCE, PULL_TO_REFRESH_POINTER_QUERY, PULL_TO_REFRESH_SNAP_BACK_MS, PULL_TO_REFRESH_THRESHOLD, PanelSplitAction, PanelSplitActionMain, type PanelSplitActionMainProps, PanelSplitActionMenu, type PanelSplitActionMenuProps, type PanelSplitActionProps, PanelSplitActionToggle, type PanelSplitActionToggleProps, PopoverActions, type PopoverActionsProps, PopoverBody, type PopoverBodyProps, PreviewCardActions, type PreviewCardActionsProps, PreviewCardBody, type PreviewCardBodyProps, PreviewCardEyebrow, type PreviewCardEyebrowProps, PreviewCardFooter, type PreviewCardFooterProps, PreviewCardMeta, type PreviewCardMetaProps, type PullToRefresh, PullToRefreshIndicator, type PullToRefreshIndicatorProps, type PullToRefreshPlatform, type PullToRefreshState, SaveStatus, SaveStatusError, type SaveStatusErrorProps, type SaveStatusProps, SaveStatusSaved, type SaveStatusSavedProps, SelectionToolbar, SelectionToolbarAction, type SelectionToolbarActionProps, SelectionToolbarActions, type SelectionToolbarActionsProps, SelectionToolbarClose, type SelectionToolbarCloseProps, SelectionToolbarCount, type SelectionToolbarCountProps, SelectionToolbarCountValue, type SelectionToolbarCountValueProps, SelectionToolbarDock, type SelectionToolbarDockProps, SelectionToolbarHint, type SelectionToolbarHintProps, SelectionToolbarItem, type SelectionToolbarItemProps, SelectionToolbarMore, SelectionToolbarMoreItems, type SelectionToolbarMoreProps, type SelectionToolbarProps, SheetPopupBoundary, type SheetPopupBoundaryProps, TOUCH_DRAG_DISTANCE_PX, TOUCH_DRAG_HOLD_MS, TOUCH_DRAG_TOLERANCE_PX, type TableSort, TableSortButton, type TableSortButtonProps, TableSortableHead, type TableSortableHeadProps, TaskCompletionControl, type TaskCompletionControlProps, type UseCommentMarginFitsOptions, type UseDragListsOptions, type UsePullToRefreshOptions, WebTopBarCenter, type WebTopBarCenterProps, WebTopBarEnd, type WebTopBarEndProps, WebTopBarRoot, type WebTopBarRootProps, WebTopBarStart, type WebTopBarStartProps, cancelDrag, createDragAnnouncements, dragInstructions, dragListStrategy, dragMessages, keepGrabInside, listKeyboardCoordinates, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useDragAcrossLists, useDragAnnouncer, useDragLists, useDragSensors, useDragSiblingTransition, useFitItem, useFitMore, useHoldThenMoveTouchSensor, useInFitToolbar, useKeyboardPlatform, useMouseOnlyPointerSensor, useParentOverlayKind, usePullToRefresh, useTruncated };
|
package/dist/wip-exports.mjs
CHANGED
|
@@ -5,14 +5,15 @@ import { MessageItemTrailing } from "./components/message-item/message-item-cont
|
|
|
5
5
|
import { LightboxBody } from "./components/lightbox/lightbox.mjs";
|
|
6
6
|
import { MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup } from "./components/message-list/message-list-jump.mjs";
|
|
7
7
|
import { InboxItemLeadingBadge } from "./components/inbox-item/inbox-item-leading-badge.mjs";
|
|
8
|
-
import { HoldThenMoveTouchSensor, MouseOnlyPointerSensor, TOUCH_DRAG_DISTANCE_PX, TOUCH_DRAG_HOLD_MS, TOUCH_DRAG_TOLERANCE_PX, useHoldThenMoveTouchSensor, useMouseOnlyPointerSensor } from "./lib/touch-drag.mjs";
|
|
9
8
|
import { InboxItemLine, InboxItemListGroup, InboxItemListHeading, InboxItemStatus } from "./components/inbox-item/inbox-item.mjs";
|
|
9
|
+
import { HoldThenMoveTouchSensor, MouseOnlyPointerSensor, TOUCH_DRAG_DISTANCE_PX, TOUCH_DRAG_HOLD_MS, TOUCH_DRAG_TOLERANCE_PX, useHoldThenMoveTouchSensor, useMouseOnlyPointerSensor } from "./lib/touch-drag.mjs";
|
|
10
10
|
import { InboxItemSkeleton, InboxItemSkeletonList } from "./components/inbox-item/inbox-item-skeleton.mjs";
|
|
11
11
|
import { ListRowSkeleton } from "./components/list-row/list-row-skeleton.mjs";
|
|
12
|
-
import { FIT_SEARCH_MAX_LEAST, FitToolbar, FitToolbarButton, FitToolbarGroup, FitToolbarMore, FitToolbarMoreItems, FitToolbarPicker, FitToolbarSearch, FitToolbarSplitButton, useFitItem, useFitMore, useInFitToolbar } from "./components/fit-toolbar/fit-toolbar.mjs";
|
|
13
12
|
import { DropdownMenuLinkItem } from "./components/dropdown-menu/dropdown-menu.mjs";
|
|
13
|
+
import { FIT_SEARCH_MAX_LEAST, FitToolbar, FitToolbarButton, FitToolbarGroup, FitToolbarMore, FitToolbarMoreItems, FitToolbarPicker, FitToolbarSearch, FitToolbarSplitButton, useFitItem, useFitMore, useInFitToolbar } from "./components/fit-toolbar/fit-toolbar.mjs";
|
|
14
14
|
import { Dialog, DialogClose, DialogFooterNote, DialogTrigger } from "./components/dialog/dialog.mjs";
|
|
15
15
|
import { OverlayLayerProvider, useParentOverlayKind } from "./lib/overlay-depth.mjs";
|
|
16
|
+
import { SheetPopupBoundary } from "./lib/popup-boundary.mjs";
|
|
16
17
|
import { MobileNavServerItem, MobileNavServerPopover, MobileNavServerPopoverContent, MobileNavServerPopoverDestination, MobileNavServerPopoverDestinations, MobileNavServerPopoverGroup, MobileNavServerPopoverList, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, MobileNavServerPopoverRowDescription, MobileNavServerPopoverRowLabel } from "./components/mobile-nav/mobile-nav-server.mjs";
|
|
17
18
|
import { MessageReferenceIcon, MessageReferenceReadMark } from "./components/message-item/message-reference.mjs";
|
|
18
19
|
import { PreviewCardActions, PreviewCardBody, PreviewCardEyebrow, PreviewCardFooter, PreviewCardMeta } from "./components/preview-card/preview-card.mjs";
|
|
@@ -51,4 +52,4 @@ import { SaveStatus, SaveStatusError, SaveStatusSaved } from "./components/save-
|
|
|
51
52
|
import { TaskCompletionControl } from "./components/task-completion-control/task-completion-control.mjs";
|
|
52
53
|
import { KbdButton, KbdButtonCaret, KbdButtonPlaceholder } from "./components/kbd-button/kbd-button.mjs";
|
|
53
54
|
import { WebTopBarCenter, WebTopBarEnd, WebTopBarRoot, WebTopBarStart } from "./components/web-top-bar/web-top-bar.mjs";
|
|
54
|
-
export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, AppLinkCard, AppLinkCardActions, AppLinkCardBadge, AppLinkCardBody, AppLinkCardEyebrow, AppLinkCardHeader, AppLinkCardHost, AppLinkCardIcon, AppLinkCardMeta, AppLinkCardName, AppLinkCardPlaceholder, AppLinkCardTitle, AvatarGroupButton, ButtonSplit, ButtonSplitMain, ButtonSplitMenu, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ChoiceList, ComboboxSelect, CommentCard, CommentCardMeta, CommentCardQuote, CommentCardTrigger, CommentEntry, CommentEntryAuthor, CommentEntryBody, CommentEntryHeader, CommentEntryTime, CommentMargin, CommentMarginItem, CommentMarker, DEFAULT_DRAG_MESSAGES, DRAG_AUTO_SCROLL_ZONE_PX, DRAG_KEYBOARD_CODES, DRAG_KEYBOARD_OFFSET_PX, DRAG_LIFT_Z_INDEX, DRAG_SETTLE, DRAG_SIBLING_TRANSITION, DROP_GLIDE, DialogFooterNote, DragLift, DragLiveRegion, DragRefusalHint, DragRemeasure, DraggedSlot, DropPlaceholder, DropdownMenuLinkItem, Ellipsis, EllipsisToggle, FIT_SEARCH_MAX_LEAST, FilterChip, FilterChipLabel, FilterChipRemove, FitToolbar, FitToolbarButton, FitToolbarGroup, FitToolbarMore, FitToolbarMoreItems, FitToolbarPicker, FitToolbarSearch, FitToolbarSplitButton, HoldThenMoveTouchSensor, InboxItemLeadingBadge, InboxItemLine, InboxItemListGroup, InboxItemListHeading, InboxItemSkeleton, InboxItemSkeletonList, InboxItemStatus, KbdButton, KbdButtonCaret, KbdButtonPlaceholder, KbdShortcut, LIFT_CLASS, LightboxBody, ListRowSkeleton, MOUSE_DRAG_DISTANCE_PX, MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageItemTrailing, MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup, MessageQuotedPreviewAuthorDelegatedBy, MessageReferenceIcon, MessageReferenceReadMark, Meter, MeterHeader, MeterIndicator, MeterLabel, MeterTrack, MeterValue, MobileNavServerItem, MobileNavServerPopover, MobileNavServerPopoverContent, MobileNavServerPopoverDestination, MobileNavServerPopoverDestinations, MobileNavServerPopoverGroup, MobileNavServerPopoverList, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, MobileNavServerPopoverRowDescription, MobileNavServerPopoverRowLabel, MouseOnlyPointerSensor, ORIGIN_OPACITY, OverlayLayerProvider, PULL_TO_REFRESH_DAMPING, PULL_TO_REFRESH_HOLD_DISTANCE, PULL_TO_REFRESH_MAX_DISTANCE, PULL_TO_REFRESH_POINTER_QUERY, PULL_TO_REFRESH_SNAP_BACK_MS, PULL_TO_REFRESH_THRESHOLD, PanelSplitAction, PanelSplitActionMain, PanelSplitActionMenu, PanelSplitActionToggle, PopoverActions, PopoverBody, PreviewCardActions, PreviewCardBody, PreviewCardEyebrow, PreviewCardFooter, PreviewCardMeta, PullToRefreshIndicator, SaveStatus, SaveStatusError, SaveStatusSaved, SelectionToolbar, SelectionToolbarAction, SelectionToolbarActions, SelectionToolbarClose, SelectionToolbarCount, SelectionToolbarCountValue, SelectionToolbarDock, SelectionToolbarHint, SelectionToolbarItem, SelectionToolbarMore, SelectionToolbarMoreItems, TOUCH_DRAG_DISTANCE_PX, TOUCH_DRAG_HOLD_MS, TOUCH_DRAG_TOLERANCE_PX, TableSortButton, TableSortableHead, TaskCompletionControl, WebTopBarCenter, WebTopBarEnd, WebTopBarRoot, WebTopBarStart, cancelDrag, createDragAnnouncements, dragInstructions, dragListStrategy, dragMessages, keepGrabInside, listKeyboardCoordinates, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useDragAcrossLists, useDragAnnouncer, useDragLists, useDragSensors, useDragSiblingTransition, useFitItem, useFitMore, useHoldThenMoveTouchSensor, useInFitToolbar, useKeyboardPlatform, useMouseOnlyPointerSensor, useParentOverlayKind, usePullToRefresh, useTruncated };
|
|
55
|
+
export { Dialog as AnnouncementDialog, AnnouncementDialogAction, AnnouncementDialogBody, DialogClose as AnnouncementDialogClose, AnnouncementDialogContent, AnnouncementDialogFooter, AnnouncementDialogHeader, AnnouncementDialogLabel, AnnouncementDialogPicture, AnnouncementDialogSecondaryAction, AnnouncementDialogText, AnnouncementDialogTitle, DialogTrigger as AnnouncementDialogTrigger, AppLinkCard, AppLinkCardActions, AppLinkCardBadge, AppLinkCardBody, AppLinkCardEyebrow, AppLinkCardHeader, AppLinkCardHost, AppLinkCardIcon, AppLinkCardMeta, AppLinkCardName, AppLinkCardPlaceholder, AppLinkCardTitle, AvatarGroupButton, ButtonSplit, ButtonSplitMain, ButtonSplitMenu, COMMENT_HIGHLIGHT, COMMENT_HIGHLIGHT_ACTIVE, ChoiceList, ComboboxSelect, CommentCard, CommentCardMeta, CommentCardQuote, CommentCardTrigger, CommentEntry, CommentEntryAuthor, CommentEntryBody, CommentEntryHeader, CommentEntryTime, CommentMargin, CommentMarginItem, CommentMarker, DEFAULT_DRAG_MESSAGES, DRAG_AUTO_SCROLL_ZONE_PX, DRAG_KEYBOARD_CODES, DRAG_KEYBOARD_OFFSET_PX, DRAG_LIFT_Z_INDEX, DRAG_SETTLE, DRAG_SIBLING_TRANSITION, DROP_GLIDE, DialogFooterNote, DragLift, DragLiveRegion, DragRefusalHint, DragRemeasure, DraggedSlot, DropPlaceholder, DropdownMenuLinkItem, Ellipsis, EllipsisToggle, FIT_SEARCH_MAX_LEAST, FilterChip, FilterChipLabel, FilterChipRemove, FitToolbar, FitToolbarButton, FitToolbarGroup, FitToolbarMore, FitToolbarMoreItems, FitToolbarPicker, FitToolbarSearch, FitToolbarSplitButton, HoldThenMoveTouchSensor, InboxItemLeadingBadge, InboxItemLine, InboxItemListGroup, InboxItemListHeading, InboxItemSkeleton, InboxItemSkeletonList, InboxItemStatus, KbdButton, KbdButtonCaret, KbdButtonPlaceholder, KbdShortcut, LIFT_CLASS, LightboxBody, ListRowSkeleton, MOUSE_DRAG_DISTANCE_PX, MessageItemDelegatedAvatar, MessageItemDelegatedBy, MessageItemDelegatedByButton, MessageItemDelegatedByName, MessageItemTrailing, MessageListJumpControls, MessageListJumpPill, MessageListJumpPillDismiss, MessageListJumpPillGroup, MessageQuotedPreviewAuthorDelegatedBy, MessageReferenceIcon, MessageReferenceReadMark, Meter, MeterHeader, MeterIndicator, MeterLabel, MeterTrack, MeterValue, MobileNavServerItem, MobileNavServerPopover, MobileNavServerPopoverContent, MobileNavServerPopoverDestination, MobileNavServerPopoverDestinations, MobileNavServerPopoverGroup, MobileNavServerPopoverList, MobileNavServerPopoverRow, MobileNavServerPopoverRowBody, MobileNavServerPopoverRowDescription, MobileNavServerPopoverRowLabel, MouseOnlyPointerSensor, ORIGIN_OPACITY, OverlayLayerProvider, PULL_TO_REFRESH_DAMPING, PULL_TO_REFRESH_HOLD_DISTANCE, PULL_TO_REFRESH_MAX_DISTANCE, PULL_TO_REFRESH_POINTER_QUERY, PULL_TO_REFRESH_SNAP_BACK_MS, PULL_TO_REFRESH_THRESHOLD, PanelSplitAction, PanelSplitActionMain, PanelSplitActionMenu, PanelSplitActionToggle, PopoverActions, PopoverBody, PreviewCardActions, PreviewCardBody, PreviewCardEyebrow, PreviewCardFooter, PreviewCardMeta, PullToRefreshIndicator, SaveStatus, SaveStatusError, SaveStatusSaved, SelectionToolbar, SelectionToolbarAction, SelectionToolbarActions, SelectionToolbarClose, SelectionToolbarCount, SelectionToolbarCountValue, SelectionToolbarDock, SelectionToolbarHint, SelectionToolbarItem, SelectionToolbarMore, SelectionToolbarMoreItems, SheetPopupBoundary, TOUCH_DRAG_DISTANCE_PX, TOUCH_DRAG_HOLD_MS, TOUCH_DRAG_TOLERANCE_PX, TableSortButton, TableSortableHead, TaskCompletionControl, WebTopBarCenter, WebTopBarEnd, WebTopBarRoot, WebTopBarStart, cancelDrag, createDragAnnouncements, dragInstructions, dragListStrategy, dragMessages, keepGrabInside, listKeyboardCoordinates, resolveCommentMarginLayout, setCommentHighlights, useCommentMarginFits, useDragAcrossLists, useDragAnnouncer, useDragLists, useDragSensors, useDragSiblingTransition, useFitItem, useFitMore, useHoldThenMoveTouchSensor, useInFitToolbar, useKeyboardPlatform, useMouseOnlyPointerSensor, useParentOverlayKind, usePullToRefresh, useTruncated };
|