@yahoo/uds 3.175.6 → 3.175.7

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 (27) hide show
  1. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +1 -1
  2. package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +1 -1
  3. package/dist/components/client/Toast/UDSToastConfigProvider.d.cts +5 -5
  4. package/dist/components/client/Toast/UDSToastConfigProvider.d.ts +5 -5
  5. package/dist/tailwind-internal/dist/utils/getShadowStyles.d.cts +2 -2
  6. package/dist/tailwind-internal/dist/utils/getShadowStyles.d.ts +2 -2
  7. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/README.md +4 -2
  8. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/container.d.ts +16 -20
  9. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/declaration.d.ts +2 -2
  10. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/lazy-result.js +23 -2
  11. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/list.js +5 -2
  12. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/map-generator.js +3 -2
  13. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/node.d.ts +2 -2
  14. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/parser.js +4 -1
  15. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/postcss.js +1 -1
  16. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/previous-map.js +18 -12
  17. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/processor.js +1 -1
  18. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/root.js +16 -1
  19. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/stringifier.js +37 -7
  20. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/lib/warning.js +10 -0
  21. package/dist/tailwind-internal/dist/vendor/node_modules/postcss/package.json +2 -2
  22. package/dist/uds/generated/componentData.cjs +2626 -2626
  23. package/dist/uds/generated/componentData.js +2626 -2626
  24. package/dist/uds/package.cjs +2 -2
  25. package/dist/uds/package.js +2 -2
  26. package/generated/componentData.json +3322 -3322
  27. package/package.json +3 -3
@@ -11,6 +11,7 @@ let list = {
11
11
  },
12
12
 
13
13
  split(string, separators, last) {
14
+ if (typeof string !== 'string') return []
14
15
  let array = []
15
16
  let current = ''
16
17
  let split = false
@@ -41,7 +42,8 @@ let list = {
41
42
  }
42
43
 
43
44
  if (split) {
44
- if (current !== '') array.push(current.trim())
45
+ let value = current.trim()
46
+ if (last || value !== '') array.push(value)
45
47
  current = ''
46
48
  split = false
47
49
  } else {
@@ -49,7 +51,8 @@ let list = {
49
51
  }
50
52
  }
51
53
 
52
- if (last || current !== '') array.push(current.trim())
54
+ let value = current.trim()
55
+ if (last || value !== '') array.push(value)
53
56
  return array
54
57
  }
55
58
  }
@@ -75,9 +75,10 @@ class MapGenerator {
75
75
  }
76
76
  }
