mam 1.11.626 → 1.11.628

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/node.test.js CHANGED
@@ -14008,7 +14008,7 @@ var $;
14008
14008
  props.push(`\t${keys.join('-')}: ${val};\n`);
14009
14009
  }
14010
14010
  else if (val.constructor === Object) {
14011
- for (let suffix in val) {
14011
+ for (let suffix of Object.keys(val).reverse()) {
14012
14012
  addProp([...keys, kebab(suffix)], val[suffix]);
14013
14013
  }
14014
14014
  }
@@ -14026,13 +14026,13 @@ var $;
14026
14026
  }
14027
14027
  else if (key === '>') {
14028
14028
  const types = config[key];
14029
- for (let type in types) {
14029
+ for (let type of Object.keys(types).reverse()) {
14030
14030
  make_class(selector(prefix, path) + ' > :where([' + $mol_dom_qname(type) + '])', [], types[type]);
14031
14031
  }
14032
14032
  }
14033
14033
  else if (key === '@') {
14034
14034
  const attrs = config[key];
14035
- for (let name in attrs) {
14035
+ for (let name of Object.keys(attrs).reverse()) {
14036
14036
  for (let val in attrs[name]) {
14037
14037
  make_class(selector(prefix, path) + ':where([' + name + '=' + JSON.stringify(val) + '])', [], attrs[name][val]);
14038
14038
  }
@@ -14040,7 +14040,7 @@ var $;
14040
14040
  }
14041
14041
  else if (key === '@media') {
14042
14042
  const media = config[key];
14043
- for (let query in media) {
14043
+ for (let query of Object.keys(media).reverse()) {
14044
14044
  rules.push('}\n');
14045
14045
  make_class(prefix, path, media[query]);
14046
14046
  rules.push(`${key} ${query} {\n`);
@@ -14049,7 +14049,7 @@ var $;
14049
14049
  else if (key[0] === '[' && key[key.length - 1] === ']') {
14050
14050
  const attr = key.slice(1, -1);
14051
14051
  const vals = config[key];
14052
- for (let val in vals) {
14052
+ for (let val of Object.keys(vals).reverse()) {
14053
14053
  make_class(selector(prefix, path) + ':where([' + attr + '=' + JSON.stringify(val) + '])', [], vals[val]);
14054
14054
  }
14055
14055
  }
@@ -14092,10 +14092,9 @@ var $;
14092
14092
  'various units'() {
14093
14093
  class $mol_style_sheet_test extends $mol_view {
14094
14094
  }
14095
- const { px, per } = $mol_style_unit;
14096
14095
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14097
- width: per(50),
14098
- height: px(50),
14096
+ width: '50%',
14097
+ height: '50px',
14099
14098
  });
14100
14099
  $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\twidth: 50%;\n\theight: 50px;\n}\n');
14101
14100
  },
@@ -14103,50 +14102,50 @@ var $;
14103
14102
  class $mol_style_sheet_test extends $mol_view {
14104
14103
  }
14105
14104
  const { calc } = $mol_style_func;
14106
- const { px, per } = $mol_style_unit;
14107
14105
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14108
- width: calc(`${per(100)} - ${px(1)}`),
14106
+ width: calc(`100% - 1px`),
14109
14107
  });
14110
14108
  $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\twidth: calc(100% - 1px);\n}\n');
14111
14109
  },
14112
14110
  'property groups'() {
14113
14111
  class $mol_style_sheet_test extends $mol_view {
14114
14112
  }
14115
- const { px } = $mol_style_unit;
14116
14113
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14117
14114
  flex: {
14118
- grow: 5
14115
+ grow: 5,
14116
+ shrink: 10,
14119
14117
  }
14120
14118
  });
14121
- $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tflex-grow: 5;\n}\n');
14119
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tflex-grow: 5;\n\tflex-shrink: 10;\n}\n');
14122
14120
  },
