@symbo.ls/shorthand 2.34.32 → 2.34.33

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.
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var decode_exports = {};
20
+ __export(decode_exports, {
21
+ decode: () => decode,
22
+ expand: () => expand,
23
+ parse: () => parse
24
+ });
25
+ module.exports = __toCommonJS(decode_exports);
26
+ var import_registry = require("./registry.js");
27
+ function decode(str) {
28
+ if (!str || typeof str !== "string") return {};
29
+ const obj = {};
30
+ const tokens = tokenize(str);
31
+ for (const token of tokens) {
32
+ if (token.startsWith("!")) {
33
+ const abbr2 = token.slice(1);
34
+ const prop2 = import_registry.abbrToProp[abbr2] || abbr2;
35
+ obj[prop2] = false;
36
+ continue;
37
+ }
38
+ const colonIdx = token.indexOf(":");
39
+ if (colonIdx === -1) {
40
+ const prop2 = import_registry.abbrToProp[token] || token;
41
+ obj[prop2] = true;
42
+ continue;
43
+ }
44
+ const abbr = token.slice(0, colonIdx);
45
+ const rawVal = token.slice(colonIdx + 1);
46
+ const prop = import_registry.abbrToProp[abbr] || abbr;
47
+ if (rawVal.includes(",")) {
48
+ obj[prop] = rawVal.split(",").map(decodeValue);
49
+ continue;
50
+ }
51
+ obj[prop] = decodeValue(rawVal);
52
+ }
53
+ return obj;
54
+ }
55
+ function tokenize(str) {
56
+ return str.trim().split(/\s+/).filter(Boolean);
57
+ }
58
+ function decodeValue(val) {
59
+ const str = val.replace(/_/g, " ");
60
+ if (/^-?\d+(\.\d+)?$/.test(str)) {
61
+ return Number(str);
62
+ }
63
+ return str;
64
+ }
65
+ function decodeInlineValue(val) {
66
+ return val.replace(/_/g, " ");
67
+ }
68
+ function decodeInline(str) {
69
+ if (!str || typeof str !== "string") return {};
70
+ const obj = {};
71
+ const tokens = tokenize(str);
72
+ for (const token of tokens) {
73
+ if (token.startsWith("!")) {
74
+ const abbr2 = token.slice(1);
75
+ const prop2 = import_registry.abbrToProp[abbr2] || abbr2;
76
+ obj[prop2] = false;
77
+ continue;
78
+ }
79
+ const colonIdx = token.indexOf(":");
80
+ if (colonIdx === -1) {
81
+ const prop2 = import_registry.abbrToProp[token] || token;
82
+ obj[prop2] = true;
83
+ continue;
84
+ }
85
+ const abbr = token.slice(0, colonIdx);
86
+ const rawVal = token.slice(colonIdx + 1);
87
+ const prop = import_registry.abbrToProp[abbr] || abbr;
88
+ if (rawVal.includes(",")) {
89
+ obj[prop] = rawVal.split(",").map(decodeInlineValue);
90
+ continue;
91
+ }
92
+ obj[prop] = decodeInlineValue(rawVal);
93
+ }
94
+ return obj;
95
+ }
96
+ function expand(obj) {
97
+ if (!obj || typeof obj !== "object") return obj;
98
+ if (Array.isArray(obj)) {
99
+ return obj.map(function(item) {
100
+ if (item !== null && typeof item === "object") return expand(item);
101
+ return item;
102
+ });
103
+ }
104
+ const result = {};
105
+ for (const key in obj) {
106
+ const val = obj[key];
107
+ if ((0, import_registry.isComponentKey)(key)) {
108
+ result[key] = expandVal(val);
109
+ continue;
110
+ }
111
+ const fullKey = import_registry.abbrToProp[key] || key;
112
+ if ((0, import_registry.isSelectorKey)(key) && fullKey === key) {
113
+ result[key] = expandVal(val);
114
+ continue;
115
+ }
116
+ if (import_registry.PRESERVE_VALUE_KEYS.has(fullKey) || import_registry.PRESERVE_VALUE_KEYS.has(key)) {
117
+ result[fullKey] = val;
118
+ continue;
119
+ }
120
+ result[fullKey] = expandVal(val);
121
+ }
122
+ return result;
123
+ }
124
+ function expandVal(val) {
125
+ if (val === null || val === void 0) return val;
126
+ if (typeof val === "function") return val;
127
+ if (Array.isArray(val)) {
128
+ return val.map(function(item) {
129
+ if (item !== null && typeof item === "object") return expand(item);
130
+ return item;
131
+ });
132
+ }
133
+ if (typeof val === "object") return expand(val);
134
+ return val;
135
+ }
136
+ function parse(obj) {
137
+ if (!obj || typeof obj !== "object") return obj;
138
+ if (Array.isArray(obj)) {
139
+ return obj.map(function(item) {
140
+ if (item !== null && typeof item === "object") return parse(item);
141
+ return item;
142
+ });
143
+ }
144
+ const result = {};
145
+ if (typeof obj.in === "string") {
146
+ const decoded = decodeInline(obj.in);
147
+ for (const prop in decoded) {
148
+ result[prop] = decoded[prop];
149
+ }
150
+ }
151
+ for (const key in obj) {
152
+ if (key === "in") continue;
153
+ const val = obj[key];
154
+ if ((0, import_registry.isComponentKey)(key)) {
155
+ result[key] = parseVal(val);
156
+ continue;
157
+ }
158
+ const fullKey = import_registry.abbrToProp[key] || key;
159
+ if ((0, import_registry.isSelectorKey)(key) && fullKey === key) {
160
+ result[key] = parseVal(val);
161
+ continue;
162
+ }
163
+ if (import_registry.PRESERVE_VALUE_KEYS.has(fullKey) || import_registry.PRESERVE_VALUE_KEYS.has(key)) {
164
+ result[fullKey] = val;
165
+ continue;
166
+ }
167
+ result[fullKey] = parseVal(val);
168
+ }
169
+ return result;
170
+ }
171
+ function parseVal(val) {
172
+ if (val === null || val === void 0) return val;
173
+ if (typeof val === "function") return val;
174
+ if (Array.isArray(val)) {
175
+ return val.map(function(item) {
176
+ if (item !== null && typeof item === "object") return parse(item);
177
+ return item;
178
+ });
179
+ }
180
+ if (typeof val === "object") return parse(val);
181
+ return val;
182
+ }
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var encode_exports = {};
20
+ __export(encode_exports, {
21
+ encode: () => encode,
22
+ shorten: () => shorten,
23
+ stringify: () => stringify
24
+ });
25
+ module.exports = __toCommonJS(encode_exports);
26
+ var import_registry = require("./registry.js");
27
+ function encode(obj) {
28
+ if (!obj || typeof obj !== "object") return "";
29
+ const tokens = [];
30
+ for (const prop in obj) {
31
+ const val = obj[prop];
32
+ if (typeof val === "function") continue;
33
+ if (val !== null && typeof val === "object" && !Array.isArray(val)) continue;
34
+ if (val === void 0) continue;
35
+ const abbr = import_registry.propToAbbr[prop] || prop;
36
+ if (val === true) {
37
+ tokens.push(abbr);
38
+ } else if (val === false) {
39
+ tokens.push("!" + abbr);
40
+ } else if (Array.isArray(val)) {
41
+ const items = val.map((item) => encodeValue(item));
42
+ tokens.push(abbr + ":" + items.join(","));
43
+ } else {
44
+ tokens.push(abbr + ":" + encodeValue(val));
45
+ }
46
+ }
47
+ return tokens.join(" ");
48
+ }
49
+ function encodeValue(val) {
50
+ const str = String(val);
51
+ return str.replace(/ /g, "_");
52
+ }
53
+ function shorten(obj) {
54
+ if (!obj || typeof obj !== "object") return obj;
55
+ if (Array.isArray(obj)) {
56
+ return obj.map(function(item) {
57
+ if (item !== null && typeof item === "object") return shorten(item);
58
+ return item;
59
+ });
60
+ }
61
+ const result = {};
62
+ for (const key in obj) {
63
+ const val = obj[key];
64
+ if ((0, import_registry.isComponentKey)(key)) {
65
+ result[key] = shortenVal(val);
66
+ continue;
67
+ }
68
+ if ((0, import_registry.isSelectorKey)(key)) {
69
+ result[key] = shortenVal(val);
70
+ continue;
71
+ }
72
+ const shortKey = import_registry.propToAbbr[key] || key;
73
+ if (import_registry.PRESERVE_VALUE_KEYS.has(key) || import_registry.PRESERVE_VALUE_KEYS.has(shortKey)) {
74
+ result[shortKey] = val;
75
+ continue;
76
+ }
77
+ result[shortKey] = shortenVal(val);
78
+ }
79
+ return result;
80
+ }
81
+ function shortenVal(val) {
82
+ if (val === null || val === void 0) return val;
83
+ if (typeof val === "function") return val;
84
+ if (Array.isArray(val)) {
85
+ return val.map(function(item) {
86
+ if (item !== null && typeof item === "object") return shorten(item);
87
+ return item;
88
+ });
89
+ }
90
+ if (typeof val === "object") return shorten(val);
91
+ return val;
92
+ }
93
+ function stringify(obj) {
94
+ if (!obj || typeof obj !== "object") return obj;
95
+ if (Array.isArray(obj)) {
96
+ return obj.map(function(item) {
97
+ if (item !== null && typeof item === "object") return stringify(item);
98
+ return item;
99
+ });
100
+ }
101
+ const result = {};
102
+ const tokens = [];
103
+ for (const key in obj) {
104
+ const val = obj[key];
105
+ if ((0, import_registry.isComponentKey)(key)) {
106
+ result[key] = stringifyVal(val);
107
+ continue;
108
+ }
109
+ if ((0, import_registry.isSelectorKey)(key)) {
110
+ result[key] = stringifyVal(val);
111
+ continue;
112
+ }
113
+ const shortKey = import_registry.propToAbbr[key] || key;
114
+ if (import_registry.PRESERVE_VALUE_KEYS.has(key) || import_registry.PRESERVE_VALUE_KEYS.has(shortKey)) {
115
+ result[shortKey] = val;
116
+ continue;
117
+ }
118
+ if (typeof val === "function") {
119
+ result[shortKey] = val;
120
+ continue;
121
+ }
122
+ if (val === null || val === void 0) {
123
+ result[shortKey] = val;
124
+ continue;
125
+ }
126
+ if (import_registry.SKIP_INLINE_KEYS.has(key) || import_registry.SKIP_INLINE_KEYS.has(shortKey)) {
127
+ result[shortKey] = val;
128
+ continue;
129
+ }
130
+ if (Array.isArray(val)) {
131
+ const hasObjects = val.some(function(item) {
132
+ return item !== null && typeof item === "object";
133
+ });
134
+ if (hasObjects) {
135
+ result[shortKey] = val.map(function(item) {
136
+ if (item !== null && typeof item === "object") return stringify(item);
137
+ return item;
138
+ });
139
+ continue;
140
+ }
141
+ if (val.length <= 1) {
142
+ result[shortKey] = val;
143
+ continue;
144
+ }
145
+ tokens.push(shortKey + ":" + val.map(encodeValue).join(","));
146
+ continue;
147
+ }
148
+ if (typeof val === "object") {
149
+ result[shortKey] = stringify(val);
150
+ continue;
151
+ }
152
+ if (val === true) {
153
+ tokens.push(shortKey);
154
+ } else if (val === false) {
155
+ tokens.push("!" + shortKey);
156
+ } else if (typeof val === "number") {
157
+ result[shortKey] = val;
158
+ } else if (typeof val === "string" && (val.includes(",") || val.includes("_"))) {
159
+ result[shortKey] = val;
160
+ } else {
161
+ tokens.push(shortKey + ":" + encodeValue(val));
162
+ }
163
+ }
164
+ if (tokens.length) {
165
+ result.in = tokens.join(" ");
166
+ }
167
+ return result;
168
+ }
169
+ function stringifyVal(val) {
170
+ if (val === null || val === void 0) return val;
171
+ if (typeof val === "function") return val;
172
+ if (Array.isArray(val)) {
173
+ return val.map(function(item) {
174
+ if (item !== null && typeof item === "object") return stringify(item);
175
+ return item;
176
+ });
177
+ }
178
+ if (typeof val === "object") return stringify(val);
179
+ return val;
180
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var index_exports = {};
20
+ __export(index_exports, {
21
+ PRESERVE_VALUE_KEYS: () => import_registry.PRESERVE_VALUE_KEYS,
22
+ SKIP_INLINE_KEYS: () => import_registry.SKIP_INLINE_KEYS,
23
+ abbrToProp: () => import_registry.abbrToProp,
24
+ decode: () => import_decode.decode,
25
+ encode: () => import_encode.encode,
26
+ expand: () => import_decode.expand,
27
+ isComponentKey: () => import_registry.isComponentKey,
28
+ isSelectorKey: () => import_registry.isSelectorKey,
29
+ parse: () => import_decode.parse,
30
+ propToAbbr: () => import_registry.propToAbbr,
31
+ shorten: () => import_encode.shorten,
32
+ stringify: () => import_encode.stringify
33
+ });
34
+ module.exports = __toCommonJS(index_exports);
35
+ var import_encode = require("./encode.js");
36
+ var import_decode = require("./decode.js");
37
+ var import_registry = require("./registry.js");
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "commonjs",
3
+ "main": "index.js"
4
+ }
@@ -0,0 +1,612 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var registry_exports = {};
20
+ __export(registry_exports, {
21
+ PRESERVE_VALUE_KEYS: () => PRESERVE_VALUE_KEYS,
22
+ SKIP_INLINE_KEYS: () => SKIP_INLINE_KEYS,
23
+ abbrToProp: () => abbrToProp,
24
+ isComponentKey: () => isComponentKey,
25
+ isSelectorKey: () => isSelectorKey,
26
+ propToAbbr: () => propToAbbr
27
+ });
28
+ module.exports = __toCommonJS(registry_exports);
29
+ const propToAbbr = {
30
+ // ── Core DOMQL Properties ──
31
+ attr: "at",
32
+ childExtends: "cex",
33
+ childExtendsRecursive: "cexr",
34
+ childProps: "cp",
35
+ children: "ch",
36
+ childrenAs: "cha",
37
+ class: "cl",
38
+ content: "cnt",
39
+ context: "ctx",
40
+ data: "dt",
41
+ extends: "ext",
42
+ hide: "hd",
43
+ html: "htm",
44
+ if: "if",
45
+ ignoreChildExtend: "icex",
46
+ key: "ky",
47
+ query: "qy",
48
+ routes: "rt",
49
+ scope: "scp",
50
+ show: "shw",
51
+ state: "st",
52
+ style: "sy",
53
+ tag: "tg",
54
+ text: "tx",
55
+ // ── Symbols Shorthand Props ──
56
+ align: "aln",
57
+ boxSize: "bsz",
58
+ flow: "fl",
59
+ heightRange: "hr",
60
+ horizontalInset: "hi",
61
+ round: "rnd",
62
+ shadow: "shd",
63
+ size: "sz",
64
+ templateColumns: "tcol",
65
+ verticalInset: "vi",
66
+ widthRange: "wr",
67
+ wrap: "wrp",
68
+ // ── Box / Sizing ──
69
+ aspectRatio: "ar",
70
+ blockSize: "bks",
71
+ boxSizing: "bxs",
72
+ height: "h",
73
+ inlineSize: "ins",
74
+ margin: "m",
75
+ marginBottom: "mb",
76
+ marginLeft: "ml",
77
+ marginRight: "mr",
78
+ marginTop: "mt",
79
+ maxBlockSize: "mxbs",
80
+ maxHeight: "mxh",
81
+ maxInlineSize: "mxis",
82
+ maxWidth: "mxw",
83
+ minBlockSize: "mnbs",
84
+ minHeight: "mnh",
85
+ minInlineSize: "mnis",
86
+ minWidth: "mnw",
87
+ padding: "p",
88
+ paddingBottom: "pb",
89
+ paddingInline: "pil",
90
+ paddingLeft: "pl",
91
+ paddingRight: "pr",
92
+ paddingTop: "pt",
93
+ width: "w",
94
+ // ── Flexbox ──
95
+ alignContent: "ac",
96
+ alignItems: "ai",
97
+ alignSelf: "as",
98
+ flex: "fx",
99
+ flexBasis: "fxb",
100
+ flexDirection: "fxd",
101
+ flexFlow: "fxf",
102
+ flexGrow: "fxg",
103
+ flexShrink: "fxs",
104
+ flexWrap: "fxw",
105
+ gap: "g",
106
+ justifyContent: "jc",
107
+ justifyItems: "ji",
108
+ justifySelf: "js",
109
+ order: "od",
110
+ placeContent: "pcn",
111
+ placeItems: "pit",
112
+ placeSelf: "psl",
113
+ rowGap: "rg",
114
+ // ── Grid ──
115
+ columnGap: "cg",
116
+ gridArea: "ga",
117
+ gridAutoColumns: "gac",
118
+ gridAutoFlow: "gaf",
119
+ gridAutoRows: "gar",
120
+ gridColumn: "gc",
121
+ gridColumnEnd: "gce",
122
+ gridColumnStart: "gcs",
123
+ gridRow: "gr",
124
+ gridRowEnd: "gre",
125
+ gridRowStart: "grs",
126
+ gridTemplateAreas: "gta",
127
+ gridTemplateColumns: "gtc",
128
+ gridTemplateRows: "gtr",
129
+ // ── Position ──
130
+ bottom: "bot",
131
+ float: "flt",
132
+ inset: "ist",
133
+ left: "lft",
134
+ position: "pos",
135
+ right: "rgt",
136
+ top: "tp",
137
+ zIndex: "zi",
138
+ // ── Display / Visibility ──
139
+ clear: "clr",
140
+ contain: "ctn",
141
+ cursor: "cur",
142
+ display: "d",
143
+ opacity: "op",
144
+ overflow: "ov",
145
+ overflowX: "ovx",
146
+ overflowY: "ovy",
147
+ pointerEvents: "pe",
148
+ resize: "rsz",
149
+ userSelect: "us",
150
+ visibility: "vis",
151
+ // ── Color / Theme ──
152
+ background: "bg",
153
+ backgroundAttachment: "bga",
154
+ backgroundBlendMode: "bgbm",
155
+ backgroundClip: "bgcl",
156
+ backgroundColor: "bgc",
157
+ backgroundImage: "bgi",
158
+ backgroundOrigin: "bgo",
159
+ backgroundPosition: "bgp",
160
+ backgroundPositionX: "bgpx",
161
+ backgroundPositionY: "bgpy",
162
+ backgroundRepeat: "bgr",
163
+ backgroundRepeatX: "bgrx",
164
+ backgroundRepeatY: "bgry",
165
+ backgroundSize: "bgs",
166
+ color: "c",
167
+ theme: "thm",
168
+ themeModifier: "thmm",
169
+ // ── Border ──
170
+ border: "bd",
171
+ borderBottom: "bdb",
172
+ borderBottomLeftRadius: "bdblr",
173
+ borderBottomRightRadius: "bdbrr",
174
+ borderCollapse: "bdcl",
175
+ borderColor: "bdc",
176
+ borderImage: "bdi",
177
+ borderImageOutset: "bdio",
178
+ borderImageRepeat: "bdir",
179
+ borderImageSlice: "bdis",
180
+ borderImageSource: "bdisrc",
181
+ borderImageWidth: "bdiw",
182
+ borderLeft: "bdl",
183
+ borderRadius: "bdr",
184
+ borderRight: "bdrg",
185
+ borderSpacing: "bdsp",
186
+ borderStyle: "bdst",
187
+ borderTop: "bdt",
188
+ borderTopLeftRadius: "bdtlr",
189
+ borderTopRightRadius: "bdtrr",
190
+ borderWidth: "bdw",
191
+ // ── Outline ──
192
+ outline: "ol",
193
+ outlineColor: "olc",
194
+ outlineOffset: "olo",
195
+ outlineStyle: "ols",
196
+ outlineWidth: "olw",
197
+ // ── Shadow ──
198
+ boxShadow: "bxsh",
199
+ textShadow: "txsh",
200
+ // ── Typography ──
201
+ direction: "dir",
202
+ fontDisplay: "fdi",
203
+ fontFamily: "ff",
204
+ fontFeatureSettings: "ffs",
205
+ fontKerning: "fk",
206
+ fontOpticalSizing: "fos",
207
+ fontPalette: "fpl",
208
+ fontSize: "fs",
209
+ fontSizeAdjust: "fsa",
210
+ fontSmooth: "fsm",
211
+ fontStretch: "fsr",
212
+ fontStyle: "fsy",
213
+ fontSynthesis: "fsyn",
214
+ fontVariant: "fv",
215
+ fontVariationSettings: "fvs",
216
+ fontWeight: "fw",
217
+ hyphens: "hyp",
218
+ letterSpacing: "ls",
219
+ lineHeight: "lh",
220
+ tabSize: "tsz",
221
+ textAlign: "ta",
222
+ textDecoration: "td",
223
+ textDecorationColor: "tdc",
224
+ textDecorationLine: "tdl",
225
+ textDecorationStyle: "tds",
226
+ textIndent: "ti",
227
+ textOverflow: "tov",
228
+ textStroke: "tsk",
229
+ textTransform: "tt",
230
+ unicodeBidi: "ub",
231
+ verticalAlign: "va",
232
+ whiteSpace: "ws",
233
+ wordBreak: "wbr",
234
+ wordSpacing: "wsp",
235
+ wordWrap: "wwr",
236
+ writingMode: "wm",
237
+ // ── List / Table ──
238
+ captionSide: "cps",
239
+ counterIncrement: "ci",
240
+ counterReset: "cr",
241
+ emptyCells: "ec",
242
+ listStyle: "lst",
243
+ listStyleImage: "lsi",
244
+ listStylePosition: "lsp",
245
+ listStyleType: "lsty",
246
+ quotes: "qt",
247
+ tableLayout: "tl",
248
+ // ── Column ──
249
+ columnCount: "cc",
250
+ columnFill: "cf",
251
+ columnRule: "crl",
252
+ columnRuleColor: "crlc",
253
+ columnRuleStyle: "crls",
254
+ columnRuleWidth: "crlw",
255
+ columnSpan: "cspn",
256
+ columnWidth: "cwi",
257
+ columns: "col",
258
+ // ── Filter / Effects ──
259
+ backdropFilter: "bdf",
260
+ boxDecorationBreak: "bxdb",
261
+ clipPath: "cpth",
262
+ filter: "fil",
263
+ isolation: "iso",
264
+ mixBlendMode: "mbm",
265
+ objectFit: "obf",
266
+ objectPosition: "obp",
267
+ perspective: "prs",
268
+ perspectiveOrigin: "prso",
269
+ willChange: "wc",
270
+ // ── Transform ──
271
+ transform: "tf",
272
+ transformOrigin: "tfo",
273
+ transformStyle: "tfs",
274
+ // ── Transition ──
275
+ transition: "trn",
276
+ transitionDelay: "trnd",
277
+ transitionDuration: "trndr",
278
+ transitionProperty: "trnp",
279
+ transitionTimingFunction: "trntf",
280
+ // ── Animation ──
281
+ animation: "an",
282
+ animationDelay: "and",
283
+ animationDirection: "andr",
284
+ animationDuration: "andur",
285
+ animationFillMode: "anfm",
286
+ animationIterationCount: "anic",
287
+ animationName: "ann",
288
+ animationPlayState: "anps",
289
+ animationTimingFunction: "antf",
290
+ // ── Scroll ──
291
+ scrollBehavior: "sb",
292
+ scrollMargin: "smr",
293
+ scrollMarginBottom: "smrb",
294
+ scrollMarginLeft: "smrl",
295
+ scrollMarginRight: "smrr",
296
+ scrollMarginTop: "smrt",
297
+ scrollPadding: "spd",
298
+ scrollPaddingBottom: "spdb",
299
+ scrollPaddingLeft: "spdl",
300
+ scrollPaddingRight: "spdr",
301
+ scrollPaddingTop: "spdt",
302
+ scrollSnapAlign: "ssa",
303
+ scrollSnapStop: "sss",
304
+ scrollSnapType: "sst",
305
+ // ── Page Break ──
306
+ breakAfter: "bka",
307
+ breakBefore: "bkb",
308
+ breakInside: "bki",
309
+ pageBreakAfter: "pbka",
310
+ pageBreakBefore: "pbkb",
311
+ pageBreakInside: "pbki",
312
+ // ── HTML Attributes: Global ──
313
+ accessKey: "ack",
314
+ className: "cn",
315
+ contentEditable: "ced",
316
+ contextMenu: "cmu",
317
+ draggable: "drg",
318
+ hidden: "hid",
319
+ id: "id",
320
+ is: "is",
321
+ lang: "lng",
322
+ nonce: "nnc",
323
+ spellCheck: "spc",
324
+ tabIndex: "tbi",
325
+ title: "ttl",
326
+ translate: "trl",
327
+ // ── HTML Attributes: Form ──
328
+ accept: "acp",
329
+ acceptCharset: "accs",
330
+ action: "act",
331
+ autoComplete: "atc",
332
+ autoFocus: "atf",
333
+ capture: "cap",
334
+ challenge: "chg",
335
+ checked: "chk",
336
+ cols: "cls",
337
+ colSpan: "csn",
338
+ controls: "ctl",
339
+ default: "def",
340
+ defer: "dfr",
341
+ disabled: "dis",
342
+ encType: "ect",
343
+ form: "frm",
344
+ formAction: "fac",
345
+ formEncType: "fect",
346
+ formMethod: "fme",
347
+ formNoValidate: "fnv",
348
+ formTarget: "ftg",
349
+ high: "hgh",
350
+ inputMode: "imd",
351
+ kind: "knd",
352
+ label: "lbl",
353
+ list: "lis",
354
+ loop: "lp",
355
+ low: "lw",
356
+ max: "mx",
357
+ maxLength: "mxl",
358
+ method: "mtd",
359
+ min: "mn",
360
+ minLength: "mnl",
361
+ multiple: "mul",
362
+ muted: "mut",
363
+ name: "nm",
364
+ open: "opn",
365
+ optimum: "opt",
366
+ pattern: "ptn",
367
+ placeholder: "phd",
368
+ readOnly: "ro",
369
+ required: "req",
370
+ reversed: "rev",
371
+ rows: "rws",
372
+ rowSpan: "rsn",
373
+ selected: "sel",
374
+ span: "spn",
375
+ start: "srt",
376
+ step: "stp",
377
+ type: "typ",
378
+ value: "val",
379
+ // ── HTML Attributes: Link / Navigation ──
380
+ download: "dl",
381
+ href: "hrf",
382
+ hrefLang: "hrl",
383
+ ping: "png",
384
+ referrerPolicy: "rfp",
385
+ rel: "rl",
386
+ target: "tgt",
387
+ // ── HTML Attributes: Media ──
388
+ allow: "alw",
389
+ allowFullScreen: "afs",
390
+ allowPaymentRequest: "apr",
391
+ alt: "alt",
392
+ cellPadding: "cpg",
393
+ cellSpacing: "csg",
394
+ cite: "cit",
395
+ coords: "crd",
396
+ crossOrigin: "cor",
397
+ dateTime: "dtm",
398
+ fetchPriority: "fpr",
399
+ headers: "hds",
400
+ httpEquiv: "hte",
401
+ integrity: "itg",
402
+ isMap: "ism",
403
+ keyType: "kty",
404
+ loading: "ldg",
405
+ manifest: "mft",
406
+ media: "mda",
407
+ poster: "pst",
408
+ preload: "prl",
409
+ radioGroup: "rdg",
410
+ sandbox: "sbx",
411
+ scoped: "scod",
412
+ seamless: "sml",
413
+ shape: "shp",
414
+ sizes: "szs",
415
+ src: "src",
416
+ srcDoc: "srd",
417
+ srcLang: "srl",
418
+ srcSet: "srs",
419
+ useMap: "ump",
420
+ // ── HTML Attributes: ARIA ──
421
+ ariaActiveDescendant: "aad",
422
+ ariaAtomic: "aat",
423
+ ariaBusy: "abu",
424
+ ariaChecked: "achk",
425
+ ariaControls: "acl",
426
+ ariaCurrent: "acr",
427
+ ariaDescribedBy: "adb",
428
+ ariaDetails: "adt",
429
+ ariaDisabled: "adis",
430
+ ariaDropEffect: "ade",
431
+ ariaErrorMessage: "aem",
432
+ ariaExpanded: "aexp",
433
+ ariaGrabbed: "agr",
434
+ ariaHasPopup: "ahp",
435
+ ariaHidden: "ahid",
436
+ ariaInvalid: "ainv",
437
+ ariaLabel: "alb",
438
+ ariaLabelledBy: "alby",
439
+ ariaLive: "alv",
440
+ ariaModal: "amod",
441
+ ariaMultiSelectable: "ams",
442
+ ariaOrientation: "aor",
443
+ ariaOwns: "aow",
444
+ ariaPosInSet: "apis",
445
+ ariaPressed: "aprs",
446
+ ariaReadOnly: "aro",
447
+ ariaRelevant: "arl",
448
+ ariaRequired: "areq",
449
+ ariaSelected: "asel",
450
+ ariaSetSize: "assz",
451
+ ariaValueMax: "avmx",
452
+ ariaValueMin: "avmn",
453
+ ariaValueNow: "avn",
454
+ role: "role",
455
+ // ── Events: Lifecycle ──
456
+ onInit: "@in",
457
+ onRender: "@rn",
458
+ onUpdate: "@up",
459
+ onStateChange: "@sc",
460
+ onStateUpdate: "@su",
461
+ // ── Events: Mouse ──
462
+ onClick: "@ck",
463
+ onContextMenu: "@cm",
464
+ onDblClick: "@dc",
465
+ onMouseDown: "@md",
466
+ onMouseEnter: "@me",
467
+ onMouseLeave: "@ml",
468
+ onMouseMove: "@mm",
469
+ onMouseOut: "@mo",
470
+ onMouseOver: "@mv",
471
+ onMouseUp: "@mu",
472
+ // ── Events: Keyboard ──
473
+ onKeyDown: "@kd",
474
+ onKeyPress: "@kp",
475
+ onKeyUp: "@ku",
476
+ // ── Events: Focus ──
477
+ onBlur: "@bl",
478
+ onFocus: "@fc",
479
+ onFocusIn: "@fi",
480
+ onFocusOut: "@fo",
481
+ // ── Events: Form ──
482
+ onBeforeInput: "@bi",
483
+ onChange: "@cg",
484
+ onFormData: "@fd",
485
+ onInput: "@ip",
486
+ onInvalid: "@iv",
487
+ onReset: "@rs",
488
+ onSearch: "@sr",
489
+ onSelect: "@sl",
490
+ onSubmit: "@sm",
491
+ // ── Events: Touch ──
492
+ onTouchCancel: "@tc",
493
+ onTouchEnd: "@te",
494
+ onTouchMove: "@tm",
495
+ onTouchStart: "@ts",
496
+ // ── Events: Pointer ──
497
+ onPointerCancel: "@pc",
498
+ onPointerDown: "@pd",
499
+ onPointerEnter: "@pe",
500
+ onPointerLeave: "@ple",
501
+ onPointerMove: "@pm",
502
+ onPointerOut: "@po",
503
+ onPointerOver: "@pov",
504
+ onPointerUp: "@pu",
505
+ // ── Events: Drag ──
506
+ onDrag: "@dg",
507
+ onDragEnd: "@dge",
508
+ onDragEnter: "@dgn",
509
+ onDragLeave: "@dgl",
510
+ onDragOver: "@dgo",
511
+ onDragStart: "@dgs",
512
+ onDrop: "@dp",
513
+ // ── Events: Scroll / Resize ──
514
+ onResize: "@rz",
515
+ onScroll: "@scl",
516
+ onWheel: "@wh",
517
+ // ── Events: Clipboard ──
518
+ onCopy: "@cy",
519
+ onCut: "@ct",
520
+ onPaste: "@pt",
521
+ // ── Events: Composition ──
522
+ onCompositionEnd: "@cpe",
523
+ onCompositionStart: "@cps",
524
+ onCompositionUpdate: "@cpu",
525
+ // ── Events: Animation / Transition ──
526
+ onAnimationEnd: "@ae",
527
+ onAnimationIteration: "@ai",
528
+ onAnimationStart: "@as",
529
+ onTransitionEnd: "@tre",
530
+ onTransitionStart: "@trs",
531
+ // ── Events: Media ──
532
+ onAbort: "@ab",
533
+ onCanPlay: "@cap",
534
+ onCanPlayThrough: "@cpt",
535
+ onDurationChange: "@duc",
536
+ onEmptied: "@em",
537
+ onEncrypted: "@enc",
538
+ onEnded: "@end",
539
+ onError: "@er",
540
+ onLoad: "@ld",
541
+ onLoadedData: "@ldd",
542
+ onLoadedMetadata: "@ldm",
543
+ onPause: "@pa",
544
+ onPlay: "@pl",
545
+ onPlaying: "@plg",
546
+ onProgress: "@prg",
547
+ onRateChange: "@rc",
548
+ onSeeked: "@sk",
549
+ onSeeking: "@skg",
550
+ onStalled: "@stl",
551
+ onSuspend: "@ssp",
552
+ onTimeUpdate: "@tu",
553
+ onVolumeChange: "@vc",
554
+ onWaiting: "@wt",
555
+ // ── Special / Advanced ──
556
+ icon: "ico",
557
+ iconText: "ict",
558
+ lookup: "lkp",
559
+ router: "rtr",
560
+ shapeModifier: "shpm"
561
+ };
562
+ const abbrToProp = /* @__PURE__ */ Object.create(null);
563
+ for (const prop in propToAbbr) {
564
+ abbrToProp[propToAbbr[prop]] = prop;
565
+ }
566
+ const seen = /* @__PURE__ */ Object.create(null);
567
+ for (const prop in propToAbbr) {
568
+ const abbr = propToAbbr[prop];
569
+ if (seen[abbr]) {
570
+ throw new Error(
571
+ `Duplicate abbreviation "${abbr}" for "${prop}" \u2014 already used by "${seen[abbr]}"`
572
+ );
573
+ }
574
+ seen[abbr] = prop;
575
+ }
576
+ const PRESERVE_VALUE_KEYS = /* @__PURE__ */ new Set([
577
+ "state",
578
+ "st",
579
+ "scope",
580
+ "scp",
581
+ "attr",
582
+ "at",
583
+ "style",
584
+ "sy",
585
+ "data",
586
+ "dt",
587
+ "context",
588
+ "ctx",
589
+ "query",
590
+ "qy",
591
+ "class",
592
+ "cl"
593
+ ]);
594
+ const SKIP_INLINE_KEYS = /* @__PURE__ */ new Set([
595
+ "text",
596
+ "tx",
597
+ "html",
598
+ "htm",
599
+ "content",
600
+ "cnt",
601
+ "placeholder",
602
+ "phd",
603
+ "src",
604
+ "href",
605
+ "hrf"
606
+ ]);
607
+ function isComponentKey(key) {
608
+ return /^[A-Z]/.test(key);
609
+ }
610
+ function isSelectorKey(key) {
611
+ return /^[:@.!$>&]/.test(key) || key.startsWith("> ");
612
+ }
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": "2.34.32",
5
+ "version": "2.34.33",
6
6
  "repository": "https://github.com/symbo-ls/smbls",
7
7
  "type": "module",
8
8
  "module": "src/index.js",
@@ -23,5 +23,5 @@
23
23
  "docs"
24
24
  ],
25
25
  "license": "ISC",
26
- "gitHead": "99bd991fb87c092bcfd045ad358c15064a8b8c30"
26
+ "gitHead": "a7ecaaa2792aea530bf0b4cef625904c63a0272a"
27
27
  }