@symbo.ls/shorthand 3.6.8 → 3.7.3

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 (2) hide show
  1. package/README.md +28 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -164,6 +164,34 @@ isSelectorKey('> *') // true
164
164
  isSelectorKey('padding') // false
165
165
  ```
166
166
 
167
+ ## domql plugin
168
+
169
+ Shorthand can be used as a domql plugin to expand abbreviated component definitions during element creation:
170
+
171
+ ```js
172
+ import { shorthandPlugin } from '@symbo.ls/shorthand'
173
+
174
+ context.plugins = [shorthandPlugin]
175
+ ```
176
+
177
+ This registers shorthand as a lifecycle plugin alongside other plugins:
178
+
179
+ ```js
180
+ import { funcqlPlugin } from '@domql/funcql'
181
+ import { shorthandPlugin } from '@symbo.ls/shorthand'
182
+
183
+ context.plugins = [funcqlPlugin, shorthandPlugin]
184
+ ```
185
+
186
+ ### Plugin interface
187
+
188
+ ```js
189
+ {
190
+ name: 'shorthand',
191
+ start (element) { ... } // expands shorthand props at creation
192
+ }
193
+ ```
194
+
167
195
  ## Round-trip guarantee
168
196
 
169
197
  All three pairs are lossless — the inverse function always reproduces the original:
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/shorthand",
3
3
  "description": "Shorthand syntax transpiler for Symbols properties",
4
4
  "author": "symbo.ls",
5
- "version": "3.6.8",
5
+ "version": "3.7.3",
6
6
  "repository": "https://github.com/symbo-ls/smbls",
7
7
  "type": "module",
8
8
  "module": "./dist/esm/index.js",