14123
14121
  'custom properties'() {
14124
14122
  class $mol_style_sheet_test extends $mol_view {
14125
14123
  }
14126
14124
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14127
14125
  '--isVariable': 'yes',
14126
+ '--is_variable': 'no',
14128
14127
  });
14129
- $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\t--is-variable: yes;\n}\n');
14128
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\t--is-variable: yes;\n\t--is_variable: no;\n}\n');
14130
14129
  },
14131
14130
  'custom property groups'() {
14132
14131
  class $mol_style_sheet_test extends $mol_view {
14133
14132
  }
14134
- const { px } = $mol_style_unit;
14135
14133
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14136
14134
  '--variable': {
14137
- test: px(5)
14138
- }
14135
+ test1: '5px',
14136
+ test2: '10px',
14137
+ },
14139
14138
  });
14140
- $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\t--variable-test: 5px;\n}\n');
14139
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\t--variable-test1: 5px;\n\t--variable-test2: 10px;\n}\n');
14141
14140
  },
14142
14141
  'property shorthand'() {
14143
14142
  class $mol_style_sheet_test extends $mol_view {
14144
14143
  }
14145
- const { px } = $mol_style_unit;
14146
14144
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14147
- padding: [px(5), 'auto']
14145
+ padding: ['5px', 'auto'],
14146
+ margin: ['10px', 'auto'],
14148
14147
  });
14149
- $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tpadding: 5px auto;\n}\n');
14148
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tpadding: 5px auto;\n\tmargin: 10px auto;\n}\n');
14150
14149
  },
14151
14150
  'sequenced values'() {
14152
14151
  class $mol_style_sheet_test extends $mol_view {
@@ -14155,15 +14154,14 @@ var $;
14155
14154
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14156
14155
  background: {
14157
14156
  image: [[url('foo')], [url('bar')]],
14157
+ size: [['cover'], ['contain']],
14158
14158
  },
14159
14159
  });
14160
- $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tbackground-image: url("foo"),url("bar");\n}\n');
14160
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tbackground-image: url("foo"),url("bar");\n\tbackground-size: cover,contain;\n}\n');
14161
14161
  },
14162
14162
  'sequenced structs'() {
14163
14163
  class $mol_style_sheet_test extends $mol_view {
14164
14164
  }
14165
- const { rem } = $mol_style_unit;
14166
- const { hsla } = $mol_style_func;
14167
14165
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14168
14166
  box: {
14169
14167
  shadow: [
@@ -14171,7 +14169,7 @@ var $;
14171
14169
  inset: true,
14172
14170
  x: 0,
14173
14171
  y: 0,
14174
- blur: rem(.5),
14172
+ blur: '0.5rem',
14175
14173
  spread: 0,
14176
14174
  color: 'red',
14177
14175
  },
@@ -14179,7 +14177,7 @@ var $;
14179
14177
  inset: false,
14180
14178
  x: 0,
14181
14179
  y: 0,
14182
- blur: rem(.5),
14180
+ blur: '0.5rem',
14183
14181
  spread: 0,
14184
14182
  color: 'blue',
14185
14183
  },
@@ -14192,36 +14190,39 @@ var $;
14192
14190
  class $mol_style_sheet_test extends $mol_view {
14193
14191
  }
14194
14192
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14193
+ color: 'red',
14195
14194
  ':focus': {
14196
- color: 'red',
14197
14195
  display: 'block',
14198
14196
  },
14199
14197
  });
14200
- $mol_assert_equal(sheet, '[mol_style_sheet_test]:focus {\n\tcolor: red;\n\tdisplay: block;\n}\n');
14198
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tcolor: red;\n}\n[mol_style_sheet_test]:focus {\n\tdisplay: block;\n}\n');
14201
14199
  },
14202
14200
  'component block styles with pseudo element'() {
14203
14201
  class $mol_style_sheet_test extends $mol_view {
14204
14202
  }
14205
14203
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14204
+ color: 'red',
14206
14205
  '::first-line': {
14207
- color: 'red',
14208
14206
  display: 'block',
14209
14207
  },
14210
14208
  });
