flet-box 1.0.9 → 1.1.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/bin/commands/checkUi.js +327 -46
- package/bin/commands/create.js +48 -19
- package/bin/commands/createScreen.js +1 -1
- package/bin/commands/runBundle.js +1 -1
- package/bin/utils/colors.js +0 -8
- package/bin/utils/helpers.js +0 -5
- package/bin/utils/images/jpeg.js +2 -3
- package/bin/utils/skills.js +59 -0
- package/bin/utils/templates.js +196 -575
- package/docs/README.md +3 -1
- package/docs/cli/README.md +18 -1
- package/docs/guides/README.md +6 -1
- package/docs/guides/accessibility.md +282 -0
- package/docs/guides/clean-ui.md +84 -21
- package/docs/guides/minification-and-protection.md +1 -1
- package/docs/guides/mobile-and-platforms.md +51 -0
- package/docs/guides/utilities.md +116 -4
- package/docs/guides/widget-structure.md +30 -0
- package/docs/tools/README.md +1 -1
- package/docs/tools/animation.md +134 -11
- package/docs/tools/device.md +75 -3
- package/docs/tools/text-and-time.md +116 -6
- package/docs/widget/Accordion.md +2 -0
- package/docs/widget/AnimatedBox.md +46 -20
- package/docs/widget/AnimatedText.md +13 -7
- package/docs/widget/Badge.md +1 -0
- package/docs/widget/COMMON_PROPS.md +26 -3
- package/docs/widget/Chart.md +1 -0
- package/docs/widget/Checkbox.md +7 -1
- package/docs/widget/CircularChart.md +2 -0
- package/docs/widget/Drawer.md +1 -0
- package/docs/widget/GridView.md +4 -1
- package/docs/widget/Input.md +2 -0
- package/docs/widget/InstallButton.md +1 -0
- package/docs/widget/Markdown.md +4 -0
- package/docs/widget/Rating.md +2 -0
- package/docs/widget/Slider.md +2 -0
- package/docs/widget/Stack.md +6 -5
- package/docs/widget/Stepper.md +2 -0
- package/docs/widget/Tooltip.md +3 -1
- package/package.json +4 -2
- package/skills/fletbox-design/SKILL.md +949 -0
- package/skills/fletbox-memory/SKILL.md +134 -0
- package/skills/fletbox-motion/SKILL.md +266 -0
- package/skills/fletbox-rules/SKILL.md +293 -0
- package/src/animations/AnimatedBox.js +321 -226
- package/src/animations/MatrixRain.js +7 -1
- package/src/animations/ParallaxBox.js +13 -10
- package/src/animations/animate.js +269 -106
- package/src/animations/color.js +91 -0
- package/src/animations/easings.js +275 -0
- package/src/animations/index.js +21 -0
- package/src/animations/motion.js +204 -0
- package/src/animations/transitions.js +327 -0
- package/src/core/runApp.js +0 -6
- package/src/helpers/boxEdges.js +69 -0
- package/src/helpers/html.js +39 -0
- package/src/index.d.ts +377 -25
- package/src/index.js +77 -0
- package/src/navigations/AdaptiveScaffold.js +6 -2
- package/src/navigations/AppBar.js +16 -7
- package/src/navigations/BottomNavigation.js +24 -1
- package/src/navigations/CollapsibleSideBar.js +0 -1
- package/src/navigations/Drawer.js +32 -1
- package/src/navigations/DrawerItem.js +1 -1
- package/src/navigations/Router.js +0 -1
- package/src/navigations/Scaffold.js +9 -3
- package/src/navigations/Tabs.js +104 -31
- package/src/services/RamStore.js +1 -2
- package/src/tools/breakpoints.js +113 -0
- package/src/tools/createList.js +0 -2
- package/src/tools/fonts.js +99 -0
- package/src/tools/index.js +74 -1
- package/src/tools/margin.js +5 -63
- package/src/tools/padding.js +5 -63
- package/src/tools/print.js +0 -8
- package/src/tools/scale.js +9 -2
- package/src/tools/time.js +56 -15
- package/src/tools/useState.js +1 -54
- package/src/utils/fieldFont.js +77 -0
- package/src/utils/focusRing.js +73 -0
- package/src/utils/focusScope.js +113 -0
- package/src/utils/markdownParser.js +7 -9
- package/src/utils/readableInk.js +7 -1
- package/src/utils/stackLayout.js +55 -0
- package/src/utils/styleInjector.js +25 -0
- package/src/utils/syntaxHighlight.js +1 -17
- package/src/utils/themes.js +31 -0
- package/src/utils/visualEffects.js +49 -47
- package/src/widget-factory/createWidget.js +16 -3
- package/src/widget-factory/effects.js +76 -3
- package/src/widget-factory/reactiveValue.js +0 -7
- package/src/widget-factory/tools.js +26 -143
- package/src/widget-factory/translateProps.js +5 -0
- package/src/widget-factory/widgetFactory.js +1 -1
- package/src/widgets/Accordion.js +70 -12
- package/src/widgets/AdMob.js +1 -1
- package/src/widgets/AdSense.js +1 -1
- package/src/widgets/AlertDialog.js +11 -9
- package/src/widgets/Avatar.js +10 -1
- package/src/widgets/Badge.js +7 -1
- package/src/widgets/BottomSheet.js +39 -5
- package/src/widgets/Chart.js +41 -9
- package/src/widgets/Checkbox.js +59 -9
- package/src/widgets/Chip.js +13 -1
- package/src/widgets/CircularBar.js +17 -5
- package/src/widgets/CircularChart.js +24 -2
- package/src/widgets/CodeViewer.js +5 -3
- package/src/widgets/Dropdown.js +223 -20
- package/src/widgets/GridView.js +17 -1
- package/src/widgets/Icon.js +21 -0
- package/src/widgets/Input.js +75 -44
- package/src/widgets/InstallButton.js +8 -2
- package/src/widgets/ListTile.js +6 -5
- package/src/widgets/ListView.js +21 -7
- package/src/widgets/Markdown.js +25 -44
- package/src/widgets/Modal.js +43 -6
- package/src/widgets/Pagination.js +35 -3
- package/src/widgets/ProgressBar.js +18 -0
- package/src/widgets/Radio.js +7 -0
- package/src/widgets/Rating.js +104 -16
- package/src/widgets/Skeleton.js +9 -5
- package/src/widgets/Slider.js +87 -7
- package/src/widgets/SnackBar.js +30 -1
- package/src/widgets/Stack.js +25 -13
- package/src/widgets/Stepper.js +112 -64
- package/src/widgets/Switch.js +10 -1
- package/src/widgets/Tooltip.js +93 -10
- package/src/widgets/TreeView.js +5 -5
- package/src/create-index.sh +0 -237
- package/src/widget-factory/pixTool.js +0 -40
- package/src/widget-factory/stringTool.js +0 -26
package/bin/utils/helpers.js
CHANGED
package/bin/utils/images/jpeg.js
CHANGED
|
@@ -338,7 +338,7 @@ export const decodeJpeg = (buf) => {
|
|
|
338
338
|
const decodeScan = (scan, ctx) => {
|
|
339
339
|
const { buf, components, width, height, maxH, maxV, block, scratch } = ctx;
|
|
340
340
|
const { restartInterval, tables: { quant, dc, ac } } = scan;
|
|
341
|
-
const specs = readScanHeader(scan.payload
|
|
341
|
+
const specs = readScanHeader(scan.payload);
|
|
342
342
|
if (specs.length !== components.length && specs.length !== 1) {
|
|
343
343
|
throw new Error(`JPEG scan covers ${specs.length} of ${components.length} components, which is neither interleaved nor single-component`);
|
|
344
344
|
}
|
|
@@ -558,11 +558,10 @@ const readDht = (payload, dc, ac) => {
|
|
|
558
558
|
* scan.
|
|
559
559
|
*
|
|
560
560
|
* @param {Buffer} payload
|
|
561
|
-
* @param {number} componentCount
|
|
562
561
|
* @returns {{ id: number, tables: number }[]} Component specifiers, in scan order.
|
|
563
562
|
* @throws {UnsupportedImage} For a progressive or refined scan.
|
|
564
563
|
*/
|
|
565
|
-
const readScanHeader = (payload
|
|
564
|
+
const readScanHeader = (payload) => {
|
|
566
565
|
const count = payload[0];
|
|
567
566
|
if (payload.length < 4 + count * 2) throw new Error("JPEG scan header is truncated");
|
|
568
567
|
const specs = [];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// bin/utils/skills.js
|
|
2
|
+
//
|
|
3
|
+
// The `skills/` folder at the package root is the ONLY source for the agent
|
|
4
|
+
// skills. Claude Code and Qoder load `.claude/skills/<name>/SKILL.md` and
|
|
5
|
+
// `.qoder/skills/<name>/SKILL.md` by frontmatter description, so `flet-box create`
|
|
6
|
+
// copies each file into both roots byte-for-byte. Keeping the text in a real
|
|
7
|
+
// markdown file (instead of a 450-line array of strings in templates.js) means an
|
|
8
|
+
// editor, a diff and `scripts/check-skills.mjs` can all read the same bytes the
|
|
9
|
+
// agent will.
|
|
10
|
+
//
|
|
11
|
+
// Node core only: `bin/` may not import a devDependency at module scope.
|
|
12
|
+
|
|
13
|
+
import fs from "node:fs";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { fileURLToPath } from "node:url";
|
|
16
|
+
|
|
17
|
+
const packageDir = path.join(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
18
|
+
|
|
19
|
+
/** Absolute path of the folder that holds every shipped skill. */
|
|
20
|
+
export const skillRoot = () => path.join(packageDir, "skills");
|
|
21
|
+
|
|
22
|
+
/** Kebab-case folder names, sorted, skipping anything without a SKILL.md. */
|
|
23
|
+
export const skillNames = () => {
|
|
24
|
+
let entries = [];
|
|
25
|
+
try {
|
|
26
|
+
entries = fs.readdirSync(skillRoot(), { withFileTypes: true });
|
|
27
|
+
} catch {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
return entries
|
|
31
|
+
.filter((entry) => entry.isDirectory())
|
|
32
|
+
.map((entry) => entry.name)
|
|
33
|
+
.filter((name) => fs.existsSync(path.join(skillRoot(), name, "SKILL.md")))
|
|
34
|
+
.sort();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The full skill text, frontmatter included.
|
|
39
|
+
* @throws when the skill does not exist — a missing skill is a build error, not
|
|
40
|
+
* a silent skip, or an app ships with half the contract and no one notices.
|
|
41
|
+
*/
|
|
42
|
+
export const readSkill = (name) =>
|
|
43
|
+
fs.readFileSync(path.join(skillRoot(), name, "SKILL.md"), "utf8");
|
|
44
|
+
|
|
45
|
+
/** The `key: value` lines between the two `---` fences. */
|
|
46
|
+
export const readFrontmatter = (name) => {
|
|
47
|
+
const text = readSkill(name);
|
|
48
|
+
const match = /^---\n([\s\S]*?)\n---/.exec(text);
|
|
49
|
+
if (!match) throw new Error(`skill "${name}" has no frontmatter block`);
|
|
50
|
+
const fields = {};
|
|
51
|
+
for (const line of match[1].split("\n")) {
|
|
52
|
+
const pair = /^([A-Za-z][A-Za-z0-9_-]*):\s*(.*)$/.exec(line);
|
|
53
|
+
if (pair) fields[pair[1]] = pair[2];
|
|
54
|
+
}
|
|
55
|
+
return fields;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** One short sentence for a Cursor rule or an index: the description field. */
|
|
59
|
+
export const skillDescription = (name) => readFrontmatter(name).description || name;
|