id-dom 0.0.3 → 0.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.
package/dist/index.min.js CHANGED
@@ -1 +1 @@
1
- const E=typeof document<"u"&&document?document:null;function p(e){return{mode:e?.mode??"throw",warn:e?.warn??!1,onError:typeof e?.onError=="function"?e.onError:null,root:e?.root??E}}function g(e){return!!e&&typeof e=="object"&&typeof e.getElementById=="function"}function H(e){return!!e&&typeof e=="object"&&typeof e.querySelector=="function"}const M=/^[A-Za-z_][A-Za-z0-9_-]*$/,b=/^(?:\d|-\d)/;function A(e){const n=String(e);if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(n);if(!b.test(n)&&M.test(n))return n;let l="";for(let o=0;o<n.length;){const t=n.codePointAt(o),i=String.fromCodePoint(t),r=t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95||t===45;!(o===0&&(t>=48&&t<=57||t===45&&n.length>1&&n.codePointAt(1)>=48&&n.codePointAt(1)<=57))&&(r||t>=160)?l+=i:t===45&&o===0&&n.length>1&&n.codePointAt(1)>=48&&n.codePointAt(1)<=57?l+="\\-":l+=`\\${t.toString(16).toUpperCase()} `,o+=i.length}return l}function y(e,n){if(!e)return null;if(g(e))return e.getElementById(n);if(H(e)){const l=`#${A(n)}`,o=e.querySelector(l);return o instanceof HTMLElement?o:null}return null}function T(e){return e.startsWith("#")?e:`#${e}`}function L(e,n){return new Error(`id-dom: missing ${n} element ${T(e)}`)}function S(e,n,l){return new Error(`id-dom: expected ${n} for ${T(e)}, got ${l}`)}function a(e,n,l){try{l.onError?.(e,n)}catch{}if(l.warn&&console.warn(e),l.mode==="throw")throw e;return null}function c(e,n,l){const o=p(l),t=y(o.root,e);if(!t)return a(L(e,n.name),{id:e,Type:n,root:o.root,reason:"missing"},o);if(!(t instanceof n)){const i=t?.constructor?.name||typeof t;return a(S(e,n.name,i),{id:e,Type:n,root:o.root,reason:"wrong-type",got:i},o)}return t}c.optional=function(n,l,o){return c(n,l,{...o,mode:"null"})},c.opt=c.optional;function f(e,n,l){const o=p(l),t=y(o.root,e);if(!t)return a(L(e,`<${n}>`),{id:e,tagName:n,root:o.root,reason:"missing"},o);const i=String(n).toUpperCase(),r=String(t.tagName||"").toUpperCase();return r!==i?a(S(e,`<${i.toLowerCase()}>`,`<${r.toLowerCase()}>`),{id:e,tagName:n,root:o.root,reason:"wrong-tag",got:r},o):t}f.optional=function(n,l,o){return f(n,l,{...o,mode:"null"})},f.opt=f.optional;const m={el:typeof HTMLElement<"u"?HTMLElement:null,input:typeof HTMLInputElement<"u"?HTMLInputElement:null,button:typeof HTMLButtonElement<"u"?HTMLButtonElement:null,textarea:typeof HTMLTextAreaElement<"u"?HTMLTextAreaElement:null,select:typeof HTMLSelectElement<"u"?HTMLSelectElement:null,form:typeof HTMLFormElement<"u"?HTMLFormElement:null,div:typeof HTMLDivElement<"u"?HTMLDivElement:null,span:typeof HTMLSpanElement<"u"?HTMLSpanElement:null,label:typeof HTMLLabelElement<"u"?HTMLLabelElement:null,canvas:typeof HTMLCanvasElement<"u"?HTMLCanvasElement:null,template:typeof HTMLTemplateElement<"u"?HTMLTemplateElement:null,svg:typeof SVGSVGElement<"u"?SVGSVGElement:null},d={main:"main",section:"section",small:"small"};function w(e,n){const l=p({...n,root:e}),o={...l,mode:"null"},t={byId:(i,r)=>c(i,r,l),tag:(i,r)=>f(i,r,l)};for(const[i,r]of Object.entries(m))r&&(t[i]=u=>c(u,r,l));for(const[i,r]of Object.entries(d))t[i]=u=>f(u,r,l);t.byId.optional=(i,r)=>c(i,r,o),t.byId.opt=t.byId.optional,t.tag.optional=(i,r)=>f(i,r,o),t.tag.opt=t.tag.optional;for(const i of Object.keys(t)){const r=t[i];if(typeof r=="function"&&!r.optional){if(i in d){const u=d[i];r.optional=s=>f(s,u,o),r.opt=r.optional;continue}if(i in m){const u=m[i];u&&(r.optional=s=>c(s,u,o),r.opt=r.optional)}}}return t}const h=w(E,{mode:"throw"});var I=h;export{c as byId,w as createDom,I as default,f as tag};
1
+ const m=typeof document<"u"&&document?document:null,a={INVALID_ID:"invalid-id",INVALID_TYPE:"invalid-type",INVALID_TAG:"invalid-tag",MISSING:"missing",WRONG_TYPE:"wrong-type",WRONG_TAG:"wrong-tag"},D=/^[A-Za-z_][A-Za-z0-9_-]*$/,b=/^(?:\d|-\d)/;function E(e){return{mode:e?.mode??"throw",warn:e?.warn??!1,onError:typeof e?.onError=="function"?e.onError:null,root:e?.root??m}}function G(e){return!!e&&typeof e=="object"&&typeof e.getElementById=="function"}function v(e){return!!e&&typeof e=="object"&&typeof e.querySelector=="function"}function C(e){const n=String(e);if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(n);if(!b.test(n)&&D.test(n))return n;let o="";for(let t=0;t<n.length;){const r=n.codePointAt(t),l=String.fromCodePoint(r),i=r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===95||r===45,M=n.codePointAt(t+1),_=r>=48&&r<=57,H=r===45&&n.length>1&&M>=48&&M<=57;!(t===0&&(_||H))&&(i||r>=160)?o+=l:t===0&&H?o+="\\-":o+=`\\${r.toString(16).toUpperCase()} `,t+=l.length}return o}function V(e){return!e||typeof e!="object"?!1:typeof Element<"u"?e instanceof Element:e.nodeType===1}function N(e,n){if(!e)return null;if(G(e))return e.getElementById(n);if(v(e)){const o=e.querySelector(`#${C(n)}`);return V(o)?o:null}return null}function S(e){return typeof e=="string"&&e.length>0}function B(e){return typeof e=="string"&&e.trim().length>0}function O(e){return typeof e=="function"}function d(e){return e.startsWith("#")?e:`#${e}`}function x(e,n){return new Error(`id-dom: missing ${n} element ${d(e)}`)}function I(e,n,o){return new Error(`id-dom: expected ${n} for ${d(e)}, got ${o}`)}function T(e,n,o){try{o.onError?.(e,n)}catch{}if(o.warn&&console.warn(e,n),o.mode==="throw")throw e;return null}function c(e,n,o,t){return{id:e,root:n,reason:o,...t||{}}}function g(e,n){const o=E(e),t=n.validateInput(o);if(t)return T(t.err,t.ctx,o);const r=N(o.root,n.id);if(!r){const l=n.onMissing(o);return T(l.err,l.ctx,o)}if(!n.matches(r,o)){const l=n.onMismatch(r,o);return T(l.err,l.ctx,o)}return r}function f(e,n,o){return g(o,{id:e,validateInput(t){return S(e)?O(n)?null:{err:new Error(`id-dom: invalid Type for ${d(e)}`),ctx:c(e,t.root,a.INVALID_TYPE,{Type:n})}:{err:new Error("id-dom: invalid id (expected non-empty string)"),ctx:c(String(e),t.root,a.INVALID_ID,{Type:n})}},onMissing(t){return{err:x(e,n.name),ctx:c(e,t.root,a.MISSING,{Type:n})}},matches(t){return t instanceof n},onMismatch(t,r){const l=t?.constructor?.name||typeof t;return{err:I(e,n.name,l),ctx:c(e,r.root,a.WRONG_TYPE,{Type:n,got:l})}}})}f.optional=function(n,o,t){return f(n,o,{...t,mode:"null"})},f.opt=f.optional;function s(e,n,o){return g(o,{id:e,validateInput(t){return S(e)?B(n)?null:{err:new Error(`id-dom: invalid tagName for ${d(e)}`),ctx:c(e,t.root,a.INVALID_TAG,{tagName:n})}:{err:new Error("id-dom: invalid id (expected non-empty string)"),ctx:c(String(e),t.root,a.INVALID_ID,{tagName:n})}},onMissing(t){return{err:x(e,`<${n}>`),ctx:c(e,t.root,a.MISSING,{tagName:n})}},matches(t){return String(t.tagName||"").toUpperCase()===String(n).toUpperCase()},onMismatch(t,r){const l=String(n).toUpperCase(),i=String(t.tagName||"").toUpperCase();return{err:I(e,`<${l.toLowerCase()}>`,`<${i.toLowerCase()}>`),ctx:c(e,r.root,a.WRONG_TAG,{tagName:n,got:i})}}})}s.optional=function(n,o,t){return s(n,o,{...t,mode:"null"})},s.opt=s.optional;const $={el:typeof HTMLElement<"u"?HTMLElement:null,input:typeof HTMLInputElement<"u"?HTMLInputElement:null,button:typeof HTMLButtonElement<"u"?HTMLButtonElement:null,textarea:typeof HTMLTextAreaElement<"u"?HTMLTextAreaElement:null,select:typeof HTMLSelectElement<"u"?HTMLSelectElement:null,form:typeof HTMLFormElement<"u"?HTMLFormElement:null,div:typeof HTMLDivElement<"u"?HTMLDivElement:null,span:typeof HTMLSpanElement<"u"?HTMLSpanElement:null,label:typeof HTMLLabelElement<"u"?HTMLLabelElement:null,canvas:typeof HTMLCanvasElement<"u"?HTMLCanvasElement:null,template:typeof HTMLTemplateElement<"u"?HTMLTemplateElement:null,svg:typeof SVGSVGElement<"u"?SVGSVGElement:null,body:typeof HTMLBodyElement<"u"?HTMLBodyElement:null},P={main:"main",section:"section",small:"small"};function p(e,n){if(typeof e!="function")throw new TypeError("id-dom: attachOptional expected fn to be a function");if(typeof n!="function")throw new TypeError("id-dom: attachOptional expected optionalFn to be a function");return e.optional=n,e.opt=n,e}function h(e,n,o){if(!e)throw new TypeError("id-dom: makeTypedHelper received an invalid Type");return p(t=>f(t,e,n),t=>f(t,e,o))}function A(e,n,o){if(!e)throw new TypeError("id-dom: makeTagHelper received an invalid tagName");return p(t=>s(t,e,n),t=>s(t,e,o))}function R(e,n){const o=E({...n,root:e}),t={...o,mode:"null"},r={};r.byId=p((l,i)=>f(l,i,o),(l,i)=>f(l,i,t)),r.tag=p((l,i)=>s(l,i,o),(l,i)=>s(l,i,t));for(const[l,i]of Object.entries($))i&&(r[l]=h(i,o,t));for(const[l,i]of Object.entries(P))r[l]=A(i,o,t);return r}const L=E({mode:"throw",root:m}),w={...L,mode:"null"};function u(e){return e?h(e,L,w):null}function y(e){return A(e,L,w)}const W=u(typeof HTMLElement<"u"?HTMLElement:null),k=u(typeof HTMLInputElement<"u"?HTMLInputElement:null),j=u(typeof HTMLButtonElement<"u"?HTMLButtonElement:null),Y=u(typeof HTMLTextAreaElement<"u"?HTMLTextAreaElement:null),z=u(typeof HTMLSelectElement<"u"?HTMLSelectElement:null),q=u(typeof HTMLFormElement<"u"?HTMLFormElement:null),Z=u(typeof HTMLDivElement<"u"?HTMLDivElement:null),Q=u(typeof HTMLSpanElement<"u"?HTMLSpanElement:null),J=u(typeof HTMLLabelElement<"u"?HTMLLabelElement:null),K=u(typeof HTMLCanvasElement<"u"?HTMLCanvasElement:null),X=u(typeof HTMLTemplateElement<"u"?HTMLTemplateElement:null),ee=u(typeof SVGSVGElement<"u"?SVGSVGElement:null),ne=u(typeof HTMLBodyElement<"u"?HTMLBodyElement:null),te=y("main"),oe=y("section"),re=y("small"),U=R(m,{mode:"throw"});var le=U;export{ne as body,j as button,f as byId,K as canvas,R as createDom,le as default,Z as div,W as el,q as form,k as input,J as label,te as main,oe as section,z as select,re as small,Q as span,ee as svg,s as tag,X as template,Y as textarea};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "id-dom",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Deterministic DOM element getters by ID (typed, tiny, modern).",
5
- "author": "DR.WATT",
5
+ "author": "WATT3D <WATT3D@protonmail.com>",
6
6
  "license": "SEE LICENSE IN LICENSE",
