sheetom 0.1.0-rc.9 → 0.1.0

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/docs/api.md CHANGED
@@ -42,13 +42,17 @@ readable and mutable. Assigning any `CSSRule.cssText` is a successful no-op.
42
42
 
43
43
  `serialize()` is the SheetOM extension that emits reparsable CSS from current
44
44
  state. This can differ deliberately from browser-facing `cssText` when CSS
45
- Syntax end-of-input recovery preserved malformed source text.
45
+ Syntax end-of-input recovery preserved malformed source text. It remains
46
+ resilient when CSS text cannot exactly encode an imperative pending-shorthand
47
+ state and emits an opt-in `UNREPRESENTABLE_PENDING_SHORTHAND` diagnostic.
48
+ `serializeStrict()` throws `SheetOMSerializationError` for that state instead.
46
49
 
47
50
  | Surface | Contract |
48
51
  | --- | --- |
49
52
  | `CSSStyleDeclaration.cssText` | Browser-compatible observable declarations, including recovery quirks. |
50
53
  | `CSSRule.cssText` | Browser-compatible observable text for the current rule. |
51
54
  | `CSSStyleSheet.serialize()` | Deterministic Reparsable Stylesheet Serialization with repairs confined to their declaration or rule. |
55
+ | `CSSStyleSheet.serializeStrict()` | Exact-only reparsable serialization; rejects states CSS text cannot faithfully represent. |
52
56
 
53
57
  “Reparsable” guarantees syntactic reparse, no declaration/rule leakage, and
54
58
  preservation of SheetOM’s valid semantic state. It is not URL sanitization,
@@ -94,6 +98,37 @@ throws `TypeError`. Invalid priorities, unsupported names, invalid grammars,
94
98
  and embedded priority tokens are atomic no-ops. Diagnostics are optional and
95
99
  never change those return values or mutations.
96
100
 
101
+ For compilers that have several mutations for one block, SheetOM adds
102
+ `applyMutations(operations)`. It crosses the engine boundary once while
103
+ executing the same ordered declaration state transitions:
104
+
105
+ ```ts
106
+ const results = rule.style.applyMutations([
107
+ { kind: "set", property: "padding", value: "8px 16px" },
108
+ { kind: "set", property: "width", value: "20px; color: red" },
109
+ { kind: "remove", property: "padding-left" },
110
+ ]);
111
+
112
+ // results[0] => { kind: "set", accepted: true, diagnostic: null }
113
+ // results[1] => { kind: "set", accepted: false, diagnostic: { ... } }
114
+ // results[2] => { kind: "remove", value: "16px" }
115
+ ```
116
+
117
+ Results correspond by index. A set is `accepted: true` when `setProperty`
118
+ would apply it, including an accepted no-op or empty-value removal. Rejections
119
+ are atomic for that operation and return a diagnostic even when the sheet
120
+ diagnostic queue is disabled. When diagnostics are enabled, the same object is
121
+ also queued and can be drained once after the batch. Removes return the prior
122
+ observable value exactly like `removeProperty()`.
123
+
124
+ The batch itself is ordered, not globally atomic. A Resource Budget error
125
+ throws at the same operation as sequential calls and retains earlier commits.
126
+ The complete operation array is shape-checked before mutation and deliberately
127
+ requires string properties/priorities and string-or-null values rather than
128
+ performing arbitrary WebIDL coercion. Group operations by
129
+ `CSSStyleDeclaration`; do not concatenate them into CSS text, because that
130
+ would change duplicate, priority, invalid-recovery and removal semantics.
131
+
97
132
  Parser support for modern or implementation-dependent grammar is described by
98
133
  the release-versioned Value Capability Corpus. SheetOM uses checked-in
99
134
  validators synchronously and never launches or contacts a browser at runtime.
@@ -151,11 +186,12 @@ read-only until a standards-defined mutable interface is implemented.
151
186
 
152
187
  Required WebIDL arguments throw `TypeError`. Parse and hierarchy failures use
153
188
  `DOMException` names matching browser APIs. `takeDiagnostics()` drains
