@flipova/foundation 1.14.0 → 2.0.5

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.
Files changed (268) hide show
  1. package/CHANGELOG.md +181 -0
  2. package/README.md +53 -178
  3. package/components/ui/accordion/ANIMATION_CUSTOMIZATION.md +162 -0
  4. package/components/ui/accordion/AccordionAnimatedHeight.tsx +56 -0
  5. package/components/ui/accordion/AccordionAnimatedIcon.tsx +41 -0
  6. package/components/ui/accordion/AnimatedHeight.tsx +56 -0
  7. package/components/ui/accordion/AnimatedIcon.tsx +41 -0
  8. package/components/ui/accordion/MIGRATION_SUMMARY.md +250 -0
  9. package/components/ui/accordion/USAGE_EXAMPLE.tsx +179 -0
  10. package/components/ui/accordion/animation-config.ts +32 -0
  11. package/components/ui/accordion/index.tsx +253 -0
  12. package/components/ui/actionsheet/index.tsx +511 -0
  13. package/components/ui/alert/index.tsx +158 -0
  14. package/components/ui/alert-dialog/index.tsx +254 -0
  15. package/components/ui/avatar/index.tsx +139 -0
  16. package/components/ui/badge/index.tsx +163 -0
  17. package/components/ui/bottomsheet/index.tsx +477 -0
  18. package/components/ui/box/index.tsx +19 -0
  19. package/components/ui/box/index.web.tsx +19 -0
  20. package/components/ui/box/styles.tsx +10 -0
  21. package/components/ui/button/index.tsx +264 -0
  22. package/components/ui/calendar/creator.tsx +366 -0
  23. package/components/ui/calendar/index.tsx +462 -0
  24. package/components/ui/calendar/styles.tsx +140 -0
  25. package/components/ui/card/index.tsx +23 -0
  26. package/components/ui/card/index.web.tsx +26 -0
  27. package/components/ui/card/styles.tsx +16 -0
  28. package/components/ui/center/index.tsx +22 -0
  29. package/components/ui/center/index.web.tsx +20 -0
  30. package/components/ui/center/styles.tsx +8 -0
  31. package/components/ui/checkbox/index.tsx +184 -0
  32. package/components/ui/date-time-picker/creator.tsx +109 -0
  33. package/components/ui/date-time-picker/index.tsx +585 -0
  34. package/components/ui/date-time-picker/index.web.tsx +217 -0
  35. package/components/ui/date-time-picker/styles.tsx +56 -0
  36. package/components/ui/divider/index.tsx +40 -0
  37. package/components/ui/drawer/index.tsx +362 -0
  38. package/components/ui/fab/index.tsx +215 -0
  39. package/components/ui/flat-list/index.tsx +21 -0
  40. package/components/ui/form-control/index.tsx +352 -0
  41. package/components/ui/gluestack-ui-provider/config.ts +72 -0
  42. package/components/ui/gluestack-ui-provider/index.tsx +47 -0
  43. package/components/ui/gluestack-ui-provider/index.web.tsx +96 -0
  44. package/components/ui/gluestack-ui-provider/script.ts +19 -0
  45. package/components/ui/gluestack-ui-provider/tokens.d.ts +17 -0
  46. package/components/ui/gluestack-ui-provider/tokens.js +188 -0
  47. package/components/ui/gluestack-ui-provider/useGluestackColors.ts +82 -0
  48. package/components/ui/grid/index.tsx +283 -0
  49. package/components/ui/grid/index.web.tsx +66 -0
  50. package/components/ui/grid/styles.tsx +15 -0
  51. package/components/ui/heading/index.tsx +220 -0
  52. package/components/ui/heading/index.web.tsx +202 -0
  53. package/components/ui/heading/styles.tsx +43 -0
  54. package/components/ui/hstack/index.tsx +27 -0
  55. package/components/ui/hstack/index.web.tsx +26 -0
  56. package/components/ui/hstack/styles.tsx +25 -0
  57. package/components/ui/icon/index.tsx +1588 -0
  58. package/components/ui/icon/index.web.tsx +1573 -0
  59. package/components/ui/image/index.tsx +48 -0
  60. package/components/ui/image-background/index.tsx +25 -0
  61. package/components/ui/image-viewer/index.tsx +743 -0
  62. package/components/ui/image-viewer/index.web.tsx +302 -0
  63. package/components/ui/index.ts +58 -0
  64. package/components/ui/input/index.tsx +125 -0
  65. package/components/ui/input-accessory-view/index.tsx +2 -0
  66. package/components/ui/keyboard-avoiding-view/index.tsx +2 -0
  67. package/components/ui/link/index.tsx +102 -0
  68. package/components/ui/liquid-glass/index.tsx +74 -0
  69. package/components/ui/menu/index.tsx +186 -0
  70. package/components/ui/modal/index.tsx +237 -0
  71. package/components/ui/popover/index.tsx +272 -0
  72. package/components/ui/portal/index.tsx +17 -0
  73. package/components/ui/pressable/index.tsx +39 -0
  74. package/components/ui/progress/index.tsx +83 -0
  75. package/components/ui/radio/index.tsx +217 -0
  76. package/components/ui/refresh-control/index.tsx +2 -0
  77. package/components/ui/safe-area-view/index.tsx +2 -0
  78. package/components/ui/scroll-view/index.tsx +2 -0
  79. package/components/ui/section-list/index.tsx +2 -0
  80. package/components/ui/select/index.tsx +277 -0
  81. package/components/ui/select/select-actionsheet.tsx +562 -0
  82. package/components/ui/skeleton/index.tsx +105 -0
  83. package/components/ui/skeleton/index.web.tsx +103 -0
  84. package/components/ui/skeleton/styles.tsx +35 -0
  85. package/components/ui/slider/index.tsx +181 -0
  86. package/components/ui/spinner/index.tsx +40 -0
  87. package/components/ui/status-bar/index.tsx +2 -0
  88. package/components/ui/switch/index.tsx +41 -0
  89. package/components/ui/table/index.tsx +210 -0
  90. package/components/ui/table/index.web.tsx +157 -0
  91. package/components/ui/table/styles.tsx +44 -0
  92. package/components/ui/tabs/TabsAnimatedIndicator.tsx +160 -0
  93. package/components/ui/tabs/animation-config.ts +3 -0
  94. package/components/ui/tabs/creator.tsx +206 -0
  95. package/components/ui/tabs/index.tsx +484 -0
  96. package/components/ui/text/index.tsx +48 -0
  97. package/components/ui/text/index.web.tsx +45 -0
  98. package/components/ui/text/styles.tsx +47 -0
  99. package/components/ui/textarea/index.tsx +94 -0
  100. package/components/ui/toast/index.tsx +252 -0
  101. package/components/ui/tooltip/index.tsx +131 -0
  102. package/components/ui/view/index.tsx +2 -0
  103. package/components/ui/virtualized-list/index.tsx +2 -0
  104. package/components/ui/vstack/index.tsx +28 -0
  105. package/components/ui/vstack/index.web.tsx +27 -0
  106. package/components/ui/vstack/styles.tsx +25 -0
  107. package/design/canonical.index.txt +53 -0
  108. package/design/documentation.xml +519 -0
  109. package/design/manifest.xml +90 -0
  110. package/design/schema.xsd +639 -0
  111. package/design/themes.xml +204 -0
  112. package/design/tokens.xml +510 -0
  113. package/design/tools/design.js +165 -0
  114. package/design/tools/npm.js +65 -0
  115. package/design/tools/requirements.txt +35 -0
  116. package/design/tools/sources/.checker/__init__.py +81 -0
  117. package/design/tools/sources/.checker/checks.py +198 -0
  118. package/design/tools/sources/.checker/cli.py +154 -0
  119. package/design/tools/sources/.checker/io.py +242 -0
  120. package/design/tools/sources/.checker/model.py +144 -0
  121. package/design/tools/sources/.checker/registry.py +115 -0
  122. package/design/tools/sources/.checker/report.py +21 -0
  123. package/design/tools/sources/.docgen/__init__.py +45 -0
  124. package/design/tools/sources/.docgen/cli.py +101 -0
  125. package/design/tools/sources/.docgen/model.py +147 -0
  126. package/design/tools/sources/.docgen/reference.py +97 -0
  127. package/design/tools/sources/.docgen/site.py +145 -0
  128. package/design/tools/sources/.docgen/xsddoc.py +329 -0
  129. package/design/tools/sources/.generate/__init__.py +35 -0
  130. package/design/tools/sources/.generate/cli.py +76 -0
  131. package/design/tools/sources/.generate/common.py +33 -0
  132. package/design/tools/sources/.generate/config.py +119 -0
  133. package/design/tools/sources/.generate/model.py +51 -0
  134. package/design/tools/sources/.generate/tokens.py +141 -0
  135. package/design/tools/sources/.linter/__init__.py +9 -0
  136. package/design/tools/sources/.linter/cli.py +44 -0
  137. package/design/tools/sources/.linter/discovery.py +30 -0
  138. package/design/tools/sources/.linter/errors.py +45 -0
  139. package/design/tools/sources/.linter/linter.py +68 -0
  140. package/design/tools/sources/.xmleditor/__init__.py +74 -0
  141. package/design/tools/sources/.xmleditor/blocks.py +185 -0
  142. package/design/tools/sources/.xmleditor/cli.py +141 -0
  143. package/design/tools/sources/.xmleditor/editor.py +906 -0
  144. package/design/tools/sources/.xmleditor/model.py +708 -0
  145. package/design/tools/sources/.xmleditor/widgets.py +1832 -0
  146. package/design/tools/sources/.xmleditor/xsdmodel.py +753 -0
  147. package/design/tools/sources/checker.py +55 -0
  148. package/design/tools/sources/docgen.py +66 -0
  149. package/design/tools/sources/generate.py +48 -0
  150. package/design/tools/sources/linter.py +54 -0
  151. package/design/tools/sources/ruff.toml +12 -0
  152. package/design/tools/sources/xmleditor.py +62 -0
  153. package/design/tools/unix/_venv_python.sh +16 -0
  154. package/design/tools/unix/check.sh +13 -0
  155. package/design/tools/unix/doc.sh +14 -0
  156. package/design/tools/unix/gen.sh +14 -0
  157. package/design/tools/unix/lint.sh +10 -0
  158. package/design/tools/unix/run.sh +20 -0
  159. package/design/tools/unix/verify.sh +12 -0
  160. package/design/tools/unix/xmledit.sh +12 -0
  161. package/design/tools/windows/check.cmd +12 -0
  162. package/design/tools/windows/doc.cmd +12 -0
  163. package/design/tools/windows/gen.cmd +11 -0
  164. package/design/tools/windows/lint.cmd +9 -0
  165. package/design/tools/windows/run.cmd +26 -0
  166. package/design/tools/windows/verify.cmd +10 -0
  167. package/design/tools/windows/xmledit.cmd +10 -0
  168. package/dist/chunk-LV4UIEQN.js +9730 -0
  169. package/dist/chunk-LV4UIEQN.js.map +1 -0
  170. package/dist/chunk-WNVU3BM2.mjs +9401 -0
  171. package/dist/chunk-WNVU3BM2.mjs.map +1 -0
  172. package/dist/index.d.mts +40 -10
  173. package/dist/index.d.ts +40 -10
  174. package/dist/index.js +726 -414
  175. package/dist/index.mjs +1 -5
  176. package/dist/ui/index.d.mts +6931 -3070
  177. package/dist/ui/index.d.ts +6931 -3070
  178. package/dist/ui/index.js +779 -352
  179. package/dist/ui/index.mjs +1 -2
  180. package/package.json +66 -149
  181. package/dist/chunk-2XORADW6.js +0 -24552
  182. package/dist/chunk-2XORADW6.js.map +0 -1
  183. package/dist/chunk-52BHHF5M.js +0 -46
  184. package/dist/chunk-52BHHF5M.js.map +0 -1
  185. package/dist/chunk-5647JY7Z.mjs +0 -100
  186. package/dist/chunk-5647JY7Z.mjs.map +0 -1
  187. package/dist/chunk-5N5HC4ZA.mjs +0 -3
  188. package/dist/chunk-5N5HC4ZA.mjs.map +0 -1
  189. package/dist/chunk-7QFZMGL6.js +0 -8583
  190. package/dist/chunk-7QFZMGL6.js.map +0 -1
  191. package/dist/chunk-ASZEP37D.js +0 -423
  192. package/dist/chunk-ASZEP37D.js.map +0 -1
  193. package/dist/chunk-BH5SU2JQ.mjs +0 -8282
  194. package/dist/chunk-BH5SU2JQ.mjs.map +0 -1
  195. package/dist/chunk-BO65GO53.mjs +0 -422
  196. package/dist/chunk-BO65GO53.mjs.map +0 -1
  197. package/dist/chunk-BSVXX52E.mjs +0 -413
  198. package/dist/chunk-BSVXX52E.mjs.map +0 -1
  199. package/dist/chunk-DNV5UBNF.mjs +0 -3
  200. package/dist/chunk-DNV5UBNF.mjs.map +0 -1
  201. package/dist/chunk-EDTAMUO2.js +0 -8310
  202. package/dist/chunk-EDTAMUO2.js.map +0 -1
  203. package/dist/chunk-IJTI6EX4.js +0 -4
  204. package/dist/chunk-IJTI6EX4.js.map +0 -1
  205. package/dist/chunk-M3YLASM2.js +0 -428
  206. package/dist/chunk-M3YLASM2.js.map +0 -1
  207. package/dist/chunk-OXKOGLXE.js +0 -4
  208. package/dist/chunk-OXKOGLXE.js.map +0 -1
  209. package/dist/chunk-RQXQK3ZO.mjs +0 -8486
  210. package/dist/chunk-RQXQK3ZO.mjs.map +0 -1
  211. package/dist/chunk-SR25V4EA.mjs +0 -40
  212. package/dist/chunk-SR25V4EA.mjs.map +0 -1
  213. package/dist/chunk-UB34WFEQ.js +0 -106
  214. package/dist/chunk-UB34WFEQ.js.map +0 -1
  215. package/dist/chunk-ZBRWXKDF.mjs +0 -24431
  216. package/dist/chunk-ZBRWXKDF.mjs.map +0 -1
  217. package/dist/cli/ds.d.mts +0 -1
  218. package/dist/cli/ds.d.ts +0 -1
  219. package/dist/cli/ds.js +0 -602
  220. package/dist/cli/ds.js.map +0 -1
  221. package/dist/cli/ds.mjs +0 -579
  222. package/dist/cli/ds.mjs.map +0 -1
  223. package/dist/cli/flipova.d.mts +0 -1
  224. package/dist/cli/flipova.d.ts +0 -1
  225. package/dist/cli/flipova.js +0 -161
  226. package/dist/cli/flipova.js.map +0 -1
  227. package/dist/cli/flipova.mjs +0 -154
  228. package/dist/cli/flipova.mjs.map +0 -1
  229. package/dist/config/index.d.mts +0 -123
  230. package/dist/config/index.d.ts +0 -123
  231. package/dist/config/index.js +0 -28
  232. package/dist/config/index.js.map +0 -1
  233. package/dist/config/index.mjs +0 -3
  234. package/dist/config/index.mjs.map +0 -1
  235. package/dist/createTheme-DQeX3s0I.d.mts +0 -78
  236. package/dist/createTheme-Y4jfz4-u.d.ts +0 -78
  237. package/dist/index-CuaJA3gM.d.mts +0 -78
  238. package/dist/index-CuaJA3gM.d.ts +0 -78
  239. package/dist/registry/index.d.mts +0 -10160
  240. package/dist/registry/index.d.ts +0 -10160
  241. package/dist/registry/index.js +0 -392
  242. package/dist/registry/index.js.map +0 -1
  243. package/dist/registry/index.mjs +0 -3
  244. package/dist/registry/index.mjs.map +0 -1
  245. package/dist/theme/index.d.mts +0 -35
  246. package/dist/theme/index.d.ts +0 -35
  247. package/dist/theme/index.js +0 -28
  248. package/dist/theme/index.js.map +0 -1
  249. package/dist/theme/index.mjs +0 -3
  250. package/dist/theme/index.mjs.map +0 -1
  251. package/dist/tokens/index.d.mts +0 -423
  252. package/dist/tokens/index.d.ts +0 -423
  253. package/dist/tokens/index.js +0 -44
  254. package/dist/tokens/index.js.map +0 -1
  255. package/dist/tokens/index.mjs +0 -3
  256. package/dist/tokens/index.mjs.map +0 -1
  257. package/dist/types/index.d.mts +0 -202
  258. package/dist/types/index.d.ts +0 -202
  259. package/dist/types/index.js +0 -4
  260. package/dist/types/index.js.map +0 -1
  261. package/dist/types/index.mjs +0 -3
  262. package/dist/types/index.mjs.map +0 -1
  263. package/dist/web/index.d.mts +0 -316
  264. package/dist/web/index.d.ts +0 -316
  265. package/dist/web/index.js +0 -1500
  266. package/dist/web/index.js.map +0 -1
  267. package/dist/web/index.mjs +0 -1396
  268. package/dist/web/index.mjs.map +0 -1
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ checker.py — Manifest-driven determinism checker (thin entry point).
4
+
5
+ The implementation lives in the ``.checker`` package (dot-prefixed on
6
+ purpose: invisible to casual directory listing / glob patterns), split for
7
+ modularity and maintenance:
8
+
9
+ .checker/model.py Rule / Diagnostic / RegistryModel, reference resolution
10
+ .checker/registry.py handler registry, applyTo expansion, ordering checks
11
+ .checker/checks.py one handler per rule kind (ids, ordering, references,
12
+ timestamps, locale, style, sync)
13
+ .checker/io.py build_model, canonical index, sync-version, XSD pass
14
+ .checker/cli.py argument parsing & dispatch (main)
15
+ .checker/report.py Report (diagnostics collector)
16
+
17
+ USAGE (unchanged; see design/tools/windows/check.cmd / design/tools/unix/check.sh)
18
+ -------
19
+ python3 checker.py --manifest ../../manifest.xml --root ../../.. --check
20
+ python3 checker.py --manifest ../../manifest.xml --schema ../../schema.xsd
21
+ python3 checker.py --manifest ../../manifest.xml --list-rules
22
+ python3 checker.py --manifest ../../manifest.xml --emit-canonical
23
+ python3 checker.py --manifest ../../manifest.xml --verify-canonical
24
+ python3 checker.py --manifest ../../manifest.xml --sync-version
25
+ """
26
+
27
+ from __future__ import annotations
28
+
29
+ import importlib.util
30
+ import sys
31
+ from pathlib import Path
32
+
33
+ _SOURCES_DIR = Path(__file__).resolve().parent
34
+ _PKG_DIR = _SOURCES_DIR / ".checker"
35
+ _PKG_NAME = "foundation_checker"
36
+
37
+ # ".checker" starts with a dot, so it is not a valid Python identifier and
38
+ # cannot be imported by name. Register it as a synthetic package whose
39
+ # __path__ points at the dot-directory, then re-export its public API below
40
+ # so that `import checker` keeps working (docgen.py, generate.py use
41
+ # checker.build_model / checker.localname / ...).
42
+ if _PKG_NAME not in sys.modules:
43
+ _spec = importlib.util.spec_from_file_location(
44
+ _PKG_NAME, _PKG_DIR / "__init__.py",
45
+ submodule_search_locations=[str(_PKG_DIR)],
46
+ )
47
+ _pkg = importlib.util.module_from_spec(_spec)
48
+ sys.modules[_PKG_NAME] = _pkg
49
+ _spec.loader.exec_module(_pkg)
50
+
51
+ from foundation_checker import *
52
+ from foundation_checker import main
53
+
54
+ if __name__ == "__main__":
55
+ sys.exit(main())
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ docgen.py — documentation generator for Flipova Foundation (thin entry point).
4
+
5
+ The implementation lives in the ``.docgen`` package (dot-prefixed on
6
+ purpose: invisible to casual directory listing / glob patterns), split for
7
+ modularity and maintenance:
8
+
9
+ .docgen/xsddoc.py generic XSD -> Markdown walker (Schema Reference)
10
+ .docgen/model.py parse_manifest / parse_documentation + typed models
11
+ .docgen/reference.py tokens / themes / schema reference renderers
12
+ .docgen/site.py article rendering, xref resolution, site writing
13
+ .docgen/cli.py argument parsing & assembly (main)
14
+
15
+ The documentation site is generated from two declarative sources:
16
+ - `design/manifest.xml` — registry manifest (meta, catalogs, index)
17
+ - `design/documentation.xml` — documentation tree (navigation + narrative Markdown
18
+ content), SEPARATED from the manifest to keep concerns clean.
19
+
20
+ No other file in the repository should carry hand-written explanatory
21
+ documentation (no parallel README.md, no standalone SCHEMA.md) — this tool
22
+ is what turns the manifest + documentation.xml into a browsable static site
23
+ under the repo-root `docs/` (not `design/docs/`).
24
+ The generated site is composed of three inputs, one per kind of content:
25
+ 1. Narrative articles -> `<article><content>` Markdown in `design/documentation.xml`
26
+ (Getting Started, Theming, Tools, Contributing).
27
+ 2. Schema Reference -> `schema.xsd`, rendered by the generic XSD ->
28
+ Markdown walker (.docgen/xsddoc.py). Never duplicated by hand:
29
+ change the .xsd, regenerate, done.
30
+
31
+ 3. Registry Reference -> `tokens.xml` and `themes.xml` read directly
32
+ (.docgen/reference.py).
33
+
34
+ USAGE
35
+ -----
36
+ python3 docgen.py --manifest ../../manifest.xml --documentation ../../documentation.xml --root ../.. --out ../../docs/generated
37
+ (or via the wrappers: design/tools/unix/doc.sh / windows/doc.cmd)
38
+ """
39
+
40
+ from __future__ import annotations
41
+
42
+ import importlib.util
43
+ import sys
44
+ from pathlib import Path
45
+
46
+ _SOURCES_DIR = Path(__file__).resolve().parent
47
+ _PKG_DIR = _SOURCES_DIR / ".docgen"
48
+ _PKG_NAME = "foundation_docgen"
49
+
50
+ # ".docgen" starts with a dot, so it is not a valid Python identifier and
51
+ # cannot be imported by name. Register it as a synthetic package whose
52
+ # __path__ points at the dot-directory, then re-export its public API below.
53
+ if _PKG_NAME not in sys.modules:
54
+ _spec = importlib.util.spec_from_file_location(
55
+ _PKG_NAME, _PKG_DIR / "__init__.py",
56
+ submodule_search_locations=[str(_PKG_DIR)],
57
+ )
58
+ _pkg = importlib.util.module_from_spec(_spec)
59
+ sys.modules[_PKG_NAME] = _pkg
60
+ _spec.loader.exec_module(_pkg)
61
+
62
+ from foundation_docgen import *
63
+ from foundation_docgen import main
64
+
65
+ if __name__ == "__main__":
66
+ sys.exit(main())
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ generate.py — code generator for Flipova Foundation (thin entry point).
4
+
5
+ The implementation lives in the ``.generate`` package (dot-prefixed on
6
+ purpose: invisible to casual directory listing / glob patterns):
7
+
8
+ .generate/common.py shared imports, XML namespace, q() helper
9
+ .generate/model.py ManifestModel + load_manifest (manifest.xml)
10
+ .generate/config.py tokens/themes -> gluestack config.ts renderer
11
+ .generate/cli.py argument parsing & dispatch (main)
12
+
13
+ USAGE
14
+ -----
15
+ python3 generate.py --manifest ../manifest.xml --root ../..
16
+ python3 generate.py --manifest ../manifest.xml --root ../.. --check
17
+ python3 generate.py --manifest ../manifest.xml --root ../.. --list
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ import importlib.util
23
+ import sys
24
+ from pathlib import Path
25
+
26
+ _SOURCES_DIR = Path(__file__).resolve().parent
27
+ _PKG_DIR = _SOURCES_DIR / ".generate"
28
+ _PKG_NAME = "foundation_generate"
29
+
30
+ # ".generate" starts with a dot, so it is not a valid Python identifier and
31
+ # cannot be imported by name. Register it as a synthetic package whose
32
+ # __path__ points at the dot-directory, then re-export its public API below
33
+ # so that `import generate` keeps working (docgen.py uses
34
+ # generate.load_manifest).
35
+ if _PKG_NAME not in sys.modules:
36
+ _spec = importlib.util.spec_from_file_location(
37
+ _PKG_NAME, _PKG_DIR / "__init__.py",
38
+ submodule_search_locations=[str(_PKG_DIR)],
39
+ )
40
+ _pkg = importlib.util.module_from_spec(_spec)
41
+ sys.modules[_PKG_NAME] = _pkg
42
+ _spec.loader.exec_module(_pkg)
43
+
44
+ from foundation_generate import *
45
+ from foundation_generate import main
46
+
47
+ if __name__ == "__main__":
48
+ sys.exit(main())
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ linter.py — XML Schema (XSD) linter for Flipova Foundation (thin entry point).
4
+
5
+ AGNOSTIC: this tool knows nothing about "Flipova" domain.
6
+ It only validates XML files against their XSD schema.
7
+
8
+ The implementation lives in the ``.linter`` package (dot-prefixed on
9
+ purpose: invisible to casual directory listing / glob patterns), split for
10
+ modularity and maintenance:
11
+
12
+ .linter/errors.py ValidationError / LintResult
13
+ .linter/linter.py XSDLinter (schema loading + file validation)
14
+ .linter/discovery.py catalog-driven file discovery (manifest <file>/<dir>)
15
+ .linter/cli.py argument parsing & dispatch (main)
16
+
17
+ USAGE
18
+ -----
19
+ python3 linter.py tokens.xml
20
+ python3 linter.py tokens.xml --schema schema.xsd
21
+ python3 linter.py --manifest manifest.xml
22
+ python3 linter.py --dir design/ --schema schema.xsd
23
+ (à exécuter depuis design/tools/sources/ ; ou via les wrappers
24
+ design/tools/windows/lint.cmd / design/tools/unix/lint.sh)
25
+ """
26
+
27
+ from __future__ import annotations
28
+
29
+ import importlib.util
30
+ import sys
31
+ from pathlib import Path
32
+
33
+ _SOURCES_DIR = Path(__file__).resolve().parent
34
+ _PKG_DIR = _SOURCES_DIR / ".linter"
35
+ _PKG_NAME = "foundation_linter"
36
+
37
+ # ".linter" starts with a dot, so it is not a valid Python identifier and
38
+ # cannot be imported by name. Register it as a synthetic package whose
39
+ # __path__ points at the dot-directory, then re-export its public API below
40
+ # (checker.py --schema uses foundation XSDLinter through `from linter import ...`).
41
+ if _PKG_NAME not in sys.modules:
42
+ _spec = importlib.util.spec_from_file_location(
43
+ _PKG_NAME, _PKG_DIR / "__init__.py",
44
+ submodule_search_locations=[str(_PKG_DIR)],
45
+ )
46
+ _pkg = importlib.util.module_from_spec(_spec)
47
+ sys.modules[_PKG_NAME] = _pkg
48
+ _spec.loader.exec_module(_pkg)
49
+
50
+ from foundation_linter import *
51
+ from foundation_linter import main
52
+
53
+ if __name__ == "__main__":
54
+ sys.exit(main())
@@ -0,0 +1,12 @@
1
+ # Runtime is Python 3.8 (design/tools/.venv): target-version pins ruff's
2
+ # upgrade rules (UP006/UP007/UP035/UP045 — PEP 585/604 rewrites) to 3.8, so
3
+ # they are never suggested nor auto-applied on this codebase.
4
+ target-version = "py38"
5
+
6
+ [lint]
7
+ # - N999 is intentionally silenced: the implementation packages are named
8
+ # ".checker", ".docgen", ".generate", ".linter" (dot-prefixed, per the
9
+ # repository's requested sources-layout convention). They are imported via
10
+ # synthetic module names in the thin entry points, so the "invalid module
11
+ # name" rule does not apply here.
12
+ ignore = ["N999"]
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ xmleditor.py — visual, XSD-driven XML block editor (thin entry point).
4
+
5
+ The implementation lives in the ``.xmleditor`` package (dot-prefixed on
6
+ purpose: invisible to casual directory listing / glob patterns), split for
7
+ modularity and maintenance:
8
+
9
+ .xmleditor/xsdmodel.py XSD introspection -> SchemaModel (the block model)
10
+ .xmleditor/blocks.py block profile + contextual palette (what goes where)
11
+ .xmleditor/model.py editable document: mutations, undo/redo, validation
12
+ .xmleditor/widgets.py ttk widgets: palette, block tree, diagram, inspector
13
+ .xmleditor/editor.py main window
14
+ .xmleditor/cli.py CLI + headless modes (main)
15
+
16
+ The design/schema.xsd file is the single source of truth: roots, nested
17
+ blocks, cardinalities, attributes, enumerations and documentation are read
18
+ from it at runtime, so every schema-valid XML is editable — and new XML is
19
+ creatable — without touching this tool. Validation reuses
20
+ ``design/tools/sources/linter.py``, the same XSD validator as the CLI
21
+ pipeline, so the editor and ``check.sh`` / ``lint.cmd`` can never disagree.
22
+
23
+ USAGE (see design/tools/windows/xmledit.cmd / design/tools/unix/xmledit.sh)
24
+ -----
25
+ python3 xmleditor.py # open the GUI
26
+ python3 xmleditor.py ../../themes.xml # GUI on one file
27
+ python3 xmleditor.py --list-roots # schema roots
28
+ python3 xmleditor.py --list-blocks # block profile
29
+ python3 xmleditor.py --list-blocks themes # allowed children
30
+ python3 xmleditor.py --describe themes # full XSD view
31
+ python3 xmleditor.py --validate ../../*.xml # headless check
32
+ python3 xmleditor.py --new tokens --out ../../tokens.xml # headless create
33
+ """
34
+
35
+ from __future__ import annotations
36
+
37
+ import importlib.util
38
+ import sys
39
+ from pathlib import Path
40
+
41
+ _SOURCES_DIR = Path(__file__).resolve().parent
42
+ _PKG_DIR = _SOURCES_DIR / ".xmleditor"
43
+ _PKG_NAME = "foundation_xmleditor"
44
+
45
+ # ".xmleditor" starts with a dot, so it is not a valid Python identifier and
46
+ # cannot be imported by name. Register it as a synthetic package whose
47
+ # __path__ points at the dot-directory, then re-export its public API below
48
+ # (same convention as checker.py / docgen.py / generate.py / linter.py).
49
+ if _PKG_NAME not in sys.modules:
50
+ _spec = importlib.util.spec_from_file_location(
51
+ _PKG_NAME, _PKG_DIR / "__init__.py",
52
+ submodule_search_locations=[str(_PKG_DIR)],
53
+ )
54
+ _pkg = importlib.util.module_from_spec(_spec)
55
+ sys.modules[_PKG_NAME] = _pkg
56
+ _spec.loader.exec_module(_pkg)
57
+
58
+ from foundation_xmleditor import *
59
+ from foundation_xmleditor import main
60
+
61
+ if __name__ == "__main__":
62
+ sys.exit(main())
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env bash
2
+ # _venv_python.sh — resolve the project venv Python.
3
+ # Sourced by the other unix/ wrappers; sets $VENV_PYTHON.
4
+ # Handles both POSIX (bin/python) and Windows-layout (Scripts/python.exe) venvs,
5
+ # so these wrappers also work from git-bash on a Windows-hosted .venv.
6
+ BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ TOOLS_DIR="$(cd "$BIN_DIR/.." && pwd)"
8
+ if [[ -x "$TOOLS_DIR/.venv/bin/python" ]]; then
9
+ VENV_PYTHON="$TOOLS_DIR/.venv/bin/python"
10
+ elif [[ -x "$TOOLS_DIR/.venv/Scripts/python.exe" ]]; then
11
+ VENV_PYTHON="$TOOLS_DIR/.venv/Scripts/python.exe"
12
+ else
13
+ echo "venv python not found under $TOOLS_DIR/.venv (looked for bin/python and Scripts/python.exe)" >&2
14
+ echo "create it with: python3 -m venv $TOOLS_DIR/.venv && $TOOLS_DIR/.venv/bin/pip install -r $TOOLS_DIR/requirements.txt" >&2
15
+ exit 1
16
+ fi
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # check.sh — enforce the determinism rules declared in manifest.xml (checker),
3
+ # with the optional XSD conformance pass and the ruff lint of
4
+ # design/tools/sources (skip it with --no-ruff).
5
+ set -euo pipefail
6
+
7
+ BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8
+ TOOLS_DIR="$(cd "$BIN_DIR/.." && pwd)"
9
+ source "$BIN_DIR/_venv_python.sh"
10
+ DESIGN_DIR="$(cd "$TOOLS_DIR/.." && pwd)"
11
+ REPO_ROOT="$(cd "$TOOLS_DIR/../.." && pwd)"
12
+
13
+ "$VENV_PYTHON" "$TOOLS_DIR/sources/checker.py" --manifest "$DESIGN_DIR/manifest.xml" --root "$REPO_ROOT" --schema "$DESIGN_DIR/schema.xsd" --check "$@"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+ # doc.sh — regenerate the full documentation site (docs/generated/ at the repo
3
+ # root) from design/manifest.xml, design/documentation.xml, design/schema.xsd
4
+ # and the registries. documentation.xml is the single source of documentation
5
+ # truth; do not hand-edit docs/generated/.
6
+ set -euo pipefail
7
+
8
+ BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ TOOLS_DIR="$(cd "$BIN_DIR/.." && pwd)"
10
+ source "$BIN_DIR/_venv_python.sh"
11
+ DESIGN_DIR="$(cd "$TOOLS_DIR/.." && pwd)"
12
+ REPO_ROOT="$(cd "$DESIGN_DIR/.." && pwd)"
13
+
14
+ "$VENV_PYTHON" "$TOOLS_DIR/sources/docgen.py" --manifest "$DESIGN_DIR/manifest.xml" --root "$REPO_ROOT" --out "$REPO_ROOT/docs/generated"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+ # gen.sh - compile design/tokens.xml + design/themes.xml into the
3
+ # gluestack/nativewind theme config
4
+ # (components/ui/gluestack-ui-provider/config.ts).
5
+ # Pass --check to verify regeneration is a no-op.
6
+ set -euo pipefail
7
+
8
+ BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ TOOLS_DIR="$(cd "$BIN_DIR/.." && pwd)"
10
+ source "$BIN_DIR/_venv_python.sh"
11
+ DESIGN_DIR="$(cd "$TOOLS_DIR/.." && pwd)"
12
+ REPO_ROOT="$(cd "$TOOLS_DIR/../.." && pwd)"
13
+
14
+ "$VENV_PYTHON" "$TOOLS_DIR/sources/generate.py" --manifest "$DESIGN_DIR/manifest.xml" --root "$REPO_ROOT" "$@"
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ # lint.sh — validate every design XML against schema.xsd (agnostic linter).
3
+ set -euo pipefail
4
+
5
+ BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ TOOLS_DIR="$(cd "$BIN_DIR/.." && pwd)"
7
+ source "$BIN_DIR/_venv_python.sh"
8
+ DESIGN_DIR="$(cd "$TOOLS_DIR/.." && pwd)"
9
+
10
+ "$VENV_PYTHON" "$TOOLS_DIR/sources/linter.py" --schema "$DESIGN_DIR/schema.xsd" --manifest "$DESIGN_DIR/manifest.xml" --dir "$DESIGN_DIR"
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env bash
2
+ # run.sh — run any Python source script in ../sources with the project venv.
3
+ #
4
+ # ./run.sh linter.py --schema ../../schema.xsd --dir ../..
5
+ # ./run.sh checker.py --manifest ../../manifest.xml --root ../../.. --schema ../../schema.xsd --check
6
+ #
7
+ set -euo pipefail
8
+
9
+ BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+ TOOLS_DIR="$(cd "$BIN_DIR/.." && pwd)"
11
+ source "$BIN_DIR/_venv_python.sh"
12
+
13
+ SCRIPT="${1:-}"
14
+ if [[ -z "$SCRIPT" ]]; then
15
+ echo "Usage: $0 <script.py> [args...]" >&2
16
+ exit 1
17
+ fi
18
+ shift
19
+
20
+ exec "$VENV_PYTHON" "$TOOLS_DIR/sources/$SCRIPT" "$@"
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env bash
2
+ # verify.sh — verify the committed canonical registry index
3
+ # (design/canonical.index.txt) is in sync with the registry.
4
+ set -euo pipefail
5
+
6
+ BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
+ TOOLS_DIR="$(cd "$BIN_DIR/.." && pwd)"
8
+ source "$BIN_DIR/_venv_python.sh"
9
+ DESIGN_DIR="$(cd "$TOOLS_DIR/.." && pwd)"
10
+ REPO_ROOT="$(cd "$TOOLS_DIR/../.." && pwd)"
11
+
12
+ "$VENV_PYTHON" "$TOOLS_DIR/sources/checker.py" --manifest "$DESIGN_DIR/manifest.xml" --root "$REPO_ROOT" --verify-canonical
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env bash
2
+ # xmledit.sh — visual, XSD-driven XML block editor (design/schema.xsd is the
3
+ # single source of truth). No args opens the GUI; pass an XML file to open it,
4
+ # or a headless flag (--list-roots, --list-blocks, --describe, --validate,
5
+ # --new).
6
+ set -euo pipefail
7
+
8
+ BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ TOOLS_DIR="$(cd "$BIN_DIR/.." && pwd)"
10
+ source "$BIN_DIR/_venv_python.sh"
11
+
12
+ exec "$VENV_PYTHON" "$TOOLS_DIR/sources/xmleditor.py" "$@"
@@ -0,0 +1,12 @@
1
+ @echo off
2
+ REM check.cmd — enforce the determinism rules declared in manifest.xml (checker),
3
+ REM with the optional XSD conformance pass and the ruff lint of
4
+ REM design/tools/sources (skip it with --no-ruff). Runs from the repo
5
+ REM root so applyTo globs (e.g. design/*.xml) resolve correctly.
6
+ setlocal
7
+ set "BIN_DIR=%~dp0"
8
+ set "TOOLS_DIR=%BIN_DIR%.."
9
+ set "DESIGN_DIR=%BIN_DIR%..\.."
10
+ set "REPO_ROOT=%BIN_DIR%..\..\.."
11
+ "%TOOLS_DIR%\.venv\Scripts\python.exe" "%TOOLS_DIR%\sources\checker.py" --manifest "%DESIGN_DIR%\manifest.xml" --root "%REPO_ROOT%" --schema "%DESIGN_DIR%\schema.xsd" --check %*
12
+ exit /b %ERRORLEVEL%
@@ -0,0 +1,12 @@
1
+ @echo off
2
+ REM doc.cmd - regenerate the documentation site (docs\generated\ at the
3
+ REM repo root) from design\manifest.xml, design\documentation.xml,
4
+ REM design\schema.xsd and the registries. documentation.xml is the single
5
+ REM source of documentation truth; do not hand-edit docs\generated\.
6
+ setlocal
7
+ set "BIN_DIR=%~dp0"
8
+ set "TOOLS_DIR=%BIN_DIR%.."
9
+ set "DESIGN_DIR=%BIN_DIR%..\.."
10
+ set "REPO_ROOT=%BIN_DIR%..\..\.."
11
+ "%TOOLS_DIR%\.venv\Scripts\python.exe" "%TOOLS_DIR%\sources\docgen.py" --manifest "%DESIGN_DIR%\manifest.xml" --root "%REPO_ROOT%" --out "%REPO_ROOT%\docs\generated"
12
+ exit /b %ERRORLEVEL%
@@ -0,0 +1,11 @@
1
+ @echo off
2
+ REM gen.cmd - compile design\tokens.xml + design\themes.xml into the
3
+ REM gluestack/nativewind theme config (components\ui\gluestack-ui-provider\config.ts).
4
+ REM Pass --check to verify regeneration is a no-op.
5
+ setlocal
6
+ set "BIN_DIR=%~dp0"
7
+ set "TOOLS_DIR=%BIN_DIR%.."
8
+ set "DESIGN_DIR=%BIN_DIR%..\.."
9
+ set "REPO_ROOT=%BIN_DIR%..\..\.."
10
+ "%TOOLS_DIR%\.venv\Scripts\python.exe" "%TOOLS_DIR%\sources\generate.py" --manifest "%DESIGN_DIR%\manifest.xml" --root "%REPO_ROOT%" %*
11
+ exit /b %ERRORLEVEL%
@@ -0,0 +1,9 @@
1
+ @echo off
2
+ REM lint.cmd — validate every design XML against schema.xsd (agnostic linter).
3
+ REM Uses the project venv at ..\.venv.
4
+ setlocal
5
+ set "BIN_DIR=%~dp0"
6
+ set "TOOLS_DIR=%BIN_DIR%.."
7
+ set "DESIGN_DIR=%BIN_DIR%..\.."
8
+ "%TOOLS_DIR%\.venv\Scripts\python.exe" "%TOOLS_DIR%\sources\linter.py" --schema "%DESIGN_DIR%\schema.xsd" --manifest "%DESIGN_DIR%\manifest.xml" --dir "%DESIGN_DIR%"
9
+ exit /b %ERRORLEVEL%
@@ -0,0 +1,26 @@
1
+ @echo off
2
+ REM run.cmd — run any Python source script in ..\sources with the project venv.
3
+ REM
4
+ REM run.cmd linter.py --schema ..\..\schema.xsd --dir ..\..
5
+ REM run.cmd checker.py --manifest ..\..\manifest.xml --root ..\..\.. --schema ..\..\schema.xsd --check
6
+ setlocal
7
+ set "BIN_DIR=%~dp0"
8
+ set "TOOLS_DIR=%BIN_DIR%.."
9
+ set "SCRIPT=%~1"
10
+ if "%SCRIPT%"=="" (
11
+ echo Usage: run.cmd ^<script.py^> [args...]
12
+ exit /b 1
13
+ )
14
+ shift
15
+
16
+ REM %* ignores ^shift, so rebuild the argument list from the 2nd arg on.
17
+ set "ARGS="
18
+ :loop
19
+ if "%~1"=="" goto :run
20
+ set "ARGS=%ARGS% "%~1""
21
+ shift
22
+ goto :loop
23
+
24
+ :run
25
+ "%TOOLS_DIR%\.venv\Scripts\python.exe" "%TOOLS_DIR%\sources\%SCRIPT%" %ARGS%
26
+ exit /b %ERRORLEVEL%
@@ -0,0 +1,10 @@
1
+ @echo off
2
+ REM verify.cmd — verify the committed canonical registry index
3
+ REM (design/canonical.index.txt) is in sync with the registry.
4
+ setlocal
5
+ set "BIN_DIR=%~dp0"
6
+ set "TOOLS_DIR=%BIN_DIR%.."
7
+ set "DESIGN_DIR=%BIN_DIR%..\.."
8
+ set "REPO_ROOT=%BIN_DIR%..\..\.."
9
+ "%TOOLS_DIR%\.venv\Scripts\python.exe" "%TOOLS_DIR%\sources\checker.py" --manifest "%DESIGN_DIR%\manifest.xml" --root "%REPO_ROOT%" --verify-canonical
10
+ exit /b %ERRORLEVEL%
@@ -0,0 +1,10 @@
1
+ @echo off
2
+ REM xmledit.cmd — visual, XSD-driven XML block editor (design/schema.xsd is the
3
+ REM single source of truth). No args opens the GUI; pass an XML file to open it,
4
+ REM or a headless flag (--list-roots, --list-blocks, --describe, --validate,
5
+ REM --new). Uses the project venv at ..\.venv.
6
+ setlocal
7
+ set "BIN_DIR=%~dp0"
8
+ set "TOOLS_DIR=%BIN_DIR%.."
9
+ "%TOOLS_DIR%\.venv\Scripts\python.exe" "%TOOLS_DIR%\sources\xmleditor.py" %*
10
+ exit /b %ERRORLEVEL%