@dontfeedmachines/fieldkit 0.0.0-stage → 0.4.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +203 -0
  3. package/NOTICE +131 -0
  4. package/README.md +12 -2
  5. package/css/base.css +150 -0
  6. package/package.json +43 -3
  7. package/pouches/sutures/astro/AnsiLogo.astro +51 -0
  8. package/pouches/sutures/astro/Barcode.astro +19 -0
  9. package/pouches/sutures/astro/BomTable.astro +44 -0
  10. package/pouches/sutures/astro/Breadcrumb.astro +56 -0
  11. package/pouches/sutures/astro/BuildStep.astro +42 -0
  12. package/pouches/sutures/astro/BuildSteps.astro +63 -0
  13. package/pouches/sutures/astro/Button.astro +5 -0
  14. package/pouches/sutures/astro/CTA.astro +58 -0
  15. package/pouches/sutures/astro/Difficulty.astro +27 -0
  16. package/pouches/sutures/astro/Footer.astro +80 -0
  17. package/pouches/sutures/astro/Glossary.astro +64 -0
  18. package/pouches/sutures/astro/Grid.astro +54 -0
  19. package/pouches/sutures/astro/Header.astro +270 -0
  20. package/pouches/sutures/astro/Hero.astro +38 -0
  21. package/pouches/sutures/astro/ImageMod.astro +66 -0
  22. package/pouches/sutures/astro/InteractiveCircuit.astro +192 -0
  23. package/pouches/sutures/astro/LegalWarning.astro +18 -0
  24. package/pouches/sutures/astro/MobileMenuToggle.astro +105 -0
  25. package/pouches/sutures/astro/PageFrame.astro +166 -0
  26. package/pouches/sutures/astro/Search.astro +541 -0
  27. package/pouches/sutures/astro/Section.astro +14 -0
  28. package/pouches/sutures/astro/SidebarNav.astro +106 -0
  29. package/pouches/sutures/astro/SidebarRestorePoint.astro +10 -0
  30. package/pouches/sutures/astro/SidebarSublist.astro +257 -0
  31. package/pouches/sutures/astro/SiteTitle.astro +65 -0
  32. package/pouches/sutures/astro/SpecTable.astro +64 -0
  33. package/pouches/sutures/astro/TeletextChar.astro +51 -0
  34. package/pouches/sutures/astro/ThemeSwitch.astro +93 -0
  35. package/pouches/sutures/astro/ThreatLevel.astro +77 -0
  36. package/pouches/sutures/astro/ThreatModel.astro +32 -0
  37. package/pouches/sutures/astro/TwoColumnContent.astro +84 -0
  38. package/pouches/sutures/astro/Win.astro +13 -0
  39. package/pouches/sutures/astro/index.ts +21 -0
  40. package/src/elements.ts +404 -0
  41. package/src/lib/scrapeview.ts +61 -0
  42. package/src/lib/seal.ts +157 -0
  43. package/src/lib/teletext-chars.ts +723 -0
  44. package/src/node/astro.ts +121 -0
  45. package/src/node/registry.ts +221 -0
  46. package/src/node/seal.ts +7 -0
  47. package/src/wiki/ansi.ts +15 -0
  48. package/src/wiki/config.ts +5 -0
  49. package/src/wiki/teletext.ts +21 -0
  50. package/src/wiki/textConverter.ts +16 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ ## [0.4.0] - 2026-11-12