14211
- $mol_assert_equal(sheet, '[mol_style_sheet_test]::first-line {\n\tcolor: red;\n\tdisplay: block;\n}\n');
14209
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tcolor: red;\n}\n[mol_style_sheet_test]::first-line {\n\tdisplay: block;\n}\n');
14212
14210
  },
14213
14211
  'component block styles with media query'() {
14214
14212
  class $mol_style_sheet_test extends $mol_view {
14215
14213
  }
14216
14214
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14215
+ color: 'red',
14217
14216
  '@media': {
14218
14217
  'print': {
14219
- color: 'red',
14220
14218
  display: 'block',
14221
14219
  },
14220
+ '(max-width: 640px)': {
14221
+ display: 'inline',
14222
+ },
14222
14223
  },
14223
14224
  });
14224
- $mol_assert_equal(sheet, '@media print {\n[mol_style_sheet_test] {\n\tcolor: red;\n\tdisplay: block;\n}\n}\n');
14225
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tcolor: red;\n}\n@media print {\n[mol_style_sheet_test] {\n\tdisplay: block;\n}\n}\n@media (max-width: 640px) {\n[mol_style_sheet_test] {\n\tdisplay: inline;\n}\n}\n');
14225
14226
  },
14226
14227
  'component block styles with attribute value'() {
14227
14228
  class $mol_style_sheet_test extends $mol_view {
@@ -14232,46 +14233,79 @@ var $;
14232
14233
  }
14233
14234
  }
14234
14235
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14236
+ color: 'red',
14235
14237
  '@': {
14236
14238
  mol_theme: {
14237
14239
  '$mol_theme_dark': {
14238
- color: 'red',
14239
14240
  display: 'block',
14240
14241
  },
14241
14242
  },
14243
+ disabled: {
14244
+ 'true': {
14245
+ width: '100%',
14246
+ },
14247
+ },
14242
14248
  },
14243
14249
  });
14244
- $mol_assert_equal(sheet, '[mol_style_sheet_test]:where([mol_theme="$mol_theme_dark"]) {\n\tcolor: red;\n\tdisplay: block;\n}\n');
14250
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tcolor: red;\n}\n[mol_style_sheet_test]:where([mol_theme="$mol_theme_dark"]) {\n\tdisplay: block;\n}\n[mol_style_sheet_test]:where([disabled="true"]) {\n\twidth: 100%;\n}\n');
14251
+ },
14252
+ 'component block styles with attribute value (short syntax)'() {
14253
+ class $mol_style_sheet_test extends $mol_view {
14254
+ attr() {
14255
+ return {
14256
+ mol_theme: '$mol_theme_dark'
14257
+ };
14258
+ }
14259
+ }
14260
+ const sheet = $mol_style_sheet($mol_style_sheet_test, {
14261
+ color: 'red',
14262
+ '[mol_theme]': {
14263
+ '$mol_theme_dark': {
14264
+ display: 'block',
14265
+ },
14266
+ },
14267
+ '[disabled]': {
14268
+ 'true': {
14269
+ width: '100%',
14270
+ },
14271
+ 'false': {
14272
+ width: '50%',
14273
+ },
14274
+ },
14275
+ });
14276
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tcolor: red;\n}\n[mol_style_sheet_test]:where([mol_theme="$mol_theme_dark"]) {\n\tdisplay: block;\n}\n[mol_style_sheet_test]:where([disabled="true"]) {\n\twidth: 100%;\n}\n[mol_style_sheet_test]:where([disabled="false"]) {\n\twidth: 50%;\n}\n');
14245
14277
  },