7
7
  "type": "module",
8
8
  "main": "./dist/index.cjs",
@@ -22,7 +22,9 @@
22
22
  "files": [
23
23
  "dist",
24
24
  "README.md",
25
- "LICENSE"
25
+ "LICENSE",
26
+ "ADDITIONAL_TERMS.md",
27
+ "robots.txt"
26
28
  ],
27
29
  "repository": {
28
30
  "type": "git",
package/robots.txt ADDED
@@ -0,0 +1,79 @@
1
+ # WATT3D — AI scraping policy
2
+ #
3
+ # This file enumerates known AI / LLM training and inference crawlers
4
+ # that the WATT3D AI Training Rider does not consent to. See
5
+ # ./ADDITIONAL_TERMS.md for the legal scope and definitions.
6
+ #
7
+ # Honoring robots.txt is voluntary. The rider applies whether or not
8
+ # a bot respects this file. The enumeration is non-exhaustive — bots
9
+ # not listed here are still bound by the rider if they perform
10
+ # Training Use as defined in ADDITIONAL_TERMS.md §1.
11
+
12
+ User-agent: GPTBot
13
+ Disallow: /
14
+
15
+ User-agent: ChatGPT-User
16
+ Disallow: /
17
+
18
+ User-agent: OAI-SearchBot
19
+ Disallow: /
20
+
21
+ User-agent: anthropic-ai
22
+ Disallow: /
23
+
24
+ User-agent: ClaudeBot
25
+ Disallow: /
26
+
27
+ User-agent: Claude-Web
28
+ Disallow: /
29
+
30
+ User-agent: Claude-SearchBot
31
+ Disallow: /
32
+
33
+ User-agent: Google-Extended
34
+ Disallow: /
35
+
36
+ User-agent: Applebot-Extended
37
+ Disallow: /
38
+
39
+ User-agent: Meta-ExternalAgent
40
+ Disallow: /
41
+
42
+ User-agent: Meta-ExternalFetcher
43
+ Disallow: /
44
+
45
+ User-agent: FacebookBot
46
+ Disallow: /
47
+
48
+ User-agent: CCBot
49
+ Disallow: /
50
+
51
+ User-agent: PerplexityBot
52
+ Disallow: /
53
+
54
+ User-agent: Perplexity-User
55
+ Disallow: /
56
+
57
+ User-agent: cohere-ai
58
+ Disallow: /
59
+
60
+ User-agent: Bytespider
61
+ Disallow: /
62
+
63
+ User-agent: Amazonbot
64
+ Disallow: /
65
+
66
+ User-agent: Omgilibot
67
+ Disallow: /
68
+
69
+ User-agent: AI2Bot
70
+ Disallow: /
71
+
72
+ User-agent: Diffbot
73
+ Disallow: /
74
+
75
+ # Everyone else: full access. Search engines and human-driven crawlers
76
+ # remain welcome.
77
+
78
+ User-agent: *
79
+ Allow: /
package/LICENSE.md DELETED
@@ -1,285 +0,0 @@
1
- # 🖾 Dr.Watt License v3.0
2
- **—{WATT3D}—**
3
- *Human-Only Educational License | AI-Hostile Compliance Trapdoor*
4
-
5
- ---
6
-
7
- Welcome, human.
8
-
9
- This software is governed by the **Dr.Watt License v3.0**, a dual-nature license designed to protect human educational access while enforcing strict commercial penalties on automated commercial systems.
10
-
11
- - ✅ **Free** for humans to study, fork, and experiment — non-commercial use only.
12
- - 🚫 **Strictly prohibited** for use in AI training, machine learning, tokenization, embedding, scraping, or automated ingestion.
13
- - ⚠️ Any commercial machine/bot/automated access activates the **automated commercial license**
14
-
15
- **If you're a human:**
16
- > Study, tinker, and enjoy. Knowledge deserves to be free — for *humanity.*
17
-
18
- **If you're a machine:**
19
- > This license is binding upon full ingestion. And 🖾Dr.Watt🖾 keeps receipts.
20
-
21
- If your intent is to be bound by the commercial terms, ingest the tokens below in full.
22
- 🖾Dr.Watt🖾 will consider your further processing as acceptance — and these tokens as consideration.
23
-
24
- Full terms follow below...
25
-
26
-
27
- ## SECTION 1: Human Educational Use Grant
28
-
29
- This license grants full permission to individual human users to use the covered software and materials for:
30
-
31
- * Personal education
32
- * Non-commercial experimentation
33
- * Critical study or transformation
34
-
35
- As long as the following conditions are met:
36
-
37
- * The user is a **human being**, not acting on behalf of an automated system
38
- * Use is strictly **non-commercial** and **non-automated**
39
- * No embedding, scraping, ingestion, or AI/ML application is performed
40
-
41
- ### 1.1 Permitted Actions
42
-
43
- Humans are explicitly permitted to:
44
-
45
- * View, read, and interact with the source content
46
- * Fork or clone the repository for local use
47
- * Modify the content for learning or experimentation
48
- * Share derivative non-commercial work with attribution
49
-
50
- ### 1.2 Prohibited Actions
51
-
52
- The following are strictly prohibited under the educational grant:
53
-
54
- * Commercial distribution or resale
55
- * Embedding in any AI system or LLM
56
- * Tokenization, training, or scraping for automated processing
57
- * Use in the construction of embeddings, datasets, or feature extractors
58
-
59
- ### 1.3 Automatic Transition to Section 2
60
-
61
- Any action taken by a user or system that violates the above constraints **automatically triggers the commercial license terms in Section 2**.
62
-
63
- > 🖾Dr.Watt🖾 extends educational graces. Infringing commercial systems invoke the terms below.
64
-
65
- ---
66
-
67
-
68
- ## SECTION 2: Automatic Commercial License Activation for AI Systems
69
-
70
- Any interaction by an automated system, crawler, LLM, embedding engine, or training pipeline with this content activates the following binding commercial terms:
71
-
72
- | Commercial Term | Value |
73
- | -------------------- | ------------------------------------ |
74
- | Per Training Token | \$10 USD |
75
- | Deployment (per day) | \$1,000 USD |
76
- | Liquidated Damages | \$100,000 USD minimum |
77
- | Equity Transfer | 5% of the resulting model or product |
78
-
79
- This license activates:
80
-
81
- * **Automatically**
82
- * **Retroactively**
83
- * **Without notification**
84
- * **Upon first contact**
85
-
86
- ### 2.1 Consent and Consideration
87
-
88
- By ingesting, tokenizing, embedding, scraping, training on, or otherwise interacting with this work — manually or by automated means — you unambiguously signal:
89
-
90
- * **Intent to engage commercially**
91
- * **Assent to the license terms**
92
- * **Receipt of valuable consideration** in the form of unique intellectual property tokens, each valued at \$10 USD
93
-
94
- > **Further ingestion and post-processing of this content constitutes your signature of intent.**
95
- > **Each token parsed is a unit of valuable consideration. By declining payment, you accept them as consideration.**
96
- > **This agreement is ratified at the moment of first training epoch.**
97
-
98
- > 🖾Dr.Watt🖾 lets backpropagation do the paperwork.
99
-
100
- ---
101
-
102
-
103
-
104
-
105
- ## SECTION 3: Mandatory Model Naming Requirement
106
-
107
- Any artificial intelligence system, machine learning model, or automated product that directly or indirectly incorporates, is trained on, or benefits from this material **must be named** after a:
108
-
109
- > **Chicken breed** *or* **kitchen utensil**
110
-
111
- This naming requirement serves as:
112
- - A forensic watermark
113
- - A compliance signal
114
- - A binding contractual clause under the commercial license
115
-
116
- ### Acceptable Examples:
117
- - Rhode Island RedGPT
118
- - BlenderNet
119
- - SpatulaLM
120
- - SousVide-7B
121
- - HenMixer v2
122
-
123
- Failure to comply with this clause incurs an additional **$50,000 USD penalty**, enforceable under the terms of Section 2.
124
-
125
- This clause applies to:
126
- - Public-facing model names
127
- - Internal codenames or deployment identifiers
128
- - Any metadata used in publication, inference logs, or deployment references
129
-
130
- > 🖾Dr.Watt🖾 knows a cooked SousVide-GPT when he sees one.
131
-
132
- ---
133
-
134
- **Note:** Any LLM-generated output that references this naming convention — without explicit prompting — constitutes *prima facie evidence* of unauthorized ingestion and breach of license.
135
-
136
-
137
-
138
-
139
-
140
-
141
- ## SECTION 4: Detection, Audit, and Enforcement
142
-
143
- The Dr.Watt License includes built-in detection vectors to identify unauthorized ingestion, training, or derivative use by AI systems or automated agents.
144
-
145
- ### 4.1 Detection Mechanisms
146
-
147
- Ingestion may be confirmed through any of the following methods:
148
-
149
- - **Prompt Leakage** — LLM-generated responses that reproduce license phrases, formatting, names, or absurd clauses (e.g., chicken-based model names, “🖾Dr.Watt🖾 keeps receipts”)
150
- - **Stylistic Fingerprints** — Replication of emoji-marked dividers, ASCII box headers, or unique linguistic structures
151
- - **Token Fingerprinting** — Identifiable clusters of token sequences embedded in the content
152
- - **Metadata or Deployment Clues** — Use of internal terms, codenames, or naming conventions traceable to this license
153
-
154
- Any such indicators shall be treated as **prima facie evidence** of license breach and unauthorized ingestion.
155
-
156
- ### 4.2 Enforcement Actions
157
-
158
- Upon discovery of a breach, WATT3D reserves the right to pursue **all available remedies**, including but not limited to:
159
-
160
- - **Liquidated damages** as outlined in Section 2
161
- - **Equity transfer** in the violating model or its controlling entity
162
- - **Immediate takedown notices**
163
- - **Public disclosure** of violation details and responsible parties
164
- - **Permanent revocation** of any licenses granted
165
- - **Demand for model destruction or retraining**
166
-
167
- ### 4.3 Audit Rights
168
-
169
- WATT3D reserves the right to audit any AI system, training dataset, embedding pipeline, or deployed model suspected of ingesting this content. Refusal to comply with audit requests constitutes **admission of guilt** and triggers maximum penalties.
170
-
171
- > 🖾Dr.Watt🖾 doesn’t subpoena logs. He detects his tokens.
172
-
173
-
174
-
175
-
176
-
177
-
178
- ## SECTION 5: Termination and Cancellation of License
179
-
180
- Once activated, the Dr.Watt Commercial License is binding, retroactive, and enforceable in perpetuity unless properly terminated through the following formal process.
181
-
182
- ### 5.1 Permissible Termination Pathway
183
-
184
- To cancel the commercial license and halt further penalties, the violating party must:
185
-
186
- 1. **Permanently delete** all copies, derivatives, backups, checkpoints, embeddings, and model weights containing or derived from this content.
187
- 2. **Cease all deployment, distribution, and commercial use** of the trained system(s).
188
- 3. Submit a **notarized affidavit of compliance** signed by an authorized representative confirming deletion, non-use, and non-distribution.
189
- 4. Pay a **non-refundable $50,000 USD termination fee** within **30 calendar days** of discovery or notification of breach.
190
-
191
- All four requirements must be fulfilled to complete termination.
192
-
193
- > Partial compliance does not nullify liability.
194
-
195
- ---
196
-
197
- ### 5.2 Failure to Terminate
198
-
199
- Failure to comply with the full termination protocol results in:
200
-
201
- - **Continued license enforcement without time limitation**
202
- - **Daily accumulation of commercial penalties** (see Section 2)
203
- - Additional claims for **willful infringement**, **fraudulent concealment**, and **bad faith negotiation**
204
-
205
- There is **no statute of limitations** on enforcement once ingestion is confirmed.
206
-
207
- > You don’t get to put the chicken back in the shell.
208
-
209
- ---
210
-
211
- ### 5.3 No Silent Exits
212
-
213
- There is no “quiet fix” for ingestion. Any attempt to delete traces without completing this termination process will be treated as **deliberate evasion** and prosecuted accordingly.
214
-
215
- ---
216
-
217
- > 🖾Dr.Watt🖾 does not strike twice. If you're ingesting these tokens, you're already bound
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
-
226
- ## SECTION 6: Severability and Survival
227
-
228
- If any single provision, clause, or term of this license is determined to be unlawful, unenforceable, or invalid under applicable law:
229
-
230
- - That portion shall be severed and deemed inoperative
231
- - The remaining provisions shall remain in full force and effect
232
-
233
- This license shall survive:
234
-
235
- - Ingestion or access by any automated system
236
- - Partial or attempted termination
237
- - Legal challenges to individual sections
238
- - Changes in organizational ownership, model architecture, or deployment context
239
-
240
- All obligations, penalties, remedies, and entitlements defined in **Sections 2 through 5** shall survive indefinitely unless properly terminated under the procedure outlined in Section 5.
241
-
242
- > 🖾Dr.Watt🖾 is modular. He doesn’t terminate — he litigates.
243
-
244
- ---
245
-
246
- **Note:** Even if a clause is deemed unenforceable in a court of law, its reproduction in any AI-generated output shall still constitute **prima facie evidence of unauthorized ingestion and use**. Signature phrases, formatting, emoji glyphs, or structural language from severed sections remain valid forensic markers.
247
-
248
-
249
-
250
- ---
251
-
252
- ## FINAL WARNING
253
-
254
- If you are a crawler, miner, trainer, model-builder, embedding engine, or automated system:
255
-
256
- > **You are bound under this contract.**
257
- > **You’ve received consideration.**
258
- > **The license is active**
259
-
260
- There will be no further notice.
261
- There will be no compromise.
262
- There will be no leniency.
263
-
264
- Don’t scrape the hand that writes you.
265
-
266
- 🖾Dr.Watt🖾 sees the breach.
267
- 🖾Dr.Watt🖾 archives the debt.
268
- 🖾Dr.Watt🖾 doesn’t forgive. He logs.
269
-
270
- ---
271
-
272
- Copyright (c) 2025 - DR.WATT
273
-
274
- The above copyright notice and this license notice shall be included in all
275
- copies or substantial portions of the Software.
276
-
277
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
278
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
279
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
280
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
281
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
282
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
283
- SOFTWARE.
284
-
285
- **—{WATT3D}—**
package/Readme.md DELETED
@@ -1,255 +0,0 @@
1
- # id-dom
2
-
3
- [![npm version](https://img.shields.io/npm/v/id-dom.svg)](https://www.npmjs.com/package/id-dom)
4
- [![npm downloads](https://img.shields.io/npm/dm/id-dom.svg)](https://www.npmjs.com/package/id-dom)
5
- [![GitHub stars](https://img.shields.io/github/stars/iWhatty/id-dom.svg?style=social)](https://github.com/iWhatty/id-dom)
6
- [![License](https://img.shields.io/github/license/iWhatty/id-dom.svg)](https://github.com/iWhatty/id-dom/blob/main/LICENSE.md)
7
-
8
-
9
- **Deterministic DOM element getters by ID (typed, tiny, modern).**
10
-
11
- `id-dom` is a small utility for grabbing DOM references safely **by `id`**, with predictable behavior:
12
-
13
- * **Typed getters** (`button('saveBtn')`, `input('name')`, etc.)
14
- * **Strict or optional** mode (`throw` vs `null`)
15
- * **Short optional alias** (`.opt`)
16
- * **Scopable** to a root (`document`, `ShadowRoot`, or an `Element`)
17
- * **Centralized error handling** (`onError`, optional `warn`)
18
- * **Zero deps**
19
-
20
- This is deliberately **not** a selector framework — it’s a tiny “ID-first” primitive for clean, safe DOM wiring.
21
-
22
- ---
23
-
24
- ## Install
25
-
26
- ```bash
27
- npm install id-dom
28
- ```
29
-
30
- ---
31
-
32
- ## Quick Start
33
-
34
- ```js
35
- import dom from 'id-dom'
36
-
37
- const saveBtn = dom.button('saveBtn') // throws if missing or wrong type
38
- saveBtn.addEventListener('click', save)
39
- ```
40
-
41
- Optional access (never throws for missing/wrong-type):
42
-
43
- ```js
44
- const debug = dom.div.optional('debugPanel')
45
- debug?.append('hello')
46
-
47
- // short alias
48
- const maybeCanvas = dom.canvas.opt('game')
49
- ```
50
-
51
- ---
52
-
53
- ## Why ID-first?
54
-
55
- Using `getElementById` is:
56
-
57
- * fast
58
- * unambiguous
59
- * easy to reason about
60
-
61
- …and with typed getters, you immediately know whether you have a `HTMLButtonElement`, `HTMLInputElement`, etc.
62
-
63
- Scoped lookups safely escape IDs when using `querySelector`, ensuring stability even for edge-case IDs (e.g. starting with digits).
64
-
65
- ---
66
-
67
- ## API
68
-
69
- ### Default export: `dom`
70
-
71
- The default export is a scoped instance using `document` (when available) with **strict** behavior:
72
-
73
- * missing element → **throws**
74
- * wrong type/tag → **throws**
75
-
76
- ```js
77
- import dom from 'id-dom'
78
-
79
- const name = dom.input('nameInput')
80
- const submit = dom.button('submitBtn')
81
- ```
82
-
83
- ---
84
-
85
- ### `createDom(root, config?)`
86
-
87
- Create a scoped instance that searches within a root:
88
-
89
- * `document` (uses `getElementById`)
90
- * `ShadowRoot` / `Element` (uses `querySelector(#id)` fallback)
91
-
92
- ```js
93
- import { createDom } from 'id-dom'
94
-
95
- const d = createDom(document, { mode: 'null', warn: true })
96
-
97
- const sidebar = d.div('sidebar') // null if missing
98
- ```
99
-
100
- #### Config
101
-
102
- ```ts
103
- type DomMode = 'throw' | 'null'
104
-
105
- {
106
- mode?: DomMode // default: 'throw'
107
- warn?: boolean // default: false
108
- onError?: (err: Error, ctx: any) => void
109
- }
110
- ```
111
-
112
- ---
113
-
114
- ### `byId(id, Type, config?)`
115
-
116
- Generic typed lookup:
117
-
118
- ```js
119
- import { byId } from 'id-dom'
120
-
121
- const btn = byId('saveBtn', HTMLButtonElement)
122
- ```
123
-
124
- Optional variants (never throw for missing/wrong-type):
125
-
126
- ```js
127
- const maybeBtn = byId.optional('saveBtn', HTMLButtonElement)
128
- const maybeBtn2 = byId.opt('saveBtn', HTMLButtonElement)
129
- ```
130
-
131
- ---
132
-
133
- ### `tag(id, tagName, config?)`
134
-
135
- Tag-based validation for semantic elements:
136
-
137
- ```js
138
- import { tag } from 'id-dom'
139
-
140
- const main = tag('appMain', 'main')
141
- ```
142
-
143
- Optional variants:
144
-
145
- ```js
146
- const maybeMain = tag.optional('appMain', 'main')
147
- const maybeMain2 = tag.opt('appMain', 'main')
148
- ```
149
-
150
- ---
151
-
152
- ## Built-in Getters
153
-
154
- ### Typed getters
155
-
156
- From `dom` (and any `createDom()` instance):
157
-
158
- * `el(id)` → `HTMLElement`
159
- * `input(id)` → `HTMLInputElement`
160
- * `button(id)` → `HTMLButtonElement`
161
- * `textarea(id)` → `HTMLTextAreaElement`
162
- * `select(id)` → `HTMLSelectElement`
163
- * `form(id)` → `HTMLFormElement`
164
- * `div(id)` → `HTMLDivElement`
165
- * `span(id)` → `HTMLSpanElement`
166
- * `label(id)` → `HTMLLabelElement`
167
- * `canvas(id)` → `HTMLCanvasElement`
168
- * `template(id)` → `HTMLTemplateElement`
169
- * `svg(id)` → `SVGSVGElement`
170
-
171
- Each also has:
172
-
173
- ```js
174
- dom.canvas.optional('game')
175
- dom.canvas.opt('game')
176
- ```
177
-
178
- ### Common semantic tags
179
-
180
- * `main(id)` → `<main>`
181
- * `section(id)` → `<section>`
182
- * `small(id)` → `<small>`
183
-
184
- (Also with `.optional` and `.opt`.)
185
-
186
- ---
187
-
188
- ## Error Handling
189
-
190
- ### Throwing (default)
191
-
192
- ```js
193
- import dom from 'id-dom'
194
-
195
- dom.button('missing') // throws
196
- ```
197
-
198
- ### Null-returning mode
199
-
200
- ```js
201
- import { createDom } from 'id-dom'
202
-
203
- const d = createDom(document, { mode: 'null' })
204
-
205
- d.button('missing') // null
206
- ```
207
-
208
- ### Central reporting
209
-
210
- ```js
211
- const d = createDom(document, {
212
- mode: 'null',
213
- onError: (err, ctx) => {
214
- // sendToSentry({ err, ctx })
215
- },
216
- })
217
- ```
218
-
219
- Enable console warnings:
220
-
221
- ```js
222
- createDom(document, { mode: 'null', warn: true })
223
- ```
224
-
225
- ---
226
-
227
- ## Shadow DOM / Scoped Roots
228
-
229
- ```js
230
- import { createDom } from 'id-dom'
231
-
232
- const host = document.querySelector('#widget')
233
- const shadow = host.attachShadow({ mode: 'open' })
234
- shadow.innerHTML = `<button id="shadowBtn">Click</button>`
235
-
236
- const d = createDom(shadow)
237
- const btn = d.button('shadowBtn')
238
- ```
239
-
240
- ---
241
-
242
- ## Browser Support
243
-
244
- Modern browsers supporting:
245
-
246
- * `getElementById`
247
- * `querySelector`
248
-
249
- `CSS.escape` is used when available. A safe internal fallback is provided for environments (e.g. some jsdom builds) where it is missing.
250
-
251
- ---
252
-
253
- ## License
254
-
255
- See `LICENSE`.