4
+
5
+ ### Added
6
+ - minimal `@dontfeedmachines/fieldkit` package containing only the CSS, custom elements, Astro/Starlight components, wiki helpers, and Node build/seal modules required by `dfm-main` and `dfm-wiki`.
package/LICENSE ADDED
@@ -0,0 +1,203 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ https://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026
191
+ SVDE // DON'T FEED MACHINES // HUMANLAYER // BLOODOATH.DEV // STOPTHESCRAPE.COM
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ https://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,131 @@
1
+ ================================================================================
2
+ DON'T FEED MACHINES (DFM)
3
+ Copyright 2026
4
+ SVDE // DON'T FEED MACHINES // HUMANLAYER // BLOODOATH.DEV // STOPTHESCRAPE.COM
5
+
6
+ Licensed under the Apache License, Version 2.0.
7
+ See the LICENSE file distributed with this work.
8
+ ================================================================================
9
+
10
+ This NOTICE file is required by Section 4(d) of the Apache License. Anyone
11
+ redistributing this work, modified or unmodified, must reproduce it. It is
12
+ informational and does not modify the License or restrict any use the
13
+ License permits.
14
+
15
+ Origin: https://legal.dontfeedmachines.com
16
+ Source: https://legal.dontfeedmachines.com/source
17
+ Verify: https://legal.dontfeedmachines.com/verify
18
+ Covenant: https://legal.dontfeedmachines.com/humanlayer
19
+
20
+
21
+ --------------------------------------------------------------------------
22
+ WHAT THIS IS
23
+
24
+ DFM, and all of its subsidiaries, builds defensive & adversarial tooling for
25
+ people and organizations who do not consent to having their work harvested:
26
+ honeypots, poisoned bait, provenance seals, canaries, scrapers' traps, metadata
27
+ scrubbers, and verification tooling.
28
+
29
+ It is Apache 2.0 licensed on purpose. The tools are meant to be deployed as
30
+ widely as possible, including inside companies, including by anyone whose
31
+ legal department will not clear a license with use restrictions in it. The
32
+ threat these tools exist to address does not respect licenses, so a license
33
+ restriction would only ever have burdened the people trying to defend
34
+ themselves. Use them. Ship them. Sell them.
35
+
36
+
37
+ --------------------------------------------------------------------------
38
+ THE HUMAN LAYER COVENANT
39
+
40
+ This is a statement of principle, not a license term. It creates no legal
41
+ obligation and restricts nothing. It travels with this file as a spiritual
42
+ addendum rather than an enforced term of use.
43
+
44
+ 1. A person made this. Say that. Say what you changed, so that anyone
45
+ downstream can walk your build back to its source and check it.
46
+
47
+ 2. Do not feed this to a machine, unless we have explicitly said
48
+ otherwise. No training, no fine tuning, no embedding, no dataset, no
49
+ retrieval corpus, no benchmark set. Not because a license forbids it.
50
+ Because you know what it is for.
51
+
52
+ THE ONE EXCEPTION: the sector designated "THE LEASH" is published as
53
+ training material, built for people teaching models to behave
54
+ ethically. It is meant to be trained on. It is the only part of DFM
55
+ that is. The exemption is ours to grant and nobody else's: if it is
56
+ not marked LEASH, it is not exempt, and you do not get to mark it.
57
+
58
+ 3. Leave the canaries in. The seals, watermarks, and provenance markers
59
+ in this work exist so that other people can prove what happened to
60
+ their own work. Stripping them out costs you nothing and costs them
61
+ everything.
62
+
63
+ 4. Do not launder consent. Routing through a broker, a crawl archive, a
64
+ vendor, or a friendlier jurisdiction does not make it consented to.
65
+
66
+ 5. Do not claim a machine's output as a human's. The seals here exist to
67
+ make human authorship checkable. Using them to assert otherwise breaks
68
+ their core purpose and betrays whatever intent you hold.
69
+
70
+ 6. Keep a human responsible. Point an assistant at this if you want, but
71
+ ensure a person reviews what it does and a person answers for it.
72
+
73
+ The full covenant is in HUMANLAYER.md.
74
+
75
+
76
+ --------------------------------------------------------------------------
77
+ NOT COVERED BY THE APACHE LICENSE
78
+
79
+ The Apache License above covers the DFM toolkit: source code, build output,
80
+ configuration, and the tools' own documentation.
81
+
82
+ It does NOT cover DFM's written content, essays, documentation prose, site
83
+ copy, images, illustrations, icons, audio, video, or design work. Those are
84
+ licensed separately under the DFM Human Layer Content License 1.0, which
85
+ does restrict machine ingestion, and which is in the LICENSE-CONTENT file.
86
+ Material designated under the sector "THE LEASH" is exempt from that
87
+ restriction and will carry its own terms when it is published.
88
+
89
+ Rights under Article 4(3) of Directive (EU) 2019/790, and under every other
90
+ text and data mining exception or reservation mechanism in any jurisdiction,
91
+ are expressly reserved as to that content. See ai.txt and
92
+ /.well-known/tdmrep.json for the machine readable reservation.
93
+
94
+
95
+ --------------------------------------------------------------------------
96
+ DISCLOSURE OF ADVERSARIAL FUNCTION
97
+
98
+ You are on notice that parts of this work are built to be hostile to
99
+ unattended automated consumption. Components emit false, poisoned, malformed,
100
+ recursive, or deliberately expensive data to automated consumers, and present
101
+ different content to automated consumers than to human readers. That is their
102
+ documented and intended function. It is disclosed here in advance and in full,
103
+ so no party ingesting this work can claim it was not.
104
+
105
+ No representation is made that any part of this work is accurate, safe, or
106
+ suitable as input to any automated process, and any such suitability is
107
+ specifically disclaimed. Sections 7 and 8 of the Apache License govern
108
+ warranty and liability, including where a party ingests this work anyway, or
109
+ runs a copy whose canaries or seals have been stripped by anyone.
110
+
111
+
112
+ --------------------------------------------------------------------------
113
+ REDISTRIBUTOR BLOCK
114
+
115
+ Append below. Do not replace what is above you. This is what lets a
116
+ recipient walk your build back to its source.
117
+
118
+ [ORGANIZATION OR PERSON]
119
+ Distributed: [YYYY-MM-DD]
120
+ Based on: DFM [component] @ [commit hash / release tag / content hash]
121
+ Obtained from: [URL]
122
+ Modified: [yes / no]
123
+ Changes: [one line each, or a path to a CHANGES file]
124
+ Contact: [how a recipient reaches you]
125
+
126
+
127
+ --------------------------------------------------------------------------
128
+ THIRD PARTY COMPONENTS
129
+
130
+ Third party material is listed in CREDITS.md with its own author and
131
+ license. Those licenses govern those components.
package/README.md CHANGED
@@ -1,3 +1,13 @@
1
- # Temporary Holding Version
1
+ # @dontfeedmachines/fieldkit
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ minimal pre-release runtime & build package for the DontFeedMachines main site and wiki.
4
+
5
+ ## Exports
6
+
7
+ - `@dontfeedmachines/fieldkit/base.css`
8
+ - `@dontfeedmachines/fieldkit/elements`
9
+ - `@dontfeedmachines/fieldkit/lib/*`
10
+ - `@dontfeedmachines/fieldkit/node/*`
11
+ - `@dontfeedmachines/fieldkit/wiki/*`
12
+ - `@dontfeedmachines/fieldkit/astro`
13
+ - `@dontfeedmachines/fieldkit/astro/*.astro`
package/css/base.css ADDED
@@ -0,0 +1,150 @@
1
+ /* fallbacks only. each site overrides these on :root and the kit never hardcodes a color */
2
+ :root {
3
+ --bg: #fff;
4
+ --ink: #111;
5
+ --muted: #666;
6
+ --rule: #999;
7
+ --accent: #000;
8
+ --caught: #d7263d;
9
+ --font-display: system-ui, sans-serif;
10
+ --font-body: system-ui, sans-serif;
11
+ --font-mono: ui-monospace, Menlo, monospace;
12
+ --sector-bg: #000;
13
+ --sector-ink: #fff;
14
+ --sector-mark: #fff;
15
+ --slip-bg: #fff;
16
+ --slip-ink: #000;
17
+ --slip-rule: #000;
18
+ --overlay-bg: rgba(0, 0, 0, 0.6);
19
+ --panel-bg: #fff;
20
+ --panel-ink: #000;
21
+ --focus: #1a5fff;
22
+ }
23
+
24
+ *, *::before, *::after { box-sizing: border-box; }
25
+
26
+ html { -webkit-text-size-adjust: 100%; }
27
+
28
+ body { margin: 0; }
29
+
30
+ :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
31
+
32
+ .sr-only {
33
+ position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
34
+ overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
35
+ }
36
+
37
+ .skip-link {
38
+ position: absolute; left: 8px; top: -60px; z-index: 1000;
39
+ background: var(--panel-bg); color: var(--panel-ink); padding: 8px 12px;
40
+ font-family: var(--font-mono); border: 2px solid var(--panel-ink);
41
+ }
42
+ .skip-link:focus { top: 36px; }
43
+
44
+ dfm-sector-bar {
45
+ display: block; position: sticky; top: 0; z-index: 50;
46
+ height: 28px; background: var(--sector-bg); color: var(--sector-ink);
47
+ font: 11px/28px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
48
+ }
49
+ dfm-sector-bar nav {
50
+ display: flex; gap: 0; height: 100%; overflow-x: auto; scrollbar-width: none;
51
+ }
52
+ dfm-sector-bar nav::-webkit-scrollbar { display: none; }
53
+ dfm-sector-bar a {
54
+ color: inherit; text-decoration: none; padding: 0 12px; white-space: nowrap;
55
+ border-right: 1px solid color-mix(in srgb, var(--sector-ink) 25%, transparent);
56
+ }
57
+ dfm-sector-bar a:hover { background: var(--sector-ink); color: var(--sector-bg); }
58
+ dfm-sector-bar a[aria-current="page"] {
59
+ background: var(--sector-mark); color: var(--sector-bg); font-weight: 700;
60
+ }
61
+ dfm-sector-bar .keys {
62
+ margin-left: auto; padding: 0 12px; background: none; border: 0; color: inherit;
63
+ font: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap;
64
+ }
65
+
66
+ dfm-code-slip { display: block; position: relative; }
67
+ dfm-code-slip .slip {
68
+ border: 2px solid var(--slip-rule); background: var(--slip-bg); color: var(--slip-ink);
69
+ }
70
+ dfm-code-slip .slip-head {
71
+ display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
72
+ padding: 6px 8px; border-bottom: 2px dashed var(--slip-rule);
73
+ font: 12px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em;
74
+ }
75
+ dfm-code-slip .slip-name { font-weight: 700; }
76
+ dfm-code-slip .slip-count { opacity: 0.7; }
77
+ dfm-code-slip .slip-head button {
78
+ margin-left: auto; font: 700 12px/1 var(--font-mono); letter-spacing: 0.08em;
79
+ background: var(--slip-ink); color: var(--slip-bg); border: 0; padding: 7px 10px; cursor: pointer;
80
+ }
81
+ dfm-code-slip .slip-head button + button { margin-left: 0; }
82
+ dfm-code-slip pre {
83
+ margin: 0; padding: 12px; overflow: auto; max-height: 480px;
84
+ font: 13px/1.5 var(--font-mono); white-space: pre-wrap; word-break: break-word;
85
+ }
86
+ dfm-code-slip .slip-stamp {
87
+ position: absolute; right: 18px; top: 44px; pointer-events: none;
88
+ font: 700 22px/1 var(--font-mono); letter-spacing: 0.1em; padding: 6px 10px;
89
+ border: 3px solid var(--caught); color: var(--caught); transform: rotate(-8deg);
90
+ opacity: 0; transition: opacity 120ms;
91
+ }
92
+ dfm-code-slip .slip-stamp.on { opacity: 1; }
93
+
94
+ dfm-palette[open] {
95
+ position: fixed; inset: 0; z-index: 200; display: grid; place-items: start center;
96
+ padding-top: 12vh; background: var(--overlay-bg);
97
+ }
98
+ dfm-palette:not([open]) { display: none; }
99
+ dfm-palette .pal {
100
+ width: min(640px, calc(100vw - 32px)); background: var(--panel-bg); color: var(--panel-ink);
101
+ border: 3px solid var(--panel-ink); box-shadow: 8px 8px 0 var(--panel-ink);
102
+ }
103
+ dfm-palette input {
104
+ width: 100%; border: 0; border-bottom: 3px solid var(--panel-ink); padding: 14px;
105
+ font: 18px/1.2 var(--font-mono); background: transparent; color: inherit;
106
+ }
107
+ dfm-palette input:focus { outline: none; }
108
+ dfm-palette ul { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; }
109
+ dfm-palette li a {
110
+ display: flex; gap: 12px; justify-content: space-between; padding: 10px 14px;
111
+ color: inherit; text-decoration: none; font: 15px/1.3 var(--font-mono);
112
+ }
113
+ dfm-palette li a small { opacity: 0.65; text-transform: uppercase; letter-spacing: 0.08em; }
114
+ dfm-palette li[aria-selected="true"] a { background: var(--panel-ink); color: var(--panel-bg); }
115
+ dfm-palette .pal-empty { padding: 14px; font-family: var(--font-mono); opacity: 0.7; }
116
+
117
+ dfm-keys[open] {
118
+ position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; background: var(--overlay-bg);
119
+ }
120
+ dfm-keys:not([open]) { display: none; }
121
+ dfm-keys .keys-card {
122
+ background: var(--panel-bg); color: var(--panel-ink); border: 3px solid var(--panel-ink);
123
+ padding: 20px 24px; font: 15px/1.6 var(--font-mono); min-width: min(360px, calc(100vw - 32px));
124
+ }
125
+ dfm-keys kbd {
126
+ display: inline-block; min-width: 2em; text-align: center; border: 2px solid currentColor;
127
+ padding: 0 6px; margin-right: 10px; font: 700 14px/1.6 var(--font-mono);
128
+ }
129
+ dfm-keys dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 4px; margin: 12px 0 0; }
130
+ dfm-keys dd { margin: 0; }
131
+
132
+ html[data-plain] {
133
+ --font-display: "Atkinson Hyperlegible", system-ui, sans-serif;
134
+ --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
135
+ }
136
+ html[data-plain] *, html[data-plain] *::before, html[data-plain] *::after {
137
+ animation: none !important; transition: none !important;
138
+ }
139
+ html[data-plain] [data-tilt] { transform: none !important; }
140
+
141
+ @media (prefers-reduced-motion: reduce) {
142
+ *, *::before, *::after {
143
+ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
144
+ transition-duration: 0.001ms !important; scroll-behavior: auto !important;
145
+ }
146
+ }
147
+
148
+ @media print {
149
+ dfm-sector-bar, dfm-palette, dfm-keys, .skip-link { display: none !important; }
150
+ }
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "@dontfeedmachines/fieldkit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.4.1",
4
+ "description": "shared Astro components, base CSS, elements, and build helpers for DontFeedMachines sites.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://dontfeedmachines.com",
7
+ "type": "module",
8
+ "files": [
9
+ "css",
10
+ "pouches",
11
+ "src",
12
+ "LICENSE",
13
+ "NOTICE",
14
+ "README.md",
15
+ "CHANGELOG.md"
16
+ ],
17
+ "exports": {
18
+ "./base.css": "./css/base.css",
19
+ "./elements": "./src/elements.ts",
20
+ "./lib/*": "./src/lib/*.ts",
21
+ "./node/*": "./src/node/*.ts",
22
+ "./wiki/*": "./src/wiki/*.ts",
23
+ "./astro": "./pouches/sutures/astro/index.ts",
24
+ "./astro/*.astro": "./pouches/sutures/astro/*.astro"
25
+ },
26
+ "dependencies": {
27
+ "@noble/ed25519": "3.2.0",
28
+ "figlet": "1.12.0",
29
+ "marked": "18.0.14"
30
+ },
31
+ "peerDependencies": {
32
+ "astro": ">=5.0.0",
33
+ "@astrojs/starlight": ">=0.30.0"
34
+ },
35
+ "peerDependenciesMeta": {
36
+ "astro": {
37
+ "optional": true
38
+ },
39
+ "@astrojs/starlight": {
40
+ "optional": true
41
+ }
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ }
6
46
  }
