flet-box 1.0.7 → 1.0.9
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 +3 -0
- package/bin/cli.js +13 -0
- package/bin/commands/checkApi.js +13 -1
- package/bin/commands/checkUi.js +1369 -0
- package/bin/commands/create.js +49 -5
- package/bin/commands/createBundle.js +21 -0
- package/bin/commands/runServer.js +11 -2
- package/bin/utils/pwaShell.js +137 -0
- package/bin/utils/templates.js +1398 -443
- package/docs/README.md +4 -0
- package/docs/cli/README.md +63 -2
- package/docs/guides/README.md +2 -0
- package/docs/guides/clean-ui.md +211 -0
- package/docs/guides/minification-and-protection.md +1 -1
- package/docs/guides/mobile-and-platforms.md +31 -0
- package/docs/guides/online-updates.md +48 -0
- package/docs/tools/README.md +1 -1
- package/docs/tools/animation.md +1 -1
- package/docs/tools/markdown.md +3 -3
- package/docs/tools/theme.md +42 -1
- package/docs/widget/Accordion.md +3 -0
- package/docs/widget/AdMob.md +4 -1
- package/docs/widget/AdSense.md +3 -0
- package/docs/widget/AnimatedBox.md +6 -3
- package/docs/widget/AnimatedText.md +3 -0
- package/docs/widget/Audio.md +3 -0
- package/docs/widget/Avatar.md +3 -0
- package/docs/widget/Badge.md +3 -0
- package/docs/widget/Button.md +3 -0
- package/docs/widget/COMMON_PROPS.md +52 -0
- package/docs/widget/Card.md +3 -0
- package/docs/widget/Carousel.md +3 -0
- package/docs/widget/Chart.md +3 -0
- package/docs/widget/Checkbox.md +3 -0
- package/docs/widget/Chip.md +3 -0
- package/docs/widget/CircularBar.md +3 -0
- package/docs/widget/CircularChart.md +3 -0
- package/docs/widget/CodeViewer.md +3 -0
- package/docs/widget/Column.md +3 -0
- package/docs/widget/Container.md +3 -0
- package/docs/widget/DataTable.md +3 -0
- package/docs/widget/Divider.md +3 -0
- package/docs/widget/DraggBox.md +3 -0
- package/docs/widget/Dropdown.md +3 -0
- package/docs/widget/DroppBox.md +3 -0
- package/docs/widget/FloatingActionButton.md +3 -0
- package/docs/widget/GridView.md +3 -0
- package/docs/widget/Icon.md +3 -0
- package/docs/widget/Image.md +3 -0
- package/docs/widget/Input.md +3 -0
- package/docs/widget/Inspector.md +2 -2
- package/docs/widget/InstallButton.md +3 -0
- package/docs/widget/ListTile.md +3 -0
- package/docs/widget/ListView.md +3 -0
- package/docs/widget/Maps.md +3 -0
- package/docs/widget/Markdown.md +3 -0
- package/docs/widget/MatrixRain.md +3 -0
- package/docs/widget/Pagination.md +3 -0
- package/docs/widget/ParallaxBox.md +3 -0
- package/docs/widget/ProgressBar.md +3 -0
- package/docs/widget/QRCode.md +3 -0
- package/docs/widget/README.md +2 -0
- package/docs/widget/Radio.md +4 -1
- package/docs/widget/Rating.md +3 -0
- package/docs/widget/Row.md +3 -0
- package/docs/widget/Skeleton.md +3 -0
- package/docs/widget/Slider.md +3 -0
- package/docs/widget/Stack.md +3 -0
- package/docs/widget/Stepper.md +3 -0
- package/docs/widget/Switch.md +3 -0
- package/docs/widget/Tabs.md +5 -5
- package/docs/widget/Text.md +3 -0
- package/docs/widget/Tooltip.md +3 -0
- package/docs/widget/TreeView.md +3 -0
- package/docs/widget/Video.md +3 -0
- package/package.json +2 -2
- package/src/animations/AnimatedBox.js +4 -1
- package/src/animations/MatrixRain.js +3 -3
- package/src/index.d.ts +64 -8
- package/src/index.js +1 -0
- package/src/navigations/AppBar.js +7 -12
- package/src/navigations/BottomNavigation.js +8 -13
- package/src/navigations/CollapsibleSideBar.js +30 -8
- package/src/navigations/Drawer.js +16 -14
- package/src/navigations/DrawerItem.js +3 -1
- package/src/navigations/Scaffold.js +26 -12
- package/src/navigations/Tabs.js +104 -59
- package/src/tools/color.js +54 -0
- package/src/tools/index.js +9 -1
- package/src/tools/scale.js +41 -0
- package/src/tools/shadow.js +20 -0
- package/src/utils/index.js +1 -0
- package/src/utils/readableInk.js +19 -0
- package/src/utils/syntaxHighlight.js +78 -10
- package/src/utils/themes.js +265 -58
- package/src/utils/units.js +33 -11
- package/src/widget-factory/effects.js +56 -5
- package/src/widget-factory/processProps.js +10 -1
- package/src/widget-factory/remTool.js +15 -29
- package/src/widget-factory/stackPosition.js +18 -3
- package/src/widget-factory/translateProps.js +28 -0
- package/src/widgets/Accordion.js +20 -23
- package/src/widgets/AdMob.js +7 -2
- package/src/widgets/Avatar.js +18 -12
- package/src/widgets/Badge.js +3 -2
- package/src/widgets/BottomSheet.js +14 -13
- package/src/widgets/Button.js +69 -30
- package/src/widgets/Card.js +6 -2
- package/src/widgets/Carousel.js +12 -10
- package/src/widgets/Chart.js +28 -5
- package/src/widgets/Checkbox.js +76 -18
- package/src/widgets/Chip.js +31 -10
- package/src/widgets/CircularBar.js +7 -7
- package/src/widgets/CircularChart.js +26 -8
- package/src/widgets/CodeViewer.js +93 -20
- package/src/widgets/DataTable.js +17 -11
- package/src/widgets/DraggBox.js +2 -1
- package/src/widgets/Dropdown.js +26 -13
- package/src/widgets/DroppBox.js +4 -2
- package/src/widgets/FloatingActionButton.js +13 -7
- package/src/widgets/Icon.js +3 -1
- package/src/widgets/Input.js +30 -23
- package/src/widgets/Inspector.js +54 -1
- package/src/widgets/InstallButton.js +6 -4
- package/src/widgets/ListTile.js +4 -3
- package/src/widgets/ListView.js +30 -12
- package/src/widgets/Markdown.js +37 -26
- package/src/widgets/Modal.js +14 -11
- package/src/widgets/Pagination.js +16 -11
- package/src/widgets/ProgressBar.js +6 -4
- package/src/widgets/Radio.js +73 -15
- package/src/widgets/Rating.js +24 -6
- package/src/widgets/Skeleton.js +31 -31
- package/src/widgets/Slider.js +29 -18
- package/src/widgets/SnackBar.js +35 -39
- package/src/widgets/Stepper.js +13 -9
- package/src/widgets/Switch.js +59 -18
- package/src/widgets/Tooltip.js +12 -10
- package/src/widgets/TreeView.js +27 -15
package/README.md
CHANGED
|
@@ -23,6 +23,7 @@ Real DOM · No Virtual DOM · No build config to learn.
|
|
|
23
23
|
<br><br>
|
|
24
24
|
|
|
25
25
|
<a href="https://kuko53348.github.io/flet-box-docs/">📖 Docs</a> •
|
|
26
|
+
<a href="https://kuko53348.github.io/flet-box-widgets-exemples/">🧪 Widget gallery</a> •
|
|
26
27
|
<a href="#quick-start">Quick start</a> •
|
|
27
28
|
<a href="https://www.youtube.com/@flet-box">▶ YouTube</a> •
|
|
28
29
|
<a href="#support--sponsorship">❤️ Sponsor</a>
|
|
@@ -157,6 +158,8 @@ Read the docs online: **[The FletBox Book — kuko53348.github.io/flet-box-docs]
|
|
|
157
158
|
|
|
158
159
|
They are **one continuous book** — the cover maps every page: [The FletBox Book source](docs/README.md).
|
|
159
160
|
|
|
161
|
+
Rather than read, click: **[the live widget gallery](https://kuko53348.github.io/flet-box-widgets-exemples/)** gives every widget its own page, renders each example in the browser it was written for, and prints the exact call underneath it. The theme toggle in the corner shows the same screen in light and dark, which is the honest way to judge a default color.
|
|
162
|
+
|
|
160
163
|
- [Your first app](docs/guides/first-app.md) — build a working todo app in 20 minutes
|
|
161
164
|
- [The widget book](docs/widget/README.md) — every widget with property tables and examples
|
|
162
165
|
- [State, Router & Services](docs/guides/state.md) — shared state, routing, storage, and HTTP
|
package/bin/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ import fs from "fs";
|
|
|
14
14
|
import path from "path";
|
|
15
15
|
import { createProject } from "./commands/create.js";
|
|
16
16
|
import { checkApi } from "./commands/checkApi.js";
|
|
17
|
+
import { checkUi } from "./commands/checkUi.js";
|
|
17
18
|
import { auditFix } from "./commands/auditFix.js";
|
|
18
19
|
import { toPng } from "./commands/toPng.js";
|
|
19
20
|
import { images } from "./commands/images.js";
|
|
@@ -86,6 +87,10 @@ ${cmd("unpack <Widget>", "Everything one widget really accepts, and what works")
|
|
|
86
87
|
${cmd(" └─ --example", "paste-ready call using only verified props")}
|
|
87
88
|
${cmd(" └─ --diff", "what the docs or types claim that the code ignores")}
|
|
88
89
|
${cmd(" └─ unpack --all", "every widget; --json / --md write .fletbox/api/")}
|
|
90
|
+
${cmd("check-ui", "Clean-UI gate: tokens, 8-based scale, tap targets, WCAG contrast")}
|
|
91
|
+
${cmd(" └─ --tokens", "print the measured contrast of every color token")}
|
|
92
|
+
${cmd(" └─ --strict", "fail on contrast warnings too")}
|
|
93
|
+
${cmd(" └─ alias", "ui | checkUi")}
|
|
89
94
|
${cmd("audit-fix", "Rewrite broken imports, missing imports and misspelled props")}
|
|
90
95
|
${cmd(" └─ --only imports|props", "run one repair instead of both")}
|
|
91
96
|
${cmd(" └─ alias", "fix-imports | fix-path-imports | auditFix")}
|
|
@@ -315,6 +320,14 @@ async function main() {
|
|
|
315
320
|
break;
|
|
316
321
|
}
|
|
317
322
|
|
|
323
|
+
case "check-ui":
|
|
324
|
+
case "checkUi":
|
|
325
|
+
case "ui": {
|
|
326
|
+
const { exitCode } = await checkUi(args.slice(1));
|
|
327
|
+
if (exitCode) process.exit(exitCode);
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
|
|
318
331
|
case "audit-fix":
|
|
319
332
|
case "auditFix":
|
|
320
333
|
case "fix-imports":
|
package/bin/commands/checkApi.js
CHANGED
|
@@ -234,6 +234,13 @@ export const collectSources = (projectRoot) => {
|
|
|
234
234
|
/**
|
|
235
235
|
* Read the keys of an object literal starting at its opening brace.
|
|
236
236
|
*
|
|
237
|
+
* Only the object's own level is scanned: a comma inside an array, a call or a
|
|
238
|
+
* nested brace belongs to that inner expression, not to the props object.
|
|
239
|
+
* Without the group counter, `children: [slot, line]` was split on its inner
|
|
240
|
+
* commas and every widget variable in the list was reported as a shorthand prop
|
|
241
|
+
* (`Column({ line })` — UNKNOWN_PROP), which is the single most common shape in
|
|
242
|
+
* a FletBox app.
|
|
243
|
+
*
|
|
237
244
|
* @param {string} code Comment/string-free source.
|
|
238
245
|
* @param {number} open Index of `{`.
|
|
239
246
|
* @returns {{ keys: string[], opaque: boolean }} `opaque` when a top-level
|
|
@@ -242,6 +249,7 @@ export const collectSources = (projectRoot) => {
|
|
|
242
249
|
const literalKeys = (code, open) => {
|
|
243
250
|
const keys = [];
|
|
244
251
|
let depth = 0;
|
|
252
|
+
let group = 0;
|
|
245
253
|
let current = "";
|
|
246
254
|
let opaque = false;
|
|
247
255
|
const flush = () => {
|
|
@@ -267,7 +275,11 @@ const literalKeys = (code, open) => {
|
|
|
267
275
|
flush();
|
|
268
276
|
return { keys, opaque };
|
|
269
277
|
}
|
|
270
|
-
} else if (
|
|
278
|
+
} else if (ch === "[" || ch === "(") {
|
|
279
|
+
group++;
|
|
280
|
+
} else if (ch === "]" || ch === ")") {
|
|
281
|
+
if (group > 0) group--;
|
|
282
|
+
} else if (depth === 1 && group === 0 && ch === ",") {
|
|
271
283
|
flush();
|
|
272
284
|
continue;
|
|
273
285
|
}
|