14246
14278
  'component element styles'() {
14247
14279
  class $mol_style_sheet_test extends $mol_view {
14248
14280
  Item() { return new $mol_view; }
14249
14281
  }
14250
14282
  const sheet = $mol_style_sheet($mol_style_sheet_test, {
14283
+ color: 'red',
14251
14284
  Item: {
14252
- color: 'red',
14253
14285
  display: 'block',
14254
14286
  },
14255
14287
  });
14256
- $mol_assert_equal(sheet, '[mol_style_sheet_test_item] {\n\tcolor: red;\n\tdisplay: block;\n}\n');
14288
+ $mol_assert_equal(sheet, '[mol_style_sheet_test] {\n\tcolor: red;\n}\n[mol_style_sheet_test_item] {\n\tdisplay: block;\n}\n');
14257
14289
  },
14258
14290
  'component element of element styles'() {
14259
14291
  const sheet = $mol_style_sheet($mol_style_sheet_test2, {
14292
+ width: '100%',
14260
14293
  List: {
14294
+ color: 'red',
14261
14295
  Item: {
14262
- color: 'red',
14263
14296
  display: 'block',
14264
14297
  },
14265
14298
  },
14266
14299
  });
14267
- $mol_assert_equal(sheet, '[mol_style_sheet_test2_list_item] {\n\tcolor: red;\n\tdisplay: block;\n}\n');
14300
+ $mol_assert_equal(sheet, '[mol_style_sheet_test2] {\n\twidth: 100%;\n}\n[mol_style_sheet_test2_list] {\n\tcolor: red;\n}\n[mol_style_sheet_test2_list_item] {\n\tdisplay: block;\n}\n');
14268
14301
  },
14269
14302
  'component element styles with block attribute value'() {
14270
14303
  class $mol_style_sheet_test extends $mol_view {
14271
14304
  Item() { return new $mol_view; }
14272
14305
  attr() {
14273
14306
  return {
14274
- mol_theme: '$mol_theme_dark'
14307
+ mol_theme: '$mol_theme_dark',
14308
+ disabled: true,
14275
14309
  };
14276
14310
  }
14277
14311
  }
@@ -14290,23 +14324,26 @@ var $;
14290
14324
  },
14291
14325
  'inner component styles by class'() {
14292
14326
  const sheet = $mol_style_sheet($mol_style_sheet_test2, {
14327
+ color: 'red',
14293
14328
  $mol_style_sheet_test1: {
14294
- color: 'red',
14295
14329
  display: 'block',
14296
14330
  },
14297
14331
  });
14298
- $mol_assert_equal(sheet, '[mol_style_sheet_test2] :where([mol_style_sheet_test1]) {\n\tcolor: red;\n\tdisplay: block;\n}\n');
14332
+ $mol_assert_equal(sheet, '[mol_style_sheet_test2] {\n\tcolor: red;\n}\n[mol_style_sheet_test2] :where([mol_style_sheet_test1]) {\n\tdisplay: block;\n}\n');
14299
14333
  },
14300
14334
  'child component styles by class'() {
14301
14335
  const sheet = $mol_style_sheet($mol_style_sheet_test2, {
14336
+ color: 'red',
14302
14337
  '>': {
14303
14338
  $mol_style_sheet_test1: {
14304
- color: 'red',
14305
14339
  display: 'block',
14306
14340
  },
14341
+ $mol_style_sheet_test2: {
14342
+ display: 'inline',
14343
+ },
14307
14344
  },
14308
14345
  });
14309
- $mol_assert_equal(sheet, '[mol_style_sheet_test2] > :where([mol_style_sheet_test1]) {\n\tcolor: red;\n\tdisplay: block;\n}\n');
14346
+ $mol_assert_equal(sheet, '[mol_style_sheet_test2] {\n\tcolor: red;\n}\n[mol_style_sheet_test2] > :where([mol_style_sheet_test1]) {\n\tdisplay: block;\n}\n[mol_style_sheet_test2] > :where([mol_style_sheet_test2]) {\n\tdisplay: inline;\n}\n');
14310
14347
  },
14311
14348
  });
14312
14349
  })($ || ($ = {}));