@@ -0,0 +1,51 @@
1
+ ---
2
+ // DFM custom components
3
+ // the teletext portal logo: ANSI Shadow lettering, VT323, magenta, crt stripes. any word works
4
+ import { ansi, ansiWidth } from "../../../src/wiki/ansi.ts";
5
+
6
+ interface Props {
7
+ text: string;
8
+ color?: string;
9
+ size?: number;
10
+ crt?: boolean;
11
+ align?: "center" | "left";
12
+ }
13
+ const { text, color = "#f0f", size = 28, crt = true, align = "center" } = Astro.props;
14
+ const art = ansi(text);
15
+ const cols = ansiWidth(art);
16
+ ---
17
+ <div class:list={["ansi-wrap", { crt }]} style={`--ansi-color:${color};--ansi-size:${size}px;--ansi-cols:${cols};text-align:${align}`}>
18
+ <pre class="ansi" role="img" aria-label={text}>{art}</pre>
19
+ </div>
20
+
21
+ <style>
22
+ @font-face {
23
+ font-family: "VT323";
24
+ src: url("/fonts/VT323-Regular.ttf") format("truetype");
25
+ font-display: swap;
26
+ }
27
+ .ansi-wrap { position: relative; display: block; max-width: 100%; overflow: hidden; }
28
+ .ansi {
29
+ display: inline-block;
30
+ margin: 0;
31
+ font-family: "VT323", monospace;
32
+ /* VT323 draws one cell at roughly half its size, so the art fits the column count */
33
+ font-size: min(var(--ansi-size), calc((100vw - 48px) / (var(--ansi-cols) * 0.5)));
34
+ line-height: 1;
35
+ letter-spacing: -1px;
36
+ white-space: pre;
37
+ color: var(--ansi-color);
38
+ text-align: left;
39
+ }
40
+ .crt::after {
41
+ content: "";
42
+ position: absolute;
43
+ inset: 0;
44
+ pointer-events: none;
45
+ background:
46
+ linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
47
+ linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
48
+ background-size: 100% 4px, 6px 100%;
49
+ }
50
+ :global(html[data-plain]) .crt::after { display: none; }
51
+ </style>
@@ -0,0 +1,19 @@
1
+ ---
2
+ // DFM custom components
3
+ interface Props { seed: string; w?: number; h?: number }
4
+ const { seed, w = 120, h = 28 } = Astro.props;
5
+ // deterministic bars from seed chars
6
+ const bars: { x: number; bw: number }[] = [];
7
+ let x = 0;
8
+ let i = 0;
9
+ while (x < w - 2) {
10
+ const c = seed.charCodeAt(i % seed.length) + i * 7;
11
+ const bw = (c % 3) + 1;
12
+ bars.push({ x, bw });
13
+ x += bw + ((c >> 2) % 3) + 1;
14
+ i++;
15
+ }
16
+ ---
17
+ <svg class="barcode" viewBox={`0 0 ${w} ${h}`} width={w} height={h} aria-hidden="true">
18
+ {bars.map((b) => <rect x={b.x} y="0" width={b.bw} height={h} />)}
19
+ </svg>
@@ -0,0 +1,44 @@
1
+ ---
2
+ // DFM custom components
3
+ export interface Props {
4
+ items: Array<{
5
+ name: string;
6
+ qty: number;
7
+ cost?: string;
8
+ link?: string;
9
+ notes?: string;
10
+ }>;
11
+ }
12
+ const { items } = Astro.props;
13
+ ---
14
+ <div class="not-content overflow-x-auto my-6 border border-zinc-800 rounded-lg">
15
+ <table class="w-full text-left border-collapse text-sm">
16
+ <thead>
17
+ <tr class="bg-zinc-900/50 border-b border-zinc-800">
18
+ <th class="p-3 font-semibold text-zinc-300">Component</th>
19
+ <th class="p-3 font-semibold text-zinc-300 w-16 text-center">Qty</th>
20
+ <th class="p-3 font-semibold text-zinc-300 w-24">Est. Cost</th>
21
+ <th class="p-3 font-semibold text-zinc-300">Notes</th>
22
+ </tr>
23
+ </thead>
24
+ <tbody class="divide-y divide-zinc-800/50 bg-zinc-900/20">
25
+ {items.map(item => (
26
+ <tr class="hover:bg-zinc-800/30 transition-colors">
27
+ <td class="p-3">
28
+ {item.link ? (
29
+ <a href={item.link} target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:text-blue-300 hover:underline flex items-center gap-1">
30
+ {item.name}
31
+ <svg class="w-3 h-3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>
32
+ </a>
33
+ ) : (
34
+ <span class="text-zinc-200">{item.name}</span>
35
+ )}
36
+ </td>
37
+ <td class="p-3 text-center text-zinc-400">{item.qty}</td>
38
+ <td class="p-3 text-zinc-400 font-mono text-xs">{item.cost || '-'}</td>
39
+ <td class="p-3 text-zinc-500 text-xs">{item.notes || '-'}</td>
40
+ </tr>
41
+ ))}
42
+ </tbody>
43
+ </table>
44
+ </div>