77
77
  } else if (this.css) {
78
+ let annotation = '/*# sourceMappingURL='
78
79
  let startIndex
79
- while ((startIndex = this.css.lastIndexOf('/*#')) !== -1) {
80
- let endIndex = this.css.indexOf('*/', startIndex + 3)
80
+ while ((startIndex = this.css.lastIndexOf(annotation)) !== -1) {
81
+ let endIndex = this.css.indexOf('*/', startIndex + annotation.length)
81
82
  if (endIndex === -1) break
82
83
  while (startIndex > 0 && this.css[startIndex - 1] === '\n') {
83
84
  startIndex--
@@ -31,12 +31,12 @@ declare namespace Node {
31
31
 
32
32
  export interface Position {
33
33
  /**
34
- * Source line in file. In contrast to `offset` it starts from 1.
34
+ * Source column in file. It starts from 1.
35
35
  */
36
36
  column: number
37
37
 
38
38
  /**
39
- * Source column in file.
39
+ * Source line in file. It starts from 1.
40
40
  */
41
41
  line: number
42
42
 
@@ -354,8 +354,11 @@ class Parser {
354
354
  if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
355
355
  prev.raws.ownSemicolon = this.spaces
356
356
  this.spaces = ''
357
+ // `ownSemicolon` also holds the spaces before the semicolon, but
358
+ // the position above is the semicolon itself, so the node ends
359
+ // right after it.
357
360
  prev.source.end = this.getPosition(token[2])
358
- prev.source.end.offset += prev.raws.ownSemicolon.length
361
+ prev.source.end.offset++
359
362
  }
360
363
  }
361
364
  }
@@ -38,7 +38,7 @@ postcss.plugin = function plugin(name, initializer) {
38
38
  ': postcss.plugin was deprecated. Migration guide:\n' +
39
39
  'https://evilmartians.com/chronicles/postcss-8-plugin-migration'
40
40
  )
41
- if (process.env.LANG && process.env.LANG.startsWith('cn')) {
41
+ if (process.env.LANG && process.env.LANG.startsWith('zh')) {
42
42
  /* c8 ignore next 7 */
43
43
  // eslint-disable-next-line no-console
44
44
  console.warn(
@@ -1,9 +1,19 @@
1
1
  'use strict'
2
2
 
3
- let { existsSync, readFileSync } = require('fs')
3
+ let { existsSync, readFileSync, realpathSync } = require('fs')
4
4
  let { dirname, isAbsolute, join, relative, sep } = require('path')
5
5
  let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
6
6
 
7
+ function realPath(path) {
8
+ try {
9
+ return realpathSync(path)
10
+ } catch {
11
+ // Missing or dangling: keep the literal path. The existsSync() check below
12
+ // still gates the read, and a path that does not exist cannot escape.
13
+ return path
14
+ }
15
+ }
16
+
7
17
  function fromBase64(str) {
8
18
  if (Buffer) {
9
19
  return Buffer.from(str, 'base64').toString()
@@ -86,19 +96,15 @@ class PreviousMap {
86
96
 
87
97
  loadFile(path, cssFile, trusted) {
88
98
  if (!trusted && !this.unsafeMap) {
89
- if (!/\.map$/i.test(path)) {
99
+ if (!/\.map$/i.test(path)) return undefined
100
+ if (!cssFile) return undefined
101
+
102
+ // Compare *resolved* paths: relative() is textual, so without this a
103
+ // symlink at or below the CSS file's directory points the map outside it.
104
+ let rel = relative(realPath(dirname(cssFile)), realPath(path))
105
+ if (rel === '..' || rel.startsWith('..' + sep) || isAbsolute(rel)) {
90
106
  return undefined
91
107
  }
92
- if (cssFile) {
93
- let relativePath = relative(dirname(cssFile), path)
94
- if (
95
- relativePath === '..' ||
96
- relativePath.startsWith('..' + sep) ||
97
- isAbsolute(relativePath)
98
- ) {
99
- return undefined
100
- }
101
- }
102
108
  }
103
109
  this.root = dirname(path)
104
110
  if (existsSync(path)) {
@@ -7,7 +7,7 @@ let Root = require('./root')
7
7
 
8
8
  class Processor {
9
9
  constructor(plugins = []) {
10
- this.version = '8.5.18'
10
+ this.version = '8.5.28'
11
11
  this.plugins = this.normalize(plugins)
12
12
  }
13
13
 
@@ -12,6 +12,19 @@ class Root extends Container {
12
12
  }
13
13
 
14
14
  normalize(child, sample, type) {
15
+ let keepBefore = new Set()
16
+ for (let node of Array.isArray(child) ? child : [child]) {
17
+ if (
18
+ node &&
19
+ typeof node === 'object' &&
20
+ !node.parent &&
21
+ node.raws &&
22
+ typeof node.raws.before !== 'undefined'
23
+ ) {
24
+ keepBefore.add(node.raws)
25
+ }
26
+ }
27
+
15
28
  let nodes = super.normalize(child)
16
29
 
17
30
  if (sample) {
@@ -23,7 +36,9 @@ class Root extends Container {
23
36
  }
24
37
  } else if (this.first !== sample) {
25
38
  for (let node of nodes) {
26
- node.raws.before = sample.raws.before
39
+ if (!keepBefore.has(node.raws)) {
40
+ node.raws.before = sample.raws.before
41
+ }
27
42
  }
28
43
  }
29
44
  }
@@ -6,6 +6,10 @@
6
6
  const STYLE_TAG = /(<)(\/?style\b)/gi
7
7
  const COMMENT_OPEN = /(<)(!--)/g
8
8
 
9
+ // Characters that end an at-rule name, mirroring RE_AT_END in the tokenizer.
10
+ // Params starting with anything else need a space to stay separate tokens.
11
+ const AT_NAME_END = /[\t\n\f\r "#'()/;[\\\]{}]/
12
+
9
13
  function escapeHTMLInCSS(str) {
10
14
  if (typeof str !== 'string') return str
11
15
  if (!str.includes('<')) return str
@@ -34,14 +38,23 @@ function capitalize(str) {
34
38
  function atruleStart(str, node) {
35
39
  let name = '@' + node.name
36
40
  let params = node.params ? str.rawValue(node, 'params') : ''
41
+ let afterName = node.raws.afterName
37
42
 
38
- if (typeof node.raws.afterName !== 'undefined') {
39
- name += node.raws.afterName
40
- } else if (params) {
41
- name += ' '
43
+ if (typeof afterName === 'undefined') {
44
+ afterName = params ? ' ' : ''
45
+ } else if (afterName === '' && params && !AT_NAME_END.test(params[0])) {
46
+ afterName = ' '
42
47
  }
43
48
 
44
- return name + params
49
+ return name + afterName + params
50
+ }
51
+
52
+ // `*--x` is not a custom property: the parser checks the first token, and the
53
+ // `*`/`_` hack prefix moves from `prop` into `before` only after that.
54
+ function isCustomProperty(node) {
55
+ if (!node.prop.startsWith('--')) return false
56
+ let before = node.raws.before
57
+ return typeof before === 'undefined' || !/\S$/.test(before)
45
58
  }
46
59
 
47
60
  function pushBody(str, stack, node) {
@@ -55,10 +68,24 @@ function pushBody(str, stack, node) {
55
68
  let semicolon = str.raw(node, 'semicolon')
56
69
  let isDocument = node.type === 'document'
57
70
  for (let i = nodes.length - 1; i >= 0; i--) {
71
+ let child = nodes[i]
72
+ let childSemicolon = last !== i || semicolon
73
+ // A childless at-rule or a custom property declaration that still has
74
+ // following siblings must be terminated. Without the semicolon those
75
+ // trailing comments are folded into the at-rule's prelude or the custom
76
+ // property's value and disappear when the output is re-parsed.
77
+ if (
78
+ !childSemicolon &&
79
+ i < nodes.length - 1 &&
80
+ ((child.type === 'atrule' && !child.nodes) ||
81
+ (child.type === 'decl' && isCustomProperty(child)))
82
+ ) {
83
+ childSemicolon = true
84
+ }
58
85
  stack.push({
59
86
  document: isDocument,
60
- node: nodes[i],
61
- semicolon: last !== i || semicolon
87
+ node: child,
88
+ semicolon: childSemicolon
62
89
  })
63
90
  }
64
91
  }
@@ -405,6 +432,9 @@ class Stringifier {
405
432
  }
406
433
 
407
434
  root(node) {
435
+ if (node.source && node.source.input.hasBOM) {
436
+ this.builder('\uFEFF', node, 'start')
437
+ }
408
438
  this.body(node)
409
439
  if (node.raws.after) {
410
440
  let after = node.raws.after
@@ -1,11 +1,21 @@
1
1
  'use strict'
2
2
 
3
+ let Container = require('./container')
4
+ let { my } = require('./symbols')
5
+
3
6
  class Warning {
4
7
  constructor(text, opts = {}) {
5
8
  this.type = 'warning'
6
9
  this.text = text
7
10
 
8
11
  if (opts.node && opts.node.source) {
12
+ if (!opts.node[my]) {
13
+ // The node comes from another PostCSS copy in node_modules, so it does
14
+ // not have this copy’s methods. Container#normalize() rebuilds such
15
+ // nodes on insert, but a node passed straight to Result#warn() never
16
+ // goes through it.
17
+ Container.rebuild(opts.node)
18
+ }
9
19
  let range = opts.node.rangeBy(opts)
10
20
  this.line = range.start.line
11
21
  this.column = range.start.column
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss",
3
- "version": "8.5.18",
3
+ "version": "8.5.28",
4
4
  "description": "Tool for transforming styles with JS plugins",
5
5
  "keywords": [
6
6
  "css",
@@ -78,7 +78,7 @@
78
78
  "./package.json": "./package.json"
79
79
  },
80
80
  "dependencies": {
81
- "nanoid": "^3.3.12",
81
+ "nanoid": "^3.3.18",
82
82
  "picocolors": "^1.1.1",
83
83
  "source-map-js": "^1.2.1"
84
84
  },