154
- SheetOM-only warnings when diagnostics were enabled; otherwise it returns an
155
- empty array. `SheetOMDiagnostic.code` is the exported
156
- `SheetOMDiagnosticCode` string union. The optional queue retains each complete
157
- input string until it is drained; callers handling untrusted or unusually large
158
- inputs should disable diagnostics or drain the queue promptly.
189
+ SheetOM-only mutation and serialization warnings when diagnostics were enabled;
190
+ otherwise it returns an empty array. `SheetOMDiagnostic.code` is the exported
191
+ `SheetOMDiagnosticCode` string union. Serialization recovery diagnostics expose
192
+ `conflictingLonghands`; mutation diagnostics retain their complete input string
193
+ until drained. Callers handling untrusted or unusually large inputs should
194
+ disable diagnostics or drain the queue promptly.
159
195
 
160
196
  SheetOM does not implement DOM association, style-sheet collections, cascade,
161
197
  selector matching, resolved/computed values, layout, fetching, or sanitizing.
package/engine-abi.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "abiVersion": 1,
3
- "sheetomVersion": "0.1.0-rc.9",
4
- "syntaxEngineSetSha256": "2af7ec76ba46a3f20f74a90172a708afab5dcb20f45b658a4d975caed76dc855"
2
+ "abiVersion": 3,
3
+ "sheetomVersion": "0.1.0",
4
+ "syntaxEngineSetSha256": "31990c26ede4e17c3a8941027f92b2be96a167984d0ab6529e724c3d6126be50"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sheetom",
3
- "version": "0.1.0-rc.9",
3
+ "version": "0.1.0",
4
4
  "description": "A browser-compatible mutable CSSOM for JavaScript runtimes",
5
5
  "keywords": [
6
6
  "css",
@@ -48,19 +48,19 @@
48
48
  "SECURITY.md"
49
49
  ],
50
50
  "optionalDependencies": {
51
- "@sheetom/native-darwin-arm64": "0.1.0-rc.9",
52
- "@sheetom/native-darwin-x64": "0.1.0-rc.9",
53
- "@sheetom/native-linux-arm-gnueabihf": "0.1.0-rc.9",
54
- "@sheetom/native-linux-arm-musleabihf": "0.1.0-rc.9",
55
- "@sheetom/native-linux-arm64-gnu": "0.1.0-rc.9",
56
- "@sheetom/native-linux-arm64-musl": "0.1.0-rc.9",
57
- "@sheetom/native-linux-ppc64-gnu": "0.1.0-rc.9",
58
- "@sheetom/native-linux-s390x-gnu": "0.1.0-rc.9",
59
- "@sheetom/native-linux-x64-gnu": "0.1.0-rc.9",
60
- "@sheetom/native-linux-x64-musl": "0.1.0-rc.9",
61
- "@sheetom/native-win32-arm64-msvc": "0.1.0-rc.9",
62
- "@sheetom/native-win32-ia32-msvc": "0.1.0-rc.9",
63
- "@sheetom/native-win32-x64-msvc": "0.1.0-rc.9"
51
+ "@sheetom/native-darwin-arm64": "0.1.0",
52
+ "@sheetom/native-darwin-x64": "0.1.0",
53
+ "@sheetom/native-linux-arm-gnueabihf": "0.1.0",
54
+ "@sheetom/native-linux-arm-musleabihf": "0.1.0",
55
+ "@sheetom/native-linux-arm64-gnu": "0.1.0",
56
+ "@sheetom/native-linux-arm64-musl": "0.1.0",
57
+ "@sheetom/native-linux-ppc64-gnu": "0.1.0",
58
+ "@sheetom/native-linux-s390x-gnu": "0.1.0",
59
+ "@sheetom/native-linux-x64-gnu": "0.1.0",
60
+ "@sheetom/native-linux-x64-musl": "0.1.0",
61
+ "@sheetom/native-win32-arm64-msvc": "0.1.0",
62
+ "@sheetom/native-win32-ia32-msvc": "0.1.0",
63
+ "@sheetom/native-win32-x64-msvc": "0.1.0"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